:root{font-family:system-ui,-apple-system,sans-serif;color:#143f49;background:#ecf6ee}*{box-sizing:border-box}body{margin:0;background:linear-gradient(#ccece5,#f5f6e9);min-height:100vh}.wrap{max-width:720px;margin:auto;padding:12px 16px 40px}.back{font-size:12px;color:#226f77;display:inline-block;margin-bottom:8px}header{text-align:center;margin:12px 0}.eyebrow{font-size:10px;letter-spacing:.18em;color:#2c8b85;font-weight:800}h1{font-size:clamp(21px,5vw,30px);margin:4px 0}header p{font-size:12px;margin:4px 0;color:#587a78}.dashboard{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;font-size:12px;font-weight:800}.dashboard strong{font-size:20px}.dashboard small{font-size:10px;color:#527b7a}#road-state{font-size:10px;color:#317c72}.time-source{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.scene{position:relative;border:2px solid #8bbdb4;border-radius:18px;overflow:hidden;background:#83cee0;box-shadow:0 8px 25px #18464c1c}canvas{width:100%;display:block;aspect-ratio:4/3;touch-action:none}#overlay{position:absolute;inset:0;background:#124b5c55;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:white;text-shadow:0 2px 6px #1c4d6d;text-align:center;padding:16px;pointer-events:none}#overlay[hidden]{display:none}#overlay strong{font-size:clamp(23px,5vw,36px)}#overlay span{font-size:12px}#status{text-align:center;font-size:12px;min-height:18px;margin:8px 0;color:#426b68}#controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}button{font:inherit;font-size:13px;font-weight:800;min-height:42px;border:1px solid #73a69d;border-radius:12px;background:#f6fcf7;color:#205b5c;padding:9px;cursor:pointer}#controls button{font-size:17px;min-height:50px;background:#226e76;color:white;touch-action:none}button:active{transform:translateY(1px)}button:focus-visible{outline:3px solid #d3a43c;outline-offset:2px}button:disabled{opacity:.55;cursor:default}.actions{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:7px;margin-top:8px}.primary{background:#ffdf86;border-color:#d7b464}.ranking h2{color:#173f49}details{font-size:12px;line-height:1.8;margin:20px 0;color:#456d67}summary{cursor:pointer}#play-access{text-align:center;padding:30px 5px}#login-link{color:#176d5e}.score-hud-note{line-height:1.25!important}
@media(max-width:600px){.wrap{padding:6px 10px 28px}.back{margin-bottom:3px}header{margin:5px 0}header p{display:none}h1{font-size:21px}.dashboard{margin:5px 0}.scene{width:min(100%,calc((100svh - 340px)*1.3333));min-width:180px;margin:auto}.score-hud{margin-bottom:5px!important}.score-hud-note{font-size:9px!important}#controls button{min-height:48px}#status{font-size:11px;margin:6px 0}.actions{margin-top:6px}details{margin-top:14px}}
@media(max-height:480px) and (orientation:landscape){.scene{max-width:320px;margin:auto}header p{display:none}}

/* Keep the playing surface and primary controls together on small screens. */
button { -webkit-tap-highlight-color:transparent; }
button:focus-visible { outline:3px solid #e5b955; outline-offset:3px; }
canvas { touch-action:none; }
@media (max-width:600px) {
 body { padding-bottom:env(safe-area-inset-bottom); }
 .wrap,.shell { padding:6px 10px 28px; }
 .back { margin:0 0 3px;padding:4px 0;font-size:11px; }
 header { margin:4px 0; }
 .eyebrow { margin:4px 0;font-size:9px; }
 h1 { font-size:22px;margin:4px 0; }
 header>p:not(.eyebrow),.lead { display:none; }
 .score-hud { margin:4px 0 6px!important;padding:8px!important; }
 .score-hud-note { font-size:9px!important;line-height:1.3!important;margin-top:4px!important; }
 .actions { gap:6px;margin-top:7px; }
 .actions button { min-width:0;min-height:44px;font-size:12px;padding:8px 5px; }
 details { margin-top:16px;font-size:12px; }
}
@media (prefers-reduced-motion:reduce) { button:active { transform:none!important; } }

.lap-track{height:5px;border-radius:8px;background:#bbd7ce;margin-top:8px;overflow:hidden}.lap-track i{display:block;height:100%;width:0;background:#218578}.corner-tip{text-align:center;font-size:11px;font-weight:750;color:#23655e;margin:6px 0}
@media(max-width:600px){.scene{width:min(100%,max(180px,calc((100svh - 380px)*1.3333)));}}
