/* ============================================================
   KUKU ROAD — bright daylight kiosk theme
   Layout: top bar · N player strips (one per mouse) · footer
   Every size inside a strip scales with the strip height (--sh,
   set by Game.layout) so 1 to 6 strips all stay readable.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #1d2a44;
  --ink-soft: #4f5d7a;
  --ink-faint: #8794ad;
  --line: #e1e9f5;
  --panel-bg: #f3f7fd;
  --green: #22b14c;
  --green-l: #5fe274;
  --green-d: #137a33;
  --gold: #ffc61a;
  --gold-l: #ffe066;
  --gold-d: #c26a00;
  --red: #e8304a;
  --red-d: #a3172c;
  --tbh: 62px;           /* top bar height */
  --fth: 26px;           /* footer height */
  --font: 'Outfit', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system, sans-serif;
  --disp: 'Baloo 2', 'Outfit', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
}
@media (max-height: 820px) { :root { --tbh: 52px; --fth: 22px; } }

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 260px at 12% 0%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(700px 240px at 88% 4%, rgba(255, 255, 255, 0.6), transparent 70%),
    linear-gradient(180deg, #8fd5ff 0%, #bfe8ff 42%, #dff4ff 100%);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid rgba(29, 42, 68, 0.35); outline-offset: 2px; }
.hidden { display: none !important; }

#app { height: 100vh; display: flex; flex-direction: column; }

/* ============================================================
   TOP BAR
   ============================================================ */
#topbar {
  flex: none; height: var(--tbh); position: relative; z-index: 5;
  display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 3px 0 #d9e6f6, 0 8px 22px rgba(20, 70, 140, 0.14);
}
.logo { display: flex; align-items: center; gap: 10px; flex: none; }
.logo-badge { display: block; width: calc(var(--tbh) - 16px); height: calc(var(--tbh) - 16px); filter: drop-shadow(0 3px 0 rgba(176, 90, 0, 0.35)); }
.logo-badge svg { width: 100%; height: 100%; display: block; }
.logo-text {
  font: 800 calc(var(--tbh) * 0.48)/1 var(--disp); letter-spacing: 0.5px; color: var(--ink);
  white-space: nowrap; padding-top: 0.08em;
  text-shadow: 0 2px 0 #e3ecf8;
}
.logo-text span { color: #ff7a00; text-shadow: 0 2px 0 #ffe0b8; }

.pills { display: flex; gap: 8px; flex: none; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px;
  border-radius: 999px; background: #f1f5fb; border: 2px solid var(--line);
  font: 700 14px var(--font); color: var(--ink-soft); white-space: nowrap;
}
.pill b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.pill svg { flex: none; }
.pill .ic-mouse { width: 13px; height: 18px; color: var(--ink-soft); }
.pill-mice { cursor: pointer; padding-right: 5px; }
.pill-mice.pending b { color: #ff7a00; }
.mice-btn {
  width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--ink);
  font: 800 16px/1 var(--font); box-shadow: 0 2px 0 var(--line);
  transition: transform .08s, background .12s;
}
.mice-btn:hover { background: #fff7e6; border-color: #ffd28a; }
.mice-btn:active { transform: translateY(2px); box-shadow: none; }
.pill-gold { background: #fff6d8; border-color: #ffd76a; color: #8a5a00; }
.pill-gold b { color: #6b4300; }
.pill-gold svg { color: #f0a000; }
.pill-rtp { background: #e8f9ee; border-color: #b6ebc9; color: #1b7a3e; }
.pill-rtp b { color: #0f5f2c; }
.pill-rtp svg { color: var(--green); }

/* recent results — real runs from this kiosk only */
.ticker {
  --tkh: 30px;   /* one result pill */
  flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px;
  background: #f6f9fe; border: 2px solid var(--line); border-radius: 14px; padding: 0 0 0 6px;
  overflow: hidden;
}
.tk-label {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 8px; background: var(--red); color: #fff; font: 800 12px var(--font); letter-spacing: 1.2px;
  box-shadow: 0 2px 0 var(--red-d);
}
.tk-label i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: live-dot 1.4s ease-in-out infinite; }
@keyframes live-dot { 50% { opacity: .25; } }
/* one row of whole results: a pill that does not fit wraps onto a second row, out of sight,
   so the right end never shows a result cut mid-word (newest first, on the left) */
#ticker {
  list-style: none; flex: 1; min-width: 0; height: var(--tkh); overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px;
}
.tk {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: var(--tkh); padding: 0 12px 0 9px;
  border-radius: 999px; background: #fff; border: 2px solid var(--line);
  font: 600 13.5px var(--font); color: var(--ink-soft); white-space: nowrap;
  max-width: 100%;   /* a lone result wider than the ticker shortens its restart note (.tk-rec), never its numbers */
}
.tk b { color: var(--acd, var(--ink)); font-weight: 800; }
.tk em { font-style: normal; font-weight: 800; color: var(--green-d); }
.tk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ac, #999); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ac, #999); flex: none; }
.tk-lost { color: #b02a3e; background: #fff4f5; border-color: #ffd3d9; }
.tk-gold { background: #fff6d8; border-color: #ffd76a; }
.tk-gold em { color: #8a5a00; }
.tk-empty { border-style: dashed; color: var(--ink-faint); background: transparent; font-weight: 600; }
.tk-new { animation: tk-in .45s cubic-bezier(.2, 1.4, .4, 1); }
.tk-new.tk-flash { animation: tk-in .45s cubic-bezier(.2, 1.4, .4, 1), tk-flash .7s ease-in-out .45s 4; }
@keyframes tk-flash { 50% { background: #ffe066; border-color: #ffb800; box-shadow: 0 0 0 3px rgba(255, 198, 26, 0.45), 0 0 14px rgba(255, 170, 0, 0.6); } }
.tk-rec { font-style: normal; font-weight: 700; font-size: 12px; color: var(--ink-faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@keyframes tk-in { from { transform: translateX(-30px) scale(.8); opacity: 0; } }

.top-actions { display: flex; gap: 8px; flex: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--ink-soft);
  box-shadow: 0 3px 0 var(--line); transition: transform .08s, color .12s;
}
.icon-btn:hover { color: #ff7a00; }
.icon-btn:active { transform: translateY(3px); box-shadow: none; }
.icon-btn.muted { color: #b3bdd0; }

@media (max-width: 1500px) {
  #topbar { gap: 10px; padding: 0 10px; }
  .pill { font-size: 13px; padding: 0 10px; height: 34px; }
  .pill-gold svg, .pill-rtp svg { display: none; }
  .tk { font-size: 13px; }
}
@media (max-width: 1400px) {
  .logo-text { font-size: calc(var(--tbh) * 0.44); }
  .pills { gap: 6px; }
  .pill-mice { padding-left: 9px; }
}
@media (max-height: 820px) {
  .pill { height: 32px; }
  .ticker { height: 36px; --tkh: 27px; }
  .icon-btn { width: 38px; height: 38px; }
}

/* ============================================================
   PLAYER STRIPS
   ============================================================ */
.stations {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  display: grid; grid-template-rows: repeat(var(--n, 5), minmax(0, 1fr));
  gap: 9px; padding: 11px 12px 8px;
  --sh: 190px;
  --pw: clamp(236px, 14vw, 290px);          /* player panel width */
  --aw: clamp(198px, 12.6vw, 252px);        /* action column width */
  --pp: clamp(5px, calc(var(--sh) * 0.055), 16px);   /* panel padding */
  --pg: clamp(3px, calc(var(--sh) * 0.034), 12px);   /* panel gap */
  --bh: clamp(28px, calc(var(--sh) * 0.21), 60px);   /* read-out height */
  --vf: clamp(16px, calc(var(--sh) * 0.118), 34px);  /* read-out value font */
  --dh: clamp(22px, calc(var(--sh) * 0.145), 44px);  /* difficulty chip height */
  --hf: clamp(13px, calc(var(--sh) * 0.083), 22px);  /* badge font */
  --gf: clamp(18px, min(calc(var(--sh) * 0.165), calc(var(--aw) * 0.15)), 50px);  /* GO / NEXT LANE font (fits the column) */
  --cf: clamp(16px, calc(var(--sh) * 0.1), 32px);    /* CASH OUT font */
  --sf: clamp(14px, calc(var(--sh) * 0.068), 19px);  /* button sub-line font */
  --ap: clamp(6px, calc(var(--sh) * 0.05), 16px);    /* action column padding */
  --dfs: clamp(12px, min(calc(var(--sh) * 0.064), calc(var(--pw) * 0.052)), 18px); /* difficulty chip font (fits the panel) */
  --stf: clamp(14px, calc(var(--sh) * 0.064), 17px); /* status chip font */
}
/* the shortest strips (≈ 97–124px): the sub-line keeps the 12px minimum so both lines fit */
.stations[data-size="xs"] { --sf: 12px; --stf: 14px; }
/* tall strips (1–3 players): the whole panel and the action column scale up with the strip
   instead of floating as a small block in empty colour */
.stations[data-size="l"] {
  --pw: clamp(260px, min(19vw, calc(var(--sh) * 1.1)), 380px);
  --aw: clamp(220px, min(16.5vw, calc(var(--sh) * 1.05)), 330px);
  --pg: clamp(8px, calc(var(--sh) * 0.022), 18px);
  --vf: clamp(26px, calc(var(--sh) * 0.085), 52px);
  --dh: clamp(40px, calc(var(--sh) * 0.07), 58px);
  --hf: clamp(20px, calc(var(--sh) * 0.04), 30px);
  --gf: clamp(36px, min(calc(var(--sh) * 0.1), calc(var(--aw) * 0.17)), 60px);
  --cf: clamp(26px, min(calc(var(--sh) * 0.07), calc(var(--aw) * 0.12)), 40px);
  --sf: clamp(15px, calc(var(--sh) * 0.034), 24px);
  --dfs: clamp(14px, min(calc(var(--sh) * 0.04), calc(var(--pw) * 0.054)), 20px);
  --stf: clamp(15px, calc(var(--sh) * 0.03), 22px);
}
.stations[data-size="l"] .st-go { max-height: clamp(150px, calc(var(--sh) * 0.3), 260px); }
.stations[data-size="l"] .st-cash { max-height: clamp(110px, calc(var(--sh) * 0.2), 180px); }

/* station colours (same order as the Aviator kiosk: yellow, blue, orange, purple, green, pink)
   --ac main · --acl light · --acd dark · --aci text on the panel */
.sc-1 { --ac: #f5b400; --acl: #ffdc5c; --acd: #b07c00; --aci: #3d2b00; }
.sc-2 { --ac: #1e90e8; --acl: #6cc6ff; --acd: #0b5fa8; --aci: #ffffff; }
.sc-3 { --ac: #ff7f1f; --acl: #ffb469; --acd: #c2530a; --aci: #ffffff; }
.sc-4 { --ac: #9b4ce6; --acl: #c99bff; --acd: #6b23ad; --aci: #ffffff; }
.sc-5 { --ac: #22b14c; --acl: #6ee08f; --acd: #137a33; --aci: #ffffff; }
.sc-6 { --ac: #ec4f7d; --acl: #ff9ab8; --acd: #b02651; --aci: #ffffff; }

/* Performance note: the strip is NOT overflow-clipped. A rounded overflow clip around a
   canvas that redraws every frame forces a mask on every frame (6 strips: ~35 fps instead
   of 60 on a software-rendered kiosk). Instead the panel and the action column round their
   own outer corners, and the road (a plain rectangle in the middle) needs no rounding. */
.station {
  --sr: 18px; --sbb: 5px;                    /* outer radius · bottom border width */
  --ir: calc(var(--sr) - 3px);               /* inner radius (3px side borders) */
  --irb: calc(var(--sr) - var(--sbb));       /* inner radius above the thicker bottom border */
  position: relative; min-height: 0;
  display: grid; grid-template-columns: var(--pw) minmax(0, 1fr) var(--aw);
  background: #fff; border-radius: var(--sr);
  border: 3px solid var(--ac); border-bottom-width: var(--sbb); border-bottom-color: var(--acd);
  box-shadow: 0 8px 18px rgba(16, 60, 130, 0.16);
  transition: box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
}
.stations[data-size="xs"] .station { --sr: 14px; --sbb: 4px; }
/* live / gold pulse: an opacity-animated ring (composited) instead of animating box-shadow */
.station::before {
  content: ''; position: absolute; z-index: 4; pointer-events: none; opacity: 0;
  inset: -3px -3px calc(-1 * var(--sbb)) -3px; border-radius: var(--sr);
  box-shadow: 0 0 0 4px var(--acl);
  will-change: opacity;
}

/* ---- 1 · player panel ---- */
.st-panel {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  border-radius: var(--ir) 0 0 var(--ir) / var(--ir) 0 0 var(--irb);
  display: flex; flex-direction: column; justify-content: center; gap: var(--pg);
  padding: var(--pp) calc(var(--pp) + 3px);
  color: var(--aci);
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(255, 255, 255, 0.45), transparent 55%),
    linear-gradient(160deg, var(--acl) 0%, var(--ac) 72%);
  border-right: 3px solid var(--acd);
}
.st-panel::after { /* soft polka texture */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(circle at 50% 50%, #fff 0 2px, transparent 2.5px);
  background-size: 16px 16px;
}
.st-panel > * { position: relative; z-index: 1; }

.st-head { display: flex; align-items: center; gap: 8px; min-height: calc(var(--hf) * 1.6); }
.st-badge {
  display: inline-flex; align-items: center; gap: 0.35em; height: calc(var(--hf) * 1.6); padding: 0 0.6em 0 0.5em;
  border-radius: 999px; background: var(--acd); color: #fff;
  font: 800 var(--hf)/1 var(--disp); letter-spacing: .5px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 3px 0 2px rgba(0, 0, 0, 0.18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.st-badge .ic-mouse { width: 0.62em; height: 0.85em; display: block; }
.st-status {   /* dark text on a white chip: readable on every station colour */
  margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 var(--stf)/1.2 var(--font); letter-spacing: .8px; text-transform: uppercase;
  color: var(--ink); background: rgba(255, 255, 255, 0.9); padding: 0.12em 0.6em; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.st-status[data-tone="good"] { color: var(--green-d); }
.st-status[data-tone="bad"] { color: var(--red-d); }
.st-status[data-tone="gold"] { color: #8a4b00; background: #fff3c4; }

/* read-outs: label left, value right (stacked label/value in compact sizes) */
.st-box {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: var(--bh); padding: 0 10px; border-radius: 12px; text-align: left;
  background: rgba(255, 255, 255, 0.96); color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(20, 40, 80, 0.08), 0 3px 0 rgba(0, 0, 0, 0.13);
  transition: transform .15s cubic-bezier(.2, 1.6, .4, 1), box-shadow .15s, background .15s;
}
.st-lbl {   /* never shrinks: the value is fitted to the room left next to it (Station.fitBox) */
  display: flex; flex-direction: column; justify-content: center; flex: none;
  font: 800 12px/1.1 var(--font); letter-spacing: 1px; text-transform: uppercase; color: #6b7a99;
}
.st-val {
  font: 800 var(--vf)/1 var(--disp); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0;
  white-space: nowrap; display: inline-flex; align-items: baseline; gap: 0.25em; padding-top: 0.1em;
}
.st-val small { font: 800 12px var(--font); color: var(--ink-faint); letter-spacing: .5px; }
.st-box.no-cur .st-val small { display: none; }
.st-bal.dip { animation: dip .5s ease; }
@keyframes dip { 30% { background: #ffe1e6; transform: scale(.97); } }
.st-bal.bump { animation: bal-up .6s ease; }
@keyframes bal-up { 30% { background: #dcffe7; transform: scale(1.04); } }

.st-bet { cursor: pointer; padding-right: 28px; }
.st-bet .st-val { color: var(--ink); }
.st-cap {
  font: 700 12px/1.15 var(--font); letter-spacing: 0; text-transform: none; color: #d45f00; font-style: normal;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.st-cap:empty { display: none; }
.cap-x { display: none; }
.st-bet.cap-short .cap-l { display: none; }
.st-bet.cap-short .cap-s { display: inline; }
.st-ud {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 20px; display: grid; place-items: center; color: var(--acd);
}
.st-ud svg { width: 11px; height: 15px; display: block; }
.st-bet.lock { background: rgba(255, 255, 255, 0.78); cursor: default; }
.st-bet.lock .st-ud { color: var(--ink-faint); }
.st-bet:not(.lock):hover { background: #fff; box-shadow: inset 0 -3px 0 rgba(20, 40, 80, 0.08), 0 3px 0 rgba(0, 0, 0, 0.13), 0 0 0 2px var(--acd); }
.st-bet.bump { animation: bet-bump .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bet-bump { 40% { transform: scale(1.06); } }

/* difficulty: segmented chips */
.st-diffs {
  display: flex; gap: 3px; height: var(--dh); padding: 3px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.12);
}
.st-diff {
  flex: 1 1 auto; min-width: 0; padding: 0 4px; border-radius: 9px; overflow: hidden; white-space: nowrap;
  font: 800 var(--dfit, var(--dfs))/1 var(--font); letter-spacing: 0; color: #3b4866;
  transition: background .15s, color .15s, transform .1s;
}
.st-diff .ds { display: none; }
.stations.diff-short .st-diff .dl { display: none; }
.stations.diff-short .st-diff .ds { display: inline; }
.st-diff:hover:not(:disabled):not(.on) { background: rgba(255, 255, 255, 0.8); }
.st-diff.on {
  background: var(--dc); color: #fff;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 2px 0 rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.st-diff:disabled { cursor: default; }
.st-diffs.lock .st-diff:not(.on) { opacity: .45; }

.st-fund {
  height: var(--dh); border-radius: 12px; background: #fff; color: var(--green-d);
  font: 800 clamp(12px, calc(var(--sh) * 0.07), 17px) var(--font); letter-spacing: .3px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18), inset 0 0 0 2px var(--green);
}
.st-fund:hover { background: #effff3; }
.st-fund.attn { animation: attn .4s ease 3; }
@keyframes attn { 50% { transform: scale(1.06); box-shadow: 0 3px 0 rgba(0,0,0,.18), inset 0 0 0 2px var(--green), 0 0 0 5px rgba(34,177,76,.35); } }

.st-info {
  display: none; font: 700 clamp(14px, calc(var(--sh) * 0.026), 18px)/1.25 var(--font); color: var(--ink);
  text-align: center; letter-spacing: .3px; align-self: center;
  background: rgba(255, 255, 255, 0.8); padding: 0.15em 0.8em; border-radius: 999px;
}
.stations[data-size="l"] .st-info { display: block; }

/* lane-odds preview (tall strips only): the next lanes with multiplier and safe chance.
   A column-wrapping list in a clipped box: rows that do not fit wrap out of sight, so only
   whole rows ever show. */
.st-odds { display: none; }
.stations.with-odds .st-odds {
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start;
  flex: 0 1 auto; min-height: 0; overflow: hidden;   /* as tall as its rows (a short list is a short box), at most the room left */
  background: rgba(255, 255, 255, 0.9); border-radius: 12px; padding: 4px 6px;
  box-shadow: inset 0 -3px 0 rgba(20, 40, 80, 0.08), 0 3px 0 rgba(0, 0, 0, 0.13);
}
.stations.with-odds .st-panel { justify-content: flex-start; }
/* only the odds list gives up height: the read-outs, chips and the demo-funds button keep their size */
.stations.with-odds .st-panel > :not(.st-odds) { flex-shrink: 0; }
.od-r {
  width: 100%; flex: none; display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; align-items: center;
  height: clamp(26px, calc(var(--sh) * 0.036), 38px); padding: 0 8px; border-radius: 8px;
  font: 700 clamp(14px, calc(var(--sh) * 0.022), 19px)/1 var(--font); color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.od-r > :nth-child(2) { text-align: center; }
.od-r > :nth-child(3) { text-align: right; color: var(--green-d); }
.od-r b { font: 800 1.08em/1 var(--disp); color: var(--ink); padding-top: .08em; }
.od-h { font: 800 12px/1 var(--font); letter-spacing: 1px; text-transform: uppercase; color: #6b7a99; height: 24px; }
.od-h > :nth-child(3) { color: #6b7a99; }
.od-r.nx { background: #fff3c4; box-shadow: inset 0 0 0 2px #ffcf3a; }
.od-r.cap b { color: #8a4b00; }
.od-r:nth-child(odd):not(.nx):not(.od-h) { background: #f3f7fd; }
.od-note {
  width: 100%; flex: none; padding: 8px 8px 4px; text-align: center;
  font: 700 clamp(13px, calc(var(--sh) * 0.016), 16px)/1.3 var(--font); color: #6b5a2e;
}

/* "no" feedback for a locked control */
.nope { animation: nope .38s ease; }
@keyframes nope { 20% { transform: translateX(-5px); } 45% { transform: translateX(4px); } 70% { transform: translateX(-2px); } }

/* compact panels (short strips): two read-outs side by side, label above value */
.stations[data-size="xs"] .st-panel,
.stations[data-size="s"] .st-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: center;
}
.stations[data-size="xs"] .st-head,
.stations[data-size="s"] .st-head,
.stations[data-size="xs"] .st-diffs,
.stations[data-size="s"] .st-diffs,
.stations[data-size="xs"] .st-fund,
.stations[data-size="s"] .st-fund { grid-column: 1 / -1; }
.stations[data-size="xs"] .st-box,
.stations[data-size="s"] .st-box {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  height: auto; padding: 4px 8px 5px; border-radius: 10px;
}
.stations[data-size="xs"] .st-bet,
.stations[data-size="s"] .st-bet { padding-right: 8px; }
.stations[data-size="xs"] .st-lbl,
.stations[data-size="s"] .st-lbl { flex-direction: row; gap: 5px; align-items: baseline; font-size: 12px; max-width: 100%; }
.cap-s { display: none; }
.stations[data-size="xs"] .st-bet .st-lbl,
.stations[data-size="s"] .st-bet .st-lbl { display: contents; }
.stations[data-size="xs"] .st-bet .st-val,
.stations[data-size="s"] .st-bet .st-val { order: 1; }
/* short strips: the max-win lane as a small gold badge at the right end of the label row
   (no extra line); the up/down icon sits at the right end of the value row below it */
.stations[data-size="xs"] .st-cap,
.stations[data-size="s"] .st-cap {
  position: absolute; top: 3px; right: 5px; padding: 1px 3px; border-radius: 6px;
  font: 800 12px/1.1 var(--font); color: #4a3000; background: #ffcf3a; box-shadow: 0 1px 0 #c28a00;
}
.stations[data-size="xs"] .st-cap:empty,
.stations[data-size="s"] .st-cap:empty { display: none; }
.stations[data-size="xs"] .cap-l, .stations[data-size="xs"] .cap-s,
.stations[data-size="s"] .cap-l, .stations[data-size="s"] .cap-s { display: none; }
.stations[data-size="xs"] .cap-x,
.stations[data-size="s"] .cap-x { display: inline; }
.stations[data-size="xs"] .st-val small,
.stations[data-size="s"] .st-val small { display: none; }
.stations[data-size="xs"] .st-ud,
.stations[data-size="s"] .st-ud { right: 5px; top: auto; bottom: 4px; height: 16px; transform: none; }
.stations[data-size="xs"] .st-head { min-height: 18px; }
.stations[data-size="xs"] .st-badge { height: 18px; }
.stations[data-size="xs"] .st-status { padding-top: 0.04em; padding-bottom: 0.04em; }   /* as tall as the 18px badge row */
/* the shortest strips (6 players at 1280×720 ≈ 97px): tighter rhythm so nothing touches the edges */
.stations[data-size="xs"] .st-panel { gap: 2px; padding-top: 3px; padding-bottom: 3px; }
.stations[data-size="xs"] .st-box { padding: 2px 8px 3px; }
.stations[data-size="xs"] .st-diffs { height: 21px; padding: 2px; }

/* tall strips: label above a big value (the value never shares a line with the label) */
.stations[data-size="l"] .st-box {
  flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  height: auto; padding: calc(var(--pg) * 0.7) 14px calc(var(--pg) * 0.8);
}
.stations[data-size="l"] .st-bet { padding-right: 34px; }
.stations[data-size="l"] .st-lbl { flex-direction: row; gap: 8px; align-items: baseline; font-size: clamp(12px, calc(var(--sh) * 0.016), 15px); max-width: 100%; }
.stations[data-size="l"] .st-cap { font-size: clamp(12px, calc(var(--sh) * 0.016), 15px); }
.stations[data-size="l"] .st-val small { font-size: clamp(12px, calc(var(--vf) * 0.34), 16px); }
.stations[data-size="l"] .st-ud { right: 12px; }
.stations[data-size="l"] .st-ud svg { width: 14px; height: 19px; }
.stations[data-size="l"] .st-diffs { border-radius: 14px; }

/* ---- 2 · road ---- */
.st-road { position: relative; min-width: 0; min-height: 0; background: #59646f; overflow: hidden; }
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.st-say {
  position: absolute; left: 50%; top: 9%; z-index: 3; transform: translateX(-50%);
  max-width: 92%; padding: 0.4em 1em; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.97); color: var(--ink); pointer-events: none;
  font: 800 clamp(13px, calc(var(--sh) * 0.08), 22px)/1.2 var(--font);
  border: 3px solid #1e90e8; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.2);
}
.st-say.show { animation: say-in .35s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes say-in { from { transform: translate(-50%, -10px) scale(.8); opacity: 0; } }
.st-say.err { border-color: var(--red); color: #a3172c; }
.st-say.win { border-color: var(--green); color: var(--green-d); }

/* "Add demo funds": opens inside this player's own road only */
.st-dep {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 6px;
  background: rgba(20, 45, 90, 0.5); animation: fade-in .2s ease;
}
.dp-card {
  position: relative; display: flex; align-items: center; gap: clamp(8px, calc(var(--sh) * 0.06), 16px);
  max-width: 100%; max-height: 100%; padding: clamp(6px, calc(var(--sh) * 0.06), 16px) clamp(10px, calc(var(--sh) * 0.08), 20px);
  background: #fff; border-radius: 18px; border: 3px solid var(--green); color: var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), 0 12px 30px rgba(10, 30, 70, 0.35);
  animation: modal-pop .28s cubic-bezier(.34, 1.56, .64, 1);
}
.dp-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dp-t b { font: 800 clamp(15px, calc(var(--sh) * 0.1), 24px)/1.1 var(--disp); white-space: nowrap; padding-top: .08em; }
.dp-t span { font: 600 clamp(12px, calc(var(--sh) * 0.065), 14px)/1.25 var(--font); color: var(--ink-soft); max-width: 260px; }
.dp-amts { display: flex; gap: 8px; flex: none; }
.dp-amt {
  height: clamp(34px, calc(var(--sh) * 0.3), 64px); padding: 0 clamp(10px, calc(var(--sh) * 0.07), 20px); border-radius: 14px;
  font: 800 clamp(15px, calc(var(--sh) * 0.1), 22px) var(--disp); color: #fff; padding-top: .1em; white-space: nowrap;
  background: linear-gradient(180deg, var(--green-l), var(--green)); box-shadow: 0 4px 0 var(--green-d);
  text-shadow: 0 2px 0 rgba(0, 70, 20, 0.3); transition: transform .08s, box-shadow .08s;
}
.dp-amt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.dp-x {
  flex: none; width: clamp(30px, calc(var(--sh) * 0.22), 40px); height: clamp(30px, calc(var(--sh) * 0.22), 40px); border-radius: 12px;
  background: #f1f5fb; border: 2px solid var(--line); color: var(--ink-soft); font: 800 16px/1 var(--font);
}
.dp-x:hover { color: var(--red); }
.stations[data-size="xs"] .dp-t span { display: none; }

/* ---- 3 · action column ---- */
.st-actions {
  position: relative; min-width: 0; min-height: 0;
  border-radius: 0 var(--ir) var(--ir) 0 / 0 var(--ir) var(--irb) 0;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(4px, calc(var(--sh) * 0.04), 12px);
  padding: var(--ap);
  background: linear-gradient(180deg, #fbfdff 0%, var(--panel-bg) 100%);
  border-left: 3px solid #e3ebf6;
}
.st-btn {
  position: relative; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.12em;
  border-radius: 14px; color: #fff; white-space: nowrap; overflow: hidden;
  transition: transform .08s, box-shadow .12s, filter .15s, background .2s;
}
.st-btn .bt-main { font-family: var(--disp); font-weight: 800; line-height: 1; letter-spacing: .5px; padding-top: 0.08em; }
.st-btn .bt-sub { font: 700 var(--sf)/1.1 var(--font); letter-spacing: .3px; opacity: .95; font-variant-numeric: tabular-nums; }
.st-btn .bt-sub:empty { display: none; }
.st-btn::after { /* gloss: a short top highlight that fades out (no visible edge on tall buttons) */
  content: ''; position: absolute; left: 5%; right: 5%; top: 4px; height: min(38%, 34px); border-radius: 10px 10px 50% 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0) 100%); pointer-events: none;
}

/* GO and CASH OUT first get the height their two lines need, then share the rest 1.3 : 1
   (a fixed 1.3 : 1 split clipped the CASH OUT lines on the shortest strips) */
.st-go {
  flex: 1.3 1 auto; max-height: 180px;
  --bd: var(--green-d);
  background: linear-gradient(180deg, var(--green-l) 0%, var(--green) 62%, #1c9a41 100%);
  box-shadow: 0 5px 0 var(--bd), 0 9px 16px rgba(19, 122, 51, 0.3);
  text-shadow: 0 2px 0 rgba(0, 70, 20, 0.35);
  margin-bottom: 5px;
}
.st-go .bt-main { font-size: var(--gf); }
.st-go .bt-sub {   /* the next multiplier and safe chance on a darker backing: readable white */
  background: rgba(0, 72, 26, 0.42); padding: 0.08em 0.6em 0.1em; border-radius: 999px; text-shadow: none;
}
.st-go.is-low .bt-sub { background: rgba(60, 75, 105, 0.35); }
.st-go.is-hit {
  --bd: var(--red-d);
  background: linear-gradient(180deg, #ff7d8e 0%, var(--red) 62%, #c92139 100%);
  text-shadow: 0 2px 0 rgba(100, 0, 20, 0.35); filter: none;
}
.st-go.is-hit .bt-sub { background: rgba(100, 0, 20, 0.35); }
.st-go:hover { filter: brightness(1.05); }
.st-go:active, .st-go.is-busy { transform: translateY(4px); box-shadow: 0 1px 0 var(--bd), 0 3px 8px rgba(19, 122, 51, 0.25); }
.st-go.is-busy { filter: saturate(.75) brightness(.97); }
.st-go.is-low {
  --bd: #8794ad;
  background: linear-gradient(180deg, #d6deea 0%, #b6c2d6 100%);
  color: #fff; text-shadow: 0 2px 0 rgba(60, 75, 105, 0.35);
}
.station[data-state="ALIVE"] .st-go { animation: go-breathe 1.1s ease-in-out infinite; }
@keyframes go-breathe { 50% { filter: brightness(1.08); box-shadow: 0 5px 0 var(--bd), 0 0 0 4px rgba(95, 226, 116, 0.35), 0 9px 16px rgba(19, 122, 51, 0.3); } }

.st-cash {
  flex: 1 1 auto; max-height: 130px; margin-bottom: 4px;
  --bd: #c25a00;
}
.st-cash .bt-main { font-size: var(--cf); }
.st-cash.is-live {
  background: linear-gradient(180deg, #ffe066 0%, #ffc61a 55%, #ffa21a 100%);
  color: #4a2300; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 0 var(--bd), 0 8px 16px rgba(194, 90, 0, 0.28);
  animation: cash-pulse 1.1s ease-in-out infinite;
}
.st-cash.is-live:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd); }
.st-cash.is-live.bump { animation: cash-pop .4s cubic-bezier(.2, 1.7, .4, 1), cash-pulse 1.1s ease-in-out .4s infinite; }
@keyframes cash-pop { 40% { transform: scale(1.06); } }
@keyframes cash-pulse {
  50% { box-shadow: 0 4px 0 var(--bd), 0 0 0 4px rgba(255, 198, 26, 0.4), 0 8px 22px rgba(255, 150, 20, 0.45); }
}
.st-cash.is-off {
  background: #e7edf6; color: #9aa7bd; cursor: default;
  box-shadow: 0 3px 0 #d3dceb; text-shadow: none;
}
.st-cash.is-off::after { display: none; }
/* live: the amount is the main line, "CASH OUT" a smaller label above it */
.stations:not([data-size="xs"]) .st-cash.is-live .bt-main { font-size: 16px; letter-spacing: 1px; }
.stations[data-size="l"] .st-cash.is-live .bt-main { font-size: clamp(16px, calc(var(--cf) * 0.6), 22px); }
.stations:not([data-size="xs"]) .st-cash.is-live .bt-sub {
  font: 800 max(16px, min(var(--cf), calc(var(--aw) * 0.105)))/1 var(--disp); padding-top: .06em; letter-spacing: .3px;
}
/* short strips: a tighter column rhythm so both buttons keep their two lines */
.stations[data-size="xs"] .st-actions,
.stations[data-size="s"] .st-actions { padding-top: 4px; padding-bottom: 4px; gap: 3px; }
.stations[data-size="xs"] .st-go { margin-bottom: 4px; }
.cs-hint { display: none; }
.stations[data-size="xs"] .cs-hint { display: inline; }

.st-hint {
  flex: none; text-align: center; font: 600 12px/1.25 var(--font); color: var(--ink-faint);
  white-space: normal;
}
.st-hint .h-long > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-hint .h-short { display: none; }
.stations[data-size="xs"] .st-hint { display: none; }
.stations[data-size="s"] .st-hint { line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stations[data-size="s"] .st-hint .h-long { display: none; }
.stations[data-size="s"] .st-hint .h-short { display: inline; }

/* result card — covers the buttons for the result pause */
.st-result {
  position: absolute; inset: var(--ap); z-index: 2; border-radius: 14px; padding: 0 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15em;
  text-align: center; color: #fff; overflow: hidden; isolation: isolate;
  animation: rs-pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes rs-pop { from { transform: scale(.6); opacity: 0; } }
.st-result > * { position: relative; z-index: 1; max-width: 100%; white-space: nowrap; }
.rs-title { font: 800 clamp(14px, calc(var(--sh) * 0.1), 32px)/1 var(--disp); letter-spacing: 1px; padding-top: .08em; }
.rs-amt { font: 800 clamp(18px, min(calc(var(--sh) * 0.16), calc(var(--aw) * 0.105)), 48px)/1 var(--disp); font-variant-numeric: tabular-nums; padding-top: .06em; }
.rs-amt small { font-size: max(12px, 0.5em); margin-right: 0.2em; letter-spacing: .5px; opacity: .9; }
.rs-detail { font: 700 clamp(12px, calc(var(--sh) * 0.07), 18px)/1.1 var(--font); opacity: .95; }
.rs-net { font-weight: 800; }
/* tall strips: a card of a sensible size in the middle of the column (not a 900px slab);
   the buttons step aside while it shows */
/* short strips: the column's top padding is 4px (see .st-actions above), so the card's top
   edge must sit at 4px too, or a rim of the GO button shows above the card */
.stations[data-size="xs"] .st-result,
.stations[data-size="s"] .st-result { inset: 4px var(--ap) var(--ap); }
.stations[data-size="l"] .st-result {
  height: min(calc(100% - 2 * var(--ap)), clamp(220px, calc(var(--sh) * 0.42), 380px));
  margin: auto 0; gap: 0.35em; border-radius: 20px; padding: 0 12px;
}
.stations[data-size="l"] .rs-title { font-size: clamp(26px, calc(var(--sh) * 0.045), 40px); }
.stations[data-size="l"] .rs-amt { font-size: clamp(30px, min(calc(var(--sh) * 0.07), calc(var(--aw) * 0.15)), 56px); }
.stations[data-size="l"] .rs-detail { font-size: clamp(15px, calc(var(--sh) * 0.025), 22px); }
.stations[data-size="l"] .station.has-result .st-btn,
.stations[data-size="l"] .station.has-result .st-hint { visibility: hidden; }
.st-result.is-win {
  background: linear-gradient(180deg, #5fe274 0%, #22b14c 60%, #189a40 100%);
  box-shadow: 0 5px 0 var(--green-d), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 2px 0 rgba(0, 70, 20, 0.35);
}
.st-result.is-gold {
  background: linear-gradient(180deg, #fff3a6 0%, #ffd23a 45%, #ff9f1c 100%);
  box-shadow: 0 5px 0 var(--gold-d), inset 0 2px 0 rgba(255, 255, 255, 0.6);
  color: #5a2e00; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.st-result.is-gold::after {   /* the shine passes BEHIND the text (z-index 0 < the lines' 1) */
  content: ''; position: absolute; z-index: 0; top: -20%; bottom: -20%; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-18deg); animation: shine 1.4s ease-in-out infinite;
}
@keyframes shine { 0% { left: -60%; } 70%, 100% { left: 130%; } }
.st-result.is-lost {
  background: linear-gradient(180deg, #ff6b7f 0%, #e8304a 60%, #c92139 100%);
  box-shadow: 0 5px 0 var(--red-d), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 2px 0 rgba(100, 0, 20, 0.3);
  animation: rs-pop .5s cubic-bezier(.2, 1.6, .4, 1), rs-shake .45s ease .15s;
}
@keyframes rs-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---- strip states ---- */
.station[data-state="STEPPING"]::before, .station[data-state="ALIVE"]::before {
  animation: live-glow 1.2s ease-in-out infinite;
}
@keyframes live-glow { 50% { opacity: 1; } }
/* results: a white gap + a coloured ring OUTSIDE the station border, so a green or pink
   station still shows its CASHED / LOST state clearly */
.station[data-state="CASHED"]::before {
  opacity: 1; box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--green), 0 0 18px 7px rgba(34, 177, 76, 0.45);
}
.station[data-state="MAXWIN"]::before, .station[data-state="FINISHED"]::before {
  opacity: .6; box-shadow: 0 0 0 3px #fff, 0 0 0 8px #ffc61a, 0 0 26px 8px rgba(255, 190, 40, 0.7);
  animation: gold-glow .9s ease-in-out infinite;
}
@keyframes gold-glow { 50% { opacity: 1; } }
.station[data-state="LOST"]::before {
  opacity: 1; box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--red), 0 0 18px 7px rgba(232, 48, 74, 0.4);
}
.station[data-state="LOST"] .st-panel { filter: saturate(.75); }
.station.kb-focus { outline: 3px dashed var(--ink); outline-offset: 2px; }

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  flex: none; height: var(--fth); display: flex; align-items: center; gap: 16px; padding: 0 16px 2px;
  font: 700 12px var(--font); letter-spacing: 1.4px; color: rgba(29, 42, 68, 0.55);
}
#footer .foot-note { flex: 1; text-align: center; letter-spacing: .3px; font-weight: 600; color: rgba(29, 42, 68, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge18 {
  flex: none; height: calc(var(--fth) - 6px); min-width: calc(var(--fth) - 6px); padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; background: var(--red); color: #fff; letter-spacing: 0;
  font: 800 12px/1 var(--font); box-shadow: 0 0 0 2px #fff;
}

/* ============================================================
   TOASTS & MODALS
   ============================================================ */
/* kiosk-wide messages sit over the top bar (station messages appear on the station's own road) */
#toasts {
  position: fixed; top: 8px; right: 170px; z-index: 60;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none; align-items: flex-end;
}
@media (max-height: 820px) { #toasts { top: 5px; right: 154px; } }
.toast {
  min-width: 260px; max-width: min(640px, 34vw); padding: 11px 18px; border-radius: 14px; text-align: center;
  background: #fff; color: var(--ink); font: 700 14px/1.3 var(--font);
  box-shadow: 0 4px 0 rgba(20, 50, 100, 0.1), 0 12px 30px rgba(20, 50, 100, 0.22);
  border-left: 6px solid #1e90e8; animation: toast-in .3s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.win  { border-left-color: var(--green); }
.toast.gold { border-left-color: var(--gold); background: #fffbea; }
.toast.err  { border-left-color: var(--red); }
.toast.out  { animation: toast-out .3s ease forwards; }
@keyframes toast-in  { from { transform: translateY(-16px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-12px); opacity: 0; } }

/* the help panel never blocks the players: the light background lets every click and wheel
   through to the strips (pointer-events: none); only the panel itself takes input */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  background: rgba(20, 45, 90, 0.16); animation: fade-in .2s ease; pointer-events: none;
}
.modal-backdrop .modal { pointer-events: auto; cursor: pointer; }
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(440px, calc(100vw - 40px)); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  background: #fff; border-radius: 24px; padding: 22px 24px 20px; color: var(--ink);
  box-shadow: 0 6px 0 #d6e2f2, 0 30px 80px rgba(10, 30, 70, 0.4);
  animation: modal-pop .28s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes modal-pop { from { transform: scale(0.86); opacity: 0; } }
.modal h3 {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font: 800 24px/1.1 var(--disp); padding-top: .1em;
}
.m-ico { font-size: 26px; }
.modal .m-close {
  margin-left: auto; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: #f1f5fb; border: 2px solid var(--line); color: var(--ink-soft);
  font: 800 17px/1 var(--font); display: grid; place-items: center;
}
.modal .m-close:hover { color: var(--red); }
.modal p { font-size: 15px; line-height: 1.5; color: var(--ink-soft); font-weight: 500; }
.modal p b { color: var(--ink); }
.m-note { margin-top: 12px; font-size: 13px !important; font-weight: 700 !important; color: var(--ink-faint) !important; text-align: center; }
.m-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.m-amounts button {
  height: 64px; border-radius: 16px; font: 800 20px var(--disp); color: #fff; padding-top: .1em;
  background: linear-gradient(180deg, var(--green-l), var(--green)); box-shadow: 0 5px 0 var(--green-d);
  text-shadow: 0 2px 0 rgba(0, 70, 20, 0.3); transition: transform .08s, box-shadow .08s;
}
.m-amounts button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--green-d); }

.modal-help { width: min(1040px, calc(100vw - 40px)); }
.m-body { overflow: auto; min-height: 0; padding-right: 4px; }
.m-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.m-steps { list-style: none; counter-reset: s; display: grid; gap: 8px; }
.m-steps li {
  counter-increment: s; position: relative; padding-left: 38px; min-height: 28px;
  font-size: 15px; line-height: 1.4; color: var(--ink-soft); font-weight: 500;
}
.m-steps li b { color: var(--ink); }
.m-steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: #ffc61a; color: #5a3a00; font: 800 15px/1 var(--disp);
  box-shadow: 0 2px 0 #c28a00;
}
.m-keys { display: grid; gap: 7px; align-content: start; background: #f6f9fe; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.m-keys div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.m-keys kbd {
  flex: none; min-width: 112px; text-align: center; padding: 4px 8px; border-radius: 8px;
  background: #fff; border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
  font: 800 13px var(--font); color: var(--ink);
}
.m-fair {
  margin: 14px 0 12px; padding: 12px 14px; border-radius: 14px;
  background: #e8f9ee; border: 2px solid #b6ebc9; font-size: 14px !important; color: #285a3a !important;
}
.m-table-wrap { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.m-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.m-table th, .m-table td { padding: 5px 10px; text-align: center; font-size: 14px; }
.m-table thead th {
  position: sticky; top: 0; background: #fff; font: 800 13px var(--font); letter-spacing: 1px; color: var(--ink);
  border-bottom: 3px solid var(--dc, var(--line));
}
.m-table tbody th { font: 800 13px var(--font); color: var(--ink-faint); width: 64px; }
.m-table tbody tr:nth-child(even) { background: #f6f9fe; }
.m-table td b { font-weight: 800; color: var(--ink); margin-right: 8px; }
.m-table td span { font-weight: 600; color: var(--green-d); font-size: 13px; }
.m-table td.na { background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0, 0, 0, 0.03) 6px 12px); }

/* ============================================================
   reduced motion: keep the feedback, drop the movement
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .station, .station::before, .st-go, .st-cash.is-live, .tk-new, .st-result, .nope, .st-bal.dip, .st-bal.bump, .dp-card, .st-dep { animation: none !important; }
  .tk-new.tk-flash { background: #fff1b8; }
  .station[data-state="ALIVE"]::before, .station[data-state="STEPPING"]::before,
  .station[data-state="MAXWIN"]::before, .station[data-state="FINISHED"]::before { opacity: .8; }
  .st-result.is-gold::after { display: none; }
}

/* ============================================================
   DEBUG test switches (?luck ?cap ?bal ?fast) — always visible
   ============================================================ */
.debug-tag {
  flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0 auto; max-width: max-content; padding: 1px 12px; border-radius: 999px;
  font: 800 12px/calc(var(--fth) - 8px) var(--font); letter-spacing: .6px; color: #ffd400;
  background: #1d1f26; border: 2px solid #ffd400;
}
/* ?luck: every road carries a hazard-striped DEBUG label */
.m-debug {
  margin-top: 14px; padding: 10px 14px; border-radius: 14px;
  background: #1d1f26; border: 2px solid #ffd400; color: #ffd400 !important; font-weight: 700 !important; font-size: 14px !important;
}
.is-luck .st-road::before {
  content: 'DEBUG · LUCK'; position: absolute; bottom: 4px; left: 8px; z-index: 3; pointer-events: none;
  padding: 2px 10px 2px 26px; border-radius: 8px;
  font: 800 clamp(12px, calc(var(--sh) * 0.06), 15px)/1.15 var(--font); letter-spacing: 1px; color: #ffd400;
  background:
    repeating-linear-gradient(-45deg, #ffd400 0 5px, #1d1f26 5px 10px) left center / 18px 100% no-repeat,
    #1d1f26;
  border: 2px solid #ffd400; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* bottom left: behind the chicken (passed lanes or the pavement), clear of the live multiplier and the FINISH sign */

/* ============================================================
   VERTICAL LAYOUT (CONFIG.layout = 'vertical', the default)
   The players sit side by side in columns. Each column: the player panel on top,
   the road in the middle (the chicken hops UP it), GO and CASH OUT side by side below.
   game.js sets --cw (column width) and a matching --sh / data-size (xs or s).
   ============================================================ */
.stations.vert {
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  --pw: var(--cw, 300px);
  --aw: calc(var(--cw, 300px) * 0.5);
}
.stations.vert .station {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.stations.vert .st-panel {
  border-radius: var(--ir) var(--ir) 0 0;
  border-right: 0; border-bottom: 3px solid var(--acd);
}
.stations.vert .st-actions {
  border-radius: 0 0 var(--irb) var(--irb);
  border-left: 0; border-top: 3px solid #e3ebf6;
  flex-direction: row; align-items: stretch; gap: clamp(5px, calc(var(--cw, 300px) * 0.025), 10px);
  padding: 7px var(--ap) 5px;
}
.stations.vert .st-go,
.stations.vert .st-cash {
  flex: 1 1 0; min-width: 0; max-height: none; margin-bottom: 5px;
  height: calc(var(--gf) + var(--sf) * 1.25 + 24px);
}
.stations.vert .st-go { flex-grow: 1.25; }
.stations.vert .st-hint { display: none; }
/* the result card covers the buttons and grows up over the foot of the road to fit its lines */
.stations.vert .st-result {
  inset: auto var(--ap) 5px; min-height: calc(100% - 10px);
  padding: 8px 10px; gap: 0.25em;
}
/* "Add demo funds" inside a narrow road: stack the card */
.stations.vert .dp-card { flex-direction: column; flex-wrap: wrap; justify-content: center; text-align: center; }
.stations.vert .dp-amts { flex-wrap: wrap; justify-content: center; }
.stations.vert .dp-x { position: absolute; top: 6px; right: 6px; }
.stations.vert .cs-hint { display: none; }

/* ---------------- online: linking this kiosk to a cashdesk (js/net.js) ---------------- */
.net-ov {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 500px at 50% 30%, rgba(255, 255, 255, 0.5), transparent 70%),
    linear-gradient(180deg, #8fd5ff 0%, #bfe8ff 50%, #dff4ff 100%);
}
.net-ov.hidden { display: none; }
.net-ov[data-mode="blocked"] { background: rgba(29, 42, 68, 0.72); }
.net-card {
  width: min(520px, 100%); text-align: center; background: #fff; border-radius: 26px; padding: 34px 30px 30px;
  box-shadow: 0 6px 0 #e07b00, 0 24px 60px rgba(29, 42, 68, 0.28); border: 3px solid #ffc61a;
}
.net-logo { font-size: 58px; line-height: 1; margin-bottom: 6px; }
.net-card h2 { font-family: var(--disp); font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.net-code {
  font-family: var(--disp); font-weight: 800; font-size: clamp(44px, 9vw, 68px); letter-spacing: 10px; color: #c26a00;
  margin: 14px 0 6px; padding-left: 10px; font-variant-numeric: tabular-nums;
}
.net-code:empty { display: none; }
.net-card p { font-size: 17px; font-weight: 600; color: var(--ink-soft); margin-top: 10px; line-height: 1.45; }
.net-card p b { color: var(--ink); }
.net-ov[data-mode="connecting"] .net-logo { animation: net-bob 1s ease-in-out infinite; }
@keyframes net-bob { 50% { transform: translateY(-8px); } }
