/* PULSE ARCADE — shared synthwave styles */
:root {
  --bg-0: #07021a;
  --bg-1: #0e0530;
  --bg-2: #160a3d;
  --panel: rgba(22, 10, 54, 0.72);
  --panel-solid: #160a3d;
  --line: rgba(124, 92, 214, 0.35);
  --magenta: #ff2e97;
  --magenta-soft: #ff79c0;
  --cyan: #29e7ff;
  --cyan-soft: #8af3ff;
  --violet: #9d6bff;
  --sun-1: #ffd86b;
  --sun-2: #ff6f9c;
  --gold: #ffce5a;
  --text: #efe9ff;
  --muted: #a394d6;
  --danger: #ff3b6b;
  --ok: #43f59b;
  --shadow-neon: 0 0 18px rgba(41, 231, 255, 0.45);
  --shadow-mag: 0 0 18px rgba(255, 46, 151, 0.45);
  --font-display: "Orbitron", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Chivo Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 50% -10%, var(--bg-2), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 70%);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-soft); }

/* Animated synthwave grid backdrop (decorative, behind everything) */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(41,231,255,0.18) 100%),
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255,46,151,0.12) 100%);
  background-size: 60px 60px, 60px 60px;
  transform: perspective(420px) rotateX(62deg) scale(2.4);
  transform-origin: 50% 100%;
  opacity: 0.5;
  animation: gridrun 6s linear infinite;
}
.bg-sun {
  position: fixed; left: 50%; top: 8vh; width: 360px; height: 360px;
  transform: translateX(-50%); z-index: -3; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--sun-1), var(--sun-2) 55%, transparent 72%);
  filter: blur(2px); opacity: 0.55;
}
@keyframes gridrun { from { background-position: 0 0, 0 0; } to { background-position: 0 60px, 60px 0; } }
@media (prefers-reduced-motion: reduce) { .bg-grid { animation: none; } }

/* Shell */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand .mark { width: 34px; height: 34px; filter: drop-shadow(var(--shadow-neon)); }
.brand .name {
  font-family: var(--font-display); font-weight: 800; letter-spacing: 4px;
  font-size: 22px; text-transform: uppercase;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .name b { color: var(--muted); -webkit-text-fill-color: var(--muted); font-weight: 400; font-size: 13px; letter-spacing: 3px; margin-left: 4px; }
/* Header nav: quick links + Games dropdown */
.nav { display: flex; gap: 6px; align-items: center; flex: none; }
.nav a { color: var(--muted); }
.nav-link { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
  padding: 8px 12px; border-radius: 10px; transition: color .14s ease, text-shadow .14s ease; }
.nav-link:hover, .nav-link.active { color: var(--text); text-shadow: var(--shadow-neon); }

.nav-drop { position: relative; }
.nav-toggle { display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  color: var(--text); background: rgba(124, 92, 214, 0.12);
  border: 1px solid rgba(124, 92, 214, 0.42); border-radius: 10px; padding: 8px 13px;
  transition: border-color .14s ease, background .14s ease, color .14s ease; }
.nav-toggle:hover, .nav-toggle.active { color: #fff; border-color: rgba(41, 231, 255, 0.55); background: rgba(41, 231, 255, 0.1); }
.nav-toggle .chev { width: 12px; height: 12px; opacity: 0.85; transition: transform .18s ease; }
.nav-drop.open .nav-toggle { color: #fff; border-color: rgba(41, 231, 255, 0.7); background: rgba(41, 231, 255, 0.12); }
.nav-drop.open .nav-toggle .chev { transform: rotate(180deg); }

.nav-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 80;
  min-width: 264px; padding: 10px; border-radius: 14px;
  background: rgba(14, 6, 40, 0.98); border: 1px solid rgba(124, 92, 214, 0.4);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(41, 231, 255, 0.1);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.nav-drop.open .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu-games { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.nav-menu-item { display: block; color: var(--muted); font-size: 12px; letter-spacing: 1px;
  text-transform: uppercase; white-space: nowrap; padding: 9px 11px; border-radius: 8px;
  transition: color .12s ease, background .12s ease; }
.nav-menu-item:hover { color: var(--text); background: rgba(124, 92, 214, 0.18); }
.nav-menu-item.active { color: #1a1100; background: var(--gold); font-weight: 700; }
.nav-menu-pages { display: none; }

@media (max-width: 760px) {
  .nav > .nav-link { display: none; }
  .nav-menu-pages { display: block; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(124, 92, 214, 0.22); }
}

/* Hero */
.hero { text-align: center; padding: 40px 0 18px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(40px, 11vw, 104px); line-height: 0.92; margin: 0; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff, var(--cyan-soft) 40%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 42px rgba(255, 46, 151, 0.35);
}
.hero .tag { color: var(--muted); letter-spacing: 4px; text-transform: uppercase; font-size: clamp(11px, 2.6vw, 14px); margin-top: 14px; }
.hero .tag .dot { color: var(--magenta); margin: 0 8px; }

/* Game card grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 26px 0 60px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  backdrop-filter: blur(6px); min-height: 220px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(41,231,255,0.6); box-shadow: var(--shadow-neon); }
.card.soon { opacity: 0.55; }
.card .thumb { height: 132px; position: relative; overflow: hidden; background: linear-gradient(160deg, #2a0f5e, #0c0530); }
.card .thumb canvas, .card .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .title { font-family: var(--font-display); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 18px; }
.card .desc { color: var(--muted); font-size: 13px; line-height: 1.45; flex: 1; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.card .badge { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.card .badge.soon { color: var(--muted); }
.card a.play { color: var(--text); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.card a.stretch::after { content: ""; position: absolute; inset: 0; }

/* Featured (most-played) card */
.card.featured { grid-column: 1 / -1; border-color: rgba(255,206,90,0.55); box-shadow: 0 0 0 1px rgba(255,206,90,0.25), 0 14px 50px rgba(255,206,90,0.14); }
.card.featured:hover { border-color: rgba(255,206,90,0.8); }
.card .ribbon { position: absolute; top: 12px; left: 12px; z-index: 3; font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #1a1100; background: var(--gold); border-radius: 999px; padding: 4px 11px; box-shadow: 0 2px 14px rgba(255,206,90,0.5); }
@media (min-width: 760px) {
  .card.featured { flex-direction: row; min-height: 260px; }
  .card.featured .thumb { height: auto; width: 48%; flex: none; }
  .card.featured .body { padding: 26px 30px; justify-content: center; }
  .card.featured .title { font-size: 26px; }
  .card.featured .desc { font-size: 14.5px; max-width: 52ch; }
}

/* Buttons */
.btn {
  font-family: var(--font-display); font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  font-size: 13px; padding: 12px 22px; border-radius: 12px; cursor: pointer;
  color: #0a0420; background: linear-gradient(90deg, var(--cyan), var(--cyan-soft));
  border: none; box-shadow: var(--shadow-neon); transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.mag { background: linear-gradient(90deg, var(--magenta), var(--magenta-soft)); box-shadow: var(--shadow-mag); color: #1a0414; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--cyan); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

/* Footer */
.site-foot { color: var(--muted); font-size: 12px; text-align: center; padding: 30px 0 40px; letter-spacing: 1px; }
.site-foot .dot { color: var(--magenta); margin: 0 7px; }

/* Icons */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- Game page ---------- */
.game-shell { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 8px 0 50px; }
@media (min-width: 940px) { .game-shell { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: start; } }

.stage-card { position: relative; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #05010f; box-shadow: 0 18px 60px rgba(0,0,0,0.5); }
.stage { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 78vh; }
@media (min-width: 940px) { .stage { aspect-ratio: 4 / 3; } }
/* Big screens: let game pages break past the hub's --maxw so the play area isn't tiny on a PC.
   Every game page carries a body class; the hub is the only class-less body. Keying off
   body[class] keeps all game windows the SAME width and auto-covers any future game. */
@media (min-width: 1100px) {
  body[class] .wrap { max-width: min(1640px, 95vw); }              /* every game page, uniform */
  body:not([class]) .wrap { max-width: min(1280px, 95vw); }        /* hub: room for the champions rail + grid */
  .game-shell { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 26px; }
  .stage { max-height: 86vh; }
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; }
.hud .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hud .stat { background: rgba(7,2,26,0.5); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; backdrop-filter: blur(3px); }
.hud .stat .k { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.hud .stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; }
.hud .stat.best .v { color: var(--gold); font-size: 16px; }
.hud .stat.speed .v { color: var(--cyan); }
.hud .ctl-hint { align-self: center; color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.hud .corner-btns { position: absolute; top: 14px; right: 16px; display: flex; gap: 8px; pointer-events: auto; }
.iconbtn { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
  background: rgba(7,2,26,0.55); border: 1px solid var(--line); color: var(--text); font-size: 18px; }
.iconbtn:hover { border-color: var(--cyan); color: var(--cyan); }

/* Overlays (ready / gameover) */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 22px; text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(22,10,61,0.65), rgba(5,1,15,0.92)); backdrop-filter: blur(3px); z-index: 4; }
.overlay.hidden { display: none; }
.overlay .panel { width: min(420px, 100%); }
.overlay h2 { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; letter-spacing: 3px;
  font-size: clamp(30px, 8vw, 56px); margin: 0 0 6px;
  background: linear-gradient(180deg, #fff, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay .sub { color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: 12px; margin-bottom: 20px; }
.overlay .final { font-family: var(--font-display); font-weight: 900; font-size: clamp(44px, 13vw, 78px); color: var(--cyan); text-shadow: var(--shadow-neon); line-height: 1; }
.overlay .final-k { color: var(--muted); letter-spacing: 4px; text-transform: uppercase; font-size: 11px; margin-bottom: 4px; }
.overlay .newbest { color: var(--gold); letter-spacing: 3px; text-transform: uppercase; font-size: 13px; margin-top: 8px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.overlay .actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* Score post form */
.postbox { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; text-align: left; }
.postbox .lbl { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.platform-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.platform-toggle button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  background: rgba(7,2,26,0.5); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px; transition: all .15s ease; }
.platform-toggle button .icon { width: 18px; height: 18px; }
.platform-toggle button.active { color: var(--text); border-color: var(--magenta); box-shadow: var(--shadow-mag); background: rgba(255,46,151,0.08); }
.handle-row { display: flex; align-items: center; gap: 8px; background: rgba(7,2,26,0.6); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.handle-row .flag-slot { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.handle-row .fi { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }
.handle-row .at { color: var(--muted); font-weight: 700; }
.handle-row input { flex: 1; background: transparent; border: none; outline: none; color: var(--text);
  font-family: var(--font-mono); font-size: 15px; padding: 12px 0; letter-spacing: 0.5px; }
.handle-row input::placeholder { color: rgba(163,148,214,0.5); }
.posthint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.posthint.err { color: var(--danger); }

/* ---------- Leaderboard ---------- */
.board-card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.board-head h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: 16px; margin: 0; }
.tabs { display: flex; gap: 4px; background: rgba(7,2,26,0.55); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs button { border: none; background: transparent; color: var(--muted); cursor: pointer; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; }
.tabs button.active { background: linear-gradient(90deg, var(--cyan), var(--magenta)); color: #0a0420; font-weight: 700; }
.board-list { list-style: none; margin: 0; padding: 4px 8px 12px; max-height: 520px; overflow-y: auto; }
.board-list li { display: grid; grid-template-columns: 30px 24px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px; }
.board-list li + li { border-top: 1px solid rgba(124,92,214,0.14); }
.board-list li.me { background: rgba(255,46,151,0.10); border: 1px solid rgba(255,46,151,0.3); }
.board-list .rank { font-family: var(--font-display); font-weight: 800; color: var(--muted); font-size: 14px; text-align: center; }
.board-list li:nth-child(1) .rank { color: var(--gold); }
.board-list li:nth-child(2) .rank { color: #cfd6e6; }
.board-list li:nth-child(3) .rank { color: #e6a36b; }
.board-list .fi { width: 22px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }

/* combined Champions board on the hub */
.champs { margin: 18px 0 10px; }
.champs .board-head h3 .icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.champs-sub { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0 18px 6px; }
/* hub: champions as a sticky left rail beside the game grid */
@media (min-width: 920px) {
  main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: start; }
  .grid { grid-column: 2; grid-row: 1; padding-top: 6px; }
  .champs { grid-column: 1; grid-row: 1; position: sticky; top: 16px; margin: 6px 0 0; }
  .champs .board-list { max-height: min(64vh, 560px); }
}
/* per-game breakdown popup for a champions row */
.champs .board-list li.has-bd { cursor: pointer; }
.champ-tip {
  position: fixed; z-index: 90; min-width: 180px; max-width: 260px;
  padding: 10px 12px; border-radius: 12px; pointer-events: none;
  background: rgba(14,6,40,0.97); border: 1px solid rgba(255,206,90,0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(41,231,255,0.12);
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease, visibility .14s;
}
.champ-tip.show { opacity: 1; visibility: visible; transform: translateY(0); }
.champ-tip .tip-hd { font-family: var(--font-display); font-weight: 800; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.champ-tip .tip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12.5px; padding: 3px 0; }
.champ-tip .tip-row .tg { color: var(--text); letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
.champ-tip .tip-row .ts { font-family: var(--font-display); font-weight: 800; color: var(--cyan); }
.champ-tip .tip-row + .tip-row { border-top: 1px solid rgba(124,92,214,0.16); }

/* ---------- FLOCK (neon shooting gallery) ---------- */
body.hunt .stage canvas { cursor: none; }
.hud .leftstats { display: flex; gap: 10px; align-items: flex-start; }
.hud .stat .ss { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--magenta);
  line-height: 1; margin-top: 4px; min-height: 13px; }
.hud .lives { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.hud .lives .k { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.pips { display: flex; gap: 6px; }
.pip { width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--magenta-soft), var(--magenta));
  box-shadow: 0 0 8px rgba(255,46,151,0.7); transition: opacity .2s ease, filter .2s ease; }
.pip.gone { background: rgba(124,92,214,0.25); box-shadow: none; filter: grayscale(1); opacity: 0.45; }
.board-list .who { display: flex; flex-direction: column; min-width: 0; }
.board-list .who .h { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .who .h .icon { width: 13px; height: 13px; color: var(--muted); flex: none; }
.board-list .who .when { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.board-list .score { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--cyan); }
.board-empty { color: var(--muted); text-align: center; padding: 30px 16px; font-size: 13px; line-height: 1.5; }
.board-foot { padding: 10px 18px 16px; color: var(--muted); font-size: 11px; line-height: 1.5; border-top: 1px solid var(--line); }

/* Mobile control zones (visual hint only; whole stage is touch-steer) */
.touch-zones { position: absolute; inset: 0; display: flex; pointer-events: none; z-index: 3; opacity: 0; transition: opacity .2s; }
.touch-zones.show { opacity: 1; }
.touch-zones .tz { flex: 1; display: grid; place-items: center; color: rgba(255,255,255,0.18); }
.touch-zones .tz.l { border-right: 1px dashed rgba(255,255,255,0.08); }
.touch-zones .tz .icon { width: 38px; height: 38px; }

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

/* ---------- PRISM (neon match-3) ---------- */
body.prism .stage canvas { cursor: pointer; }
body.prism .hud { justify-content: flex-start; gap: 12px; }
body.prism .hud .ctl-hint { margin-top: auto; }
body.blindside .stage canvas { cursor: pointer; }
.timewrap { align-self: center; width: min(360px, 78%); margin-top: 4px; pointer-events: none; }
.time-k { display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.time-k span:last-child { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: 1px; color: var(--cyan-soft); }
.time-track { height: 9px; border-radius: 999px; background: rgba(7,2,26,0.55); border: 1px solid var(--line); overflow: hidden; backdrop-filter: blur(3px); }
.time-fill { height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 12px rgba(41,231,255,0.6); transition: width .18s linear, background .3s ease, box-shadow .3s ease; }
.time-fill.low { background: linear-gradient(90deg, #ff5a3c, #ff2e6a); box-shadow: 0 0 14px rgba(255,46,106,0.75); animation: timepulse .6s ease-in-out infinite; }
@keyframes timepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- NONET (neon sudoku) ---------- */
body.nonet .stage canvas { cursor: pointer; }
body.nonet .hud .ctl-hint { display: none; } /* controls live on the overlay + on-canvas number pad */

/* ---------- SALVO (neon artillery duel) ---------- */
body.salvo .stage canvas { cursor: crosshair; }
.diff-row { display: flex; gap: 8px; justify-content: center; margin: 2px 0 20px; flex-wrap: wrap; }
.diff-pill { cursor: pointer; background: rgba(7,2,26,0.5); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 9px 20px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px;
  text-transform: uppercase; transition: all .15s ease; }
.diff-pill:hover { color: var(--text); border-color: var(--cyan); }
.diff-pill.on { color: #0a0420; font-weight: 700; border-color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: var(--shadow-neon); }

/* ---------- MOSAIC (neon block puzzle) ---------- */
body.mosaic .lives { display: none; }
body.mosaic .stage canvas { cursor: grab; touch-action: none; }
body.mosaic .stage canvas:active { cursor: grabbing; }

/* ---------- GLYPH (neon nonogram / picross) ---------- */
body.glyph .stage canvas { cursor: crosshair; touch-action: none; }

/* ---------- SAPPER (neon minesweeper) ---------- */
body.sapper .stage canvas { cursor: pointer; touch-action: none; }

/* ---------- CIRCUIT (neon flow / connect) ---------- */
body.circuit .stage canvas { cursor: pointer; touch-action: none; }
body.circuit .lives { display: none; }

/* ---------- FUSION (neon 2048 slide / merge) ---------- */
body.fusion .stage canvas { cursor: default; touch-action: none; }
body.fusion .lives { display: none; }

/* ---------- ECHO (neon Simon / pulse-sequence memory) ---------- */
body.echo .stage canvas { cursor: pointer; touch-action: none; }

/* ---------- BULLSEYE (neon darts / precision under sway) ---------- */
body.bullseye .stage canvas { cursor: crosshair; touch-action: none; }

/* ---------- DEADLINE (isometric sunrise paper route) ---------- */
body.deadline .stage canvas { cursor: pointer; touch-action: none; }
body.deadline .hud .leftstats { gap: 12px; }
body.deadline .hud .lives { bottom: auto; top: 58px; left: 16px; }

/* ---------- GRIND (neon trick skater) ---------- */
body.grind .stage canvas { cursor: pointer; touch-action: none; }
body.grind .hud .leftstats { gap: 12px; }
body.grind .hud .lives { bottom: auto; top: 58px; left: 16px; }

/* ---------- PLUMMET (neon downhill MTB) ---------- */
body.plummet .stage canvas { cursor: pointer; touch-action: none; }
body.plummet .hud .leftstats { gap: 12px; }
body.plummet .hud .lives { bottom: auto; top: 58px; left: 16px; }

/* ---------- TALON (neon 3D wingsuit canyon, WebGL) ---------- */
body.talon .stage canvas { cursor: crosshair; touch-action: none; display: block; width: 100%; height: 100%; }
body.talon .hud .leftstats { gap: 12px; }
body.talon .hud .lives { bottom: auto; top: 58px; left: 16px; }
body.talon .boostwrap { position: absolute; left: 16px; top: 84px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
body.talon .boostwrap .k { font: 700 10px/1 "Chivo Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: #9fb0d0; }
body.talon .boostbar { width: 96px; height: 7px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
body.talon .boost-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #29e7ff, #ff2e97); border-radius: 6px; transition: width .08s linear; }

/* ready overlay shop */
.overlay .panel.shop-panel { width: min(470px, 100%); max-height: 100%; overflow-y: auto; }
.shop-panel .howto { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 14px; }
.shop { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(7,2,26,0.4); margin-bottom: 16px; }
.shop-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coinpill, .bestpill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.coinpill .icon { width: 15px; height: 15px; color: var(--gold); }
.coinpill b { color: var(--gold); font-weight: 700; font-size: 14px; }
.bestpill b { color: var(--cyan); font-weight: 700; }
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.up-cell { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(22,10,61,0.5); text-align: left; }
.up-cell.maxed { border-color: rgba(67,245,155,0.4); }
.up-name { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.up-pips { display: flex; gap: 3px; }
.up-pip { height: 5px; border-radius: 3px; background: rgba(124,92,214,0.22); flex: 1; }
.up-pip.on { background: linear-gradient(90deg, var(--cyan), var(--magenta)); box-shadow: 0 0 6px rgba(41,231,255,0.5); }
.up-buy { display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-family: var(--font-mono); font-weight: 700; font-size: 12px; padding: 6px 8px; border-radius: 9px; cursor: pointer; color: #1a1100; background: var(--gold); border: 0; box-shadow: 0 0 12px rgba(255,206,90,0.35); }
.up-buy .icon { width: 14px; height: 14px; color: #1a1100; }
.up-buy:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.up-cell.maxed .up-buy { background: transparent; color: var(--ok); border: 1px solid rgba(67,245,155,0.4); box-shadow: none; }

/* on-screen touch controls (mobile only) */
.touch-ctl { position: absolute; left: 0; right: 0; bottom: 0; display: none; gap: 10px; padding: 14px;
  z-index: 5; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.tcbtn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(7,2,26,0.55); color: var(--text); backdrop-filter: blur(4px);
  -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tcbtn.steer { width: 64px; height: 64px; }
.tcbtn.steer .icon { width: 32px; height: 32px; }
.tcbtn.throw { flex: 1; max-width: 170px; height: 58px; font-family: var(--font-display); font-weight: 800;
  letter-spacing: 3px; font-size: 15px; color: #1a0414; background: linear-gradient(90deg, var(--magenta), var(--magenta-soft)); border: 0; box-shadow: var(--shadow-mag); }
.tcbtn:active { filter: brightness(1.1); }
@media (hover: none) and (pointer: coarse) { .touch-ctl { display: flex; } }
