/* ============================================================
   CANDLER — STYLES
   Table of contents:
   1. Tokens & resets
   2. Base typography & utility
   3. Buttons & chips
   4. Header & nav
   5. Intro sequence
   6. Hero
   7. Arcade terminal cabinet
   8. Game overlay / HUD
   9. Legend strip
   10. Story panels
   11. Token section
   12. Footer
   13. Animations
   14. Responsive
   15. Reduced motion / accessibility
   ============================================================ */

/* ---------- 1. Tokens & resets ---------- */
:root {
  --bg: #05070a;
  --bg-elevated: #0a0e13;
  --panel: #12161c;
  --panel-raised: #171c23;
  --metal: #1c2128;
  --metal-light: #262c35;
  --line: rgba(238, 241, 240, 0.08);
  --line-strong: rgba(238, 241, 240, 0.16);

  --emerald: #10b981;
  --emerald-dim: #0d7a5c;
  --lime: #a3f731;
  --lime-dim: #7dc424;
  --red: #ef4444;
  --red-dim: #b91c1c;
  --gold: #f0b429;
  --gold-dim: #b3800f;

  --ink: #eef1f0;
  --ink-dim: #9aa5a1;
  --ink-faint: #5c6864;

  --font-display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --container: 1180px;
  --shadow-panel: 0 20px 60px -20px rgba(0, 0, 0, 0.7);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

/* The native [hidden] attribute is overridden by any rule that sets `display`
   (e.g. .btn's display:inline-flex, .hud's flex layout). Restore it globally
   so JS toggling `.hidden = true/false` always works regardless of what
   other display rules apply to that element. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

/* Custom selection + scrollbar */
::selection { background: var(--lime); color: #05130a; }
html { scrollbar-color: var(--emerald-dim) var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--emerald-dim); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--emerald); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--lime);
  color: #05130a;
  padding: 10px 16px;
  z-index: 999;
  font-weight: 600;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 2. Base typography & utility ---------- */
.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2.2rem;
}

.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

/* ---------- 3. Buttons & chips ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease-out), background-color 0.18s, box-shadow 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn--primary {
  background: var(--lime);
  color: #05130a;
  box-shadow: 0 0 0 0 rgba(163, 247, 49, 0), 0 6px 24px -6px rgba(163, 247, 49, 0.45);
}
.btn--primary:hover { background: #b4ff45; box-shadow: 0 6px 30px -4px rgba(163, 247, 49, 0.6); }

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--emerald); background: rgba(16, 185, 129, 0.08); }

.btn--sm { padding: 9px 18px; font-size: 0.85rem; }

.btn--buy {
  background: var(--emerald);
  color: #04120c;
  padding: 10px 18px;
  font-size: 0.88rem;
}
.btn--buy:hover { background: #14cf94; }

.btn[data-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.btn[data-disabled="true"]:hover { transform: none; box-shadow: none; background: inherit; }

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--ink-dim);
  transition: color 0.18s, background-color 0.18s;
}
.icon-link:hover { color: var(--lime); background: rgba(163, 247, 49, 0.08); }
.icon-link[data-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

/* Legend chips (shared between overlay + strip) */
.chip {
  --sz: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sz);
  height: var(--sz);
  border-radius: 4px;
  flex-shrink: 0;
  font-size: calc(var(--sz) * 0.55);
  color: #05130a;
  font-weight: 700;
}
.chip--lg { --sz: 40px; border-radius: 8px; font-size: 1.1rem; }
.chip--green { background: var(--emerald); box-shadow: 0 0 14px rgba(16, 185, 129, 0.45); }
.chip--gold { background: var(--gold); box-shadow: 0 0 14px rgba(240, 180, 41, 0.5); }
.chip--red { background: var(--red); box-shadow: 0 0 14px rgba(239, 68, 68, 0.4); }
.chip--rug { background: var(--red-dim); color: var(--ink); }
.chip--warn { background: transparent; border: 2px solid var(--red); color: var(--red); }

/* ---------- 4. Header & nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5, 7, 10, 0.35);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.site-header.is-scrolled {
  background: rgba(5, 7, 10, 0.88);
  border-bottom-color: var(--line);
}
.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand__text {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.nav {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-dim);
}
.nav a { transition: color 0.18s; position: relative; }
.nav a:hover { color: var(--ink); }
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 6px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  margin-left: 4px;
}
.nav-toggle span { display: block; height: 2px; width: 18px; margin-inline: auto; background: var(--ink); transition: transform 0.25s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 24px 22px;
  background: rgba(5, 7, 10, 0.97);
  border-bottom: 1px solid var(--line);
}
.mobile-nav a, .mobile-nav button {
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  background: none;
  border-inline: none;
  border-top: none;
  color: var(--ink);
  text-align: left;
}
.mobile-nav__socials { display: flex; gap: 20px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.mobile-nav .btn { margin-top: 14px; width: 100%; }

/* ---------- 5. Intro sequence ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #030405;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}
.intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.intro__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0;
  animation: introGridIn 1.4s var(--ease-out) 0.5s forwards;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 40%, transparent 90%);
}
@keyframes introGridIn { to { opacity: 0.55; } }

.intro__noise {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.intro__stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 24px; }

.intro__candle { opacity: 0; animation: introCandleFlicker 1.2s ease-in-out 0s forwards; filter: drop-shadow(0 0 10px var(--lime)); }
@keyframes introCandleFlicker {
  0% { opacity: 0; }
  20% { opacity: 1; }
  35% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 1; }
}

.intro__candles {
  position: absolute;
  inset: -40vh 0 auto 0;
  height: 40vh;
  pointer-events: none;
  overflow: hidden;
}
.intro__candles span {
  position: absolute;
  top: -40px;
  width: 6px;
  height: 26px;
  background: var(--emerald-dim);
  border-radius: 2px;
  opacity: 0.7;
  animation: introFall linear infinite;
}
@keyframes introFall { to { transform: translateY(60vh); } }

.intro__eyes { opacity: 0; margin-top: -8px; animation: introEyesIn 0.6s ease 1.6s forwards; }
.eye { fill: var(--lime); filter: drop-shadow(0 0 8px var(--lime)); animation: eyeBlink 4s ease-in-out infinite; }
.eye--r { animation-delay: 0.15s; }
@keyframes introEyesIn { to { opacity: 1; } }
@keyframes eyeBlink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.1); } }

.intro__logo { opacity: 0; animation: introFadeUp 0.6s var(--ease-out) 2.1s forwards; }
.intro__logo-text {
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.intro__line {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  opacity: 0;
  height: 1.4em;
}
.intro__line--1 { animation: introFadeUp 0.5s var(--ease-out) 2.6s forwards, introFadeOut 0.4s ease 3.6s forwards; }
.intro__line--2 { margin-top: -1.4em; color: var(--lime); animation: introFadeUp 0.5s var(--ease-out) 3.7s forwards; }
@keyframes introFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes introFadeOut { to { opacity: 0; } }

.intro__enter { opacity: 0; margin-top: 6px; animation: introFadeUp 0.5s var(--ease-out) 4.3s forwards; }

.intro__skip {
  position: absolute;
  bottom: 26px;
  right: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  padding: 9px 14px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: color 0.18s, border-color 0.18s;
}
.intro__skip:hover { color: var(--ink); border-color: var(--ink-dim); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding: 84px 24px 60px;
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  z-index: -2;
}
.hero__glow {
  position: absolute;
  top: -10%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.16), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.hero__inner { max-width: 640px; }
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--emerald);
  margin-bottom: 18px;
}
.hero__title {
  font-size: clamp(2.6rem, 6.6vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero__title span { color: var(--lime); }
.hero__sub {
  margin-top: 22px;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--ink-dim);
  max-width: 46ch;
}
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero__status {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.hero__terminal-peek {
  position: absolute;
  right: -6%;
  bottom: -14%;
  width: 46%;
  aspect-ratio: 4/3;
  border-radius: 22px;
  background: linear-gradient(160deg, var(--metal), var(--panel));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
  z-index: -1;
  opacity: 0.85;
  transform: rotate(3deg);
}
.terminal-peek__screen {
  position: absolute;
  inset: 10%;
  border-radius: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(163,247,49,0.05) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 30% 20%, rgba(16,185,129,0.35), transparent 60%),
    #060a08;
  animation: peekPulse 5s ease-in-out infinite;
}
@keyframes peekPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }

/* ---------- 7. Arcade terminal cabinet ---------- */
.terminal-section {
  padding: 40px 24px 90px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(16, 185, 129, 0.08), transparent 60%),
    var(--bg);
}
.terminal-section__inner { max-width: 980px; margin-inline: auto; }

.cabinet {
  position: relative;
  background: linear-gradient(160deg, var(--metal-light), var(--metal) 40%, #14181e 100%);
  border-radius: 26px;
  padding: 18px 18px 26px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

.cabinet__vents {
  position: absolute;
  top: 14px;
  right: 22px;
  display: flex;
  gap: 5px;
}
.cabinet__vents span { width: 3px; height: 16px; background: rgba(0,0,0,0.5); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }

.cabinet__topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 14px;
}
.cabinet__power {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime), 0 0 2px var(--lime);
  animation: powerBlink 3.2s ease-in-out infinite;
}
@keyframes powerBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.cabinet__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.cabinet__signal { display: flex; gap: 3px; margin-left: auto; align-items: flex-end; height: 10px; }
.cabinet__signal i { display: block; width: 3px; background: var(--emerald-dim); border-radius: 1px; animation: signalBar 1.8s ease-in-out infinite; }
.cabinet__signal i:nth-child(1) { height: 4px; }
.cabinet__signal i:nth-child(2) { height: 7px; animation-delay: 0.2s; }
.cabinet__signal i:nth-child(3) { height: 10px; animation-delay: 0.4s; }
@keyframes signalBar { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.cabinet__screen-frame {
  background: #000;
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), inset 0 10px 30px rgba(0,0,0,0.6);
}

.cabinet__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: #060a08;
  touch-action: none;
}
.cabinet__screen.is-shaking { animation: screenShake 0.35s; }
@keyframes screenShake {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, 4px); }
  80% { transform: translate(3px, -2px); }
}

#gameCanvas { width: 100%; height: 100%; display: block; }

.screen-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.screen-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 90px 20px rgba(0,0,0,0.65);
}
.screen-glare {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 200px at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,0.06), transparent 70%);
  transition: background-position 0.1s;
}

/* ---------- 8. Game overlay / HUD ---------- */
.game-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(3px);
  z-index: 5;
}
.game-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  max-width: 92%;
}
.game-panel__eyebrow { font-family: var(--font-mono); font-size: 0.72rem; color: var(--emerald); letter-spacing: 0.06em; }
.game-panel__title { font-size: clamp(1.3rem, 3.4vw, 1.9rem); font-weight: 700; line-height: 1.15; }
.game-panel__controls { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-dim); max-width: 40ch; }

.legend-list { display: flex; flex-direction: column; gap: 10px; text-align: left; font-size: 0.9rem; margin: 4px 0; }
.legend-list li { display: flex; align-items: center; gap: 10px; }

.countdown__num {
  font-size: clamp(3.5rem, 10vw, 5.5rem);
  font-weight: 700;
  color: var(--lime);
  text-shadow: 0 0 30px rgba(163, 247, 49, 0.5);
}

.gameover-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 22px;
  margin: 6px 0 4px;
  font-family: var(--font-mono);
}
.gameover-stats > div { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.gameover-stats__label { font-size: 0.68rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.gameover-stats__value { font-size: 1.15rem; color: var(--lime); font-weight: 600; }
.gameover-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.gameover-copied { font-family: var(--font-mono); font-size: 0.78rem; color: var(--emerald); min-height: 1.2em; }

.hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 10px 14px;
  font-family: var(--font-mono);
  z-index: 4;
  pointer-events: none;
}
.hud__row { display: flex; align-items: center; justify-content: space-between; }
.hud__score {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--lime);
  text-shadow: 0 0 12px rgba(163,247,49,0.4);
  transition: transform 0.15s;
}
.hud__score.is-bumped { transform: scale(1.15); }
.hud__lives { display: flex; gap: 5px; }
.hud__lives span { width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px rgba(239,68,68,0.6); }
.hud__lives span.is-lost { background: rgba(255,255,255,0.08); box-shadow: none; }

.hud__combo {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--gold);
  width: fit-content;
}
.hud__multiplier {
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hud__multiplier-bar { width: 70px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.hud__multiplier-bar span { display: block; height: 100%; background: var(--gold); width: 100%; transform-origin: left; }

.toast {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--red);
  text-shadow: 0 0 20px rgba(239,68,68,0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.15s, transform 0.15s;
  letter-spacing: 0.04em;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Cabinet physical controls */
.cabinet__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 14px 4px;
  flex-wrap: wrap;
}

.joystick { position: relative; width: 64px; height: 64px; }
.joystick__base {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2c333c, #14181e 70%);
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.6), inset 0 -2px 0 rgba(255,255,255,0.05);
}
.joystick__stick {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--lime), var(--lime-dim));
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), 0 0 12px rgba(163,247,49,0.4);
  transform: translate(-50%, -50%);
  transition: transform 0.12s var(--ease-out);
}

.cabinet__dpad { display: flex; gap: 8px; }
.dpad-btn {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--metal-light), var(--metal));
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-dim);
  box-shadow: 0 3px 0 rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  font-size: 0.9rem;
  transition: transform 0.1s, box-shadow 0.1s;
}
.dpad-btn:active, .dpad-btn.is-active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
  color: var(--lime);
}

.cabinet__play-btn {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #14e88a, var(--emerald-dim));
  border: none;
  color: #04160e;
  font-size: 1.1rem;
  box-shadow: 0 5px 0 var(--emerald-dim), 0 8px 22px -4px rgba(16,185,129,0.6);
  transition: transform 0.1s, box-shadow 0.1s;
}
.cabinet__play-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--emerald-dim); }

.cabinet__toggles { display: flex; gap: 8px; }
.toggle-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: var(--metal);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--ink-dim);
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
  transition: color 0.15s, transform 0.1s;
}
.toggle-btn:hover { color: var(--lime); }
.toggle-btn:active { transform: translateY(2px); box-shadow: none; }
.toggle-btn[aria-pressed="true"] { color: var(--lime); border-color: var(--emerald-dim); }

.rotate-hint {
  text-align: center;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- 9. Legend strip ---------- */
.legend-strip { padding: 70px 24px; background: var(--bg-elevated); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.legend-strip__inner { max-width: var(--container); margin-inline: auto; }
.legend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.legend-grid li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.legend-grid li div { display: flex; flex-direction: column; gap: 2px; }
.legend-grid li strong { font-size: 0.95rem; }
.legend-grid li span { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-dim); }
.legend-strip__controls {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- 10. Story panels ---------- */
.story { padding: 100px 24px; }
.story__inner { max-width: var(--container); margin-inline: auto; }
.story-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding-block: 50px;
}
.story-panel:not(:last-child) { border-bottom: 1px solid var(--line); }
.story-panel--reverse .story-panel__visual { order: 2; }
.story-panel--reverse .story-panel__text { order: 1; }

.story-panel__label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--emerald);
  margin-bottom: 14px;
}
.story-panel__body { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 600; line-height: 1.35; max-width: 30ch; }

.story-art {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel-raised), var(--bg-elevated));
  border: 1px solid var(--line);
  overflow: hidden;
}
.story-art::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
}

.story-art__mascot {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 78px;
  background: linear-gradient(180deg, #1b1f26, #101318);
  border-radius: 50% 50% 44% 44% / 60% 60% 40% 40%;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.6);
  animation: mascotIdle 3.2s ease-in-out infinite;
}
.story-art__mascot--look-up { transform: translateX(-50%) rotate(-4deg); }
@keyframes mascotIdle { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-6px); } }
.story-panel--reverse .story-art__mascot,
.story-art--rug .story-art__mascot { animation-name: mascotIdle; }

.mascot-eye {
  position: absolute;
  top: 34%;
  width: 13px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.mascot-eye--l { left: 22%; }
.mascot-eye--r { right: 22%; }

.story-art__desk {
  position: absolute;
  bottom: 12%;
  left: 12%;
  right: 12%;
  height: 8px;
  background: var(--metal);
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.story-art__chart--red {
  position: absolute;
  top: 10%; left: 10%; right: 10%;
  height: 36%;
  background: repeating-linear-gradient(90deg, transparent 0 14px, rgba(239,68,68,0.35) 14px 18px);
  mask-image: linear-gradient(to bottom, black, transparent);
}

.story-art__candle-glow {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 50px;
  background: var(--lime);
  border-radius: 3px;
  box-shadow: 0 0 30px 8px rgba(163,247,49,0.5);
  animation: candleFloat 2.4s ease-in-out infinite;
}
@keyframes candleFloat { 0%, 100% { top: 16%; } 50% { top: 22%; } }

.story-art__rug-shadow {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(239,68,68,0.4), transparent 70%);
  border-radius: 50%;
  animation: rugLoom 2.6s ease-in-out infinite;
}
@keyframes rugLoom { 0%, 100% { transform: translateX(-50%) scale(0.9); opacity: 0.6; } 50% { transform: translateX(-50%) scale(1.15); opacity: 1; } }

/* ---------- 11. Token section ---------- */
.token { padding: 60px 24px 110px; }
.token__inner { max-width: 760px; margin-inline: auto; }
.token__card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
}
.token__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.token__row:last-of-type { border-bottom: none; }
.token__key { color: var(--ink-dim); font-size: 0.9rem; }
.token__val { font-weight: 600; }
.token__val--mono { font-family: var(--font-mono); font-size: 0.85rem; color: var(--lime); overflow-wrap: anywhere; text-align: right; }
.token__row--contract { flex-wrap: wrap; }
.token__copy-feedback { font-family: var(--font-mono); font-size: 0.78rem; color: var(--emerald); min-height: 1.4em; margin-top: 6px; }

.token__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.token__disclaimer {
  margin-top: 26px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- 12. Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 46px 24px 60px; }
.site-footer__inner { max-width: var(--container); margin-inline: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.brand--footer { font-weight: 700; gap: 8px; }
.site-footer__links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; font-size: 0.88rem; color: var(--ink-dim); }
.site-footer__links a:hover, .site-footer__links button:hover { color: var(--ink); }
.site-footer__links button { background: none; border: none; color: inherit; padding: 0; }
.site-footer__disclaimer { max-width: 60ch; font-size: 0.78rem; color: var(--ink-faint); line-height: 1.6; }
.site-footer__tagline { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); }

/* ---------- 13. Animations (shared) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* City lights (hero grid decoration) */
.hero__grid::after { content: ""; }

/* ---------- 14. Responsive ---------- */
@media (max-width: 980px) {
  .story-panel { grid-template-columns: 1fr; gap: 26px; }
  .story-panel--reverse .story-panel__visual,
  .story-panel--reverse .story-panel__text { order: initial; }
  .legend-grid { grid-template-columns: repeat(2, 1fr); }
  .hero__terminal-peek { display: none; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav[data-open="true"] { display: flex; }
  .header-actions .btn--buy { display: none; }
  .hero { padding-top: 60px; }
  .cabinet__controls { justify-content: center; }
  .joystick { order: 1; }
  .cabinet__dpad { order: 2; }
  .cabinet__play-btn { order: 3; }
  .cabinet__toggles { order: 4; width: 100%; justify-content: center; }
  .gameover-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .legend-grid { grid-template-columns: 1fr 1fr; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { width: 100%; }
  .token__actions { flex-direction: column; }
  .token__actions .btn { width: 100%; }
}

@media (orientation: landscape) and (max-height: 480px) {
  .terminal-section { padding-top: 16px; }
  .cabinet__topbar { padding-bottom: 8px; }
}

/* ---------- 15. Reduced motion / accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .intro__candles { display: none; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
