:root {
  --red: #ff3b2f; --red2: #c4161c; --cyan: #29d8ff; --gold: #ffc21a; --ink: #07090c; --panel: rgba(8, 10, 14, 0.86); --line: rgba(255, 255, 255, 0.14);
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif; --sans: "Barlow", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050608; }
body { font-family: var(--sans); color: #fff; user-select: none; -webkit-user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
b { font-weight: inherit; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease .1s; }
body.racing #hud, body.counting #hud { opacity: 1; }
body.menu #hud > :not(#pops) { opacity: 0; transition: opacity .4s; }

.hud-motion-layer { position: absolute; inset: 0; overflow: visible; }
#hudMotionCluster { transform-origin: calc(100% - 188px) calc(100% - 176px); }
#hudMotionMap { transform-origin: 153px calc(100% - 151px); }
#hudMotionFar { transform-origin: 50% 60px; }

.slant { clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%); }

/* position block */
#posBox { position: absolute; left: 28px; top: 24px; display: flex; align-items: stretch; gap: 0; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
#posBox .pos { font-family: var(--cond); font-style: italic; font-weight: 900; line-height: 1; display: flex; align-items: flex-start;
  background: var(--red); padding: 4px 26px 2px 18px; clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%); }
#posBox.p1 .pos { background: linear-gradient(100deg, #ffcf2a, #ff9f0a); color: var(--ink); }
#posN { font-size: 92px; letter-spacing: -2px; }
#posSuf { font-size: 30px; margin: 10px 0 0 2px; }
#posBox .of { font-size: 30px; margin: 54px 0 0 2px; opacity: .55; }
#posBox .rows { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 6px 30px 6px 26px; margin-left: -14px; background: var(--panel);
  clip-path: polygon(18px 0, 100% 0, calc(100% - 18px) 100%, 0 100%); min-width: 214px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.row .k { font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .2em; color: #8f99a6; }
.row b { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.row.rv .k { color: var(--cyan); }
#gap.ahead { color: #6dff9b; } #gap.behind { color: #ff6b5f; }

/* route progress */
#routeBox { position: absolute; left: 50%; top: 26px; width: min(560px, 33vw); transform: translateX(-50%); }
#routeBox .rt { display: flex; align-items: baseline; gap: 12px; font-family: var(--cond); font-weight: 800; letter-spacing: .14em; font-size: 15px; text-shadow: 0 2px 8px rgba(0,0,0,.7); white-space: nowrap; }
#rZone { font-style: italic; font-size: 22px; letter-spacing: .06em; }
#routeBox .sep { width: 18px; height: 3px; background: var(--red); transform: skewX(-30deg) translateY(-5px); }
#rRoad { color: #c3cbd4; font-weight: 600; font-size: 14px; }
#rToGo { margin-left: auto; color: var(--gold); }
#rbar { position: relative; height: 10px; margin-top: 8px; }
#rbar::before { content: ""; position: absolute; inset: 0; background: rgba(8,10,14,.75); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
#rfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(255,59,47,.25), var(--red)); }
#rticks .t { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.35); }
#rticks .l { position: absolute; top: 15px; transform: translateX(-50%); font-family: var(--cond); font-weight: 700; font-size: 11px; letter-spacing: .12em; color: rgba(255,255,255,.7); text-shadow: 0 1px 4px #000; white-space: nowrap; }
#routeBox .mk { position: absolute; top: -7px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid #fff; margin-left: -8px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
#rMe { border-top-color: #fff !important; }
#rRival { border-top-color: var(--cyan) !important; }
#routeBox .flag { position: absolute; right: -2px; top: -6px; width: 16px; height: 22px; background: conic-gradient(#fff 0 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 8px 8px; }

/* style / combo */
#styleBox { position: absolute; right: 28px; top: 24px; text-align: right; font-family: var(--cond); }
#styleBox .k { font-weight: 700; letter-spacing: .24em; font-size: 14px; color: #8f99a6; }
#style { display: block; font-style: italic; font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 3px 14px rgba(0,0,0,.6); }
#combo { margin-top: 6px; display: inline-block; padding: 3px 16px; font-style: italic; font-weight: 900; font-size: 22px; background: var(--gold); color: var(--ink);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); opacity: 0; transform: translateX(20px); transition: opacity .25s, transform .25s; }
#combo.on { opacity: 1; transform: none; }

/* minimap */
#mapBox { position: absolute; left: 28px; bottom: 26px; width: 250px; height: 250px; background: #0b1622;
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px)); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#mapBox::after { content: ""; position: absolute; inset: 0; border: 2px solid rgba(255,255,255,.18); clip-path: inherit; pointer-events: none; }
#minimap { width: 100%; height: 100%; display: block; }
#mapBox .north { position: absolute; top: 8px; left: 10px; font-family: var(--cond); font-weight: 800; font-size: 13px; color: var(--red); }
#mapLabel { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 36px; text-align: right; font-family: var(--cond); font-weight: 800; letter-spacing: .16em; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.65)); }

/* dial */
#dialBox { position: absolute; right: 18px; bottom: 6px; width: 340px; height: 340px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); }
#tacho { width: 100%; height: 100%; }
/* the speed-limit sign (behaviour: Hud.setLimit in src/hud.js). Calm under the limit. Over it ([data-over]) the sign
   flashes red four times, then holds lit with a red halo until you are back under, like a car's speed-limit assist.
   The flash is an opacity fade on a red disc layered under the numerals, so it stays on the compositor. */
#limitSign { position: absolute; left: -70px; bottom: 58px; width: 62px; height: 62px; border-radius: 50%;
  background: #f7f7f4; border: 8px solid #c8102e; box-sizing: border-box; box-shadow: 0 2px 10px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; transition: box-shadow .3s; }
#limitSign::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; background: #e3122f; opacity: 0; pointer-events: none; }
#limitSign[hidden] { display: none; }
#limitV { position: relative; z-index: 1; font: 900 26px system-ui, sans-serif; letter-spacing: -.02em; color: #111314; }
#limitSign[data-src="inferred"] { opacity: .85; }
#limitSign[data-over] { opacity: 1; box-shadow: 0 0 0 3px rgba(255,46,61,.55), 0 0 22px 7px rgba(255,46,61,.8), 0 2px 10px rgba(0,0,0,.45); }
#limitSign[data-flashing]::after { animation: limitFlash .7s ease-in-out 4; }
#limitSign[data-flashing] #limitV { animation: limitFlashV .7s ease-in-out 4; }
@keyframes limitFlash { 0%, 100% { opacity: 0; } 45%, 60% { opacity: 1; } }
@keyframes limitFlashV { 0%, 100% { color: #111314; } 45%, 60% { color: #fff; } }
@media (prefers-reduced-motion: reduce) { #limitSign[data-flashing]::after, #limitSign[data-flashing] #limitV { animation: none; } }

/* popups */
#pops { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); white-space: nowrap; font-family: var(--cond); font-style: italic; font-weight: 900; text-align: center;
  animation: pop 1.3s cubic-bezier(.16,1.3,.4,1) forwards; text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.5); }
.pop small { display: block; font-size: 22px; font-weight: 800; letter-spacing: .12em; font-style: italic; }
.pop.opa { font-size: 120px; color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; letter-spacing: -.01em; }
.pop.opa small { color: #fff; -webkit-text-stroke: 0; }
.pop.near { top: 31%; left: auto; right: 6vw; transform: translate(0, -50%); font-size: 40px; color: #fff; text-align: right; animation-name: popR; }
.pop.near small { color: var(--gold); font-size: 20px; }
.pop.near.onc { color: var(--cyan); }
.pop.info { top: 24%; font-size: 30px; letter-spacing: .06em; padding: 4px 26px; background: rgba(8,10,14,.85); clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.pop.info.good { background: linear-gradient(100deg, #ffcf2a, #ff9f0a); color: var(--ink); text-shadow: none; }
.pop.info.bad { background: var(--red); }
.pop.info.cyan { background: var(--cyan); color: var(--ink); text-shadow: none; }
@keyframes popR { 0% { opacity: 0; transform: translate(40px, -50%) scale(.6) skewX(-8deg); } 14% { opacity: 1; transform: translate(0, -54%) scale(1.1) skewX(-8deg); }
  28% { transform: translate(0, -55%) scale(1) skewX(-8deg); } 76% { opacity: 1; } 100% { opacity: 0; transform: translate(0, -120%) scale(.96) skewX(-8deg); } }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) skewX(-8deg); } 14% { opacity: 1; transform: translate(-50%, -54%) scale(1.12) skewX(-8deg); }
  28% { transform: translate(-50%, -55%) scale(1) skewX(-8deg); } 76% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -95%) scale(.96) skewX(-8deg); } }

/* district banner */
#banner { position: absolute; left: 0; top: 17%; padding: 10px 70px 12px 46px; opacity: 0; transform: translateX(-110%); background: linear-gradient(90deg, rgba(8,10,14,.92), rgba(8,10,14,.7));
  clip-path: polygon(0 0, 100% 0, calc(100% - 40px) 100%, 0 100%); border-left: 8px solid var(--red); }
#banner.show { animation: ban 4.2s cubic-bezier(.2,1,.25,1) forwards; }
#banner .b1 { font-family: var(--cond); font-style: italic; font-weight: 900; font-size: 64px; line-height: .95; letter-spacing: .01em; }
#banner .b2 { font-family: var(--cond); font-weight: 700; font-size: 17px; letter-spacing: .2em; color: #c3cbd4; margin-top: 4px; }
@keyframes ban { 0% { opacity: 0; transform: translateX(-110%); } 10% { opacity: 1; transform: translateX(0); } 80% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(-30%); } }

/* countdown */
#count { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-family: var(--cond); font-style: italic; font-weight: 900; font-size: 210px; line-height: 1; letter-spacing: -.02em;
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 10px 40px rgba(0,0,0,.6); }
#count.tick { animation: tick .55s cubic-bezier(.2,1.4,.4,1) both; }
#count.go { color: var(--gold); animation: go 1s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes tick { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: .0; transform: translate(-50%, -50%) scale(.85); } }
@keyframes go { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) skewX(-10deg); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) skewX(-10deg); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) skewX(-10deg); } }

#msg { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); font-family: var(--cond); font-weight: 800; letter-spacing: .16em; font-size: 17px; padding: 6px 22px; background: rgba(8,10,14,.82);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); opacity: 0; transition: opacity .4s; white-space: nowrap; }
#msg.on { opacity: 1; }
#msg i { font-style: normal; color: var(--gold); }
#keys { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 18px; padding: 6px 14px; border-radius: 4px; background: rgba(8,10,14,.55); font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .14em; color: rgba(255,255,255,.8); white-space: nowrap; transition: opacity 1s; }
#keys i { display: inline-block; font-style: normal; color: #07090c; background: #e9edf1; padding: 1px 6px; margin-right: 6px; border-radius: 3px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); font-weight: 800; letter-spacing: .05em; }
body[data-input=gamepad] #keys, body[data-input=touch] #keys { display: none; }
body.started #keys { opacity: 0; }

#credit { position: fixed; right: 10px; bottom: 4px; font-family: var(--sans); font-size: 10px; color: rgba(255,255,255,.7); text-shadow: 0 1px 2px #000; z-index: 20; }
#credit a { color: inherit; }

/* ---------------------------------------------------------------- loading screen (src/ui/loading.js) */
#loading { position: fixed; inset: 0; z-index: 40; overflow: hidden; background: radial-gradient(110% 90% at 72% 42%, #13212c 0%, #080b0f 62%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility .45s; font-family: var(--cond); color: #fff; }
#loading.open { opacity: 1; visibility: visible; pointer-events: auto; }
#loading .ld-art { position: absolute; top: 4vh; bottom: 4vh; right: 2vw; width: min(62vw, 150vh); display: grid; place-items: center; opacity: .9; }
#loading .ld-art svg { width: 100%; height: 100%; }
#loading .ld-route { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s cubic-bezier(.2,.9,.3,1); filter: drop-shadow(0 0 6px rgba(255,59,47,.6)); }
#loading .ld-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,11,15,.96) 0%, rgba(8,11,15,.75) 34%, rgba(8,11,15,0) 62%), linear-gradient(0deg, rgba(8,11,15,.95), rgba(8,11,15,0) 32%); }
#loading .ld-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(1rem, 5vh, 3.5rem) clamp(1rem, 5vw, 6rem) clamp(1rem, 4vh, 3rem); }
#loading .ld-map { align-self: center; max-width: min(36rem, 100%); }
#loading .ld-map .kick { display: flex; align-items: center; gap: .6em; }
#loading .ld-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); }
#loading h1 { margin: .4rem 0 0; font-style: italic; font-weight: 900; font-size: min(5.2rem, 14vw, 16vh); line-height: .9; letter-spacing: .005em; }
#loading #ldSub { margin: .6rem 0 0; font-family: var(--sans); font-weight: 600; font-size: 1.15rem; color: #c7ced6; }
#loading .ld-foot { display: grid; gap: .55rem; max-width: 60rem; }
#loading .ld-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 800; letter-spacing: .24em; font-size: .875rem; color: #c7ced6; }
#loading #lpct { font-style: italic; font-size: 1.25rem; letter-spacing: .04em; color: #fff; font-variant-numeric: tabular-nums; }
#loading .ld-bar { height: 5px; }
#loading .ld-tip { display: flex; align-items: baseline; gap: .8rem; margin: .5rem 0 0; min-height: 2.6em; font-family: var(--sans); font-weight: 600; font-size: 1rem; line-height: 1.35; color: #e3e8ee; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#loading .ld-tip__k { flex: none; padding: .15em .5em; border-radius: 2px; background: var(--red); font-family: var(--cond); font-weight: 800; font-size: .75rem; letter-spacing: .2em; color: #fff; }
#ldTip.in { animation: ldTip .5s ease both; }
@keyframes ldTip { from { opacity: .35; transform: translateY(4px); } }
@media (max-aspect-ratio: 1/1) {
  #loading .ld-art { top: 16vh; bottom: auto; left: 0; right: 0; width: 100%; height: 42vh; }
  #loading .ld-shade { background: linear-gradient(0deg, rgba(8,11,15,.97) 30%, rgba(8,11,15,0) 60%), linear-gradient(180deg, rgba(8,11,15,.8), rgba(8,11,15,0) 22%); }
  #loading .ld-wrap { grid-template-rows: auto 1fr auto auto; }
  #loading .ld-map { grid-row: 3; margin-bottom: 1.5rem; }
  #loading .ld-foot { grid-row: 4; }
  #loading .ld-brand { grid-row: 1; }
}
@media (max-height: 500px) { #loading .ld-tip { min-height: 0; } #loading .ld-art { width: 55vw; } }

/* ---------------------------------------------------------------- results / garage */
#menu { position: fixed; inset: 0; z-index: 8; display: grid; grid-template-columns: 1fr 440px; align-items: center; padding: 0 6vw; pointer-events: none; opacity: 0; transition: opacity .45s;
  background: linear-gradient(90deg, rgba(5,6,8,.88) 0%, rgba(5,6,8,.55) 45%, rgba(5,6,8,.1) 62%, rgba(5,6,8,.75) 80%, rgba(5,6,8,.9) 100%); }
body.menu #menu { opacity: 1; }
#menu .mleft { align-self: center; transform: translateX(-40px); transition: transform .6s cubic-bezier(.2,1,.3,1); }
body.menu #menu .mleft { transform: none; }
#mKick { font-family: var(--cond); font-weight: 800; letter-spacing: .3em; font-size: 16px; color: #8f99a6; }
#mTitle { font-family: var(--cond); font-style: italic; font-weight: 900; font-size: clamp(80px, 10vw, 150px); line-height: .88; margin-top: 4px; }
#menu.win #mTitle { color: var(--gold); filter: drop-shadow(0 6px 0 rgba(255,59,47,.9)); }
#menu.lose #mTitle { color: #fff; filter: drop-shadow(0 6px 0 rgba(41,216,255,.8)); }
#menu.garage #mTitle { font-size: clamp(64px, 7vw, 110px); }
#mSub { margin-top: 14px; font-family: var(--cond); font-weight: 700; font-size: 22px; letter-spacing: .08em; color: #dfe5ea; max-width: 560px; }
#mTable { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(130px, 170px)); gap: 2px; }
#mTable div { background: rgba(10,12,16,.82); padding: 10px 14px 8px; }
#mTable div:nth-child(1) { border-left: 4px solid var(--red); }
#mTable div:nth-child(2) { border-left: 4px solid var(--cyan); }
#mTable span { display: block; font-family: var(--cond); font-weight: 700; letter-spacing: .2em; font-size: 12px; color: #8f99a6; }
#mTable b { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; }
#mTable b.nb { color: var(--gold); }
#menu .mright { background: rgba(8,10,14,.9); padding: 22px 26px 24px; clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px); border-top: 4px solid var(--red); transform: translateX(40px); transition: transform .6s cubic-bezier(.2,1,.3,1); }
body.menu #menu .mright { transform: none; }
.ck { font-family: var(--cond); font-weight: 800; letter-spacing: .28em; font-size: 14px; color: #8f99a6; display: flex; justify-content: space-between; }
.carsel { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.carsel .arr { font-size: 18px; color: var(--red); }
#cName { font-family: var(--cond); font-style: italic; font-weight: 900; font-size: 34px; line-height: 1; text-align: center; flex: 1; }
#cName.flip { animation: flip .25s ease-out; }
@keyframes flip { from { opacity: 0; transform: translateY(10px) skewX(-8deg); } to { opacity: 1; transform: none; } }
#cTag { margin-top: 6px; text-align: center; font-family: var(--cond); font-weight: 600; letter-spacing: .1em; font-size: 15px; color: #c3cbd4; }
#cSpecs { margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
#cSpecs div { background: rgba(255,255,255,.06); padding: 6px 10px; }
#cSpecs div.wide { grid-column: 1 / -1; }
#cSpecs div.wide b { font-size: 19px; }
#cSpecs span { display: block; font-family: var(--cond); font-weight: 700; font-size: 11px; letter-spacing: .2em; color: #8f99a6; }
#cSpecs b { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 24px; }
#cStats { margin-top: 14px; display: grid; gap: 8px; }
.stat { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-family: var(--cond); font-weight: 700; letter-spacing: .18em; font-size: 13px; color: #c3cbd4; }
.stat .bar { height: 8px; background: rgba(255,255,255,.1); position: relative; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.stat .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #fff, var(--red)); transition: width .4s cubic-bezier(.2,1,.3,1); }
#cBest { margin-top: 14px; font-family: var(--cond); font-weight: 700; letter-spacing: .16em; font-size: 14px; color: var(--gold); }
#mKeys { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; gap: 26px; font-family: var(--cond); font-weight: 800; font-size: 16px; letter-spacing: .16em; white-space: nowrap; }
#mKeys i { font-style: normal; color: #000; background: #fff; padding: 2px 8px; margin-right: 6px; }
#menu.results #mEsc { display: none; }

#fade { position: fixed; inset: 0; background: #050608; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 9; }
body.fading #fade { opacity: 1; }
#err { display: none; position: fixed; left: 50%; top: 20px; transform: translateX(-50%); background: #a00; padding: 10px 16px; z-index: 30; font-family: var(--sans); }

@media (max-width: 1100px) {
  #posN { font-size: 70px; } #posBox .rows { min-width: 200px; } .row b { font-size: 26px; }
  #dialBox { width: 260px; height: 260px; } #mapBox { width: 190px; height: 190px; }
  #routeBox { top: 130px; width: 70vw; } #styleBox { top: 24px; }
  #menu { grid-template-columns: 1fr 380px; padding: 0 3vw; } #mTable { grid-template-columns: repeat(2, 150px); }
  #keys { display: none; }
}
@media (min-width: 1700px) and (min-height: 950px) { #hud, #menu { zoom: 1.3; } }

/* ---------------------------------------------------------------- round 4: traffic lights + penalties */
.row.pen { display: none; } .row.pen.on { display: flex; }
.row.pen .k { color: #ff6b5f; } .row.pen b { color: #ff6b5f; font-size: 24px; }
#sigBox { position: absolute; right: 28px; top: 132px; display: flex; align-items: center; gap: 12px; padding: 8px 22px 8px 12px; background: var(--panel);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); opacity: 0; transform: translateX(18px); transition: opacity .25s, transform .25s; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
#sigBox.on { opacity: 1; transform: none; }
#sigBox .sl { display: flex; flex-direction: column; gap: 4px; padding: 5px 4px; background: #0d0e10; border-radius: 7px; border: 1px solid rgba(255,255,255,.12); }
#sigBox .sl i { display: block; width: 13px; height: 13px; border-radius: 50%; background: #262626; }
#sigBox.R .sl i.r { background: #ff2a14; box-shadow: 0 0 12px 2px #ff2a14; }
#sigBox.A .sl i.a { background: #ffa800; box-shadow: 0 0 12px 2px #ffa800; }
#sigBox.G .sl i.g { background: #14ff6a; box-shadow: 0 0 12px 2px #14ff6a; }
#sigBox .st { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--cond); line-height: 1; }
#sigTxt { font-style: italic; font-weight: 900; font-size: 27px; letter-spacing: .03em; }
#sigD { font-weight: 700; font-size: 14px; letter-spacing: .16em; color: #c3cbd4; margin-top: 4px; }
#sigBox.R #sigTxt { color: #ff5a4a; } #sigBox.A #sigTxt { color: #ffc21a; } #sigBox.G #sigTxt { color: #4dff8e; }
#sigBox.R.close { animation: sigpulse .45s ease-in-out infinite alternate; }
@keyframes sigpulse { from { transform: scale(1); } to { transform: scale(1.07); } }
.pop.redlight { top: 30%; font-size: 78px; color: #fff; background: var(--red); padding: 0 40px 6px; clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%); text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.pop.redlight small { color: #ffe36b; font-size: 22px; }
.pop.quote { top: 44%; left: auto; right: 7vw; transform: translate(0, -50%); font-size: 30px; color: #fff; text-align: right; animation-name: popR; }
.pop.quote small { color: #ff8f80; font-size: 16px; letter-spacing: .2em; }
.pop.quote.good small { color: #6dff9b; }
