/* style.css — one classroom, drawn with boxes and border-radius.
   Stacking is deliberate and spelled out, because "something invisible is
   covering the buttons" is the bug that keeps coming back:
     room and pupils .... 1
     bubbles ............ 20
     hud / noise ........ 50
     floating points .... 100
     end-of-round card .. 300                                              */

:root {
  --wall: #f3eefb;
  --wall2: #e6dcf5;
  --chalk: #4a2f6b;
  --wood: #8a5bc4;
  --wood2: #6b4299;
  --ink: #2a2a33;
  --good: #34a05a;
  --bad: #d8453f;
  --gold: #f0b429;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wall);
  background-image:
    radial-gradient(1200px 700px at 50% -20%, #ffffff, transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(0,0,0,.022) 78px 80px);
  user-select: none;
}
body { display: flex; flex-direction: column; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ------------------------------------------------------------- the menu -- */
#menu {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #8a4fb5, #5a2f7a 60%, #3a1d52);
}
#menu[hidden] { display: none; }
.menu-box {
  width: min(560px, 100%); text-align: center; color: #f3f7f2;
  background: rgba(0,0,0,.22); border: 3px solid rgba(255,255,255,.16);
  border-radius: 26px; padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.logo {
  font-size: clamp(44px, 13vw, 84px); font-weight: 800; letter-spacing: -1px; line-height: 1;
  color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.tagline { font-size: clamp(15px, 3.6vw, 18px); line-height: 1.6; opacity: .92; margin: 16px 0 8px; }
.note { font-size: 15px; opacity: .8; margin-bottom: 10px; }
.best { margin-top: 14px; font-size: 15px; opacity: .85; }
.linky { margin-top: 12px; font-size: 14px; opacity: .7; text-decoration: underline; }

.big {
  display: inline-block; margin-top: 12px;
  background: var(--gold); color: #3a2a00; font-weight: 800;
  font-size: clamp(19px, 4.6vw, 24px); padding: 16px 34px; border-radius: 999px;
  box-shadow: 0 6px 0 #c8920f; transition: transform .08s, box-shadow .08s;
}
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #c8920f; }

/* ------------------------------------------------------------ the scene -- */
.scene {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
}
.scene[hidden] { display: none; }

/* ------------------------------------------------------------- the hud --- */
.hud {
  position: relative; z-index: 50; flex: none;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 2px solid #d9cbee; border-radius: 16px;
  padding: 8px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.06);
}
.hud-title { font-weight: 800; font-size: clamp(15px, 3.4vw, 19px); }
.hud-stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: 5px;
  background: #f6f1fd; border-radius: 10px; padding: 4px 9px; font-size: 14px;
}
.stat b { font-size: 17px; }
.stat .lbl { opacity: .6; font-size: 12px; }
.stat.pop { animation: pop .35s ease; }
@keyframes pop { 0%{transform:scale(1)} 45%{transform:scale(1.22)} 100%{transform:scale(1)} }

.clock { position: relative; width: 100%; height: 12px; background: #e2d6f4; border-radius: 999px; overflow: hidden; }
.clock-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #57b979, #8fd35f); transition: width .1s linear; }
.clock.low .clock-fill { background: linear-gradient(90deg, #e8664f, #f0a03c); }
.clock-num {
  position: absolute; right: 8px; top: -20px; font-size: 13px; font-weight: 800; opacity: .65;
}

/* ------------------------------------------------------ floaty bits ------ */
.say {
  position: absolute; z-index: 100; left: 50%; top: 64px; transform: translateX(-50%);
  background: rgba(28,28,34,.9); color: #fff; font-weight: 700;
  font-size: clamp(14px, 3.4vw, 17px); padding: 9px 18px; border-radius: 999px;
  animation: sayin .28s ease; pointer-events: none; max-width: 92%; text-align: center;
}
.say.good { background: rgba(36,132,74,.94); }
.say.bad { background: rgba(190,53,47,.94); }
.say.out { opacity: 0; transform: translate(-50%, -10px); transition: .3s; }
@keyframes sayin { from { opacity: 0; transform: translate(-50%, 10px) } }

.float {
  position: absolute; z-index: 100; transform: translate(-50%, -50%);
  font-weight: 800; font-size: clamp(16px, 4vw, 22px); pointer-events: none;
  animation: floaty .9s ease-out forwards; text-shadow: 0 2px 0 rgba(255,255,255,.7);
}
.float.good { color: #1c8a4a; } .float.bad { color: #c8342e; }
@keyframes floaty { to { transform: translate(-50%, -220%); opacity: 0 } }

/* --------------------------------------------------------- round card ---- */
.card-screen {
  position: absolute; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(22,30,26,.72); backdrop-filter: blur(3px);
  animation: sayin .22s ease;
}
.card-box {
  width: min(480px, 100%); text-align: center; color: #23231f;
  background: #ffffff; border: 4px solid #d9cbee; border-radius: 24px;
  padding: clamp(22px, 5vw, 36px); box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.card-screen.bad .card-box { border-color: #eec0bc; }
.card-box h2 { margin: 0 0 12px; font-size: clamp(23px, 6vw, 32px); }
.card-box p { margin: 7px 0; font-size: clamp(14px, 3.6vw, 17px); line-height: 1.55; }
.stars { font-size: clamp(22px, 6vw, 30px); letter-spacing: 3px; }

/* on anything wide the carpet sits them six across instead of four */
@media (min-width: 680px) { .carpetarea { grid-template-columns: repeat(6, 1fr); } }

/* --------------------------------------------------------------- juice --- */
.bit {
  position: absolute; z-index: 110; width: 9px; height: 9px; border-radius: 2px;
  transform: translate(-50%, -50%); pointer-events: none;
  animation: bitfly .68s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes bitfly {
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(220deg); opacity: 0; }
}
@keyframes shakesm { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-5px,2px)} 75%{transform:translate(5px,-2px)} }
@keyframes shakelg { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-11px,4px)} 60%{transform:translate(11px,-4px)} 85%{transform:translate(-5px,2px)} }
.shake-sm { animation: shakesm .28s ease; }
.shake-lg { animation: shakelg .42s ease; }

.combo {
  position: absolute; z-index: 105; left: 50%; top: 96px; transform: translateX(-50%);
  font-weight: 800; font-size: clamp(15px, 3.8vw, 21px); color: #b4700c;
  background: #fff6dd; border: 3px solid #f0b429; border-radius: 999px;
  padding: 5px 16px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0,0,0,.1);
}
.combo[hidden] { display: none; }
.combo.hot { color: #fff; background: linear-gradient(90deg, #f0803e, #e8534a); border-color: #c33a34; }
.combo.bump { animation: bump .3s ease; }
@keyframes bump { 0%{transform:translateX(-50%) scale(1)} 45%{transform:translateX(-50%) scale(1.2)} 100%{transform:translateX(-50%) scale(1)} }

/* --------------------------------------------------------- playground --- */
.yard { }
.yardarea {
  position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #9dc9e8 0 26%, #8fbf6a 26% 34%, #b9b2a6 34%);
  border: 4px solid #cbb287;
}
.yardarea .markings {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%);
  width: min(230px, 46%); aspect-ratio: 1; border: 5px solid rgba(255,255,255,.5); border-radius: 50%;
}
.yardarea .fence {
  position: absolute; left: 0; right: 0; top: 26%; height: 8%;
  background: repeating-linear-gradient(90deg, #7b8a99 0 4px, transparent 4px 16px);
}
.pupil.roam {
  position: absolute; width: auto; max-width: none; transform: translate(-50%,-50%);
  transition: left 1.3s ease-in-out, top 1.3s ease-in-out;
  padding: 10px 14px;              /* a bigger target than the child is drawn */
}
/* Once they are in trouble they stop dead. Chasing a child who is still
   sliding across the playground is not a fair thing to ask of a thumb. */
.pupil.roam.trouble {
  transition: none; animation: jiggle .35s ease-in-out infinite; z-index: 10;
}
@keyframes jiggle { 0%,100%{transform:translate(-50%,-50%) rotate(-6deg)} 50%{transform:translate(-50%,-50%) rotate(6deg)} }

/* -------------------------------------------------------- dinner hall --- */
.hallarea {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  justify-content: space-between; gap: 10px;
  background: linear-gradient(180deg, #f4e7cd, #e6d2ab);
  border: 4px solid #cbb287; border-radius: 16px; padding: 12px 10px;
}
.tables {
  position: absolute; left: 0; right: 0; top: 8%;
  display: flex; justify-content: space-around; font-size: clamp(18px, 4.5vw, 30px); opacity: .28;
}
.tables::before, .tables::after {
  content: ''; position: absolute; left: 4%; right: 4%; height: 10px;
  background: #c49a63; border-radius: 4px; opacity: .5;
}
.tables::before { top: -14px; } .tables::after { top: 46px; }
.queue {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(4px, 1.6vw, 16px); flex: 1; min-height: 0; padding-bottom: 4px;
}
.pupil.queuer {
  /* the padding is the point: it makes the drop target far bigger than the
     child is drawn, which on a phone is the difference between 29px and 50px
     of something to aim a finger at */
  position: relative; width: auto; max-width: none; flex: none;
  padding: 6px 12px; min-width: 58px;
  opacity: .8; transform: scale(.85); transform-origin: bottom center;
  transition: transform .22s ease, opacity .22s ease;
  animation: joinq .28s ease;
}
/* The one you are actually serving: full size, full colour, and lit up. */
.pupil.queuer.front {
  opacity: 1; transform: scale(1.12);
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}
.pupil.queuer.front::before {
  content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  width: 108%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(240,180,41,.75), transparent 70%);
}
.pupil.queuer .bubble { top: -46%; font-size: clamp(15px, 3.6vw, 22px); }
.pupil.queuer.front .bubble {
  top: -86%; font-size: clamp(24px, 6.5vw, 40px); padding: 5px 12px;
  border-color: #f0b429; border-width: 3px;
}
.pupil.queuer.front .tag::after { content: ''; }
/* while you are carrying something, everyone who could take it lights up */
.queue.taking .pupil.queuer { outline: 4px dashed rgba(240,180,41,.85); outline-offset: 3px; border-radius: 14px; }
@keyframes joinq { from { opacity: 0; transform: translateX(40px) scale(.6) } }
.pupil.queuer.going { opacity: 0; transform: translateY(-16px) scale(.7); transition: .26s; }
.pupil.queuer.impatient .kid { animation: jiggle .3s ease-in-out infinite; }
.patience {
  display: block; width: 80%; height: 8px; margin: 6px auto 0;
  background: #d9c8a5; border-radius: 999px; overflow: hidden;
}
.pupil.queuer.front .patience { height: 11px; box-shadow: 0 0 0 2px rgba(240,180,41,.4); }
.patience i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg,#57b979,#e8c34f); }
.pupil.queuer.impatient .patience i { background: linear-gradient(90deg,#f0803e,#e0453f); }

.hatch { flex: none; background: #ffffff; border: 3px solid #d8c39a; border-radius: 14px; padding: 8px; }
.hatchtop { text-align: center; font-size: 13px; font-weight: 800; opacity: .6; margin-bottom: 6px; }
.trays { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 2vw, 14px); }
.tray {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #f6f1fd; border: 3px solid #d8c39a; border-radius: 14px;
  padding: 7px clamp(9px, 3vw, 20px); box-shadow: 0 4px 0 rgba(0,0,0,.1);
}
.tray-ic { font-size: clamp(23px, 6vw, 36px); line-height: 1; }
.tray-lbl { font-size: clamp(10px, 2.4vw, 12.5px); font-weight: 700; opacity: .65; }
.tray:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.1); }

/* ---------------------------------------------- dragging and holding ----- */
.ghost {
  position: fixed; z-index: 500; transform: translate(-50%,-50%);
  font-size: clamp(30px, 8vw, 50px); pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); animation: lift .14s ease;
}
@keyframes lift { from { transform: translate(-50%,-50%) scale(.7) } }
.lifted { opacity: .45; }
.droptarget { outline: 4px dashed #f0b429; outline-offset: 4px; border-radius: 14px; }

.holdring {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%);
  width: clamp(46px, 12vw, 74px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(#f0b429 calc(var(--k) * 360deg), rgba(255,255,255,.35) 0);
  pointer-events: none; opacity: 0; transition: opacity .12s;
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
}
.holding .holdring, .pupil[data-k]:not([data-k="0"]) .holdring { opacity: 1; }

.trail {
  position: absolute; z-index: 108; height: 7px; border-radius: 999px;
  transform-origin: left center; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff);
  animation: fadetrail .3s ease forwards;
}
@keyframes fadetrail { to { opacity: 0 } }

/* --------------------------------------------------------- story time --- */
.carpetarea {
  position: relative; flex: 1; min-height: 0; border-radius: 16px;
  border: 4px solid #cbb287; padding: 10px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-content: center; justify-items: center; gap: clamp(4px, 1.4vw, 12px);
  background:
    radial-gradient(ellipse at 50% 60%, #d98fa6 0 32%, #c2607a 32% 56%, #a94f66 56%),
    #f4e7cd;
}
.pupil.sitter { max-width: 110px; touch-action: none; }
.pupil.sitter.fidgeting .kid { animation: jiggle .3s ease-in-out infinite; }
.pupil.sitter.holding .kid { animation: none; }
.pupil.sitter .holdring { z-index: 22; }

/* ---------------------------------------------------------------- PE ---- */
.court {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border: 4px solid #cbb287; border-radius: 16px; touch-action: none;
  background: linear-gradient(180deg, #f0e2c4, #dcc79f);
}
.court .net {
  position: absolute; left: 0; right: 0; top: 62%; height: 10%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 3px, transparent 3px 12px);
  border-top: 4px solid rgba(255,255,255,.85);
}
.court .line {
  position: absolute; left: 8%; right: 8%; bottom: 12%; height: 5px;
  background: rgba(255,255,255,.7); border-radius: 3px;
}
.flier {
  position: absolute; transform: translate(-50%,-50%);
  font-size: clamp(30px, 8vw, 50px); line-height: 1; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.28));
}
.flier.notball { filter: drop-shadow(0 3px 4px rgba(0,0,0,.28)) saturate(1.3); }
.flier.whacked { animation: whacked .3s ease forwards; }
@keyframes whacked { to { transform: translate(-50%,-50%) scale(1.9) rotate(90deg); opacity: 0 } }
.flier.fouled { animation: fouled .3s ease forwards; }
@keyframes fouled { to { transform: translate(-50%,-50%) scale(.4); opacity: 0 } }




/* --------------------------------------------------------- ticket booth -- */
.bootharea { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.till {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 10px;
  background: linear-gradient(180deg, #fff, #f6f1fd);
  border: 4px solid #d9cbee; border-radius: 14px;
}
.sale { text-align: center; line-height: 1.5; }
.saleline { font-size: clamp(15px, 4vw, 21px); }
.saletotal { font-size: clamp(17px, 4.6vw, 25px); }
.salepaid { font-size: clamp(14px, 3.6vw, 19px); margin-top: 4px; }
.sale b { color: #6b4299; }
.note { background: #d8f0dc; border-radius: 6px; padding: 1px 8px; }

.handed {
  width: 100%; max-width: 520px; background: #f0e9fb; border: 3px dashed #c4b2e4;
  border-radius: 12px; padding: 8px; text-align: center;
}
.handlabel { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; opacity: .55; }
.handtotal { display: block; font-size: clamp(24px, 7vw, 38px); font-weight: 800; }
.handtotal.exact { color: #2f9c5a; }
.handtotal.over { color: #c8392f; }
.handcoins { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 5px; }
.hcoin { background: #fff; border: 2px solid #c4b2e4; border-radius: 999px; padding: 2px 9px; font-size: clamp(11px, 2.8vw, 14px); font-weight: 800; }

.tillbtns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.clearcoins, .give {
  border-radius: 999px; font-weight: 800; padding: 11px 20px; font-size: clamp(13px, 3.3vw, 16px);
}
.clearcoins { background: #e2d6f4; color: #4a2f6b; box-shadow: 0 4px 0 #c4b2e4; }
.give { background: #34a05a; color: #fff; box-shadow: 0 4px 0 #267943; }
.give:disabled { opacity: .4; }
.clearcoins:active, .give:active { transform: translateY(3px); box-shadow: none; }

.coindrawer {
  flex: none; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center;
  background: #6b4299; border: 4px solid #533280; border-radius: 14px; padding: 9px;
}
.coin {
  background: #f6d97a; color: #4a3410; font-weight: 800;
  font-size: clamp(14px, 3.8vw, 19px); min-width: clamp(56px, 15vw, 78px);
  padding: 12px 8px; border-radius: 999px; border: 3px solid #d8b23c;
  box-shadow: 0 4px 0 #b8942c;
}
.coin:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8942c; }

/* --------------------------------------------------------- safety check -- */
.safearea { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.ridetop {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: #4a2f6b; color: #f3eefb; border-radius: 12px; padding: 8px 12px;
}
.ridename { font-weight: 800; font-size: clamp(14px, 3.8vw, 19px); }
.heightrule { font-size: clamp(10px, 2.5vw, 13px); opacity: .8; }
.carrow {
  flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: center;
  justify-content: center; gap: clamp(4px, 1.4vw, 10px); padding: 8px;
  background: linear-gradient(180deg, #cfe3f5 0 55%, #6b6b78 55%);
  border: 4px solid #d9cbee; border-radius: 14px; transition: transform .5s ease, opacity .5s;
}
.carrow.away { transform: translateX(110%); opacity: 0; }
.seat {
  position: relative; display: flex; flex-direction: column; align-items: center;
  background: #efe7fb; border: 3px solid #c4b2e4; border-radius: 12px;
  padding: 6px 5px 4px; width: clamp(58px, 15vw, 92px);
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.rider { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .2s; }
.rider.small { transform: scale(.66); }
.rider.up { transform: translateY(-9px); animation: wobble .4s ease-in-out infinite; }
@keyframes wobble { 0%,100%{transform:translateY(-9px) rotate(-4deg)} 50%{transform:translateY(-9px) rotate(4deg)} }
.rhead { position: relative; width: clamp(24px, 6.5vw, 34px); aspect-ratio: 1/1.06; border-radius: 42% 42% 46% 46% / 40% 40% 52% 52%; }
.rhair { position: absolute; left: -8%; right: -8%; top: -14%; height: 44%; border-radius: 50% 50% 20% 20%; }
.reye { position: absolute; top: 48%; width: 16%; aspect-ratio: 1; background: #22222c; border-radius: 50%; }
.reye.l { left: 24%; } .reye.r { right: 24%; }
.rbody { width: clamp(28px, 7.5vw, 40px); height: clamp(17px, 4.5vw, 25px); margin-top: -3px; border-radius: 38% 38% 14% 14%; }
.rdrink { position: absolute; right: -30%; bottom: 0; font-size: clamp(14px, 4vw, 20px); }
.lapbar {
  width: 88%; height: 8px; margin-top: 4px; background: #4a2f6b; border-radius: 999px;
  transition: transform .2s; transform-origin: left center;
}
.lapbar.open { transform: rotate(-28deg) translateY(-5px); background: #d8453f; }
.seat .fixed { position: absolute; right: 4px; top: 3px; color: #2f9c5a; font-weight: 800; opacity: 0; }
.seat.sorted .fixed { opacity: 1; }
.seat.sorted { border-color: #7fc9a0; background: #eef9f2; }
.seat.trouble { border-color: #d8453f; background: #fbe4e2; animation: shakesm .3s ease; }
.launch {
  flex: none; background: #c8392f; color: #fff; font-weight: 800;
  font-size: clamp(15px, 4vw, 20px); padding: 13px; border-radius: 999px; box-shadow: 0 5px 0 #8f2721;
}
.launch.ready { background: #34a05a; box-shadow: 0 5px 0 #267943; }
.launch:active { transform: translateY(3px); box-shadow: none; }

/* --------------------------------------------------------- ride control -- */
.ridearea { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.track {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background: linear-gradient(180deg, #bfe0f5 0 60%, #7fae63 60%);
  border: 4px solid #d9cbee; border-radius: 14px;
}
.rail {
  position: absolute; left: 0; right: 0; top: 48%; height: 12px;
  background: repeating-linear-gradient(90deg, #6b5b46 0 10px, #52463a 10px 20px);
  border-top: 4px solid #8a7358; border-bottom: 4px solid #4a3f33;
}
.station {
  position: absolute; left: 0; top: 30%; width: 12%; height: 34%;
  background: rgba(74,47,107,.85); color: #f3eefb; border-radius: 0 10px 10px 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(8px, 2vw, 11px); font-weight: 800; letter-spacing: 1px;
}
.cars { position: absolute; inset: 0; }
.car {
  position: absolute; top: 48%; transform: translate(-50%,-58%);
  font-size: clamp(26px, 7vw, 40px); line-height: 1;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.3));
}
.car.bumped { animation: shakelg .4s ease; }
.queuebar { flex: none; display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid #d9cbee; border-radius: 12px; padding: 7px 11px; }
.queuebar span { font-size: 12px; font-weight: 800; opacity: .65; white-space: nowrap; }
.qb { flex: 1; height: 13px; background: #e2d6f4; border-radius: 999px; overflow: hidden; }
.qb i { display: block; height: 100%; background: linear-gradient(90deg,#7fc9a0,#e8c34f); transition: width .1s linear; }
.qb.long i { background: linear-gradient(90deg,#f0803e,#e0453f); }
.dispatch {
  flex: none; background: #f0b429; color: #3a2a00; font-weight: 800;
  font-size: clamp(15px, 4vw, 20px); padding: 14px; border-radius: 999px; box-shadow: 0 5px 0 #c8920f;
}
.dispatch:active { transform: translateY(3px); box-shadow: none; }
