[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #8fd0ff; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; }
canvas { display: block; position: absolute; inset: 0; }
/* T-035 step 2: the full-screen canvases (3D view, lines) always take the screen size from CSS. renderer.setSize writes a px
   width into the style; after a phone turn that old width (e.g. 844 px) made the page wider than the screen, the page zoomed
   out and stayed wide (innerWidth 844 upright). 100 % of the screen can never make the page wider. */
body > canvas { width: 100% !important; height: 100% !important; }
#lines { pointer-events: none; z-index: 2; }
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; text-shadow: 2px 2px 0 #1a1030, -1px -1px 0 #1a1030; }
#placeBox { position: absolute; left: 24px; top: 14px; font-weight: 900; }
#place { font-size: 84px; color: #ffe14a; }
#placeOf { font-size: 30px; margin-left: 6px; }
#lapBox { position: absolute; right: 24px; top: 18px; font-size: 26px; font-weight: 800; text-align: right; }
#lapBox b { font-size: 40px; }
#time { font-size: 22px; font-variant-numeric: tabular-nums; opacity: 0.9; }
#board { position: absolute; left: 26px; top: 118px; list-style: none; margin: 0; padding: 0 0 0 22px; font-size: 18px; font-weight: 700; }
#board li.me { color: #7fe3ff; }
#board li i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 0 2px #1a1030; }
#speedBox { position: absolute; right: 26px; bottom: 18px; text-align: right; }
#speedBox b { font-size: 76px; font-weight: 900; font-variant-numeric: tabular-nums; }
#speedBox span { font-size: 20px; margin-left: 6px; font-weight: 700; }
#ctlBox { position: absolute; left: 50%; bottom: 18px; width: 220px; margin-left: -110px; text-align: center; font-size: 12px; opacity: 0.85; }
#steerBar { position: relative; height: 8px; border-radius: 4px; background: #ffffff55; }
#steerDot { position: absolute; top: -4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; left: 50%; box-shadow: 0 0 0 2px #1a1030; }
#big { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 140px; font-weight: 900; z-index: 4; pointer-events: none;
  color: #fff; text-shadow: 6px 6px 0 #ff3d8b, -2px -2px 0 #1a1030; font-style: italic; }
/* step 3: the yellow hint line sits at the top middle (step 2: on the car's roof), on a dark strip so it reads on the sky */
#hint { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); max-width: calc(100% - 520px); min-width: 260px; text-align: center;
  font-size: clamp(18px, 2.4vw, 30px); font-weight: 900; z-index: 4; pointer-events: none; line-height: 1.2;
  color: #ffe14a; text-shadow: 2px 2px 0 #1a1030; background: #1a1030b0; border-radius: 12px; padding: 6px 16px; }
#hint:empty { display: none; }
#bump { position: absolute; inset: 0; pointer-events: none; z-index: 3; box-shadow: inset 0 0 120px 30px #ff2a2a; opacity: 0; }
/* T-023 s1: a short dark red ring at the screen edges when you crash in the cabin (game.js cabinShake sets the opacity) */
#cabinHit { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; background: radial-gradient(ellipse 75% 70% at 50% 46%, #0000 52%, #2a0204a8 80%, #120000f2 100%); }
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; background: #1a1030e8; border-radius: 22px; padding: 16px 26px; max-height: calc(100vh - 20px); overflow: auto; box-sizing: border-box;
  min-width: 420px; max-width: 760px; text-align: center; box-shadow: 0 10px 0 #ff3d8b; }
.panel h1 { margin: 0 0 12px; font-size: 54px; font-style: italic; letter-spacing: 2px; }
.panel h1 span { color: #ff3d8b; }
#qrRow { display: flex; gap: 22px; align-items: center; text-align: left; }
#qr { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
#qr svg { width: 180px; height: 180px; }
.panel p { margin: 6px 0; font-size: 17px; line-height: 1.35; }
.small { font-size: 14px !important; color: #cbbdf0; }
button { font: inherit; font-size: 22px; font-weight: 800; color: #fff; border: 0; border-radius: 14px; padding: 12px 30px; margin-top: 14px; background: #ff3d8b; cursor: pointer; }
.credits { font-size: 11px !important; color: #9d90c4; margin-top: 14px !important; }
#endBoard { text-align: left; display: inline-block; font-size: 22px; font-weight: 700; margin: 6px 0; }
#endBoard li.me { color: #7fe3ff; }
#endTime { font-size: 24px !important; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; background: #8fd0ff; z-index: 9; text-shadow: 2px 2px 0 #1a1030; }
/* step 11c: the numbers panel (tests only) sits top left, so it never covers the POLICE tag (bottom left) */
#nums { position: absolute; left: 8px; top: 104px; margin: 0; z-index: 6; font: 12px/1.35 ui-monospace, monospace; background: #000a; padding: 6px 8px; border-radius: 6px; color: #9f9; }
/* step 4: Route A / Route B on the start screen (the chosen one is pink, the other one dark) */
#routeRow { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
#routeRow button { margin-top: 0; padding: 8px 18px; font-size: 20px; background: #3a2f63; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; max-width: 300px; }
#routeRow button small { font-size: 12px; font-weight: 500; opacity: 0.85; margin-top: 2px; }
#routeRow button.on { background: #ff3d8b; border-color: #fff; }
/* step 5: sound on/off (key M). Bottom left, small, always there */
#muteBtn { position: absolute; left: 16px; bottom: 14px; z-index: 8; margin: 0; padding: 8px 14px; font-size: 15px; font-weight: 800; border-radius: 12px; background: #1a1030c8; border: 2px solid #ffffff66; }
#muteBtn.off { background: #5a1030d0; border-color: #ff3d8b; }
#soundTip { color: #ffe14a !important; }
/* step 6: A-to-B race. Distance to the finish, a progress bar with the 3 cars, the next turn, a small map */
#lapBox .lbl { font-size: 18px; }
#prog { position: absolute; left: 50%; top: 84px; width: min(46vw, 520px); transform: translateX(-50%); height: 26px; }
#progLine { position: absolute; left: 0; right: 0; top: 11px; height: 5px; border-radius: 3px; background: #ffffffaa; box-shadow: 0 0 0 2px #1a1030; }
#prog .flag { position: absolute; right: -14px; top: -6px; font-style: normal; font-size: 24px; }
#prog .pm { position: absolute; top: 4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; box-shadow: 0 0 0 2px #1a1030; left: 0; }
#prog .pm.me { background: #2bd4ff; width: 22px !important; height: 22px !important; top: 2px !important; margin-left: -11px !important; z-index: 2; }
/* step 9 (D-411): the turn sign, cartoon racing style. Big chevrons (1 = easy curve, 2 = turn, 3 = SHARP), bright with a
   thick dark outline, always in the same spot under the race line. It pops in early, grows as the turn comes (--ts,
   set by game.js from settings hud.sign*), the chevrons run in the turn direction, and it flashes close to the turn. */
#turn { position: absolute; left: 50%; top: 108px; transform: translateX(-50%) scale(var(--ts, 1)); transform-origin: 50% 0; pointer-events: none; z-index: 3; }
#turnCard { display: flex; flex-direction: column; align-items: center; }
#turn.pop #turnCard { animation: signPop 0.45s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes signPop { 0% { transform: scale(0.2) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
#turnSvg { width: 228px; height: 95px; display: block; overflow: visible; filter: drop-shadow(0 5px 0 #1a1030) drop-shadow(0 0 12px var(--glow, #ffc21a)); }
#turnSvg .chev { animation: chevRun 0.72s linear infinite; }
#turnSvg .chev:nth-of-type(2) { animation-delay: 0.14s; }
#turnSvg .chev:nth-of-type(3) { animation-delay: 0.28s; }
@keyframes chevRun { 0%, 100% { opacity: 0.5; } 28% { opacity: 1; } }
#turn.flash #turnCard { animation: signFlash 0.3s ease-in-out infinite alternate; }
@keyframes signFlash { from { filter: brightness(1); } to { filter: brightness(1.55); } }
#turnText { display: flex; gap: 12px; align-items: baseline; margin-top: -4px; font-style: italic; font-weight: 900; letter-spacing: 1px; white-space: nowrap;
  -webkit-text-stroke: 8px #1a1030; paint-order: stroke fill; text-shadow: 0 4px 0 #1a1030; }
#turnWord { font-size: 30px; color: var(--c0, #ffe066); }
#turnWord:empty { display: none; }
#turnDist { font-size: 34px; color: #fff; font-variant-numeric: tabular-nums; }
/* step 7 (D-403): the map in the bottom right corner (the speed number is gone: speed is on the phone only) */
/* step 9 (D-411): much smaller; the size is settings hud.mapSize (game.js sets --mapK), hud.map = false hides it */
#mapBox { position: absolute; right: 14px; bottom: 14px; width: calc(min(40vh, 34vw) * var(--mapK, 1)); height: calc(min(40vh, 34vw) * var(--mapK, 1)); border-radius: max(10px, calc(18px * var(--mapK, 1))); background: #1a1030c8; box-shadow: 0 0 0 3px #ffffffcc, 0 6px 0 #1a1030; overflow: hidden; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; }
#mapLbl { position: absolute; left: 10px; top: 6px; font-size: 13px; font-weight: 900; letter-spacing: 2px; opacity: 0.75; }
#lapLine { font-size: 30px; font-weight: 900; color: #ffe14a; }
#soundHud { position: absolute; left: 16px; bottom: 62px; font-size: 18px; font-weight: 900; color: #ffe14a; background: #1a1030c0; padding: 6px 12px; border-radius: 10px; }
/* step 7: race kind and car on the start screen */
.pickLbl { font-size: 13px; font-weight: 900; letter-spacing: 3px; color: #ffb3d1; margin-top: 12px; }
.pickRow { display: flex; gap: 10px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.pickRow button { margin-top: 0; padding: 8px 14px; font-size: 20px; background: #3a2f63; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; min-width: 120px; max-width: 280px; }
.pickRow button small { font-size: 12px; font-weight: 500; opacity: 0.85; margin-top: 2px; }
.pickRow button.on { background: #ff3d8b; border-color: #fff; }
#carRow button { min-width: 0; font-size: 16px; padding: 6px 10px; }
#endGaps { font-size: 16px !important; }

/* step 8 (D-404): big text pops in with a neon glow; colours per text (3 red, 2 orange, 1 yellow, GO green) */
#big.pop { animation: bigPop 0.5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bigPop { 0% { transform: scale(2.4); opacity: 0; } 55% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1); } }
#big[data-k="3"] { text-shadow: 0 0 22px #ff2040, 0 0 50px #ff2040, 6px 6px 0 #a0102a; }
#big[data-k="2"] { text-shadow: 0 0 22px #ff8a1c, 0 0 50px #ff8a1c, 6px 6px 0 #a04a00; }
#big[data-k="1"] { text-shadow: 0 0 22px #ffe14a, 0 0 50px #ffe14a, 6px 6px 0 #a08000; }
#big[data-k="GO!"] { font-size: 190px; text-shadow: 0 0 26px #20ff70, 0 0 70px #20ff70, 8px 8px 0 #0a8040; }
#big[data-k="PHONE LOST"] { font-size: 120px; color: #fff; text-shadow: 0 0 22px #ff2040, 0 0 50px #ff2040, 6px 6px 0 #1a1030; animation: lostBlink 1s steps(2) infinite; }
@keyframes lostBlink { 50% { opacity: 0.55; } }
#big[data-k="YOU WIN!"] { font-size: 150px; text-shadow: 0 0 26px #ffd040, 0 0 70px #ff9a20, 8px 8px 0 #ff3d8b; }
/* the result panel after the finish show: slides in on the right, so the car stays visible on the left */
#end.pop { left: auto; right: 4%; transform: translate(0, -50%); animation: endIn 0.6s cubic-bezier(.2, 1.3, .4, 1); box-shadow: 0 0 0 3px #ff3d8b, 0 0 40px #ff3d8b88; }
@keyframes endIn { 0% { transform: translate(120%, -50%); } 100% { transform: translate(0, -50%); } }
#endBoard { list-style: none; padding: 0; min-width: 380px; }
#endBoard li { display: grid; grid-template-columns: 34px 14px 1fr auto 118px; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 8px; }
#endBoard li:nth-child(odd) { background: #ffffff10; }
#endBoard li.me { background: #2bd4ff30; }
#endBoard li i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
#endBoard .md { font-size: 22px; text-align: center; }
#endBoard .tm { font-variant-numeric: tabular-nums; }
#endBoard .gp { font-size: 15px; color: #cbbdf0; text-align: right; font-variant-numeric: tabular-nums; }
/* during the finish show the map and the progress bar step aside */
body.endshow #mapBox, body.endshow #prog, body.endshow #turn { opacity: 0; transition: opacity 0.6s; }
/* step 8b (Huell round 7, fix 5): on low windows (1280x720 laptop) the start panel is tighter, so the credits
   (CC-BY names) show without scrolling. Taller windows look the same as before. */
@media (max-height: 820px) {
  #wait.panel { padding: 10px 26px 12px; }
  #wait h1 { font-size: 44px; margin-bottom: 4px; }
  #wait #qr svg { width: 150px; height: 150px; }
  #wait p { margin: 3px 0; line-height: 1.28; }
  #wait .small { font-size: 13px !important; }
  #wait .pickLbl { margin-top: 4px; }
  #wait #startBtn { margin-top: 8px; padding: 9px 30px; }
  #wait .credits { margin-top: 8px !important; line-height: 1.3; font-size: 11px !important; color: #b4a8da; }
}

/* step 11 (D-416): police near you: a red / blue flashing tag, bottom left */
#cop { position: fixed; left: 24px; bottom: 110px; z-index: 6; font: 900 22px/1 system-ui, sans-serif; letter-spacing: 2px;
  padding: 8px 18px; border-radius: 12px; color: #fff; background: #ff1838; border: 3px solid #fff; box-shadow: 0 0 18px #ff1838; pointer-events: none; }
#cop.b { background: #2050ff; box-shadow: 0 0 18px #2050ff; }

/* ---------- T-032 step R1: the realistic game. Calmer texts: no neon colours, no italic cartoon text (the full HUD is step R2) ---------- */
html, body { background: #05070c; }
#hud { text-shadow: 0 1px 3px #000c, 0 0 1px #000; }
#place { color: #fff; }
#big, #big[data-k] { font-style: normal; font-weight: 800; letter-spacing: 0.04em; color: #fff; font-size: 110px;
  text-shadow: 0 2px 10px #000b, 0 0 2px #000; }
#big[data-k="GO!"] { font-size: 130px; color: #b8ffcc; }
#big[data-k="3"], #big[data-k="2"], #big[data-k="1"] { color: #ffd0c8; }
#big.pop { animation: bigFade 0.35s ease-out; }
@keyframes bigFade { 0% { opacity: 0; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
.panel { background: #0b0e14ee; box-shadow: 0 8px 30px #000a; border: 1px solid #ffffff22; }
#end.pop { box-shadow: 0 8px 30px #000a; }
#hint { color: #ffe9a8; background: #000a; text-shadow: none; }
#lines { display: none; }
.panel h1 { font-style: normal; }   /* no anime speed lines */
h1 .real { font-size: 0.42em; letter-spacing: 0.25em; color: #9fb4c8; vertical-align: middle; margin-left: 8px; }

/* ---------- T-032 step R2: calm realistic HUD (real car game style): white / grey, thin font, small, no cartoon boxes ---------- */
#hud { font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; text-shadow: 0 1px 4px #000d; color: #f2f4f6; }
#hud .lbl, #lapBox .lbl { font-size: 13px; font-weight: 500; letter-spacing: 0.18em; color: #b9c0c8; }
#placeBox { left: 28px; top: 22px; font-weight: 300; display: flex; align-items: baseline; gap: 6px; }
#placeBox .lbl { margin-right: 4px; }
#place { font-size: 52px; font-weight: 300; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
#placeOf { font-size: 22px; font-weight: 300; color: #c8ced5; margin-left: 0; }
#board { left: 30px; top: 86px; padding: 0; font-size: 14px; font-weight: 400; color: #c8ced5; line-height: 1.5; }
#board li.me { color: #fff; font-weight: 600; }
#board li i { width: 7px; height: 7px; margin-right: 8px; box-shadow: none; vertical-align: 1px; }
#lapBox { right: 28px; top: 22px; font-size: 16px; font-weight: 300; }
#lapBox b { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; }
#lapBox #togoU { font-size: 16px; color: #c8ced5; }
#time { font-size: 20px; font-weight: 300; opacity: 1; color: #dfe3e8; margin-top: 2px; }
#prog { top: 30px; width: min(34vw, 420px); height: 14px; }
#progLine { top: 6px; height: 2px; border-radius: 1px; background: #ffffff66; box-shadow: none; }
#prog .flag { right: -16px; top: -2px; font: 600 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; color: #fff; }
#prog .pm { top: 3px; width: 8px; height: 8px; margin-left: -4px; box-shadow: 0 0 0 1px #000a; }
#prog .pm.me { width: 12px !important; height: 12px !important; top: 1px !important; margin-left: -6px !important; background: #fff !important; }
#speedBox { right: auto; left: 50%; bottom: 40px; transform: translateX(-50%); text-align: center; }
#speedBox b { font-size: 44px; font-weight: 300; }
#speedBox span { font-size: 14px; color: #c8ced5; }
#ctlBox { width: 160px; margin-left: -80px; bottom: 14px; opacity: 0.55; }
#steerBar { height: 3px; background: #ffffff44; }
#steerDot { top: -4px; width: 10px; height: 10px; margin-left: -5px; box-shadow: none; }
#src { font-size: 10px; color: #c8ced5; margin-top: 3px; }
/* the turn sign: a real yellow road sign (drawn by game.js), calm fade in, no bounce, no glow, no words */
#turn { top: 62px; }
#turnSvg { width: 112px; height: 102px; filter: drop-shadow(0 2px 6px #000a); }
#turn.pop #turnCard { animation: signIn 0.4s ease-out; }
@keyframes signIn { 0% { opacity: 0; } 100% { opacity: 1; } }
#turn.flash #turnCard { animation: none; }
#turnText { margin-top: 4px; font-style: normal; font-weight: 400; letter-spacing: 0; -webkit-text-stroke: 0; text-shadow: 0 1px 4px #000d; }
#turnDist { font-size: 16px; color: #f2f4f6; }
/* the corner map: dark glass, thin edge */
#mapBox { background: #0a0d12dd; box-shadow: 0 0 0 1px #ffffff2e; border-radius: 8px; }
#mapLbl { display: none; }
/* big texts: thin, calm, smaller */
#big, #big[data-k] { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; font-size: 88px; letter-spacing: 0.06em; color: #fff; text-shadow: 0 2px 12px #000c; animation: none; }
#big[data-k="GO"] { font-size: 96px; color: #e8fff0; }
#big[data-k="3"], #big[data-k="2"], #big[data-k="1"] { color: #fff; }
#big[data-k="500 m to go"] { font-size: 34px; letter-spacing: 0.12em; top: 22%; }
#big[data-k="WRONG WAY"] { font-size: 54px; color: #ffd7cf; }
#big[data-k="PHONE LOST"] { font-size: 60px; text-shadow: 0 2px 12px #000c; }
#big[data-k$="place"] { font-size: 64px; }
#big.pop { animation: bigFade 0.35s ease-out; }
#hint { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 400; font-size: 18px; color: #f2f4f6; background: #000000a0; border-radius: 6px; top: 56px; }
#bump { box-shadow: inset 0 0 120px 20px #ff2a2a88; }
/* panels: dark glass, white text, grey buttons (no pink) */
.panel { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background: #0b0e14f0; border-radius: 10px; box-shadow: 0 10px 40px #000c; border: 1px solid #ffffff1f; }
.panel h1 { font-weight: 300; letter-spacing: 0.08em; font-size: 42px; }
.panel h1 span { color: #fff; font-weight: 500; }
.small { color: #aab3bd; }
.credits { color: #7f8892; }
.pickLbl { color: #9aa3ad; font-weight: 500; letter-spacing: 0.2em; }
button { font-family: inherit; font-weight: 500; border-radius: 6px; background: #e8ecf0; color: #10141a; }
.pickRow button, #routeRow button { background: #1d242d; color: #e8ecf0; border: 1px solid #ffffff22; }
.pickRow button.on, #routeRow button.on { background: #e8ecf0; color: #10141a; border-color: #fff; }
#muteBtn { font-weight: 400; font-size: 13px; background: #0b0e14c0; border: 1px solid #ffffff33; border-radius: 6px; color: #e8ecf0; }
#muteBtn.off { background: #0b0e14c0; border-color: #ffffff55; }
#soundHud { color: #f2f4f6; background: #000000a0; font-weight: 400; font-size: 14px; border-radius: 6px; }
#loading { background: #05070c; text-shadow: none; font-weight: 300; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
#end.pop { box-shadow: 0 10px 40px #000c; animation: endFade 0.6s ease-out; }
@keyframes endFade { 0% { opacity: 0; transform: translate(30px, -50%); } 100% { opacity: 1; transform: translate(0, -50%); } }
#endPlace { font-weight: 300; }
#endBoard { font-size: 18px; font-weight: 400; }
#endBoard li.me { background: #ffffff1c; color: #fff; font-weight: 600; }
#endBoard .md { font-size: 16px; color: #aab3bd; }
#endBoard .gp { color: #aab3bd; }
#turnSvg, #turnSvg text { text-shadow: none; }
/* ---------- T-032 step R3 (Huell round R1 fix 1): the HUD must read on the white tunnel walls too ----------
   A soft dark shade in the two top corners (behind POS + the driver list, and behind TO FINISH + the time), no hard
   edges, plus a slightly stronger soft text shadow. On the dark night road it is almost not seen. */
#hud::before, #hud::after { content: ""; position: absolute; top: 0; width: 360px; height: 260px; pointer-events: none; z-index: -1; }
#hud::before { left: 0; background: radial-gradient(ellipse 100% 100% at 0 0, #04070cb8 0%, #04070c80 42%, #04070c00 100%); }
#hud::after { right: 0; width: 330px; height: 150px; background: radial-gradient(ellipse 100% 100% at 100% 0, #04070cb8 0%, #04070c80 42%, #04070c00 100%); }
#hud { isolation: isolate; text-shadow: 0 1px 2px #000e, 0 0 8px #000a; }
#board li { text-shadow: 0 1px 2px #000e, 0 0 6px #000c; }
/* T-022 step 3 (Ruby round-T022 point 1): in the cabin view the race list sits in two short columns under POS (1-3, 4-6),
   so it ends above the middle mirror in all 5 cars; game.js boardGuard lifts it a little more if a mirror still comes close */
#hud.cabin #board { display: grid; grid-auto-flow: column; grid-template-rows: repeat(3, auto); column-gap: 18px; line-height: 1.35; transition: transform 0.3s; }
#progLine { box-shadow: 0 0 0 1px #0006, 0 1px 4px #0008; }
#prog .flag { text-shadow: 0 1px 3px #000e; }

/* ---------- T-032 step R6: the Sydney maps on the start screen (map 1 open, the others locked until top 3) ---------- */
#mapRow button { min-width: 170px; }
#mapRow button b { font-weight: 500; font-size: 17px; }
#mapRow button .mt { font-size: 14px; font-weight: 400; margin-top: 1px; }
#mapRow button.lock { opacity: 0.55; cursor: default; }
#mapRow button.soon { opacity: 0.8; }
#mapRow button .lk { font-size: 12px; margin-top: 3px; color: #c9d0d8; }
#mapRow button.on .lk { color: #3a4450; }
#mapNote { margin-top: 4px !important; color: #e8ecf0 !important; }
#endUnlock, #endCar { margin: 8px 0 2px; font-size: 18px; color: #e8ecf0; }
#endUnlock.open, #endCar.open { color: #fff; font-weight: 600; }
#endUnlock:empty, #endCar:empty { display: none; }
/* the police tag in the calm HUD: a small dark pill with a red and a blue lamp that flash (no big neon box) */
#cop { left: 24px; bottom: 110px; font: 600 15px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 0.22em; padding: 8px 14px 8px 12px;
  border-radius: 6px; color: #f2f4f6; background: #0b0e14d0; border: 1px solid #ffffff33; box-shadow: 0 4px 16px #0008; display: flex; align-items: center; gap: 6px; }
#cop[hidden] { display: none; }
#cop i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #3a1018; }
#cop i.u { background: #101a3a; margin-right: 6px; }
#cop i.r { background: #ff1838; box-shadow: 0 0 10px #ff1838; }
#cop.b { background: #0b0e14d0; box-shadow: 0 4px 16px #0008; }
#cop.b i.r { background: #3a1018; box-shadow: none; }
#cop.b i.u { background: #2f63ff; box-shadow: 0 0 10px #2f63ff; }
#mapsBtn { background: #1d242d; color: #e8ecf0; border: 1px solid #ffffff33; margin-left: 8px; }

/* T-003 step 2: the car menu (picture, name, what it is good at, bars for the numbers, lock) */
#carRow { gap: 8px; }
#carRow button { width: 168px; max-width: 168px; padding: 6px 6px 8px; font-size: 16px; align-items: stretch; text-align: left; }
#carRow button .pic { display: block; height: 66px; border-radius: 6px; overflow: hidden; background: #0e131a; margin-bottom: 4px; }
#carRow button .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
#carRow button .pic img:not([src]) { visibility: hidden; }
#carRow button b { display: block; }
#carRow button small { display: block; min-height: 28px; line-height: 14px; }
#carRow .bars { display: block; margin-top: 4px; }
#carRow .st { display: flex; align-items: center; gap: 6px; font-size: 11px; line-height: 13px; }
#carRow .st i { font-style: normal; width: 56px; opacity: 0.8; flex: none; }
#carRow .st q { flex: none; width: 50px; text-align: right; quotes: none; font-variant-numeric: tabular-nums; }
#carRow .st.wt q { flex: 1; width: auto; text-align: left; }
#carRow .st em { flex: 1; height: 6px; border-radius: 3px; background: #ffffff1c; overflow: hidden; }
#carRow .st u { display: block; height: 100%; background: #6fb6ff; text-decoration: none; }
#carRow button.on .st em { background: #10141a22; }
#carRow button.on .st u { background: #1e63ff; }
#carRow button .lk { display: block; font-size: 12px; margin-top: 4px; color: #ffcf5a; }
#carRow button.on .lk { color: #8a5a00; }
#carRow button.lock { cursor: default; }
#carRow button.lock .pic img { filter: grayscale(0.7) brightness(0.55); }
#carRow button.lock .bars, #carRow button.lock b, #carRow button.lock small { opacity: 0.55; }
#wait.panel { max-width: 940px; width: min(940px, calc(100vw - 20px)); }
/* T-035: on a phone (narrower than 500 px) the old start panel's 420 px minimum width made the whole page 405 px wide, so
   the phone zoomed out a little and everything fixed to the screen edge sat off screen. Phones only. */
@media (max-width: 500px) { .panel { min-width: 0; } }
/* T-047 (Nasi, open T-046 point): the race end panel on phones. Upright (narrow): it was ~60 px wider than the screen and its
   left edge was cut ('ondon 1 · A40 Westway'); now it sits inside the screen with 8 px edges, the board fits the width.
   Sideways (short): the buttons were below the screen (the panel had to scroll); now it is compact. Laptop sizes unchanged. */
@media (max-width: 520px) {
  #end.pop { left: 8px; right: 8px; transform: translate(0, -50%); padding: 12px 12px; }
  #end h1 { font-size: 32px; margin-bottom: 6px; }
  #end p { font-size: 15px; }
  #endTime { font-size: 18px !important; }
  #endBoard { min-width: 0; width: 100%; font-size: 15px; }
  #endBoard li { grid-template-columns: 20px 10px 1fr auto 92px; gap: 5px; padding: 3px 4px; }
  #endBoard li i { width: 10px; height: 10px; }
  #endBoard .md { font-size: 14px; }
  #endBoard .gp { font-size: 13px; }
}
@media (max-height: 500px) {
  #end.pop { padding: 8px 18px; }
  #end h1 { font-size: 28px; margin: 0 0 2px; }
  #end p { font-size: 14px; margin: 3px 0; }
  #endTime { font-size: 16px !important; }
  #endBoard { font-size: 14px; margin: 2px 0; }
  #endBoard li { padding: 1px 8px; }
  #end button { padding-top: 6px; padding-bottom: 6px; margin-top: 4px; }
}
