:root {
  --bg: #0b0b0c;
  --bg-2: #111113;
  --panel: #161618;
  --panel-2: #1e1e22;
  --line: #2b2b31;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --neon: #e4ff1a;
  --neon-2: #c9e600;
  --ink: #0b0b0c;
  --danger: #ff5a5a;
  --ok: #3ddc84;
  --radius: 14px;
  --side-w: 236px;
  --top-h: 64px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(11, 11, 12, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand { gap: 10px; }
.brand img { height: 42px; width: auto; display: block; }
.race-tag {
  padding: 3px 10px 4px; border-radius: 6px;
  background: var(--neon); color: var(--ink);
  font-weight: 900; font-style: italic; font-size: .95rem; letter-spacing: .02em; text-transform: uppercase;
  transform: skewX(-8deg);
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--panel-2); }
.menu-btn { display: none; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidebar {
  position: sticky; top: var(--top-h);
  width: var(--side-w); flex: none;
  height: calc(100vh - var(--top-h));
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem;
}
.sidebar a svg { width: 20px; height: 20px; }
.sidebar a:hover { color: var(--text); background: var(--panel); }
.sidebar a.active { color: var(--ink); background: var(--neon); }
.sidebar a span { flex: 1; }
.tag { font-style: normal; font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.tag.hot { background: #ff7a1a22; color: #ff9b4d; }
.tag.new { background: #e4ff1a22; color: var(--neon); }
.sidebar a.active .tag { background: var(--ink); color: var(--neon); }
.side-card {
  margin-top: auto; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
  font-size: .82rem; color: var(--muted);
}
.side-card img { width: 100%; height: auto; border-radius: 8px; display: block; }
.side-card p { margin: 10px 0 0; }
a.side-card { display: block; text-decoration: none; transition: border-color .15s; }
a.side-card:hover { border-color: var(--neon); }
.side-cta { display: inline-block; margin-top: 8px; color: var(--neon); font-weight: 800; }
.scrim { display: none; }

main { flex: 1; min-width: 0; padding: 20px 24px 0; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Stage ---------- */
.stage-wrap { display: grid; place-items: center; }
.stage-wrap:fullscreen { background: #000; width: 100vw; height: 100vh; }
.stage {
  position: relative;
  width: 100%;
  max-width: 1180px;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #0b5e86;
  container-type: inline-size;
  box-shadow: 0 0 0 1px var(--line), 0 20px 60px -20px rgba(228, 255, 26, .18);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.stage-wrap:fullscreen .stage { width: min(100vw, 177.78vh); max-width: none; border-radius: 0; }
#raceCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fs-btn {
  position: absolute; top: 1.4cqw; right: 1.4cqw; z-index: 6;
  width: 3.6cqw; height: 3.6cqw; min-width: 30px; min-height: 30px;
  display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--ink);
  background: var(--neon); color: var(--ink);
}
.fs-btn svg { width: 55%; height: 55%; stroke-width: 2.6; }

.ui { position: absolute; inset: 0; z-index: 4; display: none; }
.stage[data-phase="setup"] .ui-setup,
.stage[data-phase="loading"] .ui-loading,
.stage[data-phase="lineup"] .ui-hud,
.stage[data-phase="countdown"] .ui-hud,
.stage[data-phase="racing"] .ui-hud,
.stage[data-phase="paused"] .ui-hud,
.stage[data-phase="finished"] .ui-result { display: block; }

/* chunky game buttons */
.stage button { border: none; }
.chunk, .keypad button, .big-btn, .tabs button, .hud-ic, .hud-text, .hud-shuffle, .trophy-btn {
  border: .25cqw solid var(--ink) !important;
  box-shadow: 0 .35cqw 0 var(--ink);
  transition: transform .06s ease, box-shadow .06s ease, filter .15s;
}
.keypad button:active, .big-btn:active, .hud-ic:active, .hud-text:active, .hud-shuffle:active, .trophy-btn:active {
  transform: translateY(.3cqw); box-shadow: 0 .05cqw 0 var(--ink);
}

/* Setup */
.timer-panel { position: absolute; top: 2cqw; left: 50%; transform: translateX(-50%); width: 54cqw; }
.timer-display {
  position: relative;
  height: 11.5cqw;
  display: flex; align-items: center; justify-content: center;
  background: #f4f6ef; color: var(--ink);
  border: .35cqw solid var(--ink); border-radius: 1.4cqw;
  box-shadow: inset 0 -.6cqw 0 #d6dbc9, 0 .45cqw 0 var(--ink);
}
.timer-display .digits { font-size: 8.6cqw; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.timer-display .hms { position: absolute; right: 1.2cqw; top: 1cqw; font-size: .95cqw; font-weight: 800; line-height: 1.15; color: #8a8f7f; text-align: center; }
.timer-display .toggle {
  position: absolute; bottom: 1cqw;
  width: 3.4cqw; height: 3.4cqw; border-radius: .8cqw;
  display: grid; place-items: center;
  background: #e3e7d8; color: #5d6252;
}
.timer-display .toggle svg { width: 70%; height: 70%; }
#alarmToggle { left: 1cqw; }
#sfxToggle { right: 1cqw; }
.toggle.off { opacity: .35; }
.toggle.off svg { stroke-dasharray: 2 2; }
.keypad { display: grid; grid-template-columns: repeat(5, 1fr) 1.5fr; gap: .8cqw; margin-top: 1.1cqw; }
.keypad button {
  height: 5.2cqw; border-radius: .9cqw;
  background: var(--neon); color: var(--ink);
  font-size: 3.2cqw; font-weight: 900; line-height: 1;
}
.keypad button:hover { filter: brightness(1.06); }
.keypad .k-set { background: var(--ink); color: var(--neon); border-color: var(--neon) !important; }
.keypad .k-clear { background: #d4d4d8; font-size: 2.2cqw; }
.timer-panel.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(calc(-50% - 1cqw)); } 40%, 80% { transform: translateX(calc(-50% + 1cqw)); } }

.mode-box { position: absolute; top: 29cqw; left: 50%; transform: translateX(-50%); width: 40cqw; text-align: center; }
.tabs { display: flex; justify-content: center; gap: .4cqw; margin-bottom: -.25cqw; position: relative; z-index: 1; }
.tabs button {
  width: 14cqw; height: 3.6cqw; border-radius: 1cqw 1cqw 0 0;
  background: #cfd3c4; color: #3f4337; font-weight: 800; font-size: 1.7cqw;
  box-shadow: none !important; border-bottom: none !important;
}
.tabs button.active { background: #fff; color: var(--ink); }
.big-btn {
  width: 100%; height: 5.2cqw; border-radius: 99px;
  background: var(--neon); color: var(--ink);
  font-weight: 900; font-size: 2.5cqw; font-style: italic; letter-spacing: -.01em;
}
.big-btn:hover { filter: brightness(1.06); }
.big-btn.sm { height: auto; padding: .8cqw 2.4cqw; font-size: 1.8cqw; width: auto; }
.mode-pane { display: none; }
.mode-box[data-mode="names"] .pane-names, .mode-box[data-mode="numbers"] .pane-numbers { display: block; }
.count {
  display: inline-block; margin-top: .9cqw; padding: .3cqw 2cqw;
  background: #fff; color: var(--ink); border: .25cqw solid var(--ink); border-radius: 1cqw;
  font-size: 1.6cqw; font-weight: 600;
}
.stepper { display: flex; align-items: stretch; height: 5.2cqw; border: .25cqw solid var(--ink); border-radius: 99px; overflow: hidden; background: #fff; box-shadow: 0 .35cqw 0 var(--ink); }
.stepper button { width: 7cqw; background: var(--neon); color: var(--ink); font-size: 3cqw; font-weight: 900; }
.stepper input { flex: 1; min-width: 0; border: none; text-align: center; font-size: 2.8cqw; font-weight: 900; color: var(--ink); background: #fff; outline: none; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

.costume-card {
  position: absolute; left: 3cqw; top: 26cqw; width: 15cqw;
  padding: .6cqw .6cqw .8cqw;
  background: #fff; color: var(--ink);
  border: .25cqw solid var(--ink); border-radius: 1.2cqw;
  box-shadow: 0 .35cqw 0 var(--ink);
  text-align: center;
}
#costumeCanvas { width: 100%; height: auto; display: block; border-radius: .8cqw; background: linear-gradient(#bfeaff, #6fd0f0 55%, #1aa3c9 56%, #0f7fab); }
.costume-card .arrow { position: absolute; top: 3.6cqw; width: 2.4cqw; height: 2.4cqw; display: grid; place-items: center; background: transparent; color: var(--ink); }
.costume-card .arrow svg { width: 100%; height: 100%; stroke-width: 3; }
#costPrev { left: -.2cqw; } #costNext { right: -.2cqw; }
.cost-name { font-size: 1.15cqw; font-weight: 800; margin-top: .4cqw; }
.dots { display: flex; justify-content: center; gap: .5cqw; margin-top: .4cqw; }
.dots i { width: .8cqw; height: .8cqw; border-radius: 50%; border: .15cqw solid var(--ink); }
.dots i.on { background: var(--ink); }
.stage-logo { position: absolute; height: auto; pointer-events: none; filter: drop-shadow(0 .3cqw 0 rgba(0, 0, 0, .55)); }
.setup-logo { right: 3cqw; top: 28cqw; width: 17cqw; }
.loading-logo { left: 50%; top: 9cqw; width: 34cqw; transform: translateX(-50%); }
.result-logo { right: 7cqw; top: 1.2cqw; width: 15cqw; }
@container (max-width: 760px) { .result-logo { display: none; } }
.hint {
  position: absolute; bottom: 2cqw; left: 50%; transform: translateX(-50%);
  padding: .5cqw 1.6cqw; border-radius: 99px;
  background: rgba(11, 11, 12, .72); color: #fff; font-size: 1.4cqw; white-space: nowrap;
}
.hint b { color: var(--neon); }
.hint.warn { background: var(--danger); }

/* Loading */
.ui-loading { background: rgba(0, 0, 0, .35); }
.loadbar {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%);
  width: 46cqw; height: 6cqw; padding: 1.2cqw;
  background: #fff; border: .35cqw solid var(--ink); border-radius: 99px;
  box-shadow: 0 .45cqw 0 var(--ink);
}
.loadbar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--neon); border: .2cqw solid var(--ink); }
.ui-loading p { position: absolute; left: 0; right: 0; top: 50%; text-align: center; font-weight: 800; font-size: 1.8cqw; color: #fff; text-shadow: 0 2px 0 #000; }

/* HUD */
.hud-left { position: absolute; top: 1cqw; left: 1cqw; display: flex; align-items: flex-start; gap: 1cqw; }
.hud-tools { display: flex; flex-direction: column; gap: .5cqw; }
.hud-row { display: flex; gap: .5cqw; }
.hud-ic {
  width: max(28px, 4.2cqw); height: max(28px, 4.2cqw); border-radius: .9cqw;
  display: grid; place-items: center;
  background: var(--ink); color: var(--neon);
  border-color: var(--neon) !important; box-shadow: 0 .3cqw 0 #000;
}
.hud-ic svg { width: 62%; height: 62%; }
.hud-ic:disabled { opacity: .35; cursor: not-allowed; }
.hud-shuffle {
  display: flex; align-items: center; gap: .5cqw;
  padding: .35cqw .8cqw; border-radius: .7cqw;
  background: var(--ink); color: #fff; font-size: max(9px, 1.05cqw); font-weight: 800;
  border-color: var(--neon) !important; box-shadow: 0 .25cqw 0 #000;
}
.hud-shuffle svg { width: max(11px, 1.3cqw); height: max(11px, 1.3cqw); color: var(--neon); }
.hud-shuffle:disabled { opacity: .35; }
.hud-actions { display: flex; flex-direction: column; gap: .6cqw; }
.hud-text {
  min-width: 9.5cqw; padding: .55cqw 1.2cqw; border-radius: .9cqw;
  background: var(--neon); color: var(--ink);
  font-weight: 900; font-size: max(12px, 1.9cqw); font-style: italic;
}
#clearBtn { background: #fff; font-size: max(11px, 1.5cqw); }
@container (max-width: 560px) {
  .hud-shuffle { font-size: 0; padding: 4px 6px; gap: 0; }
  .hud-timer { left: auto; right: 12cqw; transform: none; }
}
.hud-timer {
  position: absolute; top: 1cqw; left: 50%; transform: translateX(-50%);
  padding: .5cqw 2.4cqw; border-radius: 1.2cqw;
  background: #f4f6ef; color: var(--ink);
  border: .35cqw solid var(--ink); box-shadow: 0 .4cqw 0 var(--ink);
  font-size: 5.4cqw; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.hud-timer.low { color: #d90429; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.04); } }

/* Results */
.result-card {
  position: absolute; top: 1cqw; left: 1cqw;
  display: flex; gap: .8cqw; align-items: flex-start;
}
.result-actions {
  padding: .7cqw .9cqw; border-radius: 1cqw;
  background: #fff; color: var(--ink);
  border: .25cqw solid var(--ink); box-shadow: 0 .35cqw 0 var(--ink);
  display: flex; flex-direction: column; gap: .6cqw; align-items: stretch;
}
.remove-winner { display: flex; align-items: center; gap: .6cqw; font-size: 1.15cqw; font-weight: 700; cursor: pointer; }
.remove-winner input { width: 1.7cqw; height: 1.7cqw; accent-color: #111; margin: 0; }
.winner-banner {
  position: absolute; left: 50%; bottom: 3cqw; transform: translateX(-50%);
  min-width: 30cqw; max-width: 64cqw; padding: .8cqw 3cqw 1.1cqw;
  background: var(--neon); color: var(--ink);
  border: .35cqw solid var(--ink); border-radius: 1.4cqw; box-shadow: 0 .5cqw 0 var(--ink);
  text-align: center; line-height: 1.05;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both .2s;
}
.winner-banner small { display: block; font-size: 1.3cqw; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; }
.winner-banner strong { display: block; font-size: 4.4cqw; font-weight: 900; font-style: italic; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pop { from { transform: translateX(-50%) scale(.3); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.trophy-btn {
  position: absolute; right: 1.6cqw; bottom: 1.6cqw;
  width: 6cqw; height: 6cqw; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: var(--ink);
}
.trophy-btn svg { width: 58%; height: 58%; stroke-width: 2.2; }
.trophy-btn.on { background: var(--neon); }
.leaderboard {
  position: absolute; top: 7.5cqw; right: 1.6cqw; bottom: 9.4cqw; width: 26cqw;
  display: none; flex-direction: column;
  background: #fff; color: var(--ink);
  border: .3cqw solid var(--ink); border-radius: 1.2cqw; box-shadow: 0 .4cqw 0 var(--ink);
  overflow: hidden;
}
.leaderboard.open { display: flex; }
.leaderboard h3 { margin: 0; padding: .8cqw 1.2cqw; font-size: 1.7cqw; font-weight: 900; font-style: italic; background: var(--ink); color: var(--neon); }
.leaderboard ol { list-style: none; margin: 0; padding: .4cqw; overflow-y: auto; counter-reset: rk; }
.leaderboard li {
  display: flex; align-items: center; gap: .8cqw;
  padding: .45cqw .6cqw; border-radius: .6cqw; font-size: 1.35cqw; font-weight: 700;
}
.leaderboard li:nth-child(odd) { background: #f2f3ee; }
.leaderboard li .rk { width: 2.6cqw; text-align: center; font-weight: 900; }
.leaderboard li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard li .sw { width: 1.4cqw; height: 1.4cqw; border-radius: 50%; border: .15cqw solid var(--ink); flex: none; }
.leaderboard li.r1 { background: var(--neon); }

/* ---------- Landing ---------- */
.landing { max-width: 1180px; margin: 0 auto; padding: 48px 0 24px; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--neon); }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { margin: 10px 0 14px; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.02; font-weight: 900; font-style: italic; letter-spacing: -.03em; }
.hero h1 em { display: block; color: var(--neon); }
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.hero-logo {
  position: relative; display: block; overflow: hidden;
  border-radius: 18px; border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.hero-logo img { display: block; width: 100%; height: auto; transition: transform .4s ease, filter .25s ease; }
.hero-logo-cta {
  position: absolute; left: 50%; bottom: 7%;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 99px;
  background: var(--neon); color: var(--ink);
  font-weight: 900; font-style: italic; font-size: .95rem; white-space: nowrap;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, .7);
  opacity: 0; transform: translate(-50%, 12px);
  transition: opacity .25s ease, transform .25s ease;
}
.hero-logo-cta svg { stroke-width: 3; }
.hero-logo:hover, .hero-logo:focus-visible {
  transform: translateY(-4px);
  border-color: var(--neon);
  box-shadow: 0 0 0 1px var(--neon), 0 22px 60px -20px rgba(228, 255, 26, .55);
}
.hero-logo:hover img, .hero-logo:focus-visible img { transform: scale(1.03); filter: brightness(1.08); }
.hero-logo:hover .hero-logo-cta, .hero-logo:focus-visible .hero-logo-cta { opacity: 1; transform: translate(-50%, 0); }
.hero-logo:focus-visible { outline: 3px solid var(--neon); outline-offset: 3px; }
@media (hover: none) { .hero-logo-cta { opacity: 1; transform: translate(-50%, 0); } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 12px;
  font-weight: 800; text-decoration: none; border: 1px solid transparent;
  transition: filter .15s, background .15s;
}
.btn.primary { background: var(--neon); color: var(--ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 8px 12px; font-size: .85rem; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 48px 0; }
.feature { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.feature b { display: block; font-size: 1.05rem; }
.feature span { color: var(--muted); font-size: .92rem; }
.howto { margin: 56px 0; }
.howto h2 { margin: 6px 0 20px; font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; font-style: italic; letter-spacing: -.02em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: st; }
.steps li { position: relative; padding: 56px 18px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); counter-increment: st; }
.steps li::before {
  content: counter(st); position: absolute; top: 16px; left: 18px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--neon); color: var(--ink); font-weight: 900;
}
.steps b { display: block; }
.steps span { color: var(--muted); font-size: .92rem; }
.tip { margin-top: 18px; padding: 14px 18px; border-radius: var(--radius); background: #e4ff1a12; border: 1px solid #e4ff1a40; }
.tip a { color: var(--neon); font-weight: 800; }
.site-footer {
  max-width: 1180px; margin: 40px auto 0; padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; align-items: start;
}
.footer-logo { height: 48px; width: auto; display: block; }
.site-footer p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.site-footer nav a:hover { color: var(--neon); }
.site-footer small { grid-column: 1 / -1; color: #71717a; }

/* ---------- Pages ---------- */
.page { max-width: 1180px; margin: 0 auto; }
.page-head h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 900; font-style: italic; letter-spacing: -.02em; }
.page-head p { margin: 0 0 24px; color: var(--muted); max-width: 62ch; }
.panel { padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.panel h3 { margin: 0 0 10px; font-size: 1.1rem; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row-btns.center { justify-content: center; }
.row-btns.big .btn { flex: 1; padding: 14px 18px; font-size: 1.05rem; }
.link-btn { background: none; border: none; color: var(--neon); font-weight: 700; font-size: .85rem; padding: 0; }
textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); padding: 12px 14px; outline: none;
}
textarea:focus { border-color: var(--neon); }
textarea { resize: vertical; line-height: 1.55; font-size: 1rem; }

/* Wheel */
.wheel-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 20px; align-items: start; }
.wheel-box { position: relative; width: 100%; max-width: 620px; margin: 0 auto; aspect-ratio: 1; }
#wheelCanvas { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute; top: 50%; right: -6px; z-index: 2; transform: translateY(-50%);
  width: 0; height: 0; border-top: 18px solid transparent; border-bottom: 18px solid transparent; border-right: 40px solid var(--neon);
  filter: drop-shadow(0 2px 0 #000);
}
.wheel-spin {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 21%; aspect-ratio: 1; border-radius: 50%;
  background: var(--neon); color: var(--ink); border: 4px solid var(--ink);
  font-weight: 900; font-style: italic; font-size: clamp(.9rem, 2.4vw, 1.4rem);
  box-shadow: 0 4px 0 #000;
}
.wheel-spin:disabled { filter: grayscale(.6); cursor: wait; }
.wheel-side textarea { min-height: 220px; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wheel-side h4 { margin: 18px 0 6px; font-size: .95rem; }
.wheel-results { margin: 0; padding-left: 22px; color: var(--muted); max-height: 180px; overflow-y: auto; }
.wheel-results li b { color: var(--text); }
.wheel-winner { margin: 8px 0 18px; font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; font-style: italic; color: var(--neon); overflow-wrap: anywhere; line-height: 1.05; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); animation: fade .2s; }
.modal-card.center { text-align: center; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 1.25rem; font-weight: 900; font-style: italic; }
#listText { min-height: 280px; margin-top: 6px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.count-pill { padding: 6px 14px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.count-pill.over { border-color: var(--danger); color: var(--danger); }
.modal .big-btn.sm { font-size: 1.05rem; padding: 10px 28px; border: 3px solid var(--ink); box-shadow: 0 3px 0 #000; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 140%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--neon); color: var(--ink); font-weight: 800;
  transition: transform .25s ease, opacity .25s ease; pointer-events: none; opacity: 0;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .features, .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; left: 0; top: var(--top-h); z-index: 40;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--top-h) 0 0; z-index: 35; background: rgba(0, 0, 0, .55); }
  main { padding: 16px 16px 0; }
  .hero, .wheel-layout { grid-template-columns: 1fr; }
  .hero-logo { order: -1; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  .brand img { height: 34px; }
  .race-tag { font-size: .8rem; }
  .features, .steps { grid-template-columns: 1fr; }
  .stage { border-radius: 12px; }
  .site-footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
