/* =====================================================================
   THEMISTOKLES — RETRO ARCADE ONE-PAGER
   Colours are taken from the channel artwork: midnight blue room,
   crimson desk, brass nameplate, tan hoodie, cyan monitor glow.
   ===================================================================== */

/* ---------- Fonts (self-hosted, no tracking) ---------- */
@font-face { font-family: "Press Start 2P"; src: url("../fonts/press-start-2p-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "VT323"; src: url("../fonts/vt323-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../fonts/silkscreen-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../fonts/silkscreen-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url("../fonts/pixelify-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  --ink: #05071a;
  --night: #0a1033;
  --navy: #111c52;
  --royal: #2340a8;
  --blue: #3a6cf0;
  --cyan: #3fd8f2;
  --crimson: #c8213a;
  --red: #ff4d5e;
  --wine: #7a1030;
  --gold: #ffc53d;
  --gold-hi: #ffe9a3;
  --gold-lo: #c77d0a;
  --amber: #ff9a1f;
  --tan: #e0b07a;
  --cream: #fff4dc;
  --muted: #a9b0dd;
  --green: #5bff8a;

  --f-display: "Press Start 2P", "Courier New", monospace;
  --f-ui: "Silkscreen", "Courier New", monospace;
  --f-body: "Pixelify Sans", system-ui, sans-serif;
  --f-mono: "VT323", "Courier New", monospace;

  --hud-h: 64px;
  --gutter: 24px;
  --wrap: 1240px;
  --px: 4px; /* chunky pixel unit */

  --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M2 2h3v3H2zM2 5h3v3H2zM2 8h3v3H2zM2 11h3v3H2zM2 14h3v3H2zM5 5h3v3H5zM8 8h3v3H8zM11 11h3v3h-3zM5 14h3v3H5zM8 11h3v3H8z' fill='%2305071a'/%3E%3Cpath d='M3 3h1v12H3zM4 6h2v8H4zM6 8h2v5H6zM8 10h2v2H8z' fill='%23ffc53d'/%3E%3C/svg%3E") 2 2, auto;
  --cursor-hand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M6 1h4v9h3v1h3v1h3v1h2v9H7v-2H5v-2H3v-5h3z' fill='%2305071a'/%3E%3Cpath d='M7 2h2v10h2V11h2v2h1v-1h2v2h1v-1h2v8H8v-2H6v-2H4v-3h3z' fill='%23fff4dc'/%3E%3C/svg%3E") 7 1, pointer;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
}
@media (hover: hover) and (pointer: fine) {
  body { cursor: var(--cursor); }
  a, button, [role="button"], .cart { cursor: var(--cursor-hand); }
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 3px dashed var(--gold); outline-offset: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 2000; background: var(--gold); color: var(--ink); padding: 10px 14px; font-family: var(--f-ui); }
.skip-link:focus { top: 12px; }

.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.label { font-family: var(--f-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }

/* Pixel icons (drawn by main.js) */
i[data-px] { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; flex: 0 0 auto; }
i[data-px] svg { display: block; width: 100%; height: 100%; }

/* ---------- Notched "8-bit" borders ---------- */
.px-border, .btn, .stage-tag, .tile, .board, .world-card, .cart, .ally-front, .ally-back, .continue, .toast, .cab-nav, .socials a, .bubble, .name-plate {
  --bc: var(--ink);
  box-shadow: 0 calc(var(--px) * -1) 0 0 var(--bc), 0 var(--px) 0 0 var(--bc), calc(var(--px) * -1) 0 0 0 var(--bc), var(--px) 0 0 0 var(--bc);
}

/* ---------- Arcade buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px;
  font-family: var(--f-ui); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--gold); color: var(--ink);
  box-shadow:
    inset -4px -4px 0 0 var(--gold-lo), inset 4px 4px 0 0 var(--gold-hi),
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    0 8px 0 0 rgba(0,0,0,.45);
  transition: transform .12s steps(2), filter .12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: inset 4px 4px 0 0 var(--gold-lo), inset -4px -4px 0 0 var(--gold-hi), 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink); }
.btn i[data-px] { font-size: 1.15em; }

/* ---------- Boot screen ---------- */
.boot { display: none; }
.js .boot.on {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 1000;
  background: #02030b; color: var(--green);
  font-family: var(--f-mono); font-size: clamp(18px, 2.2vw, 24px);
  text-shadow: 0 0 6px rgba(91,255,138,.6);
  padding: 24px;
}
.boot-inner { width: min(720px, 100%); }
.boot-head { display: flex; justify-content: space-between; gap: 12px; color: var(--gold); text-shadow: 0 0 6px rgba(255,197,61,.5); border-bottom: 2px dashed rgba(91,255,138,.35); padding-bottom: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.boot-log { min-height: 9.5em; }
.boot-log li { display: flex; gap: 8px; white-space: nowrap; overflow: hidden; }
.boot-log li .dots { flex: 1; overflow: hidden; opacity: .5; }
.boot-log li .ok { color: var(--gold); }
.boot-bar { height: 22px; margin-top: 16px; padding: 3px; border: 2px solid var(--green); }
.boot-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--green) 0 14px, transparent 14px 18px); }
.boot-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.boot-start { color: var(--gold); visibility: hidden; }
.boot-start.show { visibility: visible; }

/* ---------- Background layers ---------- */
.starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; image-rendering: pixelated; }
.crt-overlay {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.14) 2px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 62%, rgba(0,0,0,.42) 100%);
  animation: flicker 4s steps(1) infinite;
}
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: 1; } 73% { opacity: .94; } 74% { opacity: 1; } }
main { position: relative; z-index: 1; }

/* ---------- HUD ---------- */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  height: var(--hud-h);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 28px;
  padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(5,7,26,.85), rgba(5,7,26,0));
  transition: background .3s;
}
.hud.solid { background: rgba(5,7,26,.92); box-shadow: 0 4px 0 0 rgba(255,255,255,.06); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hud-logo img { height: 34px; width: auto; image-rendering: pixelated; }
.hud-scores { display: flex; gap: 28px; justify-content: center; }
.score { display: flex; flex-direction: column; line-height: 1; align-items: center; }
.score-lbl { font-family: var(--f-display); font-size: 9px; color: var(--red); margin-bottom: 5px; letter-spacing: .05em; }
.score-val { font-family: var(--f-display); font-size: 13px; color: var(--cream); letter-spacing: .08em; }
.hud-nav { display: flex; gap: 22px; }
.hud-nav a { position: relative; font-family: var(--f-ui); font-size: 14px; text-transform: uppercase; letter-spacing: .1em; color: var(--cream); padding: 6px 0 6px 16px; }
.hud-nav a::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 10px; margin-top: -5px;
  background: var(--gold); clip-path: polygon(0 0, 25% 0, 25% 10%, 50% 10%, 50% 30%, 75% 30%, 75% 40%, 100% 40%, 100% 60%, 75% 60%, 75% 70%, 50% 70%, 50% 90%, 25% 90%, 25% 100%, 0 100%);
  opacity: 0;
}
.hud-nav a:hover, .hud-nav a.active { color: var(--gold); }
.hud-nav a:hover::before, .hud-nav a.active::before { opacity: 1; animation: blink .6s steps(1) infinite; }
.hud-actions { display: flex; align-items: center; gap: 18px; }
.sfx-btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-ui); font-size: 12px; color: var(--muted); padding: 6px 4px; }
.sfx-btn b { color: var(--red); font-weight: 700; }
.sfx-btn[aria-pressed="true"] b { color: var(--green); }
.sfx-btn i { font-size: 16px; }
.btn-coin { padding: 9px 14px; font-size: 12px; }
.pause-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; gap: 6px; background: var(--crimson); box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink); }
.pause-btn span { width: 6px; height: 18px; background: var(--cream); }
.xp-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.06); }
.xp-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 10px, var(--amber) 10px 12px); }

/* Pause menu (mobile nav) */
.pause-menu { position: fixed; inset: 0; z-index: 850; background: rgba(5,7,26,.96); display: grid; place-items: center; padding: 24px; }
.pause-menu[hidden] { display: none; }
.pause-inner { width: min(420px, 100%); text-align: center; }
.pause-title { font-family: var(--f-display); font-size: 28px; color: var(--gold); margin-bottom: 32px; text-shadow: 3px 3px 0 var(--crimson); }
.pause-list li + li { margin-top: 6px; }
.pause-list a, .pause-list button { display: block; width: 100%; padding: 14px 10px; font-family: var(--f-display); font-size: 13px; text-transform: uppercase; color: var(--cream); line-height: 1.5; }
.pause-list a:hover, .pause-list a:focus-visible, .pause-list button:hover { color: var(--gold); background: rgba(255,255,255,.05); }
.pause-list .hot { color: var(--gold); }
.pause-socials { margin-top: 28px; }

/* ---------- Shared section bits ---------- */
.section { position: relative; padding: clamp(96px, 14vh, 160px) 0; }
.sec-head { margin-bottom: clamp(36px, 6vh, 64px); position: relative; z-index: 2; }
.stage-tag {
  --bc: var(--ink);
  display: inline-block; margin: 0 4px 22px;
  font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .14em;
  background: var(--crimson); color: var(--cream); padding: 5px 12px;
}
.stage-tag-light { background: var(--ink); color: var(--gold); }
.sec-head h2 {
  font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(24px, 4.4vw, 60px); line-height: 1.2;
  color: var(--gold);
  text-shadow: .06em .06em 0 var(--crimson), .12em .12em 0 var(--ink);
}
.sec-sub { margin-top: 18px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); max-width: 640px; }
.px-wipe { position: absolute; top: -1px; left: 0; width: 100%; height: 96px; z-index: 3; pointer-events: none; image-rendering: pixelated; display: none; }
.js .px-wipe { display: block; }

/* ---------- Generic OSD (on-screen display) text ---------- */
.osd { position: absolute; z-index: 4; font-family: var(--f-mono); font-size: clamp(14px, 1.7vw, 26px); color: var(--green); text-shadow: 0 0 6px rgba(91,255,138,.75); line-height: 1; pointer-events: none; display: flex; gap: .3em; align-items: center; }
.osd-tl { top: 5%; left: 4%; }
.osd-br { bottom: 5%; right: 4%; }
.osd-center { inset: 0; justify-content: center; font-size: clamp(20px, 3vw, 44px); opacity: 0; }

/* =====================================================================
   0. TITLE SCREEN
   ===================================================================== */
.hero { position: relative; height: 100vh; height: 100svh; overflow: hidden; }
.hero-glow { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 50% at 50% 62%, rgba(35,64,168,.55), rgba(10,16,51,0) 70%); pointer-events: none; }
.hero-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--hud-h) + 2.2vh) var(--gutter) 2.6vh;
  gap: 1.6vh;
}
.wordmark {
  font-family: var(--f-display); font-weight: 400; line-height: 1;
  font-size: min(calc((100vw - var(--gutter) * 2) / 12.6), 14vh, 150px);
  display: flex; justify-content: center; white-space: nowrap;
  padding-right: .1em;  /* room for the extrude */
  position: relative; z-index: 3;
  user-select: none;
}
.wordmark .ch {
  display: inline-block;
  background: linear-gradient(180deg, #fff6c8 0 20%, #ffd23f 20% 48%, #ff9a1f 48% 72%, #ff4d5e 72% 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(.04em .04em 0 #9e1430) drop-shadow(.04em .04em 0 #3a0a24) drop-shadow(0 0 .14em rgba(255,197,61,.25));
  will-change: transform;
}
.hero-tag { font-family: var(--f-ui); font-size: clamp(11px, 1.25vw, 17px); text-transform: uppercase; letter-spacing: .16em; text-align: center; color: var(--cream); position: relative; z-index: 3; }
.hero-tag em { font-style: normal; color: var(--gold); }

.crt-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; }
.crt {
  width: var(--crt-w, min(86vw, 960px)); position: relative; transform-origin: 50% 50%; will-change: transform;
  background: linear-gradient(180deg, #2a3168, #161b40);
  padding: 2.6% 2.6% 1.2%;
  border-radius: 26px;
  box-shadow: inset 0 0 0 4px #39427f, inset 0 -12px 0 rgba(0,0,0,.35), 0 0 0 4px var(--ink), 0 40px 80px rgba(0,0,0,.6), 0 0 140px rgba(63,216,242,.18);
}
.crt-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px / 20px; background: #000; box-shadow: 0 0 0 3px #000; }
.crt-zoom { position: absolute; inset: 0; transform-origin: 69% 46%; will-change: transform; }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-wave { opacity: 0; }
.crt-zoom.pixelate .frame { image-rendering: pixelated; }
.crt-glass, .tv-glass {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 40% at 28% 12%, rgba(255,255,255,.14), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 58%, rgba(0,0,0,.55) 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,.6);
}
.crt-chin { display: flex; justify-content: space-between; align-items: center; padding: 1.2% 1% .4%; font-family: var(--f-ui); font-size: clamp(9px, .9vw, 12px); color: #8d96d6; letter-spacing: .2em; }
.crt-led { width: 10px; height: 10px; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 2s steps(1) infinite; }

.bubble {
  --bc: var(--ink);
  position: absolute; z-index: 5; left: 9%; top: 14%; max-width: 31%;
  background: var(--cream); color: var(--ink);
  font-family: var(--f-display); font-size: clamp(7px, .95vw, 13px); line-height: 1.7;
  padding: .9em 1em;
  opacity: 0; transform-origin: 100% 60%;
}
.bubble::after {
  content: ""; position: absolute; right: -16px; top: 55%; width: 16px; height: 16px;
  background: var(--cream);
  clip-path: polygon(0 0, 50% 0, 50% 25%, 75% 25%, 75% 50%, 100% 50%, 100% 75%, 50% 75%, 50% 100%, 0 100%);
  filter: drop-shadow(4px 0 0 var(--ink));
}

.press-start { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; z-index: 3; }
.press-start > span { font-family: var(--f-display); font-size: clamp(12px, 1.4vw, 18px); color: var(--gold); text-shadow: 3px 3px 0 var(--crimson); }
.press-start small { font-family: var(--f-ui); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.hero-corner { position: absolute; bottom: calc(3vh + 26px); font-family: var(--f-ui); font-size: 11px; letter-spacing: .2em; color: var(--muted); z-index: 3; }
.hero-corner b { color: var(--gold); font-weight: 700; }
.hero-corner-l { left: var(--gutter); }
.hero-corner-r { right: var(--gutter); }
.hero-flash { position: absolute; inset: 0; z-index: 10; background: var(--night); opacity: 0; pointer-events: none; }

/* =====================================================================
   1. PLAYER SELECT
   ===================================================================== */
.player { overflow: hidden; }
.player .wrap { position: relative; z-index: 2; }
.player-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.player-stage { position: relative; height: min(68vh, 620px); min-height: 420px; display: flex; align-items: flex-end; justify-content: center; }
.spotlight { position: absolute; inset: 0 8% 6%; background: linear-gradient(to bottom, rgba(255,197,61,.28), rgba(255,197,61,0) 85%); clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); }
.select-frame { position: absolute; inset: 3% 4% 9%; z-index: 3; pointer-events: none; }
.select-frame .corner { position: absolute; width: 34px; height: 34px; border: 0 solid var(--gold); animation: blink 1.2s steps(1) infinite; }
.select-frame .tl { top: 0; left: 0; border-top-width: 6px; border-left-width: 6px; }
.select-frame .tr { top: 0; right: 0; border-top-width: 6px; border-right-width: 6px; }
.select-frame .bl { bottom: 0; left: 0; border-bottom-width: 6px; border-left-width: 6px; }
.select-frame .br { bottom: 0; right: 0; border-bottom-width: 6px; border-right-width: 6px; }
.p1-tag { position: absolute; top: -14px; left: 44px; font-family: var(--f-display); font-size: 12px; background: var(--crimson); color: var(--cream); padding: 6px 8px; }
.sprite-wrap { position: relative; z-index: 2; height: 86%; margin-bottom: 4%; }
.player-sprite { height: 100%; width: auto; image-rendering: pixelated; filter: drop-shadow(8px 0 0 rgba(5,7,26,.6)); animation: idle 1.1s steps(1) infinite; }
@keyframes idle { 50% { transform: translateY(-5px); } }
.platform { position: absolute; bottom: 3%; left: 50%; width: 74%; height: 34px; transform: translateX(-50%); z-index: 1;
  background:
    linear-gradient(var(--cyan), var(--cyan)) 50% 0 / 70% 6px no-repeat,
    linear-gradient(#1a5fa8, #1a5fa8) 50% 6px / 86% 10px no-repeat,
    linear-gradient(#103a73, #103a73) 50% 16px / 100% 12px no-repeat;
  filter: drop-shadow(0 0 18px rgba(63,216,242,.55));
}
.name-plate {
  --bc: var(--gold);
  position: absolute; bottom: -18px; left: 0; right: 0; margin: 0 auto; width: max-content; z-index: 4;
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  background: var(--ink); padding: 10px 16px;
  font-family: var(--f-display); font-size: clamp(12px, 1.3vw, 18px); color: var(--gold);
}
.np-side { background: var(--crimson); color: var(--cream); font-size: .7em; padding: 4px 6px; }

.player-info > * + * { margin-top: 20px; }
.class-line { font-family: var(--f-ui); font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.class-line .label { margin-right: 10px; }
.class-line em { color: var(--muted); font-style: normal; }
.lead { font-weight: 600; font-size: clamp(22px, 2.3vw, 32px); line-height: 1.3; color: var(--cream); }
.lead strong { color: var(--gold); font-weight: 700; }
.player-info p:not(.lead):not(.class-line):not(.label) { color: #d6dbff; max-width: 620px; }

.stats { display: grid; gap: 12px; padding-top: 8px; }
.stat { display: grid; grid-template-columns: 148px 1fr 150px; gap: 14px; align-items: center; }
.stat-name { font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.stat-note { font-family: var(--f-mono); font-size: 19px; color: var(--muted); line-height: 1; }
.bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; height: 18px; }
.bar i { background: rgba(255,255,255,.08); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.bar i.on { background: var(--seg, var(--gold)); }
.stat:nth-child(1) { --seg: var(--cyan); }
.stat:nth-child(2) { --seg: var(--red); }
.stat:nth-child(3) { --seg: var(--gold); }
.stat:nth-child(4) { --seg: var(--green); }

.moves ul { display: grid; gap: 6px; margin-top: 10px; }
.moves li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 12px; background: rgba(5,7,26,.55); font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.moves li:hover { background: rgba(255,197,61,.12); }
.input { display: inline-flex; gap: 5px; align-items: center; color: var(--gold); font-size: 16px; }
.input .key { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-family: var(--f-display); font-size: 9px; color: var(--cream); background: var(--crimson); box-shadow: inset -2px -2px 0 rgba(0,0,0,.3); }
.input .key.b { background: var(--royal); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: clamp(56px, 9vh, 96px); }
.tile { --bc: var(--royal); background: rgba(5,7,26,.78); padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tile-val { font-family: var(--f-display); font-size: clamp(18px, 2.4vw, 32px); color: var(--gold); text-shadow: 3px 3px 0 var(--crimson); line-height: 1.2; }
.tile-lbl { font-family: var(--f-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

.grid-floor {
  position: absolute; left: -20%; right: -20%; bottom: 0; height: 46%; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(200,33,58,.55) 2px, transparent 2px), linear-gradient(90deg, rgba(200,33,58,.55) 2px, transparent 2px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); mask-image: linear-gradient(to top, #000 10%, transparent 90%);
  opacity: .55;
}

/* ---------- Ticker bands ---------- */
.tickers { position: relative; z-index: 4; height: 230px; overflow: hidden; margin: -30px 0; pointer-events: none; }
.tickers-2 { height: 140px; }
.ticker { position: absolute; left: -6%; width: 112%; padding: 18px 0; box-shadow: 0 6px 0 0 var(--ink), 0 -6px 0 0 var(--ink); }
.ticker-a { top: 46px; background: var(--gold); color: var(--ink); transform: rotate(-3deg); }
.ticker-b { top: 128px; background: var(--crimson); color: var(--cream); transform: rotate(2deg); }
.ticker-c { top: 40px; background: var(--cyan); color: var(--ink); transform: rotate(-1.5deg); }
.ticker-track { display: flex; width: max-content; white-space: nowrap; font-family: var(--f-display); font-size: clamp(14px, 1.6vw, 24px); text-transform: uppercase; will-change: transform; }
.ticker-track span { display: inline-flex; align-items: center; }
.ticker-track .gem { width: .55em; height: .55em; background: currentColor; transform: rotate(45deg); margin: 0 1.1em; }

/* =====================================================================
   2. HIGH SCORES
   ===================================================================== */
.hs-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.tv-body {
  display: grid; grid-template-columns: 1fr 12%; gap: 18px;
  padding: 20px; border-radius: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 22px, rgba(0,0,0,.12) 22px 26px, rgba(0,0,0,0) 26px 40px),
    linear-gradient(180deg, #7a4a24, #4f2c12);
  box-shadow: inset 0 0 0 4px #9b6534, inset 0 -10px 0 rgba(0,0,0,.3), 0 0 0 4px var(--ink), 0 30px 60px rgba(0,0,0,.55);
}
.tv-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 22px / 28px; overflow: hidden; background: #000; box-shadow: 0 0 0 10px #12141f, 0 0 0 14px #2b2f44; }
.tv-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tv-poster img { width: 100%; height: 100%; object-fit: cover; transition: filter .3s; }
.tv-poster:hover img { filter: brightness(1.1) saturate(1.1); }
.big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(56px, 7vw, 92px); aspect-ratio: 1; display: grid; place-items: center;
  background: var(--gold); color: var(--ink); font-size: clamp(24px, 3vw, 40px);
  box-shadow: inset -5px -5px 0 0 var(--gold-lo), inset 5px 5px 0 0 var(--gold-hi), 0 -5px 0 0 var(--ink), 0 5px 0 0 var(--ink), -5px 0 0 0 var(--ink), 5px 0 0 0 var(--ink), 0 10px 0 0 rgba(0,0,0,.5);
  transition: transform .15s steps(2);
}
.big-play i { transform: translateX(8%); }
.tv-poster:hover .big-play { transform: translate(-50%, -50%) scale(1.12); }
.tv-screen iframe, .cab-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 2; }
.static { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; opacity: 0; pointer-events: none; image-rendering: pixelated; }
.tv-screen .tv-glass { z-index: 4; }
.tv-screen .osd { z-index: 6; }
.tv-side { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; }
.knob { width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #4b4f66, #1b1d29 70%); box-shadow: 0 0 0 4px #12141f, inset 0 0 0 6px rgba(255,255,255,.05); position: relative; }
.knob::after { content: ""; position: absolute; left: 47%; top: 8%; width: 6%; height: 34%; background: var(--gold); }
.knob.small { width: 50%; }
.grille { flex: 1; width: 70%; min-height: 60px; background: repeating-linear-gradient(to bottom, #12141f 0 4px, rgba(0,0,0,0) 4px 8px); }
.tv-now { margin-top: 18px; font-size: 17px; color: var(--muted); min-height: 2.6em; }
.tv-now b { color: var(--cream); font-weight: 600; }

.board { --bc: var(--royal); background: rgba(5,7,26,.82); padding: 26px 22px 18px; }
.board-head, .board-rows button { display: grid; grid-template-columns: 58px 92px 1fr; gap: 12px; align-items: center; }
.board-head { font-family: var(--f-display); font-size: 10px; color: var(--cream); padding: 0 10px 14px 26px; text-transform: uppercase; }
.board-rows li + li { margin-top: 4px; }
.board-rows button {
  position: relative; width: 100%; text-align: left;
  padding: 14px 10px 14px 26px;
  font-family: var(--f-display); font-size: clamp(10px, .95vw, 13px); line-height: 1.5; color: var(--row, var(--cream));
}
.board-rows button::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 10px; margin-top: -5px; background: var(--gold);
  clip-path: polygon(0 0, 25% 0, 25% 10%, 50% 10%, 50% 30%, 75% 30%, 75% 40%, 100% 40%, 100% 60%, 75% 60%, 75% 70%, 50% 70%, 50% 90%, 25% 90%, 25% 100%, 0 100%);
  opacity: 0;
}
.board-rows button:hover { background: rgba(255,255,255,.05); }
.board-rows button.active { background: rgba(255,255,255,.08); }
.board-rows button.active::before { opacity: 1; animation: blink .6s steps(1) infinite; }
.board-rows .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-foot { margin-top: 14px; padding-left: 26px; font-family: var(--f-mono); font-size: 18px; color: var(--muted); }

/* =====================================================================
   3. LEVEL SELECT
   ===================================================================== */
.levels { position: relative; z-index: 2; }
.levels-pin { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: clamp(18px, 3vh, 32px); padding: calc(var(--hud-h) + 3vh) 0 4vh; overflow: hidden; }
.levels-head { margin-bottom: 0; }
.levels-head h2 { font-size: clamp(24px, 3.6vw, 52px); }
.levels-head .stage-tag { margin-bottom: 16px; }
.levels-head .sec-sub { margin-top: 12px; }
.levels-track { display: flex; gap: 40px; width: max-content; padding: 12px max(var(--gutter), calc((100vw - var(--wrap)) / 2)) 24px; will-change: transform; }
.world { --wc: var(--gold); display: flex; gap: 26px; align-items: stretch; }
.world-levels { display: flex; gap: 26px; align-items: stretch; }
.world-card {
  --bc: var(--wc);
  flex: 0 0 auto; width: clamp(260px, 30vh, 330px);
  background: linear-gradient(170deg, rgba(5,7,26,.92), rgba(17,28,82,.92));
  padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; justify-content: space-between;
}
.wc-num { font-family: var(--f-ui); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--wc); }
.wc-icon { font-size: clamp(56px, 8vh, 80px); color: var(--wc); line-height: 0; }
.wc-name { font-family: var(--f-display); font-weight: 400; font-size: clamp(15px, 2.2vh, 20px); line-height: 1.45; color: var(--cream); text-transform: uppercase; }
.wc-blurb { font-size: 16px; color: #cfd5ff; line-height: 1.45; }
.wc-count { font-family: var(--f-mono); font-size: 22px; color: var(--wc); }

.cart {
  --bc: var(--ink);
  position: relative; flex: 0 0 auto; width: clamp(250px, 34vh, 330px);
  text-align: left; display: flex; flex-direction: column;
  background: var(--wc); color: var(--ink);
  padding: 0 12px 14px;
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 10px 12px 0 0 rgba(0,0,0,.35);
  transition: translate .18s steps(3), rotate .18s steps(3);
}
.cart-grip, .cart-label, .cart-thumb, .cart-title { display: block; }
.cart-grip { height: 18px; margin: 0 -12px 10px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.28) 0 4px, rgba(0,0,0,0) 4px 10px) 0 4px / 100% 10px no-repeat, rgba(0,0,0,.12); }
.cart-label { background: var(--cream); padding: 7px; box-shadow: inset 0 0 0 3px var(--ink); }
.cart-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s steps(4); }
.cart-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.18) 2px 3px); pointer-events: none; }
.cart-lvl { position: absolute; top: 6px; left: 6px; z-index: 2; font-family: var(--f-display); font-size: 9px; background: var(--ink); color: var(--gold); padding: 5px 6px; }
.cart-time { position: absolute; bottom: 6px; right: 6px; z-index: 2; font-family: var(--f-mono); font-size: 18px; line-height: 1; background: var(--ink); color: var(--cream); padding: 3px 6px; }
.cart-press { position: absolute; inset: auto 0 0 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; background: var(--gold); color: var(--ink); font-family: var(--f-display); font-size: 9px; transform: translateY(100%); transition: transform .15s steps(3); }
.cart-title { margin-top: 12px; font-weight: 600; font-size: 17px; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-blurb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 15px; line-height: 1.35; opacity: .78; }
.cart-meta { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 19px; line-height: 1; opacity: .85; }
.cart:hover, .cart:focus-visible { translate: 0 -10px; rotate: -1deg; }
.cart:hover .cart-press, .cart:focus-visible .cart-press { transform: translateY(0); }
.cart:hover .cart-thumb img { transform: scale(1.06); animation: glitch .5s steps(2) 1; }
@keyframes glitch {
  0% { filter: none; translate: 0 0; }
  25% { filter: hue-rotate(80deg) saturate(2); translate: -4px 0; }
  50% { filter: none; translate: 3px 0; }
  75% { filter: hue-rotate(-60deg) contrast(1.4); translate: -2px 0; }
  100% { filter: none; translate: 0 0; }
}
.cart.bonus { background: var(--ink); color: var(--cream); --bc: var(--gold); justify-content: center; align-items: flex-start; gap: 16px; padding: 28px 24px; box-shadow: 0 -4px 0 0 var(--gold), 0 4px 0 0 var(--gold), -4px 0 0 0 var(--gold), 4px 0 0 0 var(--gold), 10px 12px 0 0 rgba(0,0,0,.35); }
.cart.bonus .wc-icon { color: var(--gold); }
.cart.bonus b { font-family: var(--f-display); font-weight: 400; font-size: 18px; line-height: 1.5; color: var(--gold); }
.cart.bonus span { font-size: 16px; color: #cfd5ff; }
.cart.bonus .btn { color: var(--ink); font-size: 13px; margin-top: 6px; }

.worldmap { position: relative; height: 64px; }
.wm-line { position: absolute; left: var(--gutter); right: var(--gutter); top: 26px; height: 6px; background: rgba(255,255,255,.1); }
.wm-fill { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 10px, var(--amber) 10px 12px); }
.wm-hero { position: absolute; top: -30px; left: 0; font-size: 28px; transform: translateX(-50%); }
.wm-nodes { position: absolute; left: var(--gutter); right: var(--gutter); top: 18px; height: 40px; }
.wm-nodes li { position: absolute; top: 0; transform: translateX(-50%); }
.wm-nodes button { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--f-ui); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.wm-nodes button::before { content: ""; width: 18px; height: 18px; background: var(--night); box-shadow: 0 0 0 3px var(--wc); }
.wm-nodes li.passed button { color: var(--cream); }
.wm-nodes li.passed button::before { background: var(--wc); }

/* =====================================================================
   4. FRIENDS OF THEMISTOKLES
   ===================================================================== */
.allies { z-index: 2; }
.ally-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); perspective: 1600px; }
.ally { position: relative; min-width: 0; }
.ally-inner { position: relative; height: 100%; transform-style: preserve-3d; will-change: transform; }
.ally-front, .ally-back { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.ally-front {
  --bc: var(--gold);
  position: relative; height: 100%; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
  padding: 26px 26px 30px;
  background: linear-gradient(165deg, #1e3290 0%, #111c52 45%, #0a1033 100%);
}
.ally-alt .ally-front { background: linear-gradient(165deg, #b3122e 0%, #6c0d27 50%, #2a0716 100%); }
.ally-front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .7;
  background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255,255,255,.55), rgba(255,255,255,0) 40%),
              linear-gradient(115deg, rgba(63,216,242,0) 30%, rgba(63,216,242,.25) 45%, rgba(255,77,94,.25) 55%, rgba(255,197,61,0) 70%);
  background-size: 100% 100%, 250% 250%;
  background-position: 0 0, var(--hx, 0%) 50%;
}
.ally-back {
  --bc: var(--gold);
  position: absolute; inset: 0; transform: rotateY(180deg);
  display: grid; place-items: center; align-content: center; gap: 18px;
  background:
    repeating-conic-gradient(var(--crimson) 0 25%, var(--wine) 0 50%) 0 0 / 32px 32px;
  color: var(--gold); font-family: var(--f-display); font-size: 48px;
}
.ally-back i { font-size: 120px; }
.ally-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.ally-ribbon { font-family: var(--f-ui); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; background: var(--gold); color: var(--ink); padding: 4px 8px; }
.ally-rarity { color: var(--gold); display: flex; gap: 4px; font-size: 18px; }
.ally-art { position: relative; height: clamp(150px, 20vh, 200px); display: grid; place-items: center; font-size: clamp(100px, 13vh, 140px); line-height: 0;
  background: repeating-conic-gradient(rgba(255,255,255,.06) 0 25%, rgba(0,0,0,0) 0 50%) 0 0 / 16px 16px, rgba(5,7,26,.45);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.08);
}
.ally-art i { filter: drop-shadow(6px 6px 0 rgba(0,0,0,.45)); animation: float 2.4s steps(4) infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.ally-name { font-family: var(--f-display); font-weight: 400; font-size: clamp(18px, 2vw, 26px); line-height: 1.3; color: var(--gold); text-shadow: 3px 3px 0 var(--ink); text-transform: uppercase; }
.ally-type { font-family: var(--f-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); margin-top: -6px; }
.ally-alt .ally-type { color: var(--gold-hi); }
.ally-copy { font-size: 17px; color: #e7e9ff; }
.ally-copy strong { color: var(--cream); font-weight: 600; }
.ally-perfect { font-size: 16px; padding: 12px 14px; background: rgba(5,7,26,.5); border-left: 4px solid var(--gold); }
.ally-perfect .label { display: block; margin-bottom: 2px; }
.ally-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ally-stats li { background: rgba(5,7,26,.55); padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 4px; }
.ally-stats span { font-family: var(--f-ui); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ally-stats b { font-family: var(--f-display); font-weight: 400; font-size: 14px; color: var(--green); }
.btn-ally { margin-top: auto; width: 100%; position: relative; z-index: 2; white-space: normal; text-align: center; }

/* =====================================================================
   5. PARTNERSHIPS
   ===================================================================== */
.partner { z-index: 2; overflow: hidden; background: linear-gradient(180deg, #b3122e 0%, #9e1430 55%, #6a0c25 100%); color: var(--cream); }
.partner-dither { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-conic-gradient(rgba(0,0,0,.09) 0 25%, rgba(0,0,0,0) 0 50%) 0 0 / 8px 8px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, #000); mask-image: linear-gradient(to bottom, transparent, #000 40%, #000);
}
.partner .wrap { position: relative; z-index: 2; }
.partner-title { display: flex; flex-direction: column; gap: 18px; }
.partner .sec-head h2 { text-shadow: none; }
.pt-big {
  font-family: var(--f-display); font-size: clamp(36px, 7.6vw, 112px); line-height: 1.05;
  background: linear-gradient(180deg, #fff6c8 0 20%, #ffd23f 20% 48%, #ff9a1f 48% 72%, #ffb347 72% 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(.04em .04em 0 #3a0a24) drop-shadow(.04em .04em 0 var(--ink));
  display: inline-block; width: fit-content;
}
.pt-small { font-family: var(--f-ui); font-size: clamp(14px, 1.7vw, 22px); letter-spacing: .18em; color: var(--cream); }
.partner-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.partner .lead { color: var(--cream); }
.powerups { display: grid; gap: 14px; margin-top: 32px; }
.powerups li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: center; padding: 14px; background: rgba(5,7,26,.28); }
.powerups li > i { width: 52px; height: 52px; padding: 12px; background: var(--gold); color: var(--ink); box-shadow: inset -4px -4px 0 var(--gold-lo), inset 4px 4px 0 var(--gold-hi); }
.powerups b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 13px; line-height: 1.5; text-transform: uppercase; color: var(--gold); }
.powerups span { font-size: 17px; color: #ffe2e2; }

.p2-screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 10px var(--ink), 0 0 0 14px #2b2f44, 0 30px 60px rgba(0,0,0,.4); }
.p2-screen img { width: 100%; height: 100%; object-fit: cover; }
.p2-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.2) 2px 3px), radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,.5) 100%); }
.kit { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 34px; }
.kit > div { background: rgba(5,7,26,.4); padding: 14px 16px; }
.kit .wide { grid-column: 1 / -1; }
.kit dt { font-family: var(--f-ui); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #ffc9cf; }
.kit dd { font-family: var(--f-display); font-size: clamp(14px, 1.6vw, 20px); color: var(--gold); margin-top: 6px; line-height: 1.4; }
.kit .wide dd { font-size: clamp(11px, 1.1vw, 14px); color: var(--cream); }

.continue {
  --bc: var(--gold);
  margin-top: clamp(56px, 9vh, 96px);
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  background: var(--ink); padding: clamp(24px, 3.5vw, 44px);
}
.continue-left { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.continue-q { font-family: var(--f-display); font-size: clamp(14px, 1.6vw, 22px); color: var(--cream); animation: blink 1s steps(1) infinite; }
.continue-n { font-family: var(--f-display); font-size: clamp(72px, 10vw, 150px); line-height: 1; color: var(--gold); text-shadow: .05em .05em 0 var(--crimson), .1em .1em 0 #3a0a24; min-height: 1em; text-align: center; }
.continue-n.over { font-size: clamp(20px, 2.6vw, 34px); line-height: 1.4; color: var(--red); text-shadow: 3px 3px 0 #3a0a24; }
.continue-lbl { font-family: var(--f-ui); font-size: 14px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: 18px; }
.btn-mega { width: 100%; padding: 26px 22px; gap: 16px; font-family: var(--f-display); font-weight: 400; font-size: clamp(13px, 1.75vw, 22px); line-height: 1.6; letter-spacing: 0; text-transform: none; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.btn-mega i { font-size: 1.5em; }
.continue-row { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.btn-ghost { background: var(--navy); color: var(--cream); box-shadow: inset -4px -4px 0 0 #0a1033, inset 4px 4px 0 0 #2a3a8c, 0 -4px 0 0 var(--gold), 0 4px 0 0 var(--gold), -4px 0 0 0 var(--gold), 4px 0 0 0 var(--gold); }
.copy-msg { font-family: var(--f-mono); font-size: 22px; color: var(--green); }
.continue-tip { margin-top: 18px; font-size: 16px; color: var(--muted); }

/* =====================================================================
   6. CREDITS / FOOTER
   ===================================================================== */
.credits { position: relative; z-index: 2; background: var(--ink); padding: clamp(110px, 15vh, 160px) 0 36px; }
.credits-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.credits-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; box-shadow: 0 0 0 6px var(--gold), 0 0 0 10px var(--ink), 16px 16px 0 10px rgba(255,197,61,.12); }
.credits-art img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.3) saturate(.85); }
.credits-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5,7,26,.55), rgba(5,7,26,.1) 70%); pointer-events: none; }
.credits-roll { position: absolute; inset: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent); }
.roll-track { position: absolute; left: 0; right: 0; top: 100%; text-align: center; animation: roll 22s linear infinite; }
.roll-track p { margin-bottom: 30px; font-family: var(--f-display); font-size: clamp(11px, 1.3vw, 17px); color: var(--cream); line-height: 1.6; text-transform: uppercase; padding: 0 16px; }
.roll-track span { display: block; font-family: var(--f-ui); font-size: 11px; letter-spacing: .2em; color: var(--gold); }
@keyframes roll { to { transform: translateY(calc(-100% - 100cqh)); } }
.credits-roll { container-type: size; }
.thanks { font-family: var(--f-display); font-size: clamp(22px, 3vw, 40px); line-height: 1.3; color: var(--gold); text-shadow: .06em .06em 0 var(--crimson), .12em .12em 0 #000; margin-bottom: 28px; text-transform: uppercase; }
.btn-sub { background: var(--red); color: var(--cream); box-shadow: inset -4px -4px 0 0 #a8122a, inset 4px 4px 0 0 #ff8f9a, 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000, 0 8px 0 0 rgba(255,77,94,.25); }
.socials { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.socials a { --bc: var(--royal); display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--night); color: var(--cream); font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; transition: transform .12s steps(2); }
.socials a:hover { transform: translateY(-3px); color: var(--gold); }
.socials a i { font-size: 18px; color: var(--gold); }
.foot-mail { margin-top: 26px; font-size: 17px; color: var(--muted); }
.foot-mail a { color: var(--gold); border-bottom: 2px dotted var(--gold); }
.to-top { display: inline-flex; gap: 10px; align-items: center; margin-top: 18px; font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--cream); }
.to-top:hover { color: var(--gold); }
.foot-base { margin-top: clamp(56px, 9vh, 96px); padding-top: 24px; border-top: 2px dashed rgba(255,255,255,.12); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; font-size: 15px; color: var(--muted); }
.foot-base img { height: 30px; width: auto; image-rendering: pixelated; }
.konami-hint { font-family: var(--f-mono); font-size: 18px; opacity: .45; display: inline-flex; gap: 8px; align-items: center; }
.konami-hint .input { color: var(--muted); font-size: 13px; }
.pause-socials.socials { grid-template-columns: 1fr 1fr; }

/* =====================================================================
   ARCADE CABINET PLAYER (modal)
   ===================================================================== */
.cab-modal { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.cab-modal[hidden] { display: none; }
.cab-backdrop { position: fixed; inset: 0; background: rgba(2,3,11,.88); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cabinet {
  position: relative; width: min(1000px, 100%, calc((100svh - 420px) * 16 / 9 + 60px)); min-width: min(300px, 100%);
  background: linear-gradient(180deg, #24308a, #121a52 60%, #0b1036);
  padding: 0 30px 22px;
  box-shadow: 0 -6px 0 0 var(--ink), 0 6px 0 0 var(--ink), -6px 0 0 0 var(--ink), 6px 0 0 0 var(--ink), 0 0 0 10px #2a3a8c, 0 0 120px rgba(63,216,242,.25);
}
.cab-marquee { margin: 0 -30px 20px; padding: 16px 70px 14px; text-align: center; background: linear-gradient(180deg, #ffe48a, #ffc53d 50%, #ff9a1f); color: var(--ink); box-shadow: inset 0 -6px 0 rgba(0,0,0,.2), 0 6px 0 var(--ink); }
.cab-world { font-family: var(--f-ui); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.cab-marquee h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(11px, 1.4vw, 17px); line-height: 1.55; margin-top: 6px; }
.cab-screen { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 10px var(--ink), 0 0 0 14px #33408f; }
.cab-frame { position: absolute; inset: 0; }
.cab-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px -8px 0; padding: 10px 16px; background: linear-gradient(180deg, #33408f, #1d2766); box-shadow: inset 0 4px 0 rgba(255,255,255,.1), inset 0 -4px 0 rgba(0,0,0,.3); }
.cab-nav { --bc: var(--gold); display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--ink); color: var(--gold); font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.cab-nav:hover { background: var(--gold); color: var(--ink); }
.cab-controls { display: flex; align-items: center; gap: 22px; }
.stick { position: relative; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a95, var(--crimson) 60%); box-shadow: 0 0 0 4px var(--ink), 0 6px 0 4px rgba(0,0,0,.35); }
.pbtn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-family: var(--f-display); font-size: 9px; color: var(--ink); background: var(--gold); box-shadow: 0 0 0 4px var(--ink), 0 5px 0 4px rgba(0,0,0,.35); }
.pbtn.b { background: var(--cyan); }
.cab-info { margin-top: 14px; display: grid; gap: 6px; }
.cab-info p { font-size: 15px; line-height: 1.45; color: #dfe3ff; }
.cab-meta { font-family: var(--f-mono); font-size: 19px !important; color: var(--muted) !important; }
.cab-yt { font-family: var(--f-ui); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; display: inline-flex; gap: 8px; align-items: center; width: fit-content; }
.cab-close { position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--ink); color: var(--cream); font-family: var(--f-ui); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.cab-close:hover { color: var(--gold); }

/* ---------- Achievements ---------- */
.toasts { position: fixed; left: 20px; bottom: 20px; z-index: 960; display: grid; gap: 12px; pointer-events: none; }
.toast { --bc: var(--gold); display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; min-width: 270px; max-width: 340px; padding: 12px 16px; background: var(--ink); }
.toast i { font-size: 36px; color: var(--gold); }
.toast small { display: block; font-family: var(--f-ui); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.toast b { display: block; font-weight: 600; font-size: 16px; color: var(--cream); line-height: 1.25; }
.toast em { font-style: normal; font-family: var(--f-mono); font-size: 17px; color: var(--green); }

.coords { position: fixed; right: 16px; bottom: 12px; z-index: 940; font-family: var(--f-mono); font-size: 16px; color: rgba(255,255,255,.5); pointer-events: none; letter-spacing: .05em; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
  .hud-scores { display: none; }
  .hud { grid-template-columns: auto 1fr auto; }
  .hud-nav { justify-content: center; }
}
@media (max-width: 980px) {
  .player-grid, .hs-grid, .partner-grid, .credits-grid { grid-template-columns: 1fr; }
  .player-stage { height: 56vh; min-height: 380px; max-width: 480px; margin: 0 auto 30px; width: 100%; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .ally-grid { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
  .continue { grid-template-columns: 1fr; }
  .p2 { max-width: 620px; }
}
@media (max-width: 860px) {
  :root { --hud-h: 58px; --gutter: 16px; }
  .hud { gap: 12px; }
  .hud-nav, .sfx-btn { display: none; }
  .pause-btn { display: inline-flex; }
  .hud { grid-template-columns: 1fr auto; }
  .hud-logo img { height: 28px; }
  .coords { display: none; }

  .hero-corner { display: none; }
  .hero-inner { gap: 2.4vh; padding-bottom: 4vh; justify-content: space-evenly; }
  .crt-stage { flex: 0 0 auto; }
  .crt-screen { aspect-ratio: 1 / 1; }
  .crt .frame { object-position: 58% 50%; }
  .crt { border-radius: 16px; padding: 3% 3% 1.6%; }
  .crt-screen { border-radius: 10px / 12px; }
  .bubble { left: 3%; top: 9%; max-width: 34%; font-size: clamp(6px, 1.9vw, 10px); }

  .stat { grid-template-columns: 118px 1fr; }
  .stat-name { font-size: 11px; letter-spacing: .05em; }
  .pt-big { font-size: min(calc((100vw - 32px) / 6.4), 64px); }
  .continue { padding: 22px 16px; }
  .btn-mega { padding: 20px 16px; }
  .stat-note { grid-column: 2; margin-top: -4px; font-size: 17px; }
  .moves li { flex-wrap: wrap; }

  /* Level select: stacked worlds with swipeable rows */
  .levels-pin { min-height: 0; padding: clamp(96px, 14vh, 140px) 0 40px; }
  .levels-track { display: block; width: auto; padding: 0; transform: none !important; }
  .world { display: block; margin-bottom: 44px; }
  .world-card { width: auto; margin: 0 var(--gutter) 22px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px; }
  .world-card .wc-icon { font-size: 44px; }
  .world-card .wc-name { flex: 1; font-size: 15px; }
  .world-card .wc-blurb { flex-basis: 100%; font-size: 15px; }
  .world-card .wc-num { flex-basis: 100%; }
  .world-levels { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px var(--gutter) 26px; scrollbar-width: none; }
  .world-levels::-webkit-scrollbar { display: none; }
  .world-levels .cart { width: 78vw; max-width: 320px; scroll-snap-align: center; }
  .worldmap { display: none; }
  .world-bonus { padding: 0 var(--gutter); }
  .world-bonus .cart { width: 100%; }

  .tickers { height: 190px; }
  .ticker-a { top: 36px; } .ticker-b { top: 104px; }

  .cabinet { padding: 0 14px 16px; }
  .cab-marquee { margin: 0 -14px 16px; padding: 14px 64px 12px 14px; text-align: left; }
  .cab-controls { display: none; }
  .cab-panel { margin: 22px 0 0; padding: 10px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; max-width: none; }
}
@media (max-width: 520px) {
  .tiles { gap: 14px; }
  .tile { padding: 16px 12px; }
  .ally-front { padding: 20px 18px 24px; }
  .ally-stats b { font-size: 12px; }
  .socials { grid-template-columns: 1fr; }
  .board { padding: 18px 10px 14px; }
  .board-head, .board-rows button { grid-template-columns: 40px 76px 1fr; gap: 8px; }
  .board-rows button { padding-left: 22px; font-size: 9px; }
  .board-head { padding-left: 22px; font-size: 8px; }
  .tv-body { grid-template-columns: 1fr; padding: 12px; }
  .tv-side { display: none; }
  .powerups li { grid-template-columns: 44px 1fr; }
  .powerups li > i { width: 44px; height: 44px; padding: 10px; }
}
@media (max-height: 700px) and (min-width: 861px) {
  .hero-tag { display: none; }
}

/* ---------- Reduced motion: keep it calm ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .crt-overlay { animation: none; }
  .roll-track { position: static; animation: none; padding-top: 30px; }
  .credits-roll { overflow: auto; }
}

/* Level track: native horizontal scroll unless the pinned scroll is active */
.levels-viewport { overflow-x: auto; scrollbar-width: thin; }
.levels.is-pinned .levels-viewport { overflow: visible; }
@media (max-width: 860px) { .levels-viewport { overflow: visible; } }

/* Konami helmet rain */
.rain { position: fixed; top: -60px; z-index: 970; font-size: 40px; pointer-events: none; }
[tabindex="-1"]:focus { outline: none; }
.wordmark { flex-wrap: wrap; }
.wordmark .brk { display: none; }
@media (max-width: 600px) {
  .wordmark { font-size: min(calc((100vw - 32px) / 6.5), 11vh); line-height: 1.05; }
  .wordmark .brk { display: block; flex-basis: 100%; height: 0; }
}
