/* Keep native gestures available in the masthead and give the game both thumbs. */
html,body{overflow:hidden;overscroll-behavior:none}
body{position:fixed;inset:0;height:100%;height:100dvh}
.scene{touch-action:none;overscroll-behavior:none;-webkit-user-select:none;-webkit-touch-callout:none}
.scene button,.scene canvas{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

.scene>.caption,.scene>.readout,.scene>button{z-index:2}

.scene{--deck-size:min(65vw,294px,43dvh);--hud-edge:clamp(12px,3.4vw,36px)}
.deck-control{position:absolute;z-index:2;left:50%;bottom:max(3px,env(safe-area-inset-bottom));width:var(--deck-size);height:var(--deck-size);transform:translateX(-50%)}
.scene .deck-face{width:100%;height:100%;border:0;border-radius:50%;background:transparent;color:#f7fff9;padding:0;touch-action:none}
.deck-face svg{display:block;width:100%;height:100%;pointer-events:none;filter:drop-shadow(0 1px 1px #09323b88)}
.deck-face .rim{fill:#a7e4ef29;stroke:#daedf2a8;stroke-width:.8}
.deck-face .rail-ring{transform-origin:70px 70px;transform:rotate(var(--rail,0deg))}
.deck-face .ticks{fill:none;stroke:#e0f4f1ab;stroke-width:2;stroke-dasharray:.45 5.55}
.deck-face .rails{fill:none;stroke:#ecf6e8de;stroke-width:2.4;stroke-linecap:round}
.deck-face .index{fill:#effae8}
.deck-face .hub{fill:#a9d7da1c;stroke:#deeee4b8;stroke-width:1.2}
.stance-prints{visibility:hidden;transform-box:view-box;transform-origin:50% 50%;transform:rotate(var(--stance-angle,0deg))}
.deck-face.planted .stance-prints{visibility:visible}
.deck-face .front-foot{opacity:var(--front-print,.72)}
.deck-face .rear-foot{opacity:var(--rear-print,.72)}
.deck-face .contact{opacity:0;transform:translate(var(--thumb-x,0%),var(--thumb-y,0%));fill:#effdf4;stroke:#366d798c;stroke-width:1.1}
.deck-face.held .contact{opacity:.9}.deck-face.ready .hub{stroke:#fff3a6;stroke-width:2}
.deck-control[data-edge="toes"]{--toe-ink:#d0f5ee;--toe-alpha:var(--edge-ink)}
.deck-control[data-edge="heels"]{--heel-ink:#d0f5ee;--heel-alpha:var(--edge-ink)}
.deck-control[data-risk="toes"] .rails,.deck-control[data-risk="heels"] .rails{stroke:#eb997b}
.deck-control[data-risk="toes"]{--toe-ink:#fa816e}
.deck-control[data-risk="heels"]{--heel-ink:#fa816e}
.deck-face #action{opacity:0;text-anchor:middle;font:700 6px var(--mono);letter-spacing:.5px;fill:#fffbea;paint-order:stroke;stroke:#173d49;stroke-width:1.4;stroke-linejoin:round}
.deck-face.ready #action{opacity:1}
.surf-options{position:absolute;z-index:2;top:calc(clamp(12px,2.5vw,28px) + clamp(28px,7vw,52px) + 2px);left:clamp(15px,3.4vw,40px);display:flex;gap:12px}
.surf-options button,.surf-icon{background:transparent;color:#fffef3;border:0;text-shadow:0 1px 4px #062b3d}
.surf-options button{padding:0;min-height:40px;font:700 10px var(--mono);text-transform:uppercase;letter-spacing:.065em}
.surf-options button[aria-pressed=true]{text-decoration:underline;text-underline-offset:5px;text-decoration-thickness:2px}
.surf-tools{position:absolute;z-index:2;top:6px;right:calc(var(--hud-edge) - 10px);display:flex}
.scene h1 svg{max-width:min(67vw,calc(100vw - 160px))}
.surf-icon{position:static;display:grid;place-items:center;width:44px;height:44px;padding:10px}
.surf-icon svg{width:21px;filter:drop-shadow(0 1px 2px #13333d)}
#camera-toggle[aria-pressed=true]{color:#a3eafa}
.surf-icon:active{color:#a3eafa}.surf-audio .mute,.surf-audio[aria-pressed=false] .waves{display:none}.surf-audio[aria-pressed=false] .mute{display:block}
.scene .readout{left:auto;bottom:auto;right:var(--hud-edge);top:52px;width:min(43%,230px);transform:none;text-align:right}
.scene .timer,.scene .meter{justify-content:flex-end}.scene .timer strong{font-size:clamp(18px,4.9vw,25px)}
.scene .readout p{margin:7px 0 0;font-size:clamp(9px,2.2vw,11px);line-height:1.3;letter-spacing:.035em}
@media(max-height:510px) and (orientation:landscape){.scene{--deck-size:min(39dvh,168px)}.surf-options{top:32px}.scene .readout{top:46px}}
@media(min-width:701px){.scene{--deck-size:min(26vw,246px,36dvh)}}

.surf-stats{position:absolute;z-index:5;left:6px;top:110px;color:#d8fff6;background:#082631e8}
.surf-stats pre{font:10px/1.35 monospace;margin:3px 5px;pointer-events:none}

/* Leave the sky clear once the player is on the water. */
.ocean-ready > .caption{opacity:0;transition:opacity 1.2s ease-out 2.4s;pointer-events:none}
.ocean-ready.underway > .caption{transition-delay:0s;transition-duration:.45s}
@media(prefers-reduced-motion:reduce){.ocean-ready > .caption,.ocean-ready.underway > .caption{transition-duration:0s}}
