/* Clerk CYCLE-12 — старинный выцветший кабинет */

:root {
  /* Основные */
  --bg: #D8C3A5;
  --bg-deep: #2B1B14;
  --bg-warm: #A67C52;
  --bg-stain: #5A4A3B;

  /* Текст */
  --text: #3E2A1F;
  --text-muted: #5A4A3B;

  /* Акценты */
  --accent: #F2C572;
  --accent-glow: rgba(242, 197, 114, 0.25);

  /* UI элементы */
  --btn-bg: rgba(62, 42, 31, 0.1);
  --btn-hover: rgba(242, 197, 114, 0.2);
  --border: rgba(62, 42, 31, 0.2);

  /* Прочее */
  --smoke: rgba(180, 170, 155, 0.08);
  --radius: 12px;
  --font: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  position: relative;
  /* Слой 1: базовый градиент пергамента (центр справа сверху — зона лампы) */
  /* Слой 5: свет лампы справа сверху */
  /* Слой 2: виньетка */
  /* Слой 4: пятна времени (age stains) — 3 пятна */
  background:
    radial-gradient(ellipse 45% 40% at 80% 10%, rgba(242, 197, 114, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 150% 120% at 50% 50%, transparent 35%, rgba(43, 27, 20, 0.55) 100%),
    radial-gradient(ellipse 200px 200px at 15% 85%, rgba(90, 74, 59, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 180px 180px at 85% 50%, rgba(167, 124, 82, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 160px 160px at 50% 5%, rgba(90, 74, 59, 0.05) 0%, transparent 70%),
    radial-gradient(ellipse 120% 100% at 75% 25%, #E8DCC7 0%, #D8C3A5 35%, #A67C52 70%, #7A5A3A 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Слой 3: зернистость старой бумаги (noise) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* Слой 6: потёртости по краям (edge wear) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(43, 27, 20, 0.12) 0%, transparent 8px),
    linear-gradient(to top, rgba(43, 27, 20, 0.1) 0%, transparent 6px),
    linear-gradient(to right, rgba(43, 27, 20, 0.08) 0%, transparent 28px),
    linear-gradient(to left, rgba(43, 27, 20, 0.08) 0%, transparent 28px);
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, 28px 100%, 28px 100%;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
}

.page-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
}

/* 1. Game logo — компактно у шапки */
.game-logo {
  margin-top: 24px;
  text-align: center;
}
.game-logo__img {
  max-width: 740px;
  width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* 2. Nav buttons — чёткие UI-кнопки */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 10px;
  background: rgba(62, 42, 31, 0.08);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid rgba(62, 42, 31, 0.15);
  box-shadow: 0 2px 8px rgba(43, 27, 20, 0.1);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.nav-btn:hover {
  background: var(--btn-hover);
  border-color: rgba(242, 197, 114, 0.4);
  box-shadow: 0 4px 16px rgba(43, 27, 20, 0.15);
  transform: translateY(-1px);
}

/* 3. Player stack: game + social (YouTube-style, same width) */
.player-stack {
  width: 726px;
  max-width: 100%;
  margin: 40px auto 40px;
}
.player-frame {
  margin-bottom: 0;
}

.terminal {
  margin: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: #1a1410;
  border: 1px solid rgba(242, 197, 114, 0.15);
  box-shadow: 0 20px 60px rgba(43, 27, 20, 0.5), 0 0 80px rgba(242, 197, 114, 0.05);
}
.terminal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #241C14;
  border-bottom: 1px solid rgba(242, 197, 114, 0.1);
  font-family: var(--font-mono);
  font-size: 13px;
}
.terminal__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.terminal__dots {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal__dot--red   { background: #ff5f56; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green { background: #27c93f; }
.terminal__prompt {
  color: var(--accent);
  margin-left: 8px;
}
.terminal__prompt::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 4px;
  background: var(--accent);
  animation: terminal-blink 1s step-end infinite;
  vertical-align: -2px;
}
@keyframes terminal-blink {
  50% { opacity: 0; }
}
.terminal__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.terminal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.terminal__btn:hover {
  color: var(--accent);
  background: rgba(242, 197, 114, 0.15);
}
.terminal__btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}
.terminal__icon {
  display: block;
}
.terminal__body {
  position: relative;
  width: 100%;
  height: 408px;
  background: #000;
}
.terminal__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

/* 4. Game description — по центру под видео */
/* Блок описания — по ширине окна игры (726px) */
.game-description {
  width: 726px;
  max-width: 100%;
  margin: 0 auto 56px;
  text-align: justify;
  padding: 0 16px;
  box-sizing: border-box;
}
.game-description__text {
  margin: 0 0 1.1em;
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
  font-weight: 400;
  hyphens: auto;
}
.game-description__text:last-child {
  margin-bottom: 0;
}

/* 5. Contacts & footer */
.contacts-section {
  padding: 48px 20px 32px;
  text-align: center;
}
.contacts-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}
.contacts-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.contacts-links a:hover {
  color: var(--text);
}
.copyright {
  margin: 0;
  font-size: 13px;
  color: #7A5A3A;
}

/* Responsive */
@media (max-width: 960px) {
  .player-stack {
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .player-stack {
    width: 100%;
  }
  .terminal__body {
    height: min(408px, 55vw);
  }
}

@media (max-width: 640px) {
  .game-logo {
    margin-top: 20px;
  }
  .game-logo__img {
    max-width: 100%;
    width: 90%;
  }
  .nav-buttons {
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
  }
  .nav-btn {
    width: 100%;
    max-width: 260px;
  }
  .player-stack {
    margin-top: 32px;
    margin-bottom: 32px;
  }
  .terminal__body {
    height: min(360px, 55vw);
  }
  .game-description__text {
    font-size: 17px;
  }
}
