* { box-sizing: border-box; }

:root {
  --bg: #05060a;
  --bg2: #0a0d16;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --text: #e9edf6;
  --muted: #9aa6bd;
  --accent: #ff9d3c;
  --accent2: #6fe0ff;
  --gold: #ffd98a;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

/* фоновые звёзды */
.stars-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 157, 60, 0.10), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(111, 224, 255, 0.08), transparent 55%),
    radial-gradient(1px 1px at 15% 30%, #fff, transparent),
    radial-gradient(1px 1px at 65% 15%, #cfe, transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, #fff, transparent),
    radial-gradient(1px 1px at 35% 75%, #ffd, transparent),
    radial-gradient(1px 1px at 50% 45%, #fff, transparent),
    var(--bg);
}

/* ---------- НАВИГАЦИЯ ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(5, 6, 10, 0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__logo {
  font-weight: 800;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 1.25rem; align-items: center; }
.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--text); }
.nav__play {
  border: 1px solid var(--accent);
  color: var(--accent) !important;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
}
.nav__play:hover { background: var(--accent); color: #14100a !important; }
.nav__burger {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1.2rem;
  border-radius: 8px;
  padding: 0.15rem 0.55rem;
  cursor: pointer;
}

/* ---------- ГЕРОЙ ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 6rem 1.25rem 4rem;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero__content { max-width: 780px; }
.hero__eyebrow {
  color: var(--accent2);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin: 0 0 0.75rem;
}
.hero__title {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 0 40px rgba(255, 157, 60, 0.35);
}
.hero__title span { color: var(--accent); }
.hero__sub {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  margin: 1.25rem auto 2rem;
  max-width: 620px;
}
.hero__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero__scroll {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--muted);
  animation: floaty 2.2s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: translate(-50%, -8px); } }

.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), #ff6a2b);
  color: #191005;
  box-shadow: 0 8px 30px rgba(255, 122, 43, 0.35);
}
.btn--ghost { border-color: var(--line); color: var(--text); background: var(--panel); }

/* ---------- СЕКЦИИ ---------- */
.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 5vw, 4rem);
  max-width: 1180px;
  margin: 0 auto;
}
.section--alt {
  max-width: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section--alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section__head { max-width: 760px; margin-bottom: 2.5rem; }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(111, 224, 255, 0.35);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.section h2 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}
.section__head p { color: var(--muted); margin: 0; }

/* ---------- ЧЁРНАЯ ДЫРА ---------- */
.bh-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.bh-stage__canvas { display: block; width: 100%; height: clamp(300px, 52vh, 520px); }
.bh-stage__hint {
  position: absolute;
  bottom: 0.75rem; right: 1rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.1em;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 157, 60, 0.5); }
.card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--gold); }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- РАКЕТА ---------- */
.rocket-stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #0d1424, #05060a 70%);
  touch-action: none;
}
.rocket-stage__canvas { display: block; width: 100%; height: clamp(340px, 58vh, 560px); cursor: grab; }
.rocket-stage__canvas:active { cursor: grabbing; }
.rocket-stage__ui {
  position: absolute;
  top: 0.85rem; left: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  background: rgba(5, 6, 10, 0.7);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[data-on="true"] { border-color: var(--accent2); color: var(--accent2); }
.rocket-stage__hint {
  position: absolute;
  bottom: 0.7rem; left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
}
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.spec {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.spec span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; }
.spec b { color: var(--gold); font-size: 1.1rem; }

/* ---------- СЮЖЕТ ---------- */
.spoiler-btn {
  background: rgba(255, 157, 60, 0.12);
  border: 1px dashed var(--accent);
  color: var(--accent);
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: background 0.2s;
}
.spoiler-btn:hover { background: rgba(255, 157, 60, 0.25); }
.spoiler-btn[data-shown="true"] { border-style: solid; background: var(--accent); color: #191005; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 22px; top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: 0.45;
}
.tl-item {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding: 0 0 1.75rem;
}
.tl-num {
  flex: 0 0 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b0f1a;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  z-index: 1;
}
.tl-item h3 { margin: 0.35rem 0 0.35rem; font-size: 1.15rem; }
.tl-item p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tl-item b { color: var(--gold); }
.tl-item--spoiler {
  filter: blur(7px);
  opacity: 0.55;
  user-select: none;
  transition: filter 0.4s, opacity 0.4s;
}
.tl-item--spoiler[data-open="true"] { filter: none; opacity: 1; user-select: auto; }

.chars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.char {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
}
.char b { color: var(--accent2); }
.char span { color: var(--muted); font-size: 0.83rem; }

/* ---------- ИГРА ---------- */
.game-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.game-shell canvas { display: block; width: 100%; height: auto; touch-action: none; }
.game-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 3.6rem 0.7rem 1rem;
  pointer-events: none;
  font-size: 0.9rem;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
}
.hud__stat b { color: var(--gold); margin-left: 0.35rem; }
.hud__lives { color: #ff5f6d; letter-spacing: 0.15em; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 1rem;
}
.game-overlay[hidden] { display: none; }
.game-overlay__box h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  letter-spacing: 0.1em;
  color: var(--accent);
}
#overlayTitle.win {
  color: #7dffa8;
  text-shadow: 0 0 30px rgba(125, 255, 168, 0.55);
}
.game-overlay__box p { color: var(--muted); margin: 0 0 1rem; max-width: 420px; }
.game-overlay__score { font-size: 1.1rem; color: var(--gold); margin-bottom: 1rem; }
.game-overlay__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.game-overlay__actions .btn {
  padding: 0.7rem 1.5rem;
  cursor: pointer;
}
.game-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.game-tips span {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

/* кнопки управления экраном игры */
.game-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  z-index: 8;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(5, 6, 10, 0.65);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.game-btn:hover { transform: scale(1.08); }
.game-btn:active { transform: scale(0.94); }
.game-btn--exit {
  background: rgba(255, 70, 70, 0.88);
  border-color: rgba(255, 160, 160, 0.9);
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  box-shadow: 0 4px 18px rgba(255, 70, 70, 0.55);
}
.game-btn--exit:hover { background: #ff4d4d; }
.game-btn[hidden] { display: none; }

/* полноэкранный режим игры */
.game-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.game-shell.is-fullscreen canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.game-shell.is-fullscreen .game-hud {
  padding: 1.1rem 4.6rem 1.4rem 1.4rem;
  font-size: 1.05rem;
}
.game-shell.is-fullscreen .game-btn {
  top: 1.15rem;
  right: 1.15rem;
  width: 46px;
  height: 46px;
  font-size: 1.55rem;
  background: rgba(255, 70, 70, 0.9);
  border-color: rgba(255, 180, 180, 0.95);
}

/* подсказка про поворот телефона (только в портрете на весь экран) */
.game-rotate {
  display: none;
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: rgba(255, 157, 60, 0.92);
  color: #191005;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}
@media (orientation: portrait) {
  .game-shell.is-fullscreen .game-rotate { display: block; }
}

/* ---------- ПОДВАЛ ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer p { margin: 0.25rem 0; }
.footer__note { color: rgba(154, 166, 189, 0.6); font-size: 0.75rem; }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 760px) {
  .nav__burger { display: block; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    background: rgba(5, 6, 10, 0.96);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1rem;
    display: none;
  }
  .nav__links[data-open="true"] { display: flex; }
  .nav__links a { padding: 0.45rem 0; width: 100%; }
  .timeline::before { left: 15px; }
  .tl-num { flex: 0 0 34px; height: 34px; font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__scroll { animation: none; }
}
