:root {
  /* palette */
  --asphalt: #7c7c7c;
  --kerb: #d3d3d3;
  --kerb-edge: #b4b4b4;
  --marking: #ffffff;
  --panel: #2b2b2b;
  --panel-2: #363636;
  --ink: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #2fbf4f;
  --danger: #e03a3a;

  /* geometry */
  --lane-w: 96px;
  --kerb-w: 32px;
  --road-h: 420px;
  /* #hen is a fixed positioning anchor -- laneX() centres the hen on a lane
     through henEl.offsetWidth, so this box must not change between poses. */
  --hen-box: 54px;
  /* Height of the idle sprite. The run and hit sprites derive their box from
     this same body scale, each at its own aspect ratio. */
  --hen-h: 60px;
  --manhole-size: 62px;
  --vehicle-w: 76px;
  --vehicle-h: 173px;

  /* Asset seam: app.js overwrites these at boot from its ASSETS map, so
     dropping new art into /assets/ needs no CSS edits. Each one is a
     background layer, so a missing file simply falls back to the flat CSS
     underneath instead of showing a broken image. */
  --asset-road: url("/assets/asphalt.jpg");
  --asset-hen-idle: url("/assets/hen-idle.png");
  --asset-hen-run: url("/assets/hen-run.png");
  --asset-hen-hit: url("/assets/hen-hit.png");
  --asset-egg: url("/assets/golden-egg.png");
  --asset-feather: url("/assets/feather.png");
  --asset-manhole: url("/assets/manhole.png");
  --asset-bush: url("/assets/bush.png");
  --asset-lamp: url("/assets/lamp.png");
  --asset-coin: url("/assets/coin.png");
  --asset-vehicle-police: url("/assets/vehicle-police.png");
  --asset-vehicle-truck: url("/assets/vehicle-truck.png");
  --asset-vehicle-taxi: url("/assets/vehicle-taxi.png");
  --asset-vehicle-sedan: url("/assets/vehicle-sedan.png");
  --asset-vehicle-sinotruck: url("/assets/vehicle-sinotruck.png");
  --asset-vehicle-bajaj: url("/assets/vehicle-bajaj.png");
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 50% -20%, #303030, #1d1d1d 70%);
}

.app {
  width: min(1180px, 97vw);
  margin: 0.8rem auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

button {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
  background: none;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

h2 { margin: 0 0 0.5rem; color: var(--ink); font-size: 1rem; }

/* ---- status strip ---- */

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  background: var(--panel);
  border-radius: 14px;
  padding: 0.55rem 1rem;
  flex-wrap: wrap;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-label { font-weight: 600; }

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: online-pulse 2s ease-in-out infinite;
}

@keyframes online-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 191, 79, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(47, 191, 79, 0); }
}

.win-ticker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--panel-2);
  border-radius: 999px;
  padding: 0.28rem 0.85rem 0.28rem 0.32rem;
  min-width: 0;
  overflow: hidden;
}

.win-ticker.swap { animation: ticker-swap 220ms ease-out; }

@keyframes ticker-swap {
  0% { opacity: 0; transform: translateY(7px); }
  100% { opacity: 1; transform: translateY(0); }
}

.win-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg,
      hsl(var(--avatar-hue, 120deg), 55%, 52%),
      hsl(var(--avatar-hue, 120deg), 60%, 32%));
}

.win-user { color: var(--ink); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }
.win-amount { color: var(--accent); font-size: 0.82rem; font-weight: 800; white-space: nowrap; }

.status-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.pill {
  border: 1px solid #4a4a4a;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: var(--panel-2);
  font-weight: 700;
}

.mode-pill { color: var(--accent); font-size: 0.75rem; letter-spacing: 0.1em; }
.balance-pill { color: var(--ink); }

.demo-toggle { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.82rem; }
.demo-toggle input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }

/* ---- stage / road ---- */

.stage {
  position: relative;
  border-radius: 18px;
  padding: 0;
  background: var(--panel);
  overflow: visible;
}

.road {
  position: relative;
  height: var(--road-h);
  overflow: hidden;
  border-radius: 18px;
  background: var(--asphalt);
}

.road-camera {
  position: relative;
  width: max-content;
  min-width: 100%;
  height: 100%;
  will-change: transform;
}

.road-track {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-width: max-content;
  /* asphalt.jpg is opaque and seamless; the flat colour underneath is only a
     fallback for a missing file. Tiled large so the repeat is hard to read. */
  background-color: var(--asphalt);
  background-image: var(--asset-road);
  background-size: 384px 384px;
  background-repeat: repeat;
}

/* ---- kerbs ---- */

.kerb {
  position: relative;
  flex: 0 0 var(--kerb-w);
  background: var(--kerb);
}

.kerb.start { border-right: 2px solid var(--kerb-edge); }

.kerb-bush {
  position: absolute;
  left: -8px;
  /* 363x337 */
  width: 46px;
  height: 43px;
  background: var(--asset-bush) center/contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.kerb-bush.top { top: 6px; }
.kerb-bush.bottom { bottom: 6px; }

/* 347x289, arm extending right -- it deliberately overhangs the carriageway. */
.kerb-lamp {
  position: absolute;
  left: 0;
  top: 12%;
  width: 62px;
  height: 52px;
  background: var(--asset-lamp) center/contain no-repeat;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.kerb.end {
  flex-basis: 120px;
  border-left: 2px solid var(--kerb-edge);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.kerb-label {
  color: #4c4636;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.golden-egg {
  /* 174x235 */
  width: 52px;
  height: 70px;
  background: var(--asset-egg) center/contain no-repeat;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.kerb.end.burst { animation: egg-burst 700ms ease-out 1; }

@keyframes egg-burst {
  0% { box-shadow: inset 0 0 0 rgba(47, 191, 79, 0); }
  40% { box-shadow: inset 0 0 60px rgba(47, 191, 79, 0.65); }
  100% { box-shadow: inset 0 0 0 rgba(47, 191, 79, 0); }
}

/* ---- lanes ---- */

.lane {
  position: relative;
  flex: 0 0 var(--lane-w);
  transition: background-color 180ms ease, opacity 180ms ease;
}

/* vertical dashed divider pinned to each lane's left edge */
.lane::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(to bottom, var(--marking) 0 14px, transparent 14px 28px);
  opacity: 0.85;
  pointer-events: none;
}

/* the kerb edge already reads as the first boundary */
.kerb.start + .lane::before { display: none; }

.manhole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--manhole-size);
  height: var(--manhole-size);
  border-radius: 50%;
  /* 353x352, square. The shadow seats the cover on the photoreal asphalt
     instead of letting it float. */
  background: var(--asset-manhole) center/contain no-repeat;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 180ms ease;
}

/* Iron-on-asphalt is a low-contrast pairing, so the label carries its own
   scrim rather than relying on the cover behind it. */
.manhole-mult {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: #f4f4f4;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.62);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Lane states tint the asphalt rather than painting over it, so the road
   texture stays visible under every state. */

.lane.crossed { background-color: rgba(0, 0, 0, 0.3); }
.lane.crossed .manhole { opacity: 0.8; filter: saturate(0.45) drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5)); }
.lane.crossed .manhole-mult { color: var(--accent); opacity: 0.85; }

.lane.standing {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 46px rgba(255, 255, 255, 0.12);
}

.lane.current { background-color: rgba(255, 255, 255, 0.12); }

.lane.current .manhole::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  animation: pulse-target 1.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-target {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.45; }
}

.lane.ahead .manhole { opacity: 1; }
.lane.ahead.near { background-color: rgba(255, 255, 255, 0.06); }

.lane.fatal { background-color: rgba(224, 58, 58, 0.42); }

.lane.fatal .manhole::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2.5px solid var(--danger);
  pointer-events: none;
}

/* ---- actors on the road ---- */

/* #hen is a fixed-size anchor box: laneX(), positionStepButton() and
   spawnAmbientVehicle() all convert between a lane's centre and the hen's left
   edge through henEl.offsetWidth, so this box must stay constant across poses.
   The sprite itself lives on ::before and is resized per pose, which is what
   lets three very differently proportioned images share one element without
   any of them being stretched. */
.hen {
  position: absolute;
  left: 0;
  top: calc(50% - var(--hen-h) / 2);
  width: var(--hen-box);
  height: var(--hen-h);
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  will-change: transform;
  z-index: 3;
}

/* Every pose sits on the bottom of the anchor box, so they all share one
   ground line and the hen never jumps vertically when the sprite swaps. */
.hen::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
}

/* 266x314 -> 0.847. Faces right, which is the direction of travel. */
.hen.is-idle::before {
  width: calc(var(--hen-h) * 0.847);
  height: var(--hen-h);
  background-image: var(--asset-hen-idle);
}

/* 307x295 -> 1.041, drawn at the same body scale as idle (295/314). */
.hen.is-run::before {
  width: calc(var(--hen-h) * 0.978);
  height: calc(var(--hen-h) * 0.940);
  background-image: var(--asset-hen-run);
}

/* 558x317 -> 1.760: flat on her back, nearly twice as wide as she is tall. */
.hen.is-hit::before {
  width: calc(var(--hen-h) * 1.777);
  height: calc(var(--hen-h) * 1.010);
  background-image: var(--asset-hen-hit);
}

/* Size is written inline per crash from the AMBIENT_VEHICLES roster so the
   chosen sprite keeps its own aspect ratio; these are only the defaults. */
.vehicle {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--vehicle-w);
  height: var(--vehicle-h);
  opacity: 0;
  background: var(--asset-vehicle-truck) center/contain no-repeat;
  filter: drop-shadow(0 6px 9px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  will-change: transform;
  z-index: 4;
}

/* Ambient traffic. Deliberately below the hen and the crash vehicle so a
   passing car can never be mistaken for the one that ends the round. */
.ambient-traffic {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ambient-vehicle {
  position: absolute;
  left: 0;
  top: 0;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.38));
  pointer-events: none;
  will-change: transform;
}

.step-target {
  position: absolute;
  top: calc(50% + 54px);
  left: 0;
  width: 74px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  z-index: 5;
  will-change: transform;
}

.step-target:not(:disabled):hover { background: #38d05a; }

.stage.flash-crash { animation: flash-crash 520ms ease-in-out 2; }

@keyframes flash-crash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 58, 58, 0); }
  50% { box-shadow: 0 0 0 3px var(--danger), 0 0 34px rgba(224, 58, 58, 0.5); }
}

/* ---- feather burst ---- */

.sprinkle-zone {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 6;
}

.sprinkle-icon {
  position: absolute;
  left: var(--burst-x, 50%);
  top: var(--burst-y, 50%);
  /* 253x208 */
  width: 26px;
  height: 21px;
  margin: -11px 0 0 -13px;
  background: var(--asset-feather) center/contain no-repeat;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  animation: sprinkle-fly 900ms ease-out forwards;
}

@keyframes sprinkle-fly {
  0% { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---- stage HUD ---- */

.stage-hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 7;
}

.hud-mult {
  display: block;
  font-size: clamp(1.7rem, 4.6vw, 2.5rem);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  line-height: 1.05;
}

.hud-mult.pulse-win { animation: mult-pulse 620ms ease-out; }

@keyframes mult-pulse {
  0% { transform: scale(1) translateY(0); color: #ffffff; }
  40% { transform: scale(1.16) translateY(-5px); color: var(--accent); }
  100% { transform: scale(1) translateY(0); color: #ffffff; }
}

.hud-sub {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f0f0f0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ---- control bar ---- */

.control-bar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.2fr) auto;
  gap: 16px;
  background: var(--panel);
  border-radius: 18px;
  padding: 14px 18px;
  align-items: center;
}

.bet-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.bet-pill {
  display: flex;
  align-items: center;
  background: var(--panel-2);
  border-radius: 999px;
  padding: 4px 6px;
}

.bet-step {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-radius: 999px;
}

.bet-step:not(:disabled):hover { color: var(--ink); }

#bet {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  outline: none;
  font-family: inherit;
}

#bet:disabled { opacity: 0.45; }

.quick-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 0.45rem 0.3rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.quick-chip:not(:disabled):hover { background: #414141; }

.chip-coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--asset-coin) center/contain no-repeat;
}

.diff-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.diff-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 2px;
}

.diff-title { font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.diff-hint { font-size: 0.72rem; color: var(--muted); }

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
  background: var(--panel-2);
  border-radius: 12px;
  gap: 4px;
}

.difficulty-btn {
  padding: 0.55rem 0.3rem;
  border-radius: 9px;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.difficulty-btn.active {
  background: #4a4a4a;
  color: var(--ink);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.action-group { display: flex; gap: 10px; align-items: stretch; }

.primary,
.collect {
  min-width: 190px;
  height: 62px;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffffff;
}

.primary { background: var(--accent); }
.primary:not(:disabled):hover { background: #38d05a; }

.collect {
  background: #1f9440;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.collect:not(:disabled):hover { background: #24a94a; }

#cashoutLabel { font-size: 19px; line-height: 1; }
#potentialPayout { font-size: 15px; font-weight: 700; opacity: 0.9; line-height: 1; }

/* ---- round details ---- */

.round-details {
  background: var(--panel);
  border-radius: 14px;
  padding: 0.4rem 1rem 0.9rem;
}

.round-details summary {
  cursor: pointer;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.detail-label { display: block; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.16em; margin-top: 0.4rem; }

.history-strip { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.4rem 0; }
.history-empty { color: var(--muted); font-size: 0.82rem; }

.history-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.history-chip .chip-tag {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.history-chip.win { background: rgba(47, 191, 79, 0.14); border-color: var(--accent); color: #9fe7b1; }
.history-chip.loss { background: rgba(224, 58, 58, 0.16); border-color: var(--danger); color: #f3b3b3; }

.results {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.results div {
  background: var(--panel-2);
  border: 1px solid #454545;
  border-radius: 10px;
  padding: 0.55rem;
}

.results span { display: block; color: var(--muted); font-size: 0.74rem; }
.results strong { display: block; margin-top: 0.25rem; font-size: 0.92rem; color: var(--ink); overflow-wrap: anywhere; }

.verify-link {
  display: block;
  margin: 0.7rem auto 0;
  background: none;
  border: 1px solid #565656;
  color: var(--ink);
  padding: 0.4rem 1rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.panels {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.panel {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 0.75rem;
  border: 1px solid #454545;
}

.panel ul { margin: 0; padding-left: 1.1rem; color: #d6d6d6; font-size: 0.84rem; }
.panel ul li { margin: 0.2rem 0; }

/* ---- toast / modal ---- */

.toast {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e1e;
  color: var(--ink);
  border: 1px solid #565656;
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  z-index: 60;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  overflow: auto;
}

.modal-card {
  margin: auto;
  background: var(--panel);
  border: 2px solid #565656;
  border-radius: 16px;
  padding: 1.3rem 1.5rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-card h2 { margin-bottom: 0.4rem; }
.modal-card p { margin: 0.2rem 0 0.6rem; color: var(--muted); }
.modal-card .collect { min-width: 120px; height: 46px; font-size: 16px; }

.verify-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.7rem;
  text-align: left;
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
}

.verify-details dt { color: var(--muted); }
.verify-details dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* ---- responsive ---- */

@media (max-width: 1099px) {
  :root {
    --lane-w: 88px;
    --road-h: 360px;
    --hen-h: 56px;
    --hen-box: 50px;
  }
  .control-bar { grid-template-columns: 1fr 1fr; }
  .action-group { grid-column: 1 / -1; }
  .action-group .primary,
  .action-group .collect { flex: 1 1 auto; }
  .results { grid-template-columns: 1fr 1fr; }
  .panels { grid-template-columns: 1fr; }
}

@media (max-width: 759px) {
  :root {
    --lane-w: 76px;
    --manhole-size: 54px;
    --road-h: 44vh;
    --hen-h: 50px;
    --hen-box: 44px;
  }
  .manhole-mult { font-size: 11px; padding: 1px 5px; }
  .control-bar { grid-template-columns: 1fr; padding: 12px; }
  .status-strip { gap: 0.5rem; }
  .win-ticker { order: 3; flex: 1 1 100%; justify-content: center; }
  .action-group {
    position: sticky;
    bottom: 8px;
    z-index: 20;
  }
  .action-group .primary,
  .action-group .collect { width: 100%; }
  .results { grid-template-columns: 1fr; }
}

/* The page is fully playable without motion: app.js swaps every GSAP tween
   for an instant state write when this query matches. */
@media (prefers-reduced-motion: reduce) {
  .online-dot,
  .win-ticker.swap,
  .sprinkle-icon,
  .stage.flash-crash,
  .kerb.end.burst,
  .lane.current .manhole::after,
  .hud-mult.pulse-win { animation: none; }
  .lane, .manhole { transition: none; }
}
