:root{font-family:system-ui,sans-serif;color:#17222e;background:#eeeade;color-scheme:light}*{box-sizing:border-box}body{margin:0}header{background:#17222e;display:flex;justify-content:space-between;align-items:center;padding:16px max(16px,calc((100vw - 1050px)/2));gap:20px}header img{width:210px;max-width:45vw;height:auto}a{color:inherit}.back{color:#fff;font-weight:700;text-decoration:none}main{max-width:1050px;margin:30px auto;padding:0 16px 40px}.panel{background:#fffbf1;border:2px solid #17222e;border-radius:20px;padding:clamp(20px,4vw,40px);box-shadow:6px 6px 0 #17222e1c;margin-bottom:24px}.eyebrow{font-size:12px;letter-spacing:.14em;font-weight:850;color:#28777f}h1{font-size:clamp(36px,6vw,65px);line-height:1.04;letter-spacing:-.055em;margin:16px 0 24px}h1 em{font-style:normal;color:#137f8b}h2{font-size:28px;line-height:1.1}.lead{font-size:20px;max-width:650px}p{line-height:1.6}button,select,input{font:inherit;border:2px solid #17222e;border-radius:10px;min-height:48px;padding:12px 18px}button{cursor:pointer;background:#fffaf0;font-weight:750;color:#17222e}button:disabled{opacity:.55;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:4px solid #007e9c;outline-offset:3px}.primary{background:#ffde45}.actions{display:flex;gap:12px;flex-wrap:wrap;margin:20px 0}.actions button{flex:1;min-width:180px}label{display:block;font-weight:750;margin:16px 0 8px}select{max-width:100%;width:420px;background:white}.join{display:flex;gap:8px;max-width:420px}.join input{min-width:0;width:100%;text-transform:uppercase;letter-spacing:.18em}.small{font-size:13px;color:#52616b}#message:not(:empty){padding:14px;background:#fff2b8;border-radius:10px}#message{margin:14px 0}.raceHeader{background:#17222e;color:#fff;padding:14px 18px;border-radius:16px 16px 0 0;display:flex;justify-content:space-between;align-items:center;gap:10px}.raceHeader .eyebrow{color:#9ee0e5;display:block;font-size:10px}.raceHeader strong{font-size:28px}.raceHeader button{padding:8px;min-height:42px;font-size:13px}.raceHeader>div:last-child{display:flex;align-items:center;gap:8px}#roomCode{font-size:13px;font-weight:800}.viewport{position:relative;aspect-ratio:16/10;background:#9dc6d7;overflow:hidden}.viewport canvas{display:block;width:100%;height:100%;touch-action:none}.selfScore{position:absolute;left:14px;top:14px;display:grid;gap:3px;background:#17222edb;color:white;border-radius:10px;padding:10px 14px;pointer-events:none}.selfScore strong{font-size:25px}.selfScore small{font-size:11px}#countdown{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);font-size:70px;color:#ffde45;text-shadow:0 3px 6px #17222e;pointer-events:none}#connection:not(:empty){position:absolute;bottom:10px;left:10px;right:10px;padding:10px;background:#fff2b8;border-radius:8px;font-weight:700;font-size:13px}.controls{display:grid;grid-template-columns:1fr 1.6fr 1fr;gap:10px;margin:12px 0}.controls button{min-height:64px;touch-action:none;background:#ffde45;font-size:21px}.controls #brake{background:#4fcec8;font-size:16px}.controls #brake[aria-pressed=true]{background:#e88742}.controlsHelp{text-align:center;margin-top:0}ol{padding:0;list-style:none}ol li{display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid #17222e25}ol li strong{margin-left:auto}ol li.mine{background:#a8e3df;border-radius:8px}.swatch{width:12px;height:12px;border-radius:50%;display:inline-block}#positions{display:grid;grid-template-columns:1fr 1fr;gap:6px}#positions li{font-size:13px}.ranking{margin-top:30px}.tabs{display:flex;gap:8px}.tabs [aria-pressed=true]{background:#17222e;color:#fff}[hidden]{display:none!important}@media(max-width:600px){main{margin-top:16px;padding:0 10px 24px}.viewport{aspect-ratio:4/5}.raceHeader{padding:10px}.raceHeader .eyebrow{max-width:150px}.raceHeader>div:last-child{flex-wrap:wrap;justify-content:flex-end;max-width:160px}#positions{grid-template-columns:1fr}.selfScore{left:8px;top:8px;padding:8px}header{padding:12px}.back{font-size:13px}.controls{gap:6px}.actions{gap:8px}}

.waiting{padding:16px;background:#d3eeea;border:2px solid #28777f}.waiting p{margin:8px 0}.selfScore>span{font-size:12px}

#spectatorStatus{position:absolute;bottom:64px;left:10px;right:10px;padding:10px 14px;border-radius:8px;background:#17222eee;color:#fff;font-size:13px;text-align:center;pointer-events:none}

.vehicleCards{display:flex;overflow-x:auto;gap:12px;scroll-snap-type:x mandatory;padding:4px 4px 14px}.vehicleCard{flex:0 0 156px;padding:6px;scroll-snap-align:start;background:#fff;border-color:#b9c4c7}.vehicleCard img{display:block;width:100%;height:100px;object-fit:contain;border-radius:6px}.vehicleCard strong{display:block;font-size:13px;padding:8px 4px;min-height:48px}.vehicleCard[aria-pressed=true]{border:3px solid #087787;background:#d9f1ef}.fleetTitle{font-size:20px}.audioControls{display:flex;gap:8px;justify-content:flex-end;margin:12px 0}.audioControls button{min-height:42px;font-size:13px;padding:8px 12px}.raceHelp{font-size:12px;color:#52616b;margin:12px 0}.raceHelp summary{cursor:pointer}.controlsHelp{font-size:12px;color:#52616b;margin:8px 0}.selfScore strong{font-size:21px}@media(prefers-reduced-motion:reduce){.vehicleCards{scroll-behavior:auto}}

/* All choices exposed in a native, keyboard-accessible expandable sheet. */
.fleetPanel{border:2px solid #709ca5;border-radius:12px;background:#e3f3f5;padding:14px;margin:20px 0}.fleetPanel summary{cursor:pointer;font-weight:800;line-height:1.5}.fleetPanel summary small{display:block;font-weight:600;color:#28616a;margin-top:4px}.fleetPanel .vehicleCards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;scroll-snap-type:none;padding:16px 0 0}.fleetPanel .vehicleCard{min-width:0}.fleetPanel .vehicleCard img{height:110px}@media(max-width:600px){.fleetPanel .vehicleCards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.fleetPanel .vehicleCard img{height:90px}}

/* Static watermark art lives only in the lobby, never in the racing renderer. */
.networkHero{position:relative;isolation:isolate;overflow:hidden;border-radius:12px;margin:-12px -12px 20px;padding:24px 24px 125px;min-height:420px;background:#fffbf1}.heroArt{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 64%;opacity:.32;pointer-events:none;z-index:-1}.heroCopy{position:relative;max-width:680px}.networkHero h1{margin-top:16px}.networkHero .lead{font-weight:550}.networkHero:after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,#fffbf14d,transparent 80%)}@media(max-width:600px){.networkHero{min-height:390px;padding:16px 12px 150px;margin:-10px -10px 18px}.heroArt{object-fit:contain;object-position:center bottom;opacity:.4}.networkHero h1{font-size:39px}.networkHero .lead{font-size:17px;line-height:1.5}.networkHero:after{background:linear-gradient(#fffbf1 5%,#fffbf1b0 38%,transparent 75%)}}

.controls:has(.turbo:not([hidden])){grid-template-columns:1fr 1.2fr 1.2fr 1fr}.controls .turbo{background:#4dd0d4;color:#17222e;font-size:14px;min-width:0;padding:12px 4px}.controls button:disabled{opacity:.6}

.podium{margin-top:20px}.podium h2{margin:4px 0 8px}.podiumPlaces{list-style:none;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:end}.podiumPlace{display:flex;flex-direction:column;gap:8px;text-align:center;padding:18px 8px;background:#e7efef;border:2px solid #9fb9bd;border-radius:12px;overflow-wrap:anywhere}.podiumPlace strong{font-size:32px}.podiumPlace span{font-weight:800}.podiumPlace small{font-size:12px}.podiumPlace.place1{background:#fff0a6;border-color:#c79b27;padding-top:32px}.podiumPlace.mine{box-shadow:inset 0 0 0 2px #087787}.podiumPlace.pending{opacity:.7}.podiumPlace:nth-child(4){grid-column:1/-1;padding:10px}.podiumStatus{font-size:14px}@media(max-width:420px){.podiumPlaces{gap:5px}.podiumPlace{padding:14px 5px;font-size:13px}.podiumPlace strong{font-size:26px}}

/* Keep road and driving controls together on short mobile screens. */
@media(max-width:600px){
 .viewport{aspect-ratio:auto;height:clamp(180px,calc(100svh - 190px),520px)}
 .controls{position:sticky;bottom:0;z-index:5;background:#eeeade;padding:8px 0 max(8px,env(safe-area-inset-bottom));margin:0;box-shadow:0 -4px 12px #17222e18}
 .controls button{min-width:0;padding:10px 4px;min-height:56px}
 .selfScore{gap:2px;max-width:60%;padding:6px 8px}
 .selfScore strong{font-size:16px}
 .selfScore>span{font-size:11px}
 .raceHeader strong{font-size:21px}
}

.network-header-links{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px 10px;min-width:0}
.network-header-links a{display:inline-flex;align-items:center;min-height:44px}
.sectorHud{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0;color:#e6f2fb;background:#123248;border-radius:8px;padding:7px 12px;font-size:.88rem;font-weight:750}
.sectorHud progress{width:min(48%,290px);height:12px;accent-color:#55d9ce}
#turbo[data-turbo="active"]{background:#f8dd4e;color:#16232c;border-color:#f8dd4e;box-shadow:0 0 12px #ffdf5766;opacity:1}
#turbo[data-turbo="ready"]{background:#43d6cc;color:#102538}

#rematchStatus:empty{margin:0}
#rematchStatus:not(:empty){padding:10px 12px;background:#fff2b8;border-radius:8px;font-weight:650}
