:root { --c-accent: #ffb02e; --c-page-bg: linear-gradient(#232a36, #0e1116); --c-panel: rgba(18, 22, 30, .95); --c-on-accent: #1d1200; }
.c-home .c-title { color: #f2f2f2; font-style: italic; }
.c-home .c-title span { color: #ffb02e; }
html, body { margin: 0; height: 100%; background: #0e1116; color: #f2f2f2; overflow: hidden; overscroll-behavior: none;
  font: 16px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#stage { position: fixed; inset: 0; background: #16232c; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; z-index: 3; pointer-events: none; top: calc(var(--band-h, 52px) + 8px);
  left: max(8px, env(safe-area-inset-left)); display: flex; flex-direction: column; align-items: flex-start; gap: .35em;
  font-size: calc(13px * var(--ui, 1)); }
#hud > div { display: flex; align-items: baseline; gap: .15em; padding: .2em .65em .25em; border-radius: .7em; line-height: 1;
  background: rgba(8, 10, 14, .6); border: 1.5px solid rgba(255, 255, 255, .28); }
#hud b { font: 900 2.3em/1 'Arial Black', Impact, system-ui, sans-serif; font-style: italic; }
#hud i { font-style: normal; font-weight: 700; font-size: max(12px, 1em); color: #c5ccd8; }
#place b { color: #ffb02e; font-size: 3em; }
#place.first b { color: #ffe14a; }
#lap svg { width: 1.3em; height: 1.3em; align-self: center; margin-right: .2em; color: #c5ccd8; }
#lap b { font-size: 1.7em; }
#speed b { font-size: 1.7em; min-width: 2.1em; text-align: right; font-variant-numeric: tabular-nums; }
#speed i { font-size: max(12px, .85em); }
#gearN { font: 900 max(12px, 1.15em)/1 'Arial Black', Impact, system-ui, sans-serif; font-style: normal; color: #14181f; background: #ffb02e;
  border-radius: .3em; padding: .12em .36em; margin-right: .35em; align-self: center; }
#health { align-items: center; gap: .4em; }
#health svg { width: 1.3em; height: 1.3em; color: #c5ccd8; }
#health .bar { display: block; width: 6.2em; height: .75em; border-radius: 99px; overflow: hidden; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .35); }
#health .bar i { display: block; width: 100%; height: 100%; transform-origin: left center; transition: transform .15s linear; background: linear-gradient(#8ef07a, #3fc24a); }
#health.mid .bar i { background: linear-gradient(#ffd86a, #ffb02e); }
#health.low .bar i { background: linear-gradient(#ff8a7a, #ff3a2a); animation: hurt .35s infinite alternate; }
#health.wreck svg { color: #ff3a2a; }
@keyframes hurt { to { filter: brightness(1.6); } }
.scr-compact #hud { font-size: calc(12px * var(--ui, 1)); }
.scr-compact #speed b, .scr-compact #lap b { font-size: 1.4em; }
.screen { position: fixed; inset: 0; z-index: 100; display: flex; overflow-y: auto; box-sizing: border-box;
  padding: calc(var(--band-h, 52px) + 12px) 16px 24px; background: rgba(8, 10, 14, .62); }
.col { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 460px; margin: auto; zoom: var(--ui, 1); text-align: center; }
.card { padding: 18px 16px; border-radius: 18px; background: #181e28; border: 1px solid rgba(255, 255, 255, .12); box-sizing: border-box; }
.col h2 { margin: 0; font: 900 52px/1 'Arial Black', Impact, system-ui, sans-serif; font-style: italic; letter-spacing: .02em; }
.col h2 small { font-size: .45em; color: #9aa6c0; }
.col h2.win { color: #ffe14a; }
.col h2.mid { color: #ffb02e; }
.col h2.out { color: #9aa6c0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stats { display: grid; grid-template-columns: auto auto; gap: 6px 16px; align-items: center; justify-content: center; font-size: 16px; }
.stats .k { text-align: right; color: #b9c4dc; }
.stats .v { text-align: left; font: 800 17px ui-monospace, Consolas, monospace; }
.total { font-size: 46px; font-weight: 900; color: #ffb02e; line-height: 1; margin: 2px 0 10px; }
.total small { display: block; font-size: 14px; color: #9aa6c0; font-weight: 700; margin-top: 4px; }
.screen.clear { background: none; pointer-events: none; align-items: center; justify-content: center; }
.screen.clear > * { pointer-events: auto; }
#wait.screen.clear { padding: 0; align-items: stretch; background: linear-gradient(#232a36, #0e1116); }
#waitPanel { width: 100%; height: 100%; }
.docs a { color: #ffd591; } .docs { margin: 4px 0 8px; }
#raceBot { max-width: min(70vw, 300px); }
#raceBot[hidden], #backOnRoad[hidden] { display: none !important; }
#backOnRoad { min-width: 48px; min-height: 48px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; }
#backOnRoad svg { width: 26px; height: 26px; }
.lapsPick { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.lapsPick span { display: flex; align-items: center; gap: 4px; min-width: 3.2em; justify-content: center; color: #fff; }
.lapsPick svg { width: 22px; height: 22px; color: #c5ccd8; }
.lapsPick b { font: 900 26px/1 'Arial Black', Impact, system-ui, sans-serif; font-style: italic; font-variant-numeric: tabular-nums; }
.lapsPick .c-btn { min-width: 44px; padding: 4px 0; font-size: 22px; font-weight: 800; }
.lapsPick:not(.host) .c-btn { display: none; }
.lapsPick:not(.host) span { justify-content: flex-start; }
#hud.watch > div:not(#lap) { display: none; }
#hud #watching { display: none; }
#hud.watch:not(.tv) > #watching { display: flex; }
#board { list-style: none; margin: 2px 0 0; padding: .25em .4em; border-radius: .7em; background: rgba(12, 14, 18, .55);
  display: grid; grid-template-columns: auto auto auto; column-gap: .45em; row-gap: .15em; align-items: center; width: max-content;
  font: 700 max(11px, .8em)/1.15 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #e8ecf2; }
#board li { display: contents; }
#board b { font: 900 1em/1.25 system-ui, sans-serif; font-style: normal; min-width: 1.35em; text-align: center; border-radius: .35em; color: #10131a; padding: 0 .2em; }
#board span { text-align: right; }
#board i { font-style: normal; font-weight: 600; color: #aab3c2; }
#board li.me span { color: #ffd23a; }
#board li.home span { color: #8ef07a; }
#board li.me b { box-shadow: 0 0 0 2px #fff inset; }
