/* Ghostline Rush — matches in-game DesignSystem palette */
:root {
  --bg-deep: #0f0f1a;
  --bg-panel: #1a1a2e;
  --bg-elevated: #252540;
  --purple: #6b21a8;
  --purple-light: #9333ea;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --danger: #dc2626;
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--cyan-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(103, 232, 249, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.brand span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover { color: var(--cyan-light); text-decoration: none; }

.nav-toggle {
  display: none;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 720px) {
  .site-nav { padding: 10px 16px; }
  .brand span { font-size: 12px; letter-spacing: 0.04em; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 16px;
    background: rgba(15, 15, 26, 0.98);
    border-bottom: 1px solid rgba(103, 232, 249, 0.12);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; }
}

/* ── Hero ── */
.hero {
  position: relative;
  padding: 72px 24px 48px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(107, 33, 168, 0.35), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6, 182, 212, 0.15), transparent);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 640px; margin: 0 auto; }

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.icon-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}

.icon-btn svg { width: 22px; height: 22px; }

.icon-btn:hover {
  color: var(--cyan-light);
  border-color: rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-lg { padding: 14px 32px; font-size: 15px; }

.btn-block { width: 100%; justify-content: center; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 .accent {
  background: linear-gradient(90deg, var(--purple-light), var(--cyan-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 28px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-2px); text-decoration: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  box-shadow: 0 4px 20px rgba(107, 33, 168, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, #0891b2, var(--cyan));
  color: #0f0f1a;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-store {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid rgba(103, 232, 249, 0.2);
}

.btn-store.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.ad-game-over {
  min-height: 100px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 8px;
}

/* ── Play section ── */
.section {
  padding: 64px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.play-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.game-panel {
  background: var(--bg-panel);
  border: 1px solid rgba(103, 232, 249, 0.15);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

#marathon-canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 12px;
  background: #050508;
  touch-action: none;
  cursor: crosshair;
}

.game-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 13px;
}

.game-hud span {
  padding: 6px 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  color: var(--cyan-light);
}

.game-hud span.gold { color: var(--gold-light); }

.game-controls {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .game-controls-desktop { display: none; }
}

.btn-restart-inline {
  display: block;
  margin: 12px auto 0;
  width: 100%;
  max-width: 200px;
}

@media (max-width: 899px) {
  .section { padding: 48px 16px; }
  .hero { padding: 48px 16px 32px; }
  .hero p { font-size: 1rem; }
  .game-panel { padding: 12px; }
  .game-hud { font-size: 11px; gap: 8px; }
  .game-hud span { padding: 5px 8px; }
  #marathon-canvas { max-width: 100%; }
}

#marathon-canvas:focus {
  outline: 2px solid rgba(6, 182, 212, 0.5);
  outline-offset: 2px;
}

.game-sidebar .tip-card {
  background: var(--bg-panel);
  border: 1px solid rgba(107, 33, 168, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.game-sidebar h3 {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-light);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

.game-sidebar ul {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
}

.game-sidebar li {
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.game-sidebar li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--cyan);
}

/* ── Features grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: rgba(147, 51, 234, 0.4);
}

.feature-card .icon { font-size: 28px; margin-bottom: 12px; }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--cyan-light);
}

.feature-card p { font-size: 14px; color: var(--text-muted); }

.universe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.universe-card {
  padding: 24px 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.universe-card.ds { background: linear-gradient(160deg, rgba(107,33,168,0.25), transparent); }
.universe-card.hf { background: linear-gradient(160deg, rgba(220,38,38,0.2), transparent); }
.universe-card.cf { background: linear-gradient(160deg, rgba(6,182,212,0.2), transparent); }
.universe-card.mw { background: linear-gradient(160deg, rgba(245,158,11,0.15), transparent); }

.universe-card h3 {
  font-family: var(--font-display);
  font-size: 14px;
  margin: 8px 0;
}

.universe-card p { font-size: 12px; color: var(--text-muted); }

/* ── CTA ── */
.cta-band {
  text-align: center;
  padding: 64px 24px;
  background: linear-gradient(180deg, transparent, rgba(107, 33, 168, 0.2));
}

/* ── Footer ── */
.site-footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
}

.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--cyan-light); }

/* ── Game overlay ── */
.game-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(5, 5, 12, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.game-overlay.visible { display: flex; }

.game-overlay[hidden] { display: none !important; }

.overlay-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid rgba(147, 51, 234, 0.5);
  border-radius: 16px;
  padding: 32px 24px 24px;
  max-width: min(400px, calc(100vw - 32px));
  width: 100%;
  text-align: center;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.overlay-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.overlay-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overlay-actions .btn {
  width: 100%;
  justify-content: center;
}

.overlay-card h2 {
  font-family: var(--font-display);
  color: var(--gold-light);
  margin-bottom: 12px;
}

.overlay-card p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* Legal pages shared */
.legal-header {
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-deep));
  padding: 48px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(103, 232, 249, 0.12);
}

.legal-header h1 { font-family: var(--font-display); font-size: 1.75rem; }

.legal-container {
  max-width: 800px;
  margin: 32px auto 64px;
  padding: 32px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-container h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--cyan-light);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
}

.legal-container p, .legal-container li { color: var(--text-muted); margin-bottom: 12px; }

.legal-container .highlight {
  background: rgba(107, 33, 168, 0.15);
  border-left: 3px solid var(--purple-light);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}
