:root {
  --accent: #5B71FF;
  --accent-soft: rgba(91, 113, 255, 0.12);
  --gold: #C8960A;
  --bg: #FFFFFF;
  --surface: #EBEDF7;
  --surface-alt: #FFFFFF;
  --content: #4A5278;
  --content-muted: #6B7290;
  --content-faint: #8A93B5;
  --hairline: #E0E3EE;
  --header-bg: rgba(255, 255, 255, 0.78);
  --shadow: 0 24px 60px rgba(74, 82, 120, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --gold: #FFD700;
    --bg: #1E202D;
    --surface: #32374E;
    --surface-alt: #3A3F58;
    --content: #AEB6E1;
    --content-muted: #8A93B5;
    --content-faint: #6B7294;
    --hairline: #3D4360;
    --header-bg: rgba(30, 32, 45, 0.78);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Google Sans", system-ui, -apple-system, sans-serif;
  color: var(--content);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Fixed 3D hero canvas (transparent; body bg shows through) ---------- */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* Content scrolls above the canvas; sections are opaque so they cover the devices */
main, header, footer { position: relative; z-index: 2; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-size: 18px;
  color: var(--content);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand-mark { color: var(--gold); font-size: 20px; }
.brand strong { font-weight: 700; letter-spacing: 0.01em; }
nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
nav a { color: var(--content-muted); text-decoration: none; font-size: 15px; transition: color 0.2s ease; }
nav a:hover { color: var(--accent); }
nav a.nav-play {
  color: #fff;
  background: var(--accent);
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(91, 113, 255, 0.35);
}
nav a.nav-play:hover { color: #fff; filter: brightness(1.08); }

/* ---------- Hero (transparent so the 3D devices show through) ---------- */
.hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(110px, 16vh, 160px) 24px clamp(120px, 18vh, 200px);
  text-align: center;
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--content-muted);
  margin-bottom: 22px;
  font-weight: 500;
}
.hero h1 {
  font-size: clamp(44px, 6.8vw, 76px);
  line-height: 1.02;
  color: var(--content);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 auto;
  max-width: 14ch;
}
.hero-sub {
  max-width: 560px;
  margin: 24px auto 38px;
  font-size: 19px;
  color: var(--content-muted);
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  display: inline-block;
  box-shadow: 0 10px 30px rgba(91, 113, 255, 0.35);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 36px rgba(91, 113, 255, 0.45); }
.btn-secondary {
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--content);
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  display: inline-block;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.data-chips { margin-top: 44px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--content-muted);
}

/* ---------- Opaque content sections (cover the fixed canvas on scroll) ---------- */
.scene-section, .cta, .faq {
  background: var(--bg);
  padding: clamp(84px, 12vh, 120px) 24px;
}
.section-inner { max-width: 980px; margin: 0 auto; }
.scene-section h2, .faq h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  text-align: center;
  color: var(--content);
}
.scene-section .section-lead, .faq .section-lead {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: 17px;
  color: var(--content-muted);
}

/* Set-ranking strip */
.rank-strip { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.rank-pill {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  text-align: center;
  min-width: 120px;
}
.rank-pill .rk { font-size: 12px; color: var(--content-faint); letter-spacing: 0.08em; text-transform: uppercase; }
.rank-pill .rn { font-weight: 700; margin-top: 4px; }
.rank-pill.hot { border-color: var(--accent); }

/* How to play (preserved SEO content) */
.howto-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto 44px;
  text-align: left;
}
.howto-steps li {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 15px;
  counter-increment: step;
  display: flex;
  gap: 14px;
  align-items: baseline;
  color: var(--content-muted);
}
.howto-steps li strong { color: var(--content); }
.howto-steps li::before {
  content: counter(step);
  background: var(--accent);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  transform: translateY(3px);
}

/* Three-mode trio */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mode-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
}
.mode-card h3 { font-size: 18px; margin-bottom: 8px; font-weight: 700; color: var(--content); }
.mode-card p { font-size: 14px; color: var(--content-muted); }

/* Ritual (gold accents only here) */
.ritual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ritual-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
}
.ritual-card h3 { color: var(--gold); font-size: 18px; margin-bottom: 8px; font-weight: 700; }
.ritual-card p { font-size: 14px; color: var(--content-muted); }

/* Coins */
.coin-grid { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.coin-chip {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--content);
}
.coin-chip b { color: var(--gold); }

/* CTA */
.cta { text-align: center; }
.cta h2 { font-size: clamp(34px, 5vw, 52px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; color: var(--content); }
.cta p { color: var(--content-muted); font-size: 18px; margin-bottom: 30px; }

/* FAQ */
.faq .section-inner { max-width: 760px; }
.faq-list { display: grid; gap: 12px; }
.faq-list details {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.faq-list summary { color: var(--content); font-weight: 500; font-size: 16px; cursor: pointer; }
.faq-list summary:hover { color: var(--accent); }
.faq-list p { margin-top: 10px; font-size: 15px; color: var(--content-muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--content-faint);
  padding: 26px 24px;
  text-align: center;
  font-size: 13px;
}
.site-footer a { color: var(--content-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .footer-note { margin-top: 8px; opacity: 0.7; }

/* ---------- Rules page (inherits tokens; content untouched) ---------- */
.rules { max-width: 800px; margin: 0 auto; padding: 56px 24px; }
.rules h1 { font-size: 40px; color: var(--content); margin-bottom: 12px; font-weight: 800; letter-spacing: -0.02em; }
.rules .rules-intro { font-size: 17px; margin-bottom: 32px; color: var(--content-muted); }
.rules h2 { font-size: 24px; color: var(--content); margin: 36px 0 12px; font-weight: 700; }
.rules h3 { font-size: 18px; color: var(--gold); margin: 20px 0 8px; font-weight: 500; }
.rules p { margin-bottom: 12px; color: var(--content-muted); }
.rules ul, .rules ol { margin: 0 0 16px 22px; color: var(--content-muted); }
.rules li { margin-bottom: 6px; }
.rules table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 15px; }
.rules th, .rules td { border: 1px solid var(--hairline); padding: 10px 12px; text-align: left; color: var(--content-muted); }
.rules th { background: var(--surface); color: var(--gold); font-weight: 700; }
.rules tr:nth-child(even) td { background: var(--surface); }
.rules .term { font-weight: 700; color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-inner { flex-direction: column; gap: 10px; padding: 12px 20px; }
  nav { justify-content: center; gap: 14px; }
  .hero { padding: 92px 20px 120px; }
  .hero h1 { font-size: 42px; }
  .section-inner { padding: 0 4px; }
  .cta { padding: 70px 20px; }
  .rules { padding: 40px 20px; }
  .rank-pill { min-width: 96px; padding: 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary, .btn-secondary { transition: none; }
}