/* HAMSTER RACING · night at the hamster track
   OTB tote board × race-card paper. No glass, no blobs. */

:root {
  --ground: #0b120d;
  --ground-2: #0f1710;
  --tote: #101010;
  --tote-edge: #262622;
  --amber: #ffb52e;
  --amber-ghost: rgba(255, 181, 46, 0.13);
  --green: #35e05a;
  --red: #d92b2b;
  /* WCAG AA inks for the cream race card: the brand red and dim grey
     clear 4.5:1 on dark grounds but not on paper. */
  --red-ink: #c62222;
  --paper-dim: #66695e;
  --red-bright: #ff5749;
  --cream: #f2ead8;
  --cream-2: #e9dfc8;
  --card-ink: #241d12;
  --card-ink-dim: #6b6252;
  --line-cream: rgba(36, 29, 18, 0.16);
  --text: #e8e4d8;
  --text-dim: #a3a898;
  --line: rgba(232, 228, 216, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: var(--cream); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--amber); color: #141006; padding: 10px 16px; z-index: 60;
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
}
.skip:focus { left: 8px; top: 8px; }

/* ── LED digits ─────────────────────────────────────────────── */
.led-box {
  position: relative; z-index: 0;
  display: inline-block;
  background: var(--tote);
  border: 1px solid var(--tote-edge);
  border-radius: 4px;
  padding: 5px 10px 3px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}
.led {
  position: relative;
  font-family: 'DSEG7', 'B612 Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 181, 46, 0.45);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.led::before {
  content: attr(data-shadow);
  position: absolute; left: 0; top: 0;
  color: var(--amber-ghost);
  text-shadow: none;
  z-index: -1;
}
.led.sm { font-size: 0.85rem; }
.led.big { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.led.huge { font-size: clamp(2.2rem, 7vw, 4.6rem); }
.big-box { padding: 10px 16px 7px; }
.huge-box { padding: 16px 26px 12px; border-radius: 6px; }

/* ── labels / kickers ───────────────────────────────────────── */
.chip-label, .kicker, .amt-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.chip-label.dark { color: var(--card-ink-dim); }

/* ── header ─────────────────────────────────────────────────── */
.top {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: 'Bungee', sans-serif;
  line-height: 0.92;
  display: flex; flex-direction: column;
  font-size: 1.15rem;
}
.wm-1 { color: var(--cream); }
.wm-2 { color: var(--amber); }
.jackpot-chip { display: flex; align-items: center; gap: 10px; }
.topnav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.topnav a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 0.85rem; color: var(--text-dim); text-decoration: none;
  padding: 10px 2px;
}
.topnav a:hover { color: var(--amber); }
.wallet-zone { display: flex; align-items: center; gap: 12px; }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; }
.balance-chip b {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.1em; color: var(--text-dim);
}
#walletBtn {
  font-family: 'Bungee', sans-serif; font-size: 0.8rem;
  background: var(--red-ink); color: var(--cream);
  border: none; border-radius: 6px; padding: 12px 18px;
  cursor: pointer; min-height: 44px;
}
#walletBtn:hover { background: var(--red-bright); }
#walletBtn.connected { background: #1d2a1f; color: var(--green); border: 1px solid rgba(53, 224, 90, 0.4); }

.checker {
  height: 10px;
  background: repeating-conic-gradient(var(--cream) 0% 25%, #0d0d0b 0% 50%);
  background-size: 14px 14px;
  opacity: 0.55;
}

/* ── layout ─────────────────────────────────────────────────── */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 22px;
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px;
}
#races { grid-column: 1; min-width: 0; }
#betslip { grid-column: 2; }
#jackpot, #leaderboard, #fairness, #how { grid-column: 1 / -1; margin-top: 34px; }

.sec-head { margin-bottom: 18px; }
.sec-head h2 {
  font-family: 'Bungee', sans-serif;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  margin: 2px 0 0;
  color: var(--cream);
}
.sec-head .kicker::before {
  content: "";
  display: inline-block; width: 22px; height: 3px;
  background: var(--red); margin-right: 8px; vertical-align: middle;
}

/* ── track tabs ─────────────────────────────────────────────── */
#trackTabs {
  min-height: 64px;
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
#trackTabs::-webkit-scrollbar { display: none; }
.ttab {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  min-height: 56px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.t-name {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.9rem;
}
.t-lamp {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px; justify-self: start;
}
.lamp-betting { color: #0e1f12; background: var(--green); }
.lamp-locked { color: #201503; background: var(--amber); }
.lamp-running { color: var(--cream); background: var(--red-ink); animation: lamp-pulse 1s steps(2, end) infinite; }
@keyframes lamp-pulse { 50% { opacity: 0.55; } }
.t-cd { grid-row: 1 / span 2; grid-column: 2; font-size: 0.95rem; }

/* ── stage ──────────────────────────────────────────────────── */
.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #0a0f0b 0%, #111a13 55%, #0c130e 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; inset: 0; pointer-events: none; }
#phaseBanner {
  position: absolute; top: 12px; left: 12px;
  background: var(--tote);
  border: 1px solid var(--tote-edge);
  color: var(--amber);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.85rem;
  padding: 7px 12px; border-radius: 4px;
  max-width: min(70%, 420px);
}
.cd-wrap { position: absolute; top: 12px; right: 12px; }
.lock-lamp {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--amber); color: #201503;
  font-family: 'Bungee', sans-serif; font-size: 0.85rem;
  padding: 8px 16px; border-radius: 4px;
}
#raceResultOverlay {
  position: absolute; inset: 0;
  background: rgba(7, 10, 7, 0.86);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
#raceResultOverlay[hidden] { display: none; }
.podium { text-align: center; max-width: 90%; }
.podium .p-finish {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim);
  font-size: 0.85rem;
}
.podium .p-win {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 10px 0 4px;
}
.podium .p-win img { width: 84px; height: 84px; object-fit: contain; }
.podium .p-win .p-name {
  font-family: 'Bungee', sans-serif; font-size: clamp(1.4rem, 4vw, 2.4rem);
  color: var(--cream);
}
.podium .p-minor {
  display: flex; justify-content: center; gap: 22px; margin-top: 8px;
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
}
.podium .p-minor img { width: 34px; height: 34px; object-fit: contain; vertical-align: middle; }
.podium .p-pay {
  margin-top: 14px;
  font-family: 'DSEG7', 'B612 Mono', monospace;
  color: var(--green); font-size: clamp(1.2rem, 3vw, 1.9rem);
  text-shadow: 0 0 8px rgba(53, 224, 90, 0.5);
}
.podium .p-jackpot {
  margin-top: 12px;
  background: var(--amber); color: #201503;
  font-family: 'Bungee', sans-serif;
  padding: 10px 16px; border-radius: 6px; display: inline-block;
}
.podium .p-close {
  margin-top: 16px; pointer-events: auto;
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 0.12em; padding: 9px 18px; border-radius: 4px; cursor: pointer;
  min-height: 44px;
}
.podium .p-close:hover { color: var(--cream); border-color: var(--text-dim); }

/* ── results strip ──────────────────────────────────────────── */
.results-strip {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto;
  margin-top: 10px;
  padding: 4px 0 8px;
  scrollbar-width: none;
  min-height: 40px;
}
.results-strip::-webkit-scrollbar { display: none; }
.res-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ground-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.res-chip .rw { color: var(--cream); font-weight: 700; }
.res-chip .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.res-chip.jp { border-color: var(--amber); color: var(--amber); }
@media (prefers-reduced-motion: no-preference) {
  .res-chip:first-child { animation: chip-in 0.35s ease-out; }
  @keyframes chip-in { from { transform: translateX(-8px); opacity: 0; } }
}

/* ── betslip / race card ────────────────────────────────────── */
#betslip {
  background: var(--cream);
  color: var(--card-ink);
  border-radius: 10px;
  align-self: start;
  position: sticky;
  top: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px 10px;
  border-bottom: 2px solid var(--card-ink);
}
.card-title { font-family: 'Bungee', sans-serif; font-size: 1rem; }
.card-meta {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem;
  color: var(--card-ink-dim);
}
.card-pool { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }

#raceCard { padding: 4px 0; }
.rc-note {
  padding: 12px 16px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.82rem;
  color: var(--red-ink);
  border-bottom: 1px solid var(--line-cream);
}
.rc-row {
  display: grid;
  grid-template-columns: 44px 30px minmax(0, 1fr) 74px 64px;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  min-height: 54px;
  border-bottom: 1px solid var(--line-cream);
  cursor: pointer;
}
.rc-row:last-child { border-bottom: none; }
.rc-row:hover { background: rgba(255, 255, 255, 0.5); }
.rc-row[aria-checked="true"] {
  background: #fff8ea;
  box-shadow: inset 4px 0 0 var(--jersey, var(--red));
}
.rc-row[aria-disabled="true"] { cursor: default; opacity: 0.72; }
.rc-row[aria-disabled="true"]:hover { background: none; }
.rc-thumb { width: 44px; height: 44px; object-fit: contain; }
.rc-plate {
  font-family: 'Bungee', sans-serif; font-size: 0.9rem;
  background: var(--jersey, var(--red)); color: #fff;
  border-radius: 4px; text-align: center; padding: 3px 0;
}
.rc-id { min-width: 0; }
.rc-name {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem;
  display: block;
}
.rc-you {
  font-family: 'B612 Mono', monospace; font-size: 0.68rem;
  color: #7a5b13; background: rgba(255, 181, 46, 0.25);
  padding: 1px 5px; border-radius: 3px;
}
.rc-poolcell { text-align: right; }
.rc-pool { font-family: 'B612 Mono', monospace; font-size: 0.78rem; display: block; }
.rc-poolbar {
  display: block; height: 4px; background: rgba(36, 29, 18, 0.12);
  border-radius: 2px; margin-top: 3px; overflow: hidden;
}
.rc-poolbar i { display: block; height: 100%; background: var(--jersey, var(--red)); }
.rc-odds {
  font-family: 'B612 Mono', monospace; font-weight: 700; font-size: 0.85rem;
  background: var(--tote); color: var(--amber);
  border-radius: 4px; text-align: center; padding: 7px 4px;
}
.rc-odds.open { color: var(--green); font-size: 0.72rem; letter-spacing: 0.08em; }

.slip-controls { padding: 14px 16px; border-top: 2px solid var(--card-ink); }
.amt-label { display: block; margin-bottom: 6px; color: var(--paper-dim); }
#betAmount {
  width: 100%;
  font-family: 'B612 Mono', monospace; font-size: 1.1rem;
  background: #fffdf6; color: var(--card-ink);
  border: 1px solid var(--card-ink-dim); border-radius: 6px;
  padding: 10px 12px;
}
#betAmount:focus { border-color: var(--card-ink); outline: none; box-shadow: 0 0 0 2px rgba(217, 43, 43, 0.25); }
.presets { display: flex; gap: 6px; margin-top: 8px; }
.presets button {
  flex: 1;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: none; border: 1px solid var(--card-ink-dim); border-radius: 5px;
  color: var(--card-ink); padding: 9px 4px; cursor: pointer; min-height: 40px;
}
.presets button:hover { border-color: var(--card-ink); background: #fff; }
#placeBet {
  width: 100%; margin-top: 12px;
  font-family: 'Bungee', sans-serif; font-size: 1rem;
  background: var(--red-ink); color: var(--cream);
  border: none; border-radius: 8px; padding: 15px;
  cursor: pointer; min-height: 52px;
}
#placeBet:hover:not(:disabled) { background: var(--red-bright); }
#placeBet:disabled { background: #b8b0a0; color: #6d675c; cursor: not-allowed; }
#slipMsg {
  min-height: 20px; margin-top: 8px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.05em;
}
#slipMsg.err { color: var(--red); }
#slipMsg.ok { color: #1a7a3a; }

.open-bets-wrap { padding: 12px 16px 16px; border-top: 1px solid var(--line-cream); }
#myOpenBets { margin-top: 8px; display: grid; gap: 6px; }
.ob-row {
  display: flex; align-items: center; gap: 8px;
  font-family: 'B612 Mono', monospace; font-size: 0.78rem;
}
.ob-row .dot { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.ob-empty { font-size: 0.85rem; color: var(--card-ink-dim); }

/* ── jackpot section ────────────────────────────────────────── */
.jackpot-grid {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 30px; align-items: center;
}
.jackpot-board { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.board-sub {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--text-dim);
}
.jackpot-copy { max-width: 56ch; }
.jackpot-copy p { margin: 0 0 12px; }
.drops-wrap { margin-top: 22px; }
#jackpotDrops { margin-top: 10px; display: grid; gap: 8px; }
.drop-row {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 4px; padding: 10px 14px;
  background: var(--ground-2);
}
.drop-amt { font-family: 'B612 Mono', monospace; font-weight: 700; color: var(--amber); }
.drop-meta { font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--text-dim); }
.drop-who { font-family: 'B612 Mono', monospace; font-size: 0.8rem; color: var(--text); }
.drops-empty { color: var(--text-dim); }

/* ── leaderboard ────────────────────────────────────────────── */
.scroll-x { overflow-x: auto; }
.lb-stats {
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.85rem; color: var(--text-dim);
  margin-bottom: 10px;
}
.lb-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.lb-table th {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem;
  color: var(--text-dim); text-align: left;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.lb-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-family: 'B612 Mono', monospace; font-size: 0.85rem;
}
.lb-table td.rank { font-family: 'Bungee', sans-serif; color: var(--amber); width: 48px; }
.lb-table tr:first-child td.rank { color: var(--cream); }
.lb-table td.num { text-align: right; }
.lb-table th.num { text-align: right; }
.lb-empty { color: var(--text-dim); padding: 14px 0; }

/* ── fairness ───────────────────────────────────────────────── */
.fair-grid {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 30px; align-items: start;
}
.fair-copy { max-width: 62ch; }
.fair-copy code {
  font-family: 'B612 Mono', monospace; font-size: 0.85em;
  background: var(--tote); color: var(--amber);
  padding: 2px 6px; border-radius: 3px;
  overflow-wrap: anywhere;
}
.fair-copy ol { padding-left: 20px; }
.fair-copy li { margin-bottom: 8px; }
.verifier {
  background: var(--ground-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px;
}
.v-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.v-row label {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem;
  color: var(--text-dim);
}
.v-row select, .v-row input {
  background: var(--tote); color: var(--text);
  border: 1px solid var(--tote-edge); border-radius: 5px;
  font-family: 'B612 Mono', monospace; font-size: 0.9rem;
  padding: 9px 10px; min-height: 42px;
}
.v-row input { width: 110px; }
#vGo {
  font-family: 'Bungee', sans-serif; font-size: 0.8rem;
  background: var(--amber); color: #201503;
  border: none; border-radius: 5px; padding: 11px 18px; cursor: pointer;
  min-height: 42px;
}
#vGo:hover { background: #ffc95e; }
#vOut { margin-top: 12px; font-family: 'B612 Mono', monospace; font-size: 0.78rem; }
#vOut .v-line { padding: 3px 0; overflow-wrap: anywhere; }
#vOut .v-pass { color: var(--green); }
#vOut .v-fail { color: var(--red-bright); }
#vOut .v-dim { color: var(--text-dim); }

/* ── how it works ───────────────────────────────────────────── */
.steps {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.steps li {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 18px; background: var(--ground-2);
}
.step-n {
  font-family: 'Bungee', sans-serif; color: var(--amber); font-size: 1.4rem;
}
.steps h3 {
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 1.05rem; margin: 6px 0 8px;
}
.steps p { margin: 0; color: var(--text-dim); }
.rules { padding-left: 20px; max-width: 68ch; }
.rules li { margin-bottom: 7px; }

/* ── footer / toasts ────────────────────────────────────────── */
footer { padding: 26px 22px 40px; text-align: center; color: var(--text-dim); }
footer p { margin: 4px 0; }
footer b { color: var(--cream); }

.noscript {
  padding: 20px; text-align: center; background: var(--red); color: var(--cream);
  font-family: 'Bungee', sans-serif;
}

#toasts { position: fixed; right: 14px; bottom: 14px; display: grid; gap: 8px; z-index: 80; }
.toast {
  background: var(--tote); color: var(--text);
  border: 1px solid var(--tote-edge);
  border-radius: 6px; padding: 12px 16px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  letter-spacing: 0.05em; font-size: 0.9rem;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }
.toast.gold { border-color: var(--amber); color: var(--amber); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.25s ease-out; }
  @keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
}

/* ── responsive ─────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .top { grid-template-columns: auto 1fr auto; }
  .topnav { display: none; }
}
@media (max-width: 980px) {
  main { grid-template-columns: minmax(0, 1fr); }
  #races, #betslip { grid-column: 1; }
  #betslip { position: static; }
}
@media (max-width: 768px) {
  .stage { aspect-ratio: 4 / 3; }
  .top { padding: 12px 14px; gap: 12px; }
  main { padding: 14px; }
  .jackpot-grid { grid-template-columns: minmax(0, 1fr); }
  .fair-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .jackpot-chip { display: none; }
  .rc-row { grid-template-columns: 38px 26px minmax(0, 1fr) 64px 56px; gap: 7px; padding: 6px 10px; }
  .rc-thumb { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .lamp-running { animation: none; }
  .res-chip:first-child { animation: none; }
  .toast { animation: none; }
}

/* ── CLS: reserve the JS-filled containers ───────────────────────
   These render empty in the HTML and are populated after /api/state
   resolves. Without a reservation the page reflows by ~500px on load
   (measured CLS 0.56). Heights are the measured filled heights. */
#raceCard { min-height: 508px; }
#resultsStrip { min-height: 44px; }
#myOpenBets { min-height: 20px; }
@media (max-width: 768px) {
  #raceCard { min-height: 485px; }
}
