:root{--ink:#202729;--red:#d84233;--paper:#f7f8f3;--muted:#5c6964;--line:#d5dbd2;color:var(--ink);font-family:var(--brand-font,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif);font-synthesis:none;background:#d9e1da}*{box-sizing:border-box}body{margin:0}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:disabled{cursor:wait;opacity:.5}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid var(--red);outline-offset:4px}a{color:inherit;text-decoration:none}[hidden]{display:none!important}#app{height:100dvh;min-height:400px;overflow:hidden;position:relative}#scene{position:absolute;inset:0;touch-action:none;outline:none}#scene canvas{display:block;width:100%;height:100%}header{position:absolute;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:22px 28px;z-index:5;pointer-events:none}header>*{pointer-events:auto}.brand-logo{width:106px;height:auto}.nav{display:flex;gap:7px}.icon{display:inline-grid;place-items:center;width:38px;height:38px;border:0;border-radius:50%;background:#f7f8f390;font-size:17px;letter-spacing:1px}.icon svg{width:20px;height:20px}#intro{position:absolute;left:50%;bottom:48px;transform:translateX(-50%);text-align:center;z-index:3;white-space:nowrap}#intro p{font-size:11px;margin:0 0 7px;color:var(--muted)}h1{font-size:36px;letter-spacing:-1.6px;line-height:1;margin:0 0 18px;font-weight:800}.primary{border:0;background:var(--red);color:var(--on-primary,white);font-weight:650;font-size:14px;padding:15px 30px;border-radius:5px;min-height:46px}#start{min-width:145px}#hud{position:absolute;z-index:4;left:50%;top:19px;transform:translateX(-50%);width:150px;background:#f7f8f3e8;border-radius:7px;overflow:hidden;box-shadow:0 4px 18px #20272908}.timer{text-align:center;padding:9px 15px 8px}.timer span{display:block;font-size:30px;font-variant-numeric:tabular-nums;letter-spacing:-1.5px;line-height:1.1;font-weight:700}.timer small{display:block;font-size:9px;line-height:1.4;color:var(--muted);margin-top:3px}.progress{height:3px;background:#d5dbd2}.progress i{height:100%;display:block;width:0;background:var(--red)}#map{position:absolute;width:110px;height:74px;right:24px;top:76px;z-index:3;opacity:.85}#countdown{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%);font-size:100px;font-weight:850;letter-spacing:-7px;color:white;text-shadow:0 3px 25px #20272940;z-index:4;pointer-events:none}#toast{position:absolute;left:50%;top:30%;transform:translateX(-50%);padding:9px 15px;background:var(--paper);border-radius:5px;color:var(--red);font-size:13px;font-weight:650;z-index:6;pointer-events:none}#hint{position:absolute;left:50%;bottom:42px;transform:translateX(-50%);margin:0;font-size:11px;background:#f7f8f3ad;padding:9px 15px;border-radius:20px;z-index:3;white-space:nowrap}#touch-controls{position:absolute;bottom:max(39px,calc(env(safe-area-inset-bottom) + 28px));left:24px;right:24px;display:flex;align-items:center;justify-content:space-between;pointer-events:none;z-index:4}#touch-controls button{pointer-events:auto;user-select:none;touch-action:none;border:1px solid #f7f8f3b0;background:#f7f8f3b5;backdrop-filter:blur(5px);color:var(--ink)}#touch-controls .steer{width:69px;height:65px;font-size:44px;border-radius:12px;line-height:1}#touch-controls button.pressed{background:var(--ink);color:white;border-color:var(--ink)}#brake{align-self:end;border-radius:20px;font-size:11px;padding:10px 19px;margin-bottom:4px}#pause{position:absolute;bottom:34px;right:27px;border:0;background:none;font-size:11px;z-index:3}#recover{position:absolute;left:50%;top:70%;transform:translateX(-50%);z-index:5;background:var(--paper);border:0;border-radius:5px;padding:12px 16px;font-size:12px;box-shadow:0 3px 20px #20272915}#recover small{color:var(--red);margin-left:6px}footer{position:absolute;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px 27px max(10px,env(safe-area-inset-bottom));font-size:9px;color:#42544a;pointer-events:none}footer a{pointer-events:auto;font-weight:600}dialog{border:0;border-radius:10px;background:var(--paper);color:var(--ink);width:min(430px,calc(100vw - 30px));max-height:calc(100dvh - 36px);padding:34px;box-shadow:0 25px 100px #20272945}dialog::backdrop{background:#20272968;backdrop-filter:blur(5px)}.close{position:absolute;right:10px;top:10px;background:none;font-size:23px;letter-spacing:0;width:30px;height:30px}h2{font-size:33px;line-height:1.02;letter-spacing:-1.3px;margin:8px 0 18px;font-weight:800}dialog p{font-size:12px;line-height:1.65;color:var(--muted)}.result-time{font-size:66px;line-height:1;font-weight:750;letter-spacing:-3px;font-variant-numeric:tabular-nums;margin:24px 0 6px}.result-time small{font-size:19px;letter-spacing:0}.splits{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);padding:10px 0 19px;font-size:11px;color:var(--muted)}.splits strong{color:var(--ink)}dialog label{display:block;font-size:11px;margin:18px 0 7px}dialog input{width:100%;font:inherit;padding:12px;border-radius:5px;border:1px solid #aeb9ad;background:white;color:var(--ink)}dialog .primary{width:100%;margin-top:12px}.actions{display:flex;gap:10px;margin-top:10px}.secondary{background:none;border:1px solid var(--line);border-radius:5px;padding:12px;font-size:12px;flex:1}.cta{display:block;text-align:center;font-size:12px;text-decoration:underline;margin-top:24px}.note{font-size:10px!important;color:var(--muted)}.form-status{font-size:11px!important}table{width:100%;border-collapse:collapse;font-size:12px;margin:20px 0}th,td{padding:11px 0;text-align:left;border-bottom:1px solid var(--line)}th{font-size:10px;font-weight:500;color:var(--muted)}th:last-child,td:last-child{text-align:right}.empty{padding:20px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.menu-actions{display:grid;gap:8px}.menu-actions .secondary{text-align:left;padding:14px}#status{position:absolute;left:50%;bottom:22%;transform:translateX(-50%);z-index:20;background:var(--ink);color:white;max-width:90%;width:max-content;padding:12px 18px;font-size:12px;line-height:1.5;border-radius:5px}.hud-hidden #hud{display:none}@media(min-width:851px) and (pointer:fine){#touch-controls{display:none!important}}@media(max-width:850px),(pointer:coarse){#hint{bottom:118px}.race #pause{display:none}#map{right:15px;top:69px;width:95px;height:65px}}@media(max-width:550px){header{padding:18px 17px}.brand-logo{width:76px}.icon{width:33px;height:33px}#hud{top:13px;width:123px}.timer span{font-size:26px}.timer{padding:8px 12px}.timer small{font-size:8px}.race #board{display:none}#map{top:70px;width:86px;height:58px}#intro{bottom:49px}h1{font-size:29px;letter-spacing:-1px}#intro p{font-size:10px}#touch-controls{left:17px;right:17px}#touch-controls .steer{width:65px;height:62px}footer{padding-left:17px;padding-right:17px;font-size:8px}dialog{padding:32px 25px}.result-time{font-size:58px}}@media(max-height:510px){#app{min-height:340px}header{padding-top:12px}#intro{left:auto;right:30px;bottom:35px;transform:none}h1{font-size:28px}#hud{top:10px}#map{display:none!important}#touch-controls{bottom:30px}#touch-controls .steer{height:48px;width:55px}#hint{bottom:30px}#brake{margin-bottom:0}footer{padding-bottom:6px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

#ghost-label{display:block;font-size:9px;color:#307b85;text-align:center;padding:0 5px 7px}

.brand-logo{object-fit:contain;max-width:150px;height:40px}.brand-lockup{max-width:180px}#brand-name{font-size:17px;letter-spacing:-.7px}#intro{white-space:normal;width:min(520px,90vw)}.brand-lockup img[hidden]{display:none}#intro h1{text-wrap:balance}#celebration{position:absolute;inset:0;pointer-events:none;z-index:6}.finish-badge{display:inline-block;border:1px solid var(--line);padding:8px 12px;margin-top:5px;border-radius:30px;font-size:11px}dialog .note{overflow-wrap:anywhere}@media(max-width:550px){.brand-logo{max-width:100px;height:32px}.brand-lockup{max-width:105px}}

@media(max-width:550px){.brand-logo{width:100px}}

/* A clear invitation above the circuit; two-thumb controls during the lap. */
#intro{inset:100px 0 42px;width:100%;transform:none;display:flex;flex-direction:column;align-items:center;justify-content:space-between;pointer-events:none}
#intro .intro-copy{max-width:600px;padding:0 24px}#intro .eyebrow{font-size:10px;letter-spacing:2px;font-weight:650;margin-bottom:13px}#intro h1{font-size:clamp(34px,4vw,52px);margin-bottom:12px;letter-spacing:-2px}#intro #intro-tagline{font-size:13px}#intro .intro-launch{pointer-events:auto;text-align:center}#intro .intro-launch p{font-size:11px;margin:12px 0;color:var(--ink)}#intro .start-note{opacity:.65;font-size:10px!important}#start{min-width:210px;font-size:15px;min-height:52px}.mobile-help{display:none}
.steering-pair{display:flex;gap:10px}#brake{width:84px;height:65px;border-radius:12px;margin:0;font-size:13px;font-weight:700;padding:0}.race #touch-controls{bottom:max(38px,calc(env(safe-area-inset-bottom) + 28px))}#touch-controls button.pressed{background:var(--ink);color:var(--paper)}header{padding-top:max(20px,env(safe-area-inset-top))}#hud{top:max(19px,env(safe-area-inset-top))}dialog input{font-size:16px}.icon{min-width:44px;min-height:44px}
@media(max-width:850px),(pointer:coarse){.desktop-help{display:none}.mobile-help{display:block}#hint{bottom:120px}#intro{top:105px;bottom:max(42px,calc(env(safe-area-inset-bottom) + 30px))}}
@media(max-width:550px){#intro h1{font-size:39px;max-width:320px;letter-spacing:-1.5px}#intro .intro-copy{padding:0 20px}#intro #intro-tagline{font-size:12px}#touch-controls .steer{width:64px;height:64px}#brake{height:64px;width:84px}#hud{top:max(15px,env(safe-area-inset-top))}.race .brand-logo{width:75px}#intro .eyebrow{font-size:9px}}
@media(max-height:700px) and (min-height:511px){#intro{top:85px;bottom:35px}#intro h1{font-size:34px}#intro .eyebrow{margin-bottom:8px}}
@media(max-height:510px){#intro{inset:82px 28px 36px auto;width:240px;align-items:center;justify-content:center;gap:12px}#intro h1{font-size:30px;letter-spacing:-1px}#intro .intro-copy{padding:0}#intro .eyebrow{margin-bottom:8px}#intro #intro-tagline{display:none}#intro .intro-launch p{margin:8px 0}#start{min-height:46px}#touch-controls .steer,#brake{height:52px;width:64px}#hint{bottom:34px}.race #touch-controls{bottom:max(26px,env(safe-area-inset-bottom))}header{padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}}

@media(min-width:851px) and (min-height:511px){#intro{top:80px}}

.desktop-help kbd{display:inline-block;font-family:inherit;font-size:10px;font-weight:700;letter-spacing:.5px;border:1px solid #65736a;padding:4px 7px;border-radius:4px;background:var(--paper);box-shadow:0 2px 0 #65736a}#hint{font-weight:600;background:#f7f8f3e6}

/* Native long-press selection/callouts must not interrupt held driving inputs. */
#scene,#scene *,#touch-controls,#touch-controls *,#hud,#hint,#countdown,#toast,button{
 -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
}
#scene,#scene *,#touch-controls,#touch-controls *{-webkit-user-drag:none;touch-action:none}
dialog input,dialog textarea{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}

/* Full-height thumb zones: the labels are cues, not targets. */
.race #touch-controls{inset:80px 0 0;display:block;pointer-events:none}
#touch-controls .control-zone{position:absolute;top:0;bottom:0;width:50%;height:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;backdrop-filter:none;pointer-events:auto;touch-action:none;color:var(--ink)}
#touch-controls #steer-pad{left:0}#touch-controls #brake{right:0;left:auto;width:50%;height:100%;align-self:auto}
#touch-controls .control-zone.pressed{border:0;color:var(--ink);background:linear-gradient(to top,#f7f8f330,transparent 45%)}
#touch-controls #brake.pressed{background:linear-gradient(to top,#d8423340,transparent 65%)}




#hud,#map,#hint,#countdown,#toast{pointer-events:none}
@media(max-height:510px){.race #touch-controls{top:68px}#hint{bottom:92px}}

/* One steering surface covers the entire track view on touch screens. */
.race #touch-controls{inset:0}
#touch-controls #steer-pad{inset:0;width:100%;height:100%}

@media(max-height:510px){.race #touch-controls{top:0}}

.ghost-driver{position:absolute;z-index:3;max-width:160px;padding:5px 9px;border-radius:12px;background:#f7f8f3e8;border:1px solid #56a7b761;color:#286675;font-size:10px;font-weight:650;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transform:translate(-50%,-100%);box-shadow:0 2px 8px #20303912;pointer-events:none;user-select:none;-webkit-user-select:none}
#ghost-label{max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:550px){#ghost-label{max-width:140px}.ghost-driver{max-width:150px;font-size:9px}}

/* Keep the invitation readable while the actual grid fills the background. */
#app.intro::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(to bottom,#f7f8f32e 0%,transparent 32%,transparent 73%,#f7f8f34d 100%);z-index:1}
@media(max-height:510px) and (min-aspect-ratio:7/5){#app.intro::after{background:linear-gradient(to right,transparent 38%,#f7f8f335 52%,#f7f8f3e6 72%,#f7f8f3f5 100%)}}
#app.intro footer{z-index:2}

/* Invitation, grid and race UI share Pocket Putt's short fade and opening move. */
#intro .intro-copy,#intro .intro-launch{transition:opacity .18s ease-out,transform .18s ease-out}
.launching #intro .intro-copy,.launching #intro .intro-launch{opacity:0;transform:translateY(-6px);pointer-events:none}
#hud,#map,#pause{transition:opacity .2s ease-out}
.launching #hud,.launching #map,.launching #pause{opacity:0}
#app::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:1;background:linear-gradient(to bottom,#f7f8f32e 0%,transparent 32%,transparent 73%,#f7f8f34d 100%);opacity:0;transition:opacity .18s ease-out}
#app.intro::after{opacity:1}
@media(max-height:510px) and (min-aspect-ratio:7/5){#app::after{background:linear-gradient(to right,transparent 38%,#f7f8f335 52%,#f7f8f3e6 72%,#f7f8f3f5 100%)}}
.primary,.secondary,.icon,#pause{transition:transform .12s ease-out,opacity .12s ease-out}
.primary:active:not(:disabled),.secondary:active:not(:disabled),.icon:active,#pause:active{transform:scale(.97)}
@media(hover:hover) and (pointer:fine){.primary:hover:not(:disabled){filter:brightness(.94)}.secondary:hover,.icon:hover{background:var(--paper)}}
dialog[open]::backdrop{animation:veil-in .18s ease-out}
.result-time{animation:result-in .24s .06s cubic-bezier(.16,1,.3,1) both}
@keyframes veil-in{from{opacity:0}to{opacity:1}}
@keyframes result-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.primary:active:not(:disabled),.secondary:active:not(:disabled),.icon:active,#pause:active{transform:none}}

/* Instructions stay on the invitation; a quiet wheel reflects live input. */
.gesture-demo{display:flex;align-items:center;justify-content:center;gap:20px;color:var(--ink)}
.gesture-demo svg{width:36px;height:36px;animation:steering-demo 2.6s .5s ease-in-out 2}
.gesture-demo span{font-size:22px}
#intro .mobile-help p{line-height:1.65;margin:8px 0}
#intro .mobile-help .auto-speed{font-size:10px;opacity:.75;margin:5px 0 12px}
#steering-feedback{position:absolute;bottom:max(40px,calc(env(safe-area-inset-bottom) + 28px));left:50%;transform:translateX(-50%);z-index:4;pointer-events:none;color:var(--paper);opacity:.55;filter:drop-shadow(0 1px 1px #20272966)}
#steering-wheel{display:block;width:80px;height:80px}
@keyframes steering-demo{0%,100%{transform:rotate(0)}25%{transform:rotate(-45deg)}75%{transform:rotate(45deg)}}
@media(max-height:510px){.gesture-demo{display:none}#intro .mobile-help p{margin:4px 0}#intro .mobile-help .auto-speed{margin:3px 0}#steering-feedback{bottom:26px}#steering-wheel{width:64px;height:64px}}

/* The result follows the same score, board, name and replay order as the runner. */
.intro #board{display:none}#intro .intro-launch{width:min(340px,calc(100vw - 48px))}#intro #start{width:100%;min-height:54px}
#intro .start-note{display:none}.result-dialog{width:min(440px,calc(100vw - 28px));padding:24px;border-radius:8px}
.result-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding-bottom:16px}
.result-heading img{width:78px;height:36px;object-fit:contain}.result-heading h2{font-size:24px;letter-spacing:-.8px;margin:0}
.result-dialog .result-time{display:flex;align-items:baseline;gap:8px;margin:20px 0 8px;font-size:64px;letter-spacing:-2px}
.result-time small{font-size:13px;font-weight:500;letter-spacing:0}.result-outcome{margin:0 0 16px;font-size:13px}
.lap-unfinished{font-size:32px;letter-spacing:-1px;margin:24px 0 10px}.replay-button{min-height:48px;margin-top:18px!important}
.result-tools{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:6px;flex-wrap:wrap}
.result-tools a,.text-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 0;background:none;border:0;text-decoration:underline;font:inherit;font-size:12px;color:var(--muted)}
.score-fields{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px}.score-fields input{min-width:0}.score-fields button{min-height:44px;white-space:nowrap}
@media(max-width:550px){.result-dialog{padding:20px}.result-dialog .result-time{font-size:58px}}

.result-heading h2:focus{outline:none}

.practice-board{border-top:1px solid var(--board-line,#d4d5cb);padding-top:16px;margin-top:18px;text-align:left;color:inherit}
.practice-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.practice-heading h3{font-family:inherit;font-weight:700;font-size:16px;line-height:1.2;margin:0;letter-spacing:0}
.practice-heading span{font-size:10px;line-height:1.5;text-align:right;opacity:.7}
.practice-board p{font-size:12px;line-height:1.5;margin:8px 0}
.practice-status:empty,.practice-saved:empty{display:none}
.practice-ranking{list-style:none;padding:0;margin:0;max-height:220px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.practice-ranking:empty{display:none}
.practice-ranking li{display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:10px;min-height:44px;padding:10px 8px;border-radius:0;border-bottom:1px solid var(--board-line,#d4d5cb);font-size:13px;line-height:1.4}
.practice-ranking .is-current{background:var(--board-highlight,#e4e6da);box-shadow:none;border-left:0;border-right:0}
.practice-ranking .rank-name{min-width:0;overflow-wrap:anywhere}.practice-ranking .rank-score{white-space:nowrap;font-variant-numeric:tabular-nums}
.practice-ranking .rank-number{opacity:.7;font-size:11px}
.practice-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;margin-top:14px}
.practice-form label{display:grid;gap:6px;font-size:12px;font-weight:600;margin:0;min-width:0}
.practice-form label span{display:none}
.practice-form input{display:block;width:100%;min-width:0;min-height:44px;border:1px solid var(--board-line,#c6c9bd);border-radius:6px;padding:10px 12px;background:#fff;color:inherit;font-family:inherit;font-weight:400;font-size:16px;line-height:1.2}
.practice-form button{min-height:44px;padding:10px 14px;border:1px solid currentColor;border-radius:6px;background:transparent;color:inherit;font-family:inherit;font-weight:600;font-size:13px;line-height:1.2;white-space:nowrap}
.practice-board [hidden]{display:none!important}
.practice-board :focus-visible{outline:2px solid currentColor;outline-offset:3px}
@media(max-height:700px){.practice-ranking{max-height:132px}}
