:root {
  --ink: #07080a;
  --sign: #1b4f9c;
  --sign-d: #143e7c;
  --edge: #f3f2ec;
  --led: #ffb21e;
  --led-dim: rgba(255, 178, 30, 0.13);
  --go: #3ddc72;
  --stop: #ff3b30;
  --steel: #5d6166;
  --paper: #f4f1e8;
  --paper-ink: #24221e;
  --font: "Overpass", "Arial Narrow", Arial, sans-serif;
  --mono: "Overpass Mono", ui-monospace, monospace;
  --dot: "Doto", "Overpass Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--edge); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; z-index: 5; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 50% 55%, transparent 60%, rgba(0,0,0,0.25) 100%); transition: background 0.25s; }
#vignette.hit { background: radial-gradient(ellipse at 50% 55%, rgba(255,40,20,0.05) 30%, rgba(255,30,10,0.55) 100%); }

/* ---------- menú ---------- */
#menu { display: grid; grid-template-rows: auto 1fr auto; padding: max(28px, env(safe-area-inset-top)) 0 0; background: linear-gradient(180deg, rgba(7,8,10,0.55) 0%, transparent 30%, transparent 55%, rgba(7,8,10,0.75) 100%); }
.brand { padding: 0 clamp(16px, 4vw, 56px); }
.brand h1 {
  margin: 0; font-weight: 900; font-size: clamp(56px, min(12vw, 21vh), 176px); line-height: 0.82; letter-spacing: -0.045em;
  text-transform: uppercase; color: var(--edge);
}
.brand h1::after { content: ""; display: block; width: 0.9em; height: 0.07em; margin-top: 0.12em; background: repeating-linear-gradient(90deg, var(--edge) 0 38%, transparent 38% 100%); background-size: 0.9em 100%; }
.brand p { margin: 14px 0 0; font-size: clamp(16px, 1.6vw, 21px); font-weight: 600; color: rgba(243,242,236,0.82); letter-spacing: 0.01em; }
.corner { position: absolute; top: max(28px, env(safe-area-inset-top)); right: clamp(16px, 4vw, 56px); text-align: right; font-family: var(--mono); font-size: 13px; line-height: 1.7; color: rgba(243,242,236,0.7); }
.corner b { color: var(--led); font-weight: 700; }

.gantry { grid-row: 3; position: relative; padding: 0 clamp(16px, 3vw, 44px) max(26px, env(safe-area-inset-bottom)); }
.beam { position: absolute; left: 0; right: 0; top: -14px; height: 14px; background: linear-gradient(180deg, #7a7e83, #3c3f43 60%, #24262a); box-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.beam::before, .beam::after { content: ""; position: absolute; top: 14px; width: 10px; height: 10px; background: #3c3f43; }
.signs { display: grid; grid-template-columns: minmax(320px, 1.3fr) minmax(240px, 0.95fr) minmax(290px, 1.1fr) minmax(170px, 0.6fr); gap: 14px; align-items: stretch; }
.sign {
  position: relative; background: var(--sign); border-radius: 7px; padding: 12px 14px 14px;
  box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 5.5px var(--edge), 0 18px 40px rgba(0,0,0,0.45);
  text-align: left; border: 0;
}
.sign::before, .sign::after { content: ""; position: absolute; top: -14px; width: 6px; height: 14px; background: #2b2e32; }
.sign::before { left: 22%; } .sign::after { right: 22%; }
.sign-h { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 13px; margin: 4px 4px 10px; color: var(--edge); display: flex; gap: 8px; align-items: center; }
.road-id { background: #c8102e; color: #fff; padding: 1px 7px 0; border-radius: 3px; letter-spacing: 0.02em; }

.lane-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 0; }
.lane { background: transparent; border: 0; padding: 4px 8px 6px; text-align: center; position: relative; color: var(--edge); }
.lane + .lane::before { content: ""; position: absolute; left: 0; top: 10%; bottom: 10%; border-left: 2px dashed rgba(243,242,236,0.55); }
.lcs { width: 46px; height: 46px; margin: 2px auto 8px; background: #050505; border-radius: 4px; display: grid; place-items: center; box-shadow: inset 0 0 0 2px #1a1a1a; }
.lcs svg { width: 34px; height: 34px; }
.lcs .x { stroke: var(--stop); stroke-width: 4.5; stroke-linecap: round; opacity: 0.22; }
.lcs .arr { fill: var(--go); opacity: 0; }
.lane[aria-checked="true"] .lcs .arr { opacity: 1; filter: drop-shadow(0 0 5px rgba(61,220,114,0.9)); }
.lane[aria-checked="true"] .lcs .x { opacity: 0; }
.lane-name { font-weight: 800; font-size: 15px; line-height: 1.05; min-height: 2.1em; display: flex; align-items: center; justify-content: center; }
.lane-mult { font-family: var(--mono); font-weight: 700; font-size: 13px; margin-top: 4px; color: rgba(243,242,236,0.75); }
.lane[aria-checked="true"] .lane-mult { color: #fff; }
.lane:focus-visible { outline: 2px solid var(--led); outline-offset: -2px; }

.car-pick { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 4px; }
.arrow { background: transparent; border: 0; font-size: 34px; line-height: 1; padding: 0 0 4px; color: var(--edge); opacity: 0.8; }
.arrow:hover { opacity: 1; }
.car-name { font-weight: 900; font-size: 24px; white-space: nowrap; letter-spacing: -0.01em; line-height: 1; }
.car-tag { font-size: 13px; color: rgba(243,242,236,0.78); margin: 4px 0 8px; }
.car-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.car-stats dt { color: rgba(243,242,236,0.7); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; padding-top: 2px; }
.car-stats dd { margin: 0; font-family: var(--mono); font-weight: 700; }

.opt-row { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(243,242,236,0.72); }
.seg { display: flex; border: 2px solid rgba(243,242,236,0.8); border-radius: 4px; overflow: hidden; }
.seg button { flex: 1 1 auto; white-space: nowrap; background: transparent; border: 0; padding: 6px 4px 4px; font-weight: 800; font-size: 13px; color: var(--edge); text-transform: none; letter-spacing: 0; }
.seg button + button { border-left: 2px solid rgba(243,242,236,0.8); }
.seg button[aria-pressed="true"] { background: var(--edge); color: var(--sign-d); }

.go { background: #0f6b39; box-shadow: inset 0 0 0 3px #0f6b39, inset 0 0 0 5.5px var(--edge), 0 18px 40px rgba(0,0,0,0.45); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; color: var(--edge); transition: transform 0.15s ease-out, background 0.15s; }
.go:hover { background: #128043; }
.go:active { transform: translateY(2px); }
.go-arrow svg { width: 44px; height: 44px; fill: var(--edge); }
.go-txt { font-weight: 900; font-size: 24px; line-height: 1.02; }
.go-txt small { display: block; font-family: var(--mono); font-weight: 500; font-size: 12px; margin-top: 8px; opacity: 0.8; }
.qual { position: absolute; right: clamp(16px, 4vw, 56px); top: calc(max(28px, env(safe-area-inset-top)) + 50px); background: transparent; border: 1px solid rgba(243,242,236,0.25); border-radius: 3px; font-family: var(--mono); font-size: 11px; padding: 4px 8px 3px; color: rgba(243,242,236,0.65); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.pmv {
  position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translateX(-50%);
  min-width: 360px; padding: 10px 18px 9px; background: #050505; border: 3px solid #26282b; border-radius: 3px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px #000; text-align: center;
  font-family: var(--dot); font-weight: 900; color: var(--led); text-shadow: 0 0 8px rgba(255,170,20,0.55);
}
.pmv-l1 { font-size: 34px; line-height: 1; letter-spacing: 0.04em; min-height: 34px; white-space: nowrap; }
.pmv-l2 { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px; font-size: 20px; line-height: 1; min-height: 20px; }
.pmv-bar { display: inline-flex; gap: 3px; }
.pmv-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--led); box-shadow: 0 0 6px rgba(255,170,20,0.8); }
.pmv-bar i.off { background: var(--led-dim); box-shadow: none; }
.pmv.crash { color: var(--stop); text-shadow: 0 0 10px rgba(255,40,20,0.7); }
.pmv.crash .pmv-bar i { background: rgba(255,59,48,0.2); box-shadow: none; }
.feed { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 96px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pop { font-weight: 900; font-style: italic; font-size: 26px; letter-spacing: 0.01em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,0.7); animation: pop 1.3s cubic-bezier(.2,.8,.2,1) forwards; white-space: nowrap; }
.pop b { font-family: var(--mono); font-style: normal; font-weight: 700; font-size: 0.72em; margin-left: 10px; color: var(--led); }
.pop.agulla { font-size: 40px; color: var(--led); }
.pop.agulla b { color: #fff; }
.pop.arran { color: #ffd9a0; }
.pop.bad { color: var(--stop); }
.pop.small { font-size: 16px; color: rgba(255,255,255,0.8); }
@keyframes pop { 0% { opacity: 0; transform: translateY(8px) scale(0.92); } 12% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.tl { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(18px, env(safe-area-inset-top)); font-family: var(--mono); }
.bank span { display: block; font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(243,242,236,0.6); }
.bank b { font-size: 28px; font-weight: 700; color: var(--edge); text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.lives { display: flex; gap: 6px; margin-top: 10px; }
.lives svg { width: 22px; height: 20px; }
.lives .tri { fill: none; stroke: rgba(243,242,236,0.75); stroke-width: 2.4; }
.lives .used .tri { fill: var(--stop); stroke: var(--stop); }
.traffic-tag { margin-top: 10px; font-size: 12px; color: rgba(243,242,236,0.6); }
.dash { position: absolute; right: max(22px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tell { display: flex; gap: 10px; }
.tell svg { width: 26px; height: 22px; fill: rgba(255,255,255,0.1); stroke: rgba(255,255,255,0.1); }
#t-left.on, #t-right.on { fill: #2bdc5a; filter: drop-shadow(0 0 6px rgba(43,220,90,0.9)); }
#t-beam.on { fill: #2f7bff; stroke: #2f7bff; filter: drop-shadow(0 0 6px rgba(47,123,255,0.9)); }
#t-haz.on { fill: var(--stop); filter: drop-shadow(0 0 6px rgba(255,59,48,0.9)); }
.speedo { text-align: right; }
.rpm { display: flex; gap: 2px; justify-content: flex-end; margin-bottom: 4px; }
.rpm i { width: 7px; height: 14px; background: rgba(255,255,255,0.12); transform: skewX(-12deg); }
.rpm i.on { background: var(--edge); }
.rpm i.red { background: rgba(255,59,48,0.25); }
.rpm i.red.on { background: var(--stop); box-shadow: 0 0 8px rgba(255,59,48,0.8); }
.rpm.limit i.on { animation: blink 0.08s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.spd b { font-family: var(--mono); font-weight: 700; font-size: 74px; line-height: 0.9; letter-spacing: -0.04em; color: #fff; text-shadow: 0 3px 18px rgba(0,0,0,0.6); font-variant-numeric: tabular-nums; }
.spd span { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; margin-left: 6px; color: rgba(243,242,236,0.7); }
.gear-row { display: flex; justify-content: flex-end; gap: 14px; align-items: baseline; font-family: var(--mono); margin-top: 2px; }
#gear { font-size: 22px; font-weight: 700; color: var(--led); }
.vmult { font-size: 13px; color: rgba(243,242,236,0.75); }
.vmult.hot { color: var(--led); }
.hint { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); font-size: 13px; line-height: 1.8; color: rgba(243,242,236,0.72); transition: opacity 1s; max-width: 46vw; }
.hint kbd { font-family: var(--mono); font-size: 11.5px; font-weight: 700; border: 1px solid rgba(243,242,236,0.45); border-radius: 3px; padding: 1px 5px 0; margin-right: 4px; color: #fff; }
.hint.fade { opacity: 0; }

.mirror-frame { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 96px); transform: translateX(-50%); width: min(30vw, 330px); aspect-ratio: 3.5; border: 3px solid #141518; border-radius: 10px / 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.mirror-frame:not(.hidden) ~ .feed { top: calc(max(14px, env(safe-area-inset-top)) + 106px + min(30vw, 330px) / 3.5); }
.radar-warn { position: absolute; right: max(22px, env(safe-area-inset-right)); top: max(18px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; background: var(--sign); padding: 8px 12px 6px; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--sign), inset 0 0 0 3.5px var(--edge); font-weight: 800; font-size: 15px; }
.radar-warn svg { width: 26px; height: 26px; fill: var(--edge); }
.radar-warn i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #111; border: 4px solid #d2101e; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.radar-warn.near { animation: blink 0.5s steps(2) infinite; }
.works-warn { position: absolute; right: max(22px, env(safe-area-inset-right)); top: calc(max(18px, env(safe-area-inset-top)) + 54px); display: flex; align-items: center; gap: 10px; background: #f5c400; color: #111; padding: 8px 12px 6px; border-radius: 4px; box-shadow: inset 0 0 0 2px #f5c400, inset 0 0 0 3.5px #111; font-weight: 800; font-size: 15px; }
.works-warn svg { width: 24px; height: 22px; }
#flash { position: fixed; inset: 0; z-index: 6; pointer-events: none; background: #fff; opacity: 0; }
#flash.on { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* ---------- pausa i tiquet ---------- */
#pause, #over { display: grid; place-items: center; align-content: center; gap: 18px; background: rgba(5,6,8,0.66); backdrop-filter: blur(3px); }
.panel { width: min(620px, calc(100vw - 32px)); background: var(--sign); border-radius: 8px; padding: 24px 26px; box-shadow: inset 0 0 0 3px var(--sign), inset 0 0 0 6px var(--edge), 0 30px 80px rgba(0,0,0,0.5); }
.panel h2 { margin: 2px 0 18px; font-weight: 900; font-size: 30px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns button { background: transparent; border: 2px solid var(--edge); border-radius: 4px; padding: 10px 16px 8px; font-weight: 800; font-size: 15px; }
.row-btns button.primary { background: var(--edge); color: var(--sign-d); }
.row-btns button:focus-visible, .row-btns button.focus { outline: 3px solid var(--led); outline-offset: 2px; }
.row-btns small { font-family: var(--mono); font-weight: 500; font-size: 11px; opacity: 0.7; margin-left: 6px; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin-top: 22px; font-size: 13.5px; }
.controls div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(243,242,236,0.25); padding: 3px 0; }
.controls kbd { font-family: var(--mono); font-weight: 700; color: #fff; }
#over .row-btns button { border-color: var(--edge); }
.ticket {
  width: min(380px, calc(100vw - 32px)); background: var(--paper); color: var(--paper-ink); padding: 26px 24px 20px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.55; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55); transform: rotate(-1.2deg);
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.5px) 0 0 / 14px 51% repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) 0 100% / 14px 51% repeat-x;
  mask: radial-gradient(circle at 50% 0, transparent 5px, #000 5.5px) 0 0 / 14px 51% repeat-x, radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) 0 100% / 14px 51% repeat-x;
  animation: print 0.9s cubic-bezier(.2,.8,.2,1);
}
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: rotate(-1.2deg) translateY(-30px); } to { clip-path: inset(0 0 0 0); } }
.ticket h3 { margin: 0; text-align: center; font-family: var(--font); font-weight: 900; font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; }
.ticket .sub { text-align: center; font-size: 11.5px; margin: 2px 0 14px; color: #6b675e; }
.ticket .ln { display: flex; gap: 6px; }
.ticket .ln span:nth-child(2) { flex: 1; border-bottom: 1.5px dotted #a39e92; transform: translateY(-5px); }
.ticket hr { border: 0; border-top: 1.5px dashed #a39e92; margin: 12px 0; }
.ticket .total { font-size: 22px; font-weight: 700; }
.ticket .stamp { position: absolute; right: 22px; bottom: 150px; transform: rotate(-11deg); background: rgba(244,241,232,0.6); border: 3px solid #c8102e; color: #c8102e; font-family: var(--font); font-weight: 900; font-size: 18px; padding: 4px 8px 1px; letter-spacing: 0.04em; opacity: 0.85; }
.ticket .bar { height: 44px; margin: 14px 0 4px; background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 4px, var(--paper-ink) 4px 7px, transparent 7px 8px, var(--paper-ink) 8px 9px, transparent 9px 12px); }
.ticket .foot { text-align: center; font-size: 11px; color: #6b675e; }

/* ---------- tàctil ---------- */
#touch { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
#touch button { pointer-events: auto; background: rgba(10,12,14,0.38); border: 2px solid rgba(243,242,236,0.32); border-radius: 10px; color: var(--edge); font-weight: 900; touch-action: none; -webkit-tap-highlight-color: transparent; }
#touch button.on { background: rgba(243,242,236,0.28); }
#touch button.lit { background: var(--sign); border-color: var(--edge); }
#touch svg { width: 20px; height: 20px; fill: currentColor; display: block; margin: auto; }
.t-wheel { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); width: min(40vw, 300px); height: 92px; pointer-events: auto; touch-action: none; border-radius: 46px; background: rgba(10,12,14,0.32); border: 2px solid rgba(243,242,236,0.28); }
.t-track { position: absolute; left: 46px; right: 46px; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, rgba(243,242,236,0.5) 0 10px, transparent 10px 18px); }
.t-knob { position: absolute; top: 8px; left: calc(50% - 38px); width: 76px; height: 76px; border-radius: 50%; background: rgba(243,242,236,0.16); border: 2px solid rgba(243,242,236,0.7); transition: transform 0.12s ease-out; }
.t-wheel.on .t-knob { transition: none; background: rgba(243,242,236,0.3); }
.t-pedals { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: flex-end; }
.t-pedals button { font-size: 14px; letter-spacing: 0.08em; }
.t-pedals .gas { width: 84px; height: 140px; }
.t-pedals .brake { width: 84px; height: 92px; }
.t-small { position: absolute; left: max(14px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 100px); display: flex; gap: 6px; flex-wrap: wrap; max-width: 44vw; }
.t-small button { min-width: 44px; height: 42px; font-size: 12px; padding: 0 8px; }
body.touch .hint { display: none; }
body.touch .dash { bottom: auto; top: calc(max(12px, env(safe-area-inset-top)) + 0px); right: max(14px, env(safe-area-inset-right)); }
body.touch .dash .tell { display: none; }
body.touch .radar-warn, body.touch .works-warn { right: auto; left: max(14px, env(safe-area-inset-left)); top: auto; bottom: 122px; }
body.touch .works-warn { bottom: 168px; }
body.touch .pmv { top: max(8px, env(safe-area-inset-top)); }
@media (max-height: 460px) {
  body.touch .spd b { font-size: 40px; }
  body.touch .rpm i { width: 5px; height: 10px; }
  body.touch .tl { top: max(10px, env(safe-area-inset-top)); }
  body.touch .feed { top: 64px; }
  body.touch .pop { font-size: 17px; }
  body.touch .pop.agulla { font-size: 24px; }
  .t-pedals .gas { height: 120px; }
  .t-small button { height: 38px; min-width: 40px; }
}
@media (max-height: 460px) and (pointer: coarse), (max-height: 460px) and (min-width: 600px) {
  #menu { overflow-y: auto; touch-action: pan-y; padding-top: max(12px, env(safe-area-inset-top)); grid-template-rows: auto auto auto; gap: 10px; }
  .brand h1 { font-size: 54px; }
  .brand h1::after { display: none; }
  .brand p { margin-top: 4px; font-size: 14px; }
  .corner { top: 12px; font-size: 11px; line-height: 1.5; }
  .qual { top: 58px; }
  .gantry { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .signs { gap: 8px; }
  .sign { padding: 8px 10px 10px; }
  .sign-h { margin: 2px 2px 6px; font-size: 11px; }
  .lcs { width: 30px; height: 30px; margin: 0 auto 4px; }
  .lcs svg { width: 22px; height: 22px; }
  .lane-name { font-size: 12px; min-height: 2em; }
  .lane-mult { font-size: 11px; margin-top: 2px; }
  .car-name { font-size: 19px; }
  .car-tag { font-size: 11.5px; margin: 2px 0 4px; }
  .car-stats { font-size: 11px; }
  .opt-row { grid-template-columns: 44px 1fr; margin: 0 2px 5px; font-size: 10px; gap: 4px; }
  .seg button { font-size: 11px; padding: 4px 3px 2px; }
  .go { padding: 6px 14px; }
  .go-txt { font-size: 17px; }
}
#rotate { position: fixed; inset: 0; z-index: 30; background: rgba(7,8,10,0.94); display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; }
#rotate svg { width: 76px; height: 76px; color: var(--edge); animation: tilt 1.8s ease-in-out infinite; }
#rotate p { margin: 6px 0 0; font-weight: 900; font-size: 26px; }
#rotate small { font-family: var(--mono); color: rgba(243,242,236,0.65); }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

#loading { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--ink); font-family: var(--mono); font-size: 13px; color: rgba(243,242,236,0.7); transition: opacity 0.6s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld-bar { width: 220px; height: 6px; background: repeating-linear-gradient(90deg, rgba(243,242,236,0.15) 0 22px, transparent 22px 32px); }
.ld-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--edge) 0 22px, transparent 22px 32px); transition: width 0.3s; }

@media (max-width: 1100px) {
  .signs { grid-template-columns: 1.15fr 0.95fr 1.3fr; gap: 10px; }
  .go { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; padding: 8px 16px; }
  .go-arrow svg { width: 30px; height: 30px; transform: rotate(-90deg); }
  .go-txt { font-size: 20px; display: flex; gap: 14px; align-items: baseline; }
  .go-txt small { margin: 0; }
  .lane { padding: 2px 4px 4px; }
  .lane-name { font-size: 13px; }
  .car-name { font-size: 21px; }
  .opt-row { grid-template-columns: 50px 1fr; }
  .seg button { font-size: 12px; padding: 5px 2px 3px; }
}
@media (max-height: 560px) and (min-width: 701px) {
  .brand h1 { font-size: min(12vw, 20vh); }
  .brand p { margin-top: 8px; }
  .lcs { width: 36px; height: 36px; margin-bottom: 4px; }
  .lcs svg { width: 26px; height: 26px; }
  .car-stats { font-size: 11.5px; }
}
@media (max-width: 700px) {
  #menu { overflow-y: auto; touch-action: pan-y; grid-template-rows: auto auto auto; gap: 26px; }
  .signs { grid-template-columns: 1fr; gap: 22px; }
  .corner { position: static; text-align: left; padding: 0 16px; }
  .qual { position: static; margin: 0 16px; justify-self: start; }
  .lcs { width: 38px; height: 38px; }
  .lane-name { font-size: 13px; }
  .pmv { min-width: 0; width: calc(100vw - 150px); padding: 6px 8px; }
  .pmv-l1 { font-size: 22px; min-height: 22px; }
  .pmv-l2 { font-size: 14px; }
  .tl { top: 84px; }
  .bank b { font-size: 20px; }
  .spd b { font-size: 50px; }
  .pop { font-size: 19px; }
  .pop.agulla { font-size: 28px; }
}
@media (max-height: 460px) and (min-width: 600px) {
  .pmv { min-width: 0; padding: 5px 12px 4px; }
  .pmv-l1 { font-size: 22px; min-height: 22px; }
  .pmv-l2 { font-size: 13px; margin-top: 3px; }
  .feed { top: 70px; }
  .spd b { font-size: 48px; }
  .bank b { font-size: 20px; }
  .mirror-frame { position: absolute; left: 50%; top: calc(max(14px, env(safe-area-inset-top)) + 96px); transform: translateX(-50%); width: min(30vw, 330px); aspect-ratio: 3.5; border: 3px solid #141518; border-radius: 10px / 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.mirror-frame:not(.hidden) ~ .feed { top: calc(max(14px, env(safe-area-inset-top)) + 106px + min(30vw, 330px) / 3.5); }
.radar-warn { top: 64px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .pop, .ticket { animation-duration: 0.01s; }
}
