@font-face{font-family:Rally;src:url('./fonts/barlow-condensed-extrabold-italic.ttf') format('truetype');font-weight:800;font-style:italic;font-display:swap}
@font-face{font-family:DM;src:url('./fonts/dm-sans.ttf') format('truetype');font-weight:100 1000;font-display:swap}
@font-face{font-family:Plex;src:url('./fonts/plex-mono.ttf') format('truetype');font-display:swap}
:root{--ink:#192027;--deep:#13181e;--cream:#fff5de;--yellow:#ffd346;--red:#ff6049;--muted:#bdc1c0;--display:italic 800 1em Rally,'Arial Narrow',sans-serif;color-scheme:dark}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}
body{font:16px/1.35 DM,Arial,sans-serif;color:var(--cream);background:var(--ink);display:flex;flex-direction:column}
button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;background:none;border:0}button:focus-visible,a:focus-visible,canvas:focus-visible,select:focus-visible{outline:3px solid var(--yellow);outline-offset:-3px}button:disabled{opacity:.55;cursor:default}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block;flex-shrink:0}.sprite{position:absolute;width:0;height:0;overflow:hidden}
.mast{height:77px;flex:none;background:var(--ink);border-bottom:3px solid #0b1015;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 clamp(16px,2.8vw,50px);gap:24px;position:relative;z-index:2}
.brand{margin:0;display:flex;align-items:center;gap:9px;white-space:nowrap}.brand img{width:46px;height:48px}.brand span{display:flex;flex-direction:column;transform:skewX(-3deg)}.brand small{font:800 10px/1.1 DM,sans-serif;letter-spacing:2.65px;text-transform:uppercase;margin:0 0 0 3px;color:#ffa18c}.brand b{font:var(--display);font-size:34px;line-height:.98;text-transform:uppercase;letter-spacing:-.8px}
.navigation{display:flex;align-self:stretch;gap:6px;align-items:stretch}.tab{position:relative;display:flex;align-items:center;gap:9px;padding:0 17px;font-size:15px;font-weight:680;color:#b9bfc2}.tab svg{width:18px;height:18px}.tab.active{color:var(--cream)}.tab.active:after{content:"";position:absolute;bottom:9px;height:3px;left:14px;right:14px;background:var(--red);transform:skewX(-20deg)}.tab:hover{color:#fff}.actions{justify-self:end;display:flex;gap:12px;align-items:center}.icon-button,.pause-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #5d6467;border-radius:6px;height:37px}.icon-button{width:38px}.icon-button:hover,.pause-button:hover,.expand:hover{background:#384047}.pause-button{padding:0 14px 0 10px;gap:5px;background:var(--cream);border-color:var(--cream);color:var(--ink);font-weight:800;font-size:14px}.pause-button:hover{background:var(--yellow);border-color:var(--yellow)}
#track{flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden;background:#7bc6e5 url('./art/horizon.webp') center top/cover no-repeat}#world{position:absolute;inset:0;width:100%;height:100%;display:block;outline-offset:-5px;touch-action:none}#loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);padding:10px 16px;background:var(--ink);border-radius:4px;z-index:4}[hidden]{display:none!important}
.course-hud,.map-hud,.timer-hud,.speed-hud{position:absolute;pointer-events:none;--edge:clamp(17px,2.35vw,38px)}.course-hud{top:clamp(18px,3vh,32px);left:var(--edge);filter:drop-shadow(3px 4px 0 #182027b0);width:clamp(192px,17vw,258px)}.type-label{background:var(--yellow);color:var(--ink);display:flex;align-items:center;width:max-content;min-height:25px;padding:0 17px 0 10px;gap:8px;clip-path:polygon(0 0,100% 0,calc(100% - 8px) 100%,0 100%);font:800 12px/1 DM,sans-serif;letter-spacing:1.7px;text-transform:uppercase}.checker{width:13px;height:12px;background:repeating-conic-gradient(#20262a 0 25%,transparent 0 50%) 0/8px 8px;transform:skew(-9deg)}.course-body{background:rgba(25,32,39,.96);border-left:4px solid var(--yellow);padding:10px 17px 13px;clip-path:polygon(0 0,100% 0,100% calc(100% - 12px),calc(100% - 12px) 100%,0 100%)}.course-body h2{font:var(--display);font-size:clamp(27px,2.45vw,38px);line-height:1.05;margin:0 0 5px;text-transform:uppercase;letter-spacing:-.4px}.course-stats{font-size:13px;color:#c1c8ca}.course-stats #check-count{font-weight:800;color:#fff5e1;margin-right:2px}.pips{display:flex;gap:4px;margin-top:9px}.pips i{height:4px;background:#60666b;flex:1;transform:skew(-19deg)}.pips i.hit{background:var(--yellow)}
.timer-hud{top:clamp(19px,3vh,32px);right:var(--edge);background:#192027f2;padding:9px 17px 9px 12px;display:flex;align-items:center;gap:10px;border-bottom:3px solid #0c11194a;box-shadow:3px 3px 0 #141b2066;border-radius:4px}.timer-hud svg{color:var(--yellow);width:26px;height:26px}.label{display:block;font:800 10px/1.25 DM,sans-serif;letter-spacing:1.55px;text-transform:uppercase;color:#cdd1d2}.timer-hud strong{font:600 21px/1.2 Plex,monospace;letter-spacing:-1px;display:block;margin-top:3px}
.map-hud{left:var(--edge);bottom:clamp(17px,3vh,32px);width:clamp(150px,16vw,226px);border:2px solid #e6e6d661;background:#192027;border-radius:8px;overflow:hidden;box-shadow:3px 4px 0 #151c2596}.map-main{position:relative;height:clamp(83px,10.9vh,127px)}#minimap{display:block;width:100%;height:100%}.north{position:absolute;right:8px;top:6px;border:1px solid #b9c3c970;border-radius:3px;padding:1px 4px;background:#192027d9;font:700 10px/1.4 DM,sans-serif;color:#eae6d7}.street-name{display:flex;align-items:center;gap:7px;padding:6px 10px;background:#1b2229;border-top:1px solid #667278;font:800 12px/1.3 DM,sans-serif;letter-spacing:.5px;text-transform:uppercase}.street-name svg{width:14px;height:14px;color:var(--yellow)}
.speed-hud{right:var(--edge);bottom:clamp(17px,3vh,32px);transform:skew(-10deg);background:#182028ed;border-radius:4px;box-shadow:3px 4px 0 #11182094;border-bottom:4px solid var(--yellow);padding:10px 13px 6px;min-width:130px}.speed-inner{transform:skew(10deg)}#rev{display:flex;gap:3px}#rev i{height:6px;width:9px;background:#596168;transform:skew(-17deg)}#rev i:nth-last-child(-n+2){background:#895149}#rev i.on{background:var(--yellow)}#rev i.on:nth-last-child(-n+2){background:var(--red)}.speed-text{display:flex;align-items:baseline;justify-content:flex-end;gap:7px}.speed-text strong{font:var(--display);font-size:clamp(52px,5vw,80px);line-height:1;letter-spacing:-2px}.speed-text span{font:var(--display);font-size:20px;color:var(--yellow)}#checkpoint-message{position:absolute;top:21%;left:50%;transform:translateX(-50%);font:var(--display);font-size:clamp(20px,3.2vw,43px);color:var(--yellow);text-shadow:2px 3px #1c2630,-1px -1px #1c2630;white-space:nowrap;pointer-events:none}
footer{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:50px;flex:none;border-top:3px solid #0e151c;padding:0 clamp(16px,2.5vw,48px);background:#1b2128;color:#d9dbd6}footer>div,.controls-line,.key-guide,.footer-right,.help,.place{display:flex;align-items:center}.controls-line{gap:clamp(9px,1.65vw,27px)}.key-guide{gap:5px;white-space:nowrap;font-size:12px;font-weight:600}.help{gap:7px;font-size:12px;font-weight:700;padding:7px 0;color:var(--cream)}.help svg{width:17px}.help:hover{color:var(--yellow)}.key-guide kbd,kbd{display:inline-block;font:600 12px/1.5 Plex,monospace;padding:0 5px;min-width:21px;border:1px solid #616970;border-bottom:2px solid #748087;background:#303840;border-radius:4px;text-align:center;color:var(--cream)}.footer-right{gap:16px}.footer-right a{font-size:11px;color:#b0b9bb;text-decoration:none}.footer-right a:hover{text-decoration:underline}.place{gap:7px;text-transform:uppercase;font:800 11px DM,sans-serif;letter-spacing:1.3px;white-space:nowrap}.saltire{width:19px;height:12px;background:linear-gradient(34deg,transparent 43%,#fff7e6 44% 55%,transparent 56%),linear-gradient(-34deg,transparent 43%,#fff7e6 44% 55%,transparent 56%),#3885b5;border-radius:1px}.expand{border-left:1px solid #4c5357;padding:4px 0 4px 15px}.expand svg{width:16px;height:16px}.touch{display:none}
dialog{border:1px solid #89918b;background:var(--ink);color:var(--cream);padding:0;max-width:calc(100% - 32px);width:680px;max-height:calc(100dvh - 70px);border-radius:9px;box-shadow:6px 8px 0 #0d141b82;overscroll-behavior:contain}dialog::backdrop{background:#0c131d9c;backdrop-filter:blur(3px)}.dialog-inner{padding:clamp(18px,3.2vw,34px)}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:24px;border-bottom:1px solid #586067;padding-bottom:13px;margin-bottom:18px}.dialog-head h2{font:var(--display);font-size:clamp(32px,5vw,48px);line-height:.95;text-transform:uppercase;margin:0}.dialog-head .icon-button{width:34px;height:34px;flex:none}.dialog-head .icon-button svg{width:17px}.route-list{display:grid;gap:10px}.route-card{display:grid;grid-template-columns:112px 1fr auto;gap:15px;align-items:center;text-align:left;padding:10px;border:1px solid #555e63;border-radius:5px;background:#222b32}.route-card:hover,.route-card:focus-visible{border-color:var(--yellow);background:#2a353c}.route-card canvas{width:112px;height:70px;background:#161e24;border-radius:3px}.route-card b{font:var(--display);font-size:27px;line-height:1.1;display:block;text-transform:uppercase}.route-card em{display:block;font:600 13px/1.4 DM,sans-serif;color:#c5cbd0;margin-top:4px}.route-card .card-type,.mode-note{font-size:11px;font-weight:800;color:var(--yellow);letter-spacing:1.4px;text-transform:uppercase}.route-card .card-action{font:800 12px/1.25 DM,sans-serif;color:var(--yellow);margin:0 4px}.dialog-actions,.view-tabs{display:flex;gap:9px;flex-wrap:wrap;align-items:center}.dialog-actions{margin-top:21px}.primary,.secondary,.view-tabs button,.external-link{min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border-radius:5px;padding:8px 14px;font-size:14px;font-weight:750}.primary{color:var(--ink);background:var(--yellow);border:1px solid var(--yellow)}.secondary,.view-tabs button,.external-link{border:1px solid #666f73;color:var(--cream)}.primary:hover{background:#ffe787}.secondary:hover,.view-tabs button:hover,.external-link:hover{background:#39434a}.view-tabs{margin:0 0 11px}.view-tabs button{min-height:32px;font-size:13px;padding:5px 10px}.view-tabs button.selected{background:var(--yellow);color:var(--ink);border-color:var(--yellow)}.view-frame{width:100%;height:clamp(200px,43vh,430px);border:0;border-radius:4px;background:#283339}.external-link{text-decoration:none}.external-link svg{width:15px;height:15px}.view-caption{font-size:14px;line-height:1.5;color:#c5ccce;margin:10px 0}.restart-note{font-size:13px;color:#cad0d2;margin:16px 0 0}.race-result{display:flex;justify-content:space-between;gap:12px;padding:13px 0;border-bottom:1px solid #51585d}.race-result b{color:var(--yellow);font:600 18px Plex,monospace}.control-list{display:grid;grid-template-columns:1fr auto;align-items:center;gap:14px;font-size:15px}.control-list span:nth-child(even){text-align:right}.dialog-copy{margin:12px 0 14px;color:#d5dada;font-size:15px;line-height:1.45}
@media(min-width:1600px){.mast{height:86px}footer{min-height:58px}}
@media(max-width:970px){.mast{gap:10px}.tab{padding:0 10px}.brand b{font-size:30px}.brand img{width:39px}.footer-right{gap:9px}.place{display:none}.key-guide{font-size:11px}.help span{display:none}}
@media(max-width:680px){.mast{height:62px;grid-template-columns:auto 1fr auto;gap:5px;padding:0 9px}.brand{gap:2px}.brand b{font-size:23px}.brand small{font-size:7px;letter-spacing:1.5px}.brand img{width:27px;height:39px}.navigation{justify-content:center;gap:1px}.tab{padding:5px 7px;flex-direction:column;justify-content:center;gap:3px;font-size:10px}.tab svg{width:17px;height:17px}.tab.active:after{bottom:3px;left:5px;right:5px}.actions{gap:4px}.icon-button,.pause-button{width:31px;height:32px;border-radius:4px;padding:0}.actions svg{width:16px;height:16px}.pause-button span{display:none}.course-hud,.timer-hud,.map-hud,.speed-hud{--edge:10px}.course-hud{top:12px;width:156px}.type-label{min-height:20px;font-size:10px;letter-spacing:1.1px}.course-body{padding:7px 10px 9px}.course-body h2{font-size:24px}.course-stats{font-size:11px}.pips{margin-top:6px}.timer-hud{top:12px;padding:6px 8px;gap:6px}.timer-hud strong{font-size:16px}.timer-hud svg{width:18px;height:18px}.timer-hud .label{font-size:8px}.map-hud{width:118px}.map-main{height:66px}.street-name{font-size:9px;padding:4px 6px}.speed-hud{min-width:76px;padding:7px 7px 4px}.speed-text strong{font-size:40px}.speed-text span{font-size:14px}#rev{gap:2px}#rev i{width:5px;height:4px}.controls-line{gap:6px}.key-guide{display:none}.help span{display:inline}.footer-right a{font-size:10px}footer{min-height:34px;padding:0 11px}.expand{padding:4px 0 4px 8px}.route-card{grid-template-columns:75px 1fr;gap:9px}.route-card canvas{width:75px;height:64px}.route-card .card-action{display:none}.route-card b{font-size:22px}.view-tabs{gap:4px}.view-tabs button{font-size:12px;padding:5px 6px}.dialog-actions{gap:6px}}
@media(pointer:coarse),(max-width:600px){.touch{display:flex;align-items:center;justify-content:space-between;position:absolute;left:10px;right:10px;bottom:max(8px,env(safe-area-inset-bottom));pointer-events:none}.touch>div{display:flex;gap:6px}.touch button{display:flex;align-items:center;justify-content:center;min-width:43px;min-height:43px;padding:0 8px;border:1.5px solid #f6ebd5b3;border-radius:8px;background:#1c252ce8;color:var(--cream);font:var(--display);font-size:16px;touch-action:none;user-select:none;-webkit-user-select:none;pointer-events:auto}.touch button.gas{background:var(--yellow);color:var(--ink);border-color:var(--yellow);min-width:49px}.touch button:active,.touch button.held{background:var(--red);color:var(--ink)}.map-hud,.speed-hud{bottom:65px}.key-guide{display:none}}
@media(max-height:545px){.mast{height:48px}.brand img{height:34px}.brand b{font-size:22px}.brand small{font-size:7px}.tab.active:after{bottom:2px}footer{min-height:28px}.course-hud,.timer-hud{top:8px}.course-body{padding:4px 9px 6px}.course-body h2{font-size:22px}.type-label{min-height:18px;font-size:9px}.pips{margin-top:4px}.map-main{height:49px}.map-hud{width:110px}.speed-text strong{font-size:38px}.dialog-inner{padding:12px}.dialog-head{margin-bottom:9px;padding-bottom:7px}.dialog-head h2{font-size:28px}.route-card canvas{height:43px}.route-card b{font-size:20px}.route-card{padding:5px}.route-list{gap:5px}dialog{max-height:calc(100dvh - 20px)}}
@media(min-width:681px){.course-hud{width:clamp(224px,19.5vw,300px)}}
#start-hint{position:absolute;left:50%;bottom:2.2%;transform:translateX(-50%);display:flex;align-items:center;gap:6px;white-space:nowrap;background:#192027e8;color:var(--cream);border-radius:4px;padding:5px 11px;font-size:12px;font-weight:650;pointer-events:none}
#start-hint kbd{background:var(--yellow);color:var(--ink);border-color:#a88536;font-weight:800;min-width:19px;padding:0 3px}
#next-gate{margin-top:5px;background:#192027e8;border-radius:3px;display:flex;align-items:center;gap:7px;padding:5px 9px;font-size:12px;font-weight:650;width:max-content;max-width:100%}
#next-gate svg{height:13px;width:13px;color:var(--yellow)}#next-distance{color:var(--yellow);white-space:nowrap;font-family:Plex,monospace;font-size:11px}
@media(pointer:coarse),(max-width:600px){#start-hint{display:none}}
@media(max-width:680px){.tab{white-space:nowrap}.course-body h2{font-size:21px}.brand b{font-size:21px}.tab{padding-left:5px;padding-right:5px}.course-hud{width:162px}}
@media(max-width:365px){.brand img{width:22px}.brand b{font-size:18px}.tab{font-size:9px}.actions{gap:3px}.actions button{width:28px}}

/* Race telemetry and the single carried item share the existing dashboard. */
.course-body {
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:end;
  column-gap:10px;
}
.course-body h2,.course-body .pips {grid-column:1/-1}
.position-line {display:flex;align-items:baseline;gap:5px;line-height:.9}
#place-number {color:var(--yellow);font:var(--display);font-size:37px;line-height:.97}
#place-number span {font-size:.46em;vertical-align:super;margin-left:1px}
.field-size {color:#c2c7c8;font:bold 13px Plex,monospace}
.position-line:not([hidden]) + .course-stats {text-align:right;align-self:center}
.position-line[hidden] + .course-stats {grid-column:1/-1}
.race-tools {
  position:absolute;top:clamp(19px,3vh,32px);right:clamp(17px,2.35vw,38px);
  display:flex;flex-direction:column;align-items:flex-end;gap:7px;pointer-events:none;
}
.race-tools .timer-hud {position:static}
.item-slot {
  --item-accent:#9ee9df;display:flex;align-items:center;gap:9px;pointer-events:auto;
  min-height:48px;padding:5px 11px 5px 5px;text-align:left;border:1px solid #576a73;
  border-left:3px solid var(--item-accent);border-radius:5px;background:#19232beb;
  box-shadow:3px 3px 0 #141b2066;color:var(--cream);touch-action:manipulation;
}
.item-slot:disabled {opacity:1;cursor:default}
.item-slot:not(:disabled):hover {background:#303b40;border-color:var(--item-accent)}
[data-item="turbo"] {--item-accent:#ffcf46}
[data-item="pulse"] {--item-accent:#d8adff}
[data-item="shield"] {--item-accent:#85f1de}
.item-art {
  display:grid;place-items:center;width:38px;height:36px;
  background:linear-gradient(140deg,#396069,#183340 75%);border:1px solid #5e8190;
  border-radius:4px;box-shadow:inset 0 -2px 0 #0d222a;
}
.item-art svg {width:29px;height:29px;stroke-width:1.25}
.item-copy {display:flex;flex-direction:column;gap:2px}
.item-copy .label {font-size:9px;line-height:1.1}
.item-copy b {font:var(--display);font-size:20px;line-height:1;color:var(--item-accent);text-transform:uppercase}
#item-key {background:var(--cream);color:var(--ink);border-color:#b9b6a2;align-self:center}
.race-countdown {
  position:absolute;left:50%;top:18%;transform:translateX(-50%);display:grid;
  justify-items:center;pointer-events:none;filter:drop-shadow(3px 4px 0 #14212ace);
}
.start-lights {
  display:flex;gap:7px;padding:6px 10px;background:#20272b;
  border:2px solid #b3b8ad;border-radius:20px;box-shadow:inset 0 -3px #131820;
}
.start-lights i {width:14px;height:14px;border-radius:50%;background:#643932;box-shadow:inset 1px 2px 2px #211c18}
.race-countdown[data-signal="3"] i:first-child,.race-countdown[data-signal="2"] i:nth-child(-n+2),.race-countdown[data-signal="1"] i {background:#ff6049;box-shadow:0 0 5px #ff705d}
.race-countdown[data-signal="GO!"] i {background:#60f5b5;box-shadow:0 0 5px #60f5b5}
.race-countdown strong {font:var(--display);font-size:clamp(62px,9vw,115px);line-height:1;color:var(--cream);-webkit-text-stroke:2px var(--ink);paint-order:stroke fill}
.race-countdown[data-signal="GO!"] strong {color:#74f2c6}
#item-message {
  position:absolute;bottom:14%;left:50%;transform:translateX(-50%);max-width:min(85%,410px);
  padding:5px 12px;border-radius:4px;background:#17222cf0;border-bottom:2px solid #a5eae6;
  box-shadow:2px 2px 0 #1620296b;color:var(--cream);text-align:center;
  pointer-events:none;font:700 14px/1.35 DM,sans-serif;
}
.touch #touch-item {border-color:var(--item-accent,#80b5bd);background:#223d4bea}
.touch #touch-item:disabled {opacity:.75;cursor:default}
#touch-item svg {width:27px;height:27px;stroke-width:1.35}
.guide-heading {margin:17px 0 4px;font:var(--display);font-size:24px;text-transform:uppercase}
.power-guide {display:grid;gap:9px;margin:0 0 19px}
.power-entry {display:flex;align-items:center;gap:9px;color:#cbd2d4;font-size:14px}
.power-entry svg {width:24px;height:24px;stroke-width:1.4}
.power-entry b {color:var(--cream);margin-right:3px}
.result-heading {display:flex;align-items:center;justify-content:space-between;gap:12px}
.result-heading h3 {font:var(--display);font-size:43px;line-height:1;text-transform:uppercase;color:var(--yellow);margin:4px 0 10px}
.result-time {text-align:right}.result-time b {font:600 21px Plex,monospace}
.standings {list-style:none;padding:0;margin:5px 0 13px;border:1px solid #48555c;border-radius:5px;overflow:hidden}
.standings li {display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:10px;padding:8px 12px;background:#242e35}
.standings li+li {border-top:1px solid #424e56}
.standings li.you {background:#3c3a2b;box-shadow:inset 3px 0 var(--yellow);color:var(--yellow)}
.standings li>b {font:var(--display);font-size:21px}
.standings li span {display:flex;align-items:center;gap:8px;font-weight:700}
.standings li i {width:9px;height:14px;background:var(--driver);transform:skewX(-14deg)}
.standings time {font:12px Plex,monospace}
@media(max-width:680px){
  .race-tools{right:10px;top:12px;gap:5px}
  .item-slot{min-height:36px;padding:3px 6px 3px 3px;gap:5px}
  .item-art{width:29px;height:27px}.item-art svg{width:23px;height:23px}
  .item-copy b{font-size:15px}.item-copy .label{font-size:8px;letter-spacing:1px}
  #item-key{display:none}.race-countdown{top:28%}
  #place-number{font-size:28px}.field-size{font-size:10px}
  .position-line{gap:3px}.course-body{column-gap:4px}
  #item-message{bottom:24%;font-size:12px}.start-lights i{width:11px;height:11px}
}
@media(max-height:545px){
  .race-tools{top:8px}.race-countdown{top:12%}
  .item-slot{min-height:32px}.item-art{height:24px}.item-art svg{height:21px}
  #place-number{font-size:23px}.item-copy b{font-size:15px}
}
#finish-result { position:absolute;left:50%;bottom:24%;transform:translateX(-50%);box-shadow:3px 3px #18212780 }
