/* KAZAMAKASE — r04. One palette and component system, led by the game HUD.
   Screen references: scd/design/r04/screens. Functional copy >=12px (compact landscape >=11px). */
:root{color-scheme:dark;--ui-yellow:#f1c65a;--ui-red:#d65c46;--ui-ink:#181d20;--ui-panel:#292d2d;--ui-white:#f6f1e3;--ui-muted:#cbc7b8;--ui-rule:#f6f1e344;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;--space-8:32px;--font-display:Impact,"Arial Narrow",Arial,sans-serif;font-family:Arial,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;font-synthesis:none;color:var(--ui-white);background:var(--ui-ink);-webkit-tap-highlight-color:transparent}
*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;min-height:100svh;display:grid;place-items:center;background:var(--ui-ink)}button{font:inherit;font-weight:800;cursor:pointer;touch-action:manipulation;color:inherit;border:0}button:focus-visible{outline:none;box-shadow:inset 0 0 0 3px var(--ui-yellow),inset 0 0 0 5px var(--ui-ink)}button:active{transform:translateY(1px)}
#game{position:relative;isolation:isolate;width:100%;max-width:none;height:100dvh;min-height:300px;overflow:hidden;background:#82958d}#world{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(#19202511,transparent 30%,transparent 70%,#19202533)}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:max(28px,env(safe-area-inset-top)) 20px max(32px,env(safe-area-inset-bottom));background:linear-gradient(#18202344,transparent 40%,#141c21ed)}.eyebrow{font:italic 800 12px/1.4 Arial,sans-serif;letter-spacing:.16em;color:var(--ui-yellow)}
.primary,.secondary{display:flex;align-items:center;justify-content:center;gap:16px;min-height:54px;padding:14px 20px;font:italic 900 16px/1.2 Arial,sans-serif;letter-spacing:.055em;clip-path:polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,0 100%)}.primary{background:linear-gradient(110deg,#ffe39b,#efbf4b);color:#26251e}.primary:hover{background:#ffe8ac}.primary>span{margin-left:auto;font-size:24px;line-height:1}.secondary{background:#7b85852b;color:var(--ui-white)}.secondary:hover{background:#7b85854b}.actions{display:grid;grid-template-columns:1fr 1.55fr;gap:12px;margin-top:16px}.wide{width:100%}
.home-content{display:flex;flex-direction:column;width:min(560px,100%);height:100%;text-align:center}.home-content h1.game-logo{align-self:center;width:min(560px,calc(100vw - 48px));margin:22px 0 0;line-height:0;flex-shrink:0}.game-logo img{display:block;width:100%;height:auto;opacity:.98}.home-space{flex:1;min-height:30px}.home-mode-label{font:italic 800 14px/1.4 Arial,sans-serif;letter-spacing:.19em;text-shadow:0 1px 3px #000;margin-bottom:12px}.mode-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:16px}.mode-options button{min-height:72px;padding:14px 4px;display:flex;align-items:center;justify-content:center;background:#171d23ad;border-bottom:2px solid transparent;text-align:center}.mode-options strong{display:block;font:italic 900 clamp(16px,4.2vw,20px)/1.2 Arial,sans-serif;letter-spacing:.01em;margin:0}.mode-options small{display:block;font:700 12px/1.3 Arial,sans-serif;color:var(--ui-muted)}.mode-options button[aria-pressed=true]{background:var(--ui-yellow);color:#24231d;border-bottom-color:var(--ui-red)}.mode-options button[aria-pressed=true] small{color:#51482e}
#select.screen{justify-content:center;gap:20px;overflow-y:auto;background:linear-gradient(#18202377,#182023cf 65%)}.section-heading{text-align:center;width:100%;text-shadow:0 2px 4px #182023}.section-heading h2{font:italic 900 clamp(38px,5vw,52px)/1.08 var(--font-display);letter-spacing:.035em;margin:6px 0}.section-heading p{font:italic 700 12px/1.4 Arial,sans-serif;letter-spacing:.08em;margin:8px 0 0;color:var(--ui-white)}.food-picker{width:min(560px,100%);display:flex;flex-direction:column;gap:12px;margin:0}.food-preview-stage{height:clamp(190px,30vh,300px);position:relative;width:100%;background:radial-gradient(ellipse,#b8b8a014,transparent 68%)}#preview-food{display:block;width:100%;height:100%}.food-options{display:flex;justify-content:center;gap:8px}.food-options button{min-height:44px;min-width:88px;background:none;border-bottom:2px solid transparent;font:italic 900 14px Arial,sans-serif;letter-spacing:.06em;color:var(--ui-muted)}.food-options button[aria-pressed=true]{color:var(--ui-yellow);border-bottom-color:var(--ui-red)}.food-picker .actions{margin-top:28px}
.control-guide{padding:6px 20px 0;filter:drop-shadow(0 2px 2px #0008)}.guide-inputs{display:grid;grid-template-columns:1fr 1fr;gap:30px;text-align:center}.guide-symbol{height:100px;display:grid;place-items:center}.gesture-sprite{display:block;position:relative;--gesture-size:100px;width:var(--gesture-size);height:var(--gesture-size);overflow:hidden;flex:none}.gesture-sprite>img{position:absolute;top:0;left:0;width:calc(var(--gesture-size)*2);height:var(--gesture-size);max-width:none}.gesture-right>img{left:calc(var(--gesture-size)*-1)}.guide-inputs strong{display:block;font:italic 900 16px/1.3 Arial,sans-serif;letter-spacing:.09em;margin:8px 0}.guide-key{display:flex;align-items:center;justify-content:center;gap:5px;min-height:30px}.guide-key kbd{background:#f0f2e7;color:var(--ui-ink);border:0;border-bottom:2px solid #8d938a;border-radius:2px;padding:5px;min-width:28px;font:900 12px/1.2 Arial,sans-serif}.guide-key span{color:var(--ui-muted);font:800 12px/1.3 Arial,sans-serif;letter-spacing:.05em;margin-left:6px}
#hud{position:absolute;inset:0;pointer-events:none;font-family:Arial,sans-serif}.hud-left{position:absolute;top:max(16px,env(safe-area-inset-top));left:16px;width:210px;padding:12px 16px 14px;display:flex;flex-direction:column;gap:14px;isolation:isolate}.hud-left::before{content:"";position:absolute;z-index:-1;inset:-16px -14px -18px -22px;pointer-events:none;background:radial-gradient(ellipse at 35% 40%,#182023a6,transparent 75%)}.hud-card{width:100%}.hud-card>small{display:block;font:italic 900 12px/1.3 Arial,sans-serif;letter-spacing:.1em;color:#ffe7a1;text-shadow:0 1px 3px #182023}.hud-card>strong{display:block;font:italic 900 35px/1.12 Arial,sans-serif;letter-spacing:-.045em;margin-top:7px;font-variant-numeric:tabular-nums;filter:drop-shadow(0 2px 2px #182023)}.delivery-tag{display:flex;margin-top:8px;font-size:12px;font-weight:700;line-height:1.3}.delivery-tag>span:last-child{display:none}.quality-badge{width:100%}.quality-heading{display:flex;align-items:baseline;gap:5px}.quality-heading>span{margin-right:auto;font:italic 800 12px Arial,sans-serif}.quality-badge strong{font:italic 900 25px/1 Arial,sans-serif}.quality-badge small{font-size:12px;color:var(--ui-muted)}.quality-track{height:3px;margin-top:8px;background:#f6f1e355;overflow:hidden}.quality-track b{display:block;height:100%;transform-origin:left;background:var(--ui-yellow)}.quality-track b.low{background:var(--ui-red)}
.hud-right{position:absolute;right:16px;top:max(16px,env(safe-area-inset-top));display:flex;align-items:flex-end;flex-direction:column;gap:10px}.round{pointer-events:auto;width:44px;height:44px;background:transparent;font-size:21px;text-shadow:0 2px 3px #182023}.map{width:110px;padding:3px 8px 8px}.map-title{display:flex;justify-content:space-between;padding-bottom:5px;border-bottom:1px solid var(--ui-red);font-size:12px;font-weight:900;text-shadow:0 1px 3px #182023}.map-title span{font:italic 700 12px Arial,sans-serif}#minimap{display:block;width:94px;height:124px;margin-top:7px;filter:drop-shadow(0 1px 2px #182023)}.speed{position:absolute;right:26px;bottom:150px;text-shadow:0 2px 4px #1119}.speed-readout{display:flex;align-items:baseline;gap:8px}.speed strong{font:italic 900 64px/1 Arial,sans-serif;letter-spacing:-.065em;font-variant-numeric:tabular-nums}.speed span{font:italic 800 14px Arial,sans-serif;color:var(--ui-yellow)}
#controls{position:absolute;bottom:0;left:0;right:0;padding:12px 16px max(24px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#182023a6);touch-action:none}.tilt{width:240px;margin:0 auto 14px}.tilt-label{display:flex;justify-content:space-between;font:italic 800 12px/1.3 Arial,sans-serif;letter-spacing:.09em;text-shadow:0 1px 2px #000}.tilt-jp{display:none}.tilt-bar{position:relative;height:5px;margin-top:5px;background:linear-gradient(90deg,var(--ui-red),var(--ui-yellow) 25%,#f6f1e3 43%,#f6f1e3 57%,var(--ui-yellow) 75%,var(--ui-red))}.tilt-bar b{position:absolute;left:50%;height:100%;width:1px;background:#18202366}.tilt-bar i{position:absolute;left:50%;top:-4px;width:4px;height:12px;background:var(--ui-white);border:1px solid var(--ui-ink);transform:translateX(-50%)}.control-row{display:flex;align-items:center;justify-content:space-between;gap:16px;max-width:850px;margin:auto}#steer-pad{--steer:0;position:relative;width:230px;height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 4px;clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%);background:linear-gradient(110deg,#1a202633,transparent);touch-action:none;user-select:none}#steer-pad>button{background:transparent;display:grid;place-items:center;flex:0 0 62px;width:62px;height:100%;padding:0;touch-action:none}#steer-pad>button svg{width:38px;height:38px;fill:none;stroke:var(--ui-white);stroke-width:2.4;stroke-linecap:square;stroke-linejoin:miter}#steer-pad.active{background:#a9883255}.steer-center{display:none}#brake{width:140px;min-height:64px;background:#1c232a55;border-top:1px solid var(--ui-yellow);clip-path:polygon(12px 0,100% 0,100% 100%,0 100%,0 12px);font:italic 900 20px Arial,sans-serif;letter-spacing:.1em;touch-action:none;user-select:none}#brake small{display:none}#brake.active{background:var(--ui-yellow);color:var(--ui-ink)}
#side-rush{position:absolute;inset:0;pointer-events:none;opacity:0;backdrop-filter:blur(var(--rush-blur,0px));-webkit-backdrop-filter:blur(var(--rush-blur,0px));mask-image:linear-gradient(90deg,#000,transparent 29%,transparent 71%,#000);-webkit-mask-image:linear-gradient(90deg,#000,transparent 29%,transparent 71%,#000)}#side-rush::after{content:"";position:absolute;inset:25% 0 0;background:repeating-conic-gradient(from 4deg at 50% 0%,transparent 0deg 18deg,#fff3 18.2deg 18.45deg,transparent 18.7deg 31deg);opacity:.28}#speed-lines{display:none}
.modal{position:absolute;inset:0;display:grid;place-items:center;padding:20px;background:#182023aa;backdrop-filter:blur(3px)}.panel{width:min(500px,100%);background:#181d20ed;padding:28px 24px 14px;text-align:center}#paused h2{font:italic 900 38px/1.15 var(--font-display);letter-spacing:.06em;margin:8px 0 26px}#resume{width:100%;min-height:68px;font-size:20px;justify-content:flex-start;padding:18px 24px}.pause-top{display:block;margin:12px auto 0;min-height:44px;padding:12px 24px;background:none;color:var(--ui-muted);font:italic 700 12px Arial,sans-serif;letter-spacing:.12em}.pause-top:hover{color:var(--ui-white);text-decoration:none}.audio-settings{display:flex;align-items:center;gap:14px;margin:19px 0 6px}.audio-settings label{font:italic 700 12px Arial,sans-serif;letter-spacing:.12em;color:var(--ui-muted)}.audio-settings input{accent-color:var(--ui-yellow);width:100%;min-height:32px;cursor:pointer}.audio-settings input:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--ui-yellow)}
.audio-toggle{position:absolute;right:64px;top:18px;z-index:6;width:44px;height:44px;background:none;display:grid;place-items:center}.audio-toggle svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}.audio-toggle .audio-waves{display:none}.audio-toggle[aria-pressed=true] .audio-waves{display:block}.audio-toggle[aria-pressed=true] .audio-off{display:none}#game[data-screen="home"] .audio-toggle,#game[data-screen="select"] .audio-toggle{right:16px;top:14px}
#countdown{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;font:italic 900 clamp(54px,14vw,104px)/1 var(--font-display);color:var(--ui-yellow);-webkit-text-stroke:1px var(--ui-ink);text-shadow:3px 4px var(--ui-ink)}#notice{position:absolute;top:34%;left:50%;transform:translateX(-50%);padding:10px 20px;background:#181d20e8;border-left:4px solid var(--ui-yellow);color:var(--ui-yellow);font:italic 800 13px/1.4 Arial,sans-serif;letter-spacing:.04em;white-space:nowrap;pointer-events:none}
.result-screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;overflow-y:auto;overscroll-behavior:contain;padding-bottom:max(16px,env(safe-area-inset-bottom));background:#181d20ed;backdrop-filter:blur(3px)}.result-screen:focus{outline:none}.food-stage{position:relative;width:100%;height:42%;min-height:220px;flex-shrink:0;background:radial-gradient(ellipse,#9c977b,#454b43)}#food-canvas{display:block;width:100%;height:100%}.food-caption{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);background:#181d20cc;padding:7px 12px;text-align:center;white-space:nowrap}.food-caption span{display:block;font:italic 800 14px/1.2 Arial,sans-serif}.food-caption small{display:block;margin-top:4px;font-size:12px;color:var(--ui-muted)}.result-card{width:min(480px,calc(100% - 24px));padding:20px 24px}.result-card h2{margin:6px 0 16px;font:italic 900 30px/1.1 var(--font-display);letter-spacing:.025em}.score-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:6px 0;font-size:12px;font-variant-numeric:tabular-nums}.score-row strong{font-size:17px;font-style:italic}.deduction{color:#e6ac88}.food-score{border-top:1px solid var(--ui-rule);margin:6px 0;padding:10px 0}.food-score strong{font-size:25px;color:var(--ui-yellow)}#multiplier-result{color:var(--ui-red)}.total{display:flex;align-items:baseline;justify-content:center;gap:8px;border-top:1px solid var(--ui-rule);margin-top:7px;padding-top:12px;font-weight:800}.total>span{font-size:12px}.total>strong{font:italic 900 48px/1.1 Arial,sans-serif;color:var(--ui-yellow);font-variant-numeric:tabular-nums}.total small{font-size:14px;color:var(--ui-muted)}.best{font-size:12px;line-height:1.5;color:var(--ui-yellow);text-align:center}.best:empty{display:none}.result-card .actions{grid-template-columns:1.2fr 1fr;margin-top:12px}.result-card button{min-height:48px;padding:10px 12px;font-size:14px}.digit-reel{display:inline-block;height:1em;line-height:1em;overflow:hidden;vertical-align:-.06em}.digit-strip{display:flex;flex-direction:column;will-change:transform;line-height:1em}.digit-strip>span{display:block;height:1em;min-height:1em;line-height:1em}.prototype{display:none}#loading,#error{position:absolute;inset:0;display:grid;place-items:center;background:var(--ui-ink);color:var(--ui-white);padding:30px;text-align:center;font-size:14px}#error{z-index:20}
@media(min-width:900px){.screen{padding:36px}.hud-left{left:24px;top:22px;width:260px;padding:14px 20px 16px;gap:16px}.hud-card>strong{font-size:48px}.quality-badge strong{font-size:26px}.hud-right{right:26px;top:24px}.map{width:126px}#minimap{width:110px;height:145px}.speed{right:32px;bottom:145px}.speed strong{font-size:72px}.speed span{font-size:16px}.food-stage{width:480px}}
@media(max-width:699px){.hud-left{width:200px}.hud-card>strong{font-size:33px}.speed{right:18px;bottom:151px}.speed strong{font-size:50px}.speed span{font-size:12px}.tilt{width:185px}.control-row{gap:14px}#steer-pad{width:calc(100% - 132px);max-width:220px}#brake{width:118px;font-size:19px}.food-picker{gap:9px}.food-preview-stage{height:clamp(185px,27vh,260px)}.guide-symbol{height:92px}.gesture-sprite{--gesture-size:92px}.control-guide{padding-top:0}.audio-toggle{top:12px;right:60px}.result-card{padding:18px}}
@media(max-width:359px){.screen{padding-inline:12px}.home-content h1.game-logo{margin-top:30px}.mode-options strong{font-size:16px}.hud-left{left:10px;width:176px;padding:10px 12px 12px;gap:10px}.hud-card>strong{font-size:29px}.hud-right{right:10px}.map{width:94px;padding-inline:4px}#minimap{width:86px;height:112px}.quality-badge strong{font-size:22px}.quality-badge small{display:none}.speed{right:12px}.speed strong{font-size:43px}.food-options button{min-width:75px}.control-guide{padding-inline:8px}.guide-inputs{gap:18px}.guide-symbol{height:82px}.gesture-sprite{--gesture-size:82px}#steer-pad>button{width:48px;flex-basis:48px}.result-card h2{font-size:27px}.total>strong{font-size:43px}}
@media(max-height:550px){.screen{padding:16px;gap:6px;overflow-y:auto;justify-content:flex-start}.home-content{min-height:calc(100dvh - 32px)}.home-content h1.game-logo{width:min(440px,62vw);margin:0}.home-space{min-height:18px}.home-mode-label{margin-bottom:7px}.mode-options{margin-bottom:8px}.mode-options button{min-height:56px;padding:10px 4px}.mode-options strong{font-size:18px;margin:0}.home-content .primary{min-height:44px;padding:8px 18px}.section-heading h2{font-size:30px}.section-heading .eyebrow,.section-heading p{font-size:11px}.food-picker{display:grid;grid-template-columns:1fr 1fr;gap:6px 20px;width:min(740px,100%);margin:0}.food-preview-stage{grid-column:1;grid-row:1/3;height:170px}.food-options{grid-column:2;grid-row:1;gap:3px}.food-options button{min-width:64px;min-height:38px;font-size:12px}.control-guide{grid-column:2;grid-row:2;padding:0}.guide-symbol{height:65px}.gesture-sprite{--gesture-size:65px}.guide-inputs strong{font-size:13px;margin:4px 0}.guide-key{min-height:24px;gap:4px}.guide-key kbd{font-size:11px;padding:4px;min-width:24px}.guide-key span{font-size:11px;margin-left:1px}.food-picker .actions{grid-column:1/3;grid-row:3;min-height:44px;margin-top:16px}.food-picker .actions button{min-height:44px;padding:9px 18px}.hud-left{left:12px;top:10px;width:190px;padding:6px 12px 10px;gap:8px}.hud-card>small,.delivery-tag,.quality-heading>span{font-size:11px}.hud-card>strong{font-size:29px;margin-top:4px}.delivery-tag{margin-top:5px}.quality-track{margin-top:6px}.hud-right{top:8px;right:12px;gap:5px}.map{width:92px;padding:3px 6px 6px}.map-title,.map-title span{font-size:11px}#minimap{width:80px;height:88px;margin-top:4px}.speed{right:120px;bottom:76px}.speed strong{font-size:38px}.speed span{font-size:11px}#controls{padding:5px 16px 14px}.tilt{width:180px;margin-bottom:8px}.tilt-label{font-size:11px}.control-row{height:48px;max-width:none}#steer-pad{height:48px;width:190px}#steer-pad>button svg{width:30px;height:30px}#brake{width:115px;min-height:48px;font-size:18px}.audio-toggle{right:60px;top:8px}.result-screen .food-stage{height:60%;min-height:200px}.result-card{padding:16px 24px}.panel{max-height:calc(100dvh - 32px);overflow-y:auto;padding:18px 22px 10px}#paused h2{font-size:30px;margin:4px 0 16px}#resume{min-height:60px;font-size:18px}.pause-top{margin-top:6px}}
@media(prefers-reduced-motion:reduce){#side-rush{display:none!important}.digit-strip{transition:none!important}*{scroll-behavior:auto!important}}

.result-screen.failed .result-card h2{color:var(--ui-red)}.result-screen.failed .food-caption{border-bottom:2px solid var(--ui-red)}
button:disabled{cursor:wait;opacity:.55}

.checkpoint{display:flex;align-items:baseline;gap:8px;width:100%;padding-top:8px;border-top:1px solid var(--ui-rule);font:800 12px/1.3 Arial,sans-serif;text-shadow:0 1px 2px #181d20}.checkpoint>span:first-child{font-style:italic;color:var(--ui-muted)}.checkpoint>span:nth-child(2){margin-left:auto;font-size:12px}.checkpoint strong{font:italic 900 18px/1 Arial,sans-serif;font-variant-numeric:tabular-nums;color:var(--ui-yellow)}.checkpoint strong.urgent{color:var(--ui-red)}

@media(min-width:360px){.result-card .actions .secondary{white-space:nowrap}}
@media(max-width:359px){.result-card button{font-size:13px}}

/* SP HUD: keep scenery clear; contrast comes from the lettering. */
@media(max-width:899px){
 .hud-left::before{display:none}
 #hud .hud-left,#hud .hud-left :is(small,strong,span),#hud .map-title,#hud .map-title span,#hud .round{text-shadow:0 2px 2px #101614,0 0 5px #101614e6,1px 0 1px #101614,-1px 0 1px #101614}
 #hud .hud-card>strong{filter:none}
}


.touch-hint,.touch-brake-icon{display:none}
@media(max-width:899px) and (pointer:coarse){
 #controls .control-row{height:90px}
 #controls #steer-pad{width:144px;max-width:144px;height:90px;flex:none;background:#1c232a88;border-top:1px solid var(--ui-yellow);clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%)}
 #controls #steer-pad>button{width:44px;flex-basis:44px}
 #controls #steer-pad>button svg{width:24px;height:24px}
 .touch-hint{display:flex;position:absolute;inset:5px 44px 8px;flex-direction:column;align-items:center;justify-content:space-between;pointer-events:none;filter:drop-shadow(0 2px 2px #101614)}
 .touch-hint>span:last-child{font:italic 800 12px Arial,sans-serif;letter-spacing:.05em}
 #controls .gesture-sprite{--gesture-size:54px}
 #controls #brake{width:104px;min-height:90px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:15px}
 .touch-brake-icon{display:block;pointer-events:none;filter:drop-shadow(0 2px 2px #101614)}
 #controls #steer-pad.active{background:#a9883288}
 .speed{bottom:158px}
}
@media(max-width:899px) and (pointer:coarse) and (max-height:550px){
 #controls .control-row,#controls #steer-pad{height:64px}
 #controls #brake{min-height:64px;font-size:12px;gap:0}
 #controls .gesture-sprite{--gesture-size:40px}
 .touch-hint{inset:2px 44px 4px}
 .touch-hint>span:last-child{font-size:11px}
 .speed{bottom:100px}
}

/* Back actions consistently occupy the smaller left slot. */
.food-picker .actions,.result-card .actions{grid-template-columns:minmax(112px,.65fr) minmax(0,1.7fr);align-items:center}
.actions .back-action{grid-column:1;grid-row:1;min-height:44px;padding:10px 8px;font-size:12px;letter-spacing:.025em;white-space:nowrap}
.actions .primary{grid-column:2;grid-row:1}
#quit.pause-top{margin:12px auto 0 0;padding:12px 4px;text-align:left}

.ranking-link{background:none;color:var(--ui-white);font:italic 800 13px Arial;letter-spacing:.1em;min-height:44px;padding:12px;margin:6px auto 0;display:block}
.ranking-link:hover{color:var(--ui-yellow)}
#ranking-dialog{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:0;color:var(--ui-white);background:var(--ui-ink);overflow:hidden}
#ranking-dialog::backdrop{background:#111916c9;backdrop-filter:blur(4px)}
.ranking-card{padding:22px;display:flex;flex-direction:column;max-height:calc(100dvh - 32px)}
.ranking-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.ranking-header h2{font:italic 900 36px/1 var(--font-display);margin:6px 0 20px}.ranking-header>button{width:44px;height:44px;background:none;font-size:30px;align-self:flex-start}
.ranking-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.ranking-tabs button{min-height:44px;background:#ffffff0d;font:italic 800 14px Arial}.ranking-tabs button[aria-pressed=true]{background:var(--ui-yellow);color:var(--ui-ink);border-bottom:2px solid var(--ui-red)}
.ranking-name-row{display:flex;align-items:center;gap:10px;margin-top:18px}.ranking-name-row label{font:800 12px Arial;color:var(--ui-muted)}.ranking-name-row input{min-width:0;flex:1;background:#ffffff0d;border:0;border-bottom:1px solid var(--ui-rule);padding:12px 8px;color:var(--ui-white);font:700 14px Arial;min-height:44px}.ranking-name-row input:focus{outline:0;box-shadow:inset 0 0 0 2px var(--ui-yellow)}#ranking-save{min-height:44px;padding:10px 14px;font-size:12px}
#ranking-status{font:12px/1.5 Arial;color:var(--ui-muted);margin:12px 0}
#ranking-entries{list-style:none;padding:0;margin:0;overflow-y:auto;overscroll-behavior:contain;min-height:80px}#ranking-entries:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--ui-yellow)}
.ranking-row{display:grid;grid-template-columns:26px 52px minmax(0,1fr) auto;gap:10px;align-items:center;min-height:72px;border-bottom:1px solid #f6f1e31a;padding:8px 10px 8px 12px}.ranking-place{font:italic 900 20px var(--font-display);color:var(--ui-muted)}.ranking-row:nth-child(-n+3) .ranking-place{color:var(--ui-yellow)}.ranking-food{width:52px;height:40px;object-fit:contain}.ranking-row>div>strong{display:block;font:800 14px Arial;overflow-wrap:anywhere}.ranking-detail{display:block;font:12px/1.5 Arial;color:var(--ui-muted);margin-top:5px}.ranking-points{font:italic 900 23px var(--font-display);font-variant-numeric:tabular-nums}.ranking-row.is-self{background:#f1c65a1c;box-shadow:inset 3px 0 var(--ui-yellow)}
@media(max-width:420px){.ranking-card{padding:16px}.ranking-row{grid-template-columns:22px 42px minmax(0,1fr) auto;gap:6px}.ranking-food{width:42px;height:34px}.ranking-detail{font-size:12px}.ranking-points{font-size:21px}.ranking-row>div>strong{font-size:13px}}

.food-specs{display:grid;grid-template-columns:1fr 1fr;gap:14px 22px;padding:10px 6px 0}.food-specs>div{display:flex;align-items:center;justify-content:space-between;gap:8px}.food-specs>div>span:first-child{font:800 12px Arial;color:var(--ui-muted)}.spec-bar{display:flex;gap:3px}.spec-bar i{display:block;width:8px;height:12px;background:#f6f1e326;transform:skew(-12deg)}.spec-bar i.filled{background:var(--ui-yellow)}.food-rating{display:flex;justify-content:space-between;gap:14px;padding:14px 6px 0}.food-rating>div{display:flex;flex-direction:column;gap:5px}.food-rating span{font:800 12px Arial;color:var(--ui-muted)}.food-rating strong{font:italic 900 21px Arial}.food-rating #food-level{display:flex;gap:3px}.food-rating #food-level span{font-size:19px;color:#f6f1e333}.food-rating #food-level span.filled{color:var(--ui-yellow)}
@media(max-width:359px){.food-specs{gap:12px 10px;padding-inline:0}.spec-bar{gap:2px}.spec-bar i{width:7px}.food-specs>div{gap:4px}}
@media(max-height:550px){.food-picker .food-specs{grid-column:2;grid-row:2;padding:0;gap:10px 14px;grid-template-columns:1fr}.food-picker .food-rating{grid-column:1;grid-row:3;padding:0}.food-picker .actions{grid-column:2;grid-row:3;margin-top:16px}.food-preview-stage{grid-row:1/3}.food-picker .food-options{grid-column:2;grid-row:1}.food-specs>div>span:first-child{font-size:11px}.food-rating span{font-size:11px}}

.starter-label{font:700 12px Arial;color:var(--ui-muted);margin-left:7px;letter-spacing:.04em}
@media(max-width:699px) and (min-height:551px){
 .result-screen .food-stage{height:30%;min-height:200px}
 .result-card{padding-top:14px;padding-bottom:14px}
 .result-card h2{margin-bottom:12px}
 .score-row{padding-top:4px;padding-bottom:4px}
 .food-score{margin-top:4px;margin-bottom:4px;padding-top:8px;padding-bottom:8px}
 .result-card .ranking-link{margin-top:0}
}

.home-name{margin:0 0 14px;text-align:left}
#ranking-dialog #ranking-save{align-self:flex-end;margin-top:14px;flex-shrink:0}
@media(max-height:550px){.home-name{margin-bottom:8px}.home-name input{min-height:44px;padding:8px}}

.home-name label{flex-shrink:0}.home-name label small{display:block;font:700 12px/1.4 Arial;color:var(--ui-muted);margin-top:4px;letter-spacing:.03em}.home-name input{text-transform:uppercase}

#loading{z-index:10}
.home-name{background:none;padding:0;gap:8px;flex-direction:column;align-items:stretch}
.home-name label,.home-name label small{color:var(--ui-white)}
.home-name input{clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%);background:rgba(0,0,0,.68);color:#fff9e9;border:0;caret-color:#f1c65a;min-height:48px;padding:12px 14px;width:100%}
.home-name input::placeholder{color:#e6dfcb;opacity:1}
@media(max-height:550px){.home-name{gap:6px}}
.home-name input:focus{outline:0;box-shadow:none}
.home-name:focus-within label{color:var(--ui-white)}

.home-name label{display:flex;align-items:baseline;justify-content:space-between;width:100%;color:var(--ui-white);gap:12px;text-shadow:0 1px 3px #000}.home-name label small{margin:0;color:var(--ui-white)}.home-name input:focus{background:rgba(0,0,0,.82)}

/* Focus is indicated by a lighter fill, without the double yellow frame. */
#resume:focus-visible{box-shadow:none;outline:none;background:#ffe8ac}
@media(min-width:900px){
 .result-screen{display:grid;grid-template-columns:minmax(300px,540px) minmax(340px,480px);justify-content:center;align-content:safe center;align-items:center;gap:clamp(24px,4vw,64px);padding:32px}
 .result-screen .food-stage{width:100%;height:clamp(260px,48vh,480px);min-height:0}
 .result-card{width:100%;padding:0}
}
@media(min-width:900px){.home-content{width:min(440px,100%)}}

@media(max-width:899px) and (pointer:coarse){
 #controls #steer-pad,#controls #brake{background:rgba(0,0,0,.48);border-top:0;color:var(--ui-white)}
 #controls #steer-pad.active,#controls #brake.active{background:rgba(0,0,0,.72);color:var(--ui-white)}
}

.result-card .value-unit{font-size:max(12px,.65em);font-weight:800;margin-left:2px;line-height:1;vertical-align:baseline}

@media(min-width:900px){.map{width:176px;padding:6px 8px 10px}.map-title,.map-title span{font-size:14px}#minimap{width:160px;height:205px;margin-top:10px}}

.home-best{display:flex;justify-content:center;align-items:baseline;gap:7px;margin:0 0 12px;font:800 14px Arial;color:var(--ui-muted);text-shadow:0 2px 3px #111}.home-best strong{font:italic 900 30px var(--font-display);color:var(--ui-white)}.home-best small{font-size:13px}

.pc-key{display:none}
@media(pointer:fine){
 #controls .pc-key{display:grid;place-items:center;min-width:30px;min-height:28px;padding:4px 7px;background:#f6f1e3;color:#1a201e;border:0;border-bottom:2px solid #969b91;border-radius:2px;font:900 12px/1 Arial;pointer-events:none;letter-spacing:0}
 #controls #steer-pad{width:180px;background:rgba(0,0,0,.4)}
 #controls #steer-pad>button{width:54px;flex-basis:54px}
 #controls #steer-pad>button>svg{display:none}
 #controls #steer-pad .pc-key .ui-icon{display:block;stroke:currentColor;fill:none}
 #controls .steer-center{display:flex;align-items:center;justify-content:center;font:italic 800 12px Arial;letter-spacing:.06em}
 #controls .steer-center svg{display:none}
 #controls #brake{width:160px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;background:rgba(0,0,0,.4);border-top:0}
 #controls #brake.active{background:rgba(0,0,0,.72);color:var(--ui-white)}
}

.brush-readable{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#food-preview-title .brush-label{display:block;width:220px;height:76px;object-fit:contain;margin:auto}
#countdown .brush-label{display:block;width:min(64vw,460px);height:min(40vh,250px);object-fit:contain;filter:drop-shadow(0 3px 2px #0006)}
@media(max-height:500px){#food-preview-title .brush-label{width:160px;height:48px}}

.comic-effects{position:absolute;inset:0;pointer-events:none;z-index:6;overflow:hidden}.comic-effects[hidden]{display:none}.comic-effects img{position:absolute;object-fit:contain;filter:drop-shadow(0 3px 2px #0005)}.comic-effects img[hidden]{display:none}.comic-impact{width:clamp(150px,25vw,320px);height:180px;left:55%;top:35%;transform:rotate(-8deg)}.comic-drift{width:clamp(160px,26vw,330px);height:140px;right:4%;top:52%;transform:rotate(8deg)}@media(max-width:600px){.comic-impact{left:45%;width:180px;height:120px;top:40%}.comic-drift{right:0;width:190px;height:100px;top:57%}}

/* Five-food rail keeps full-size readable labels on phones; dormant with the current three foods. */
.food-options:has(button:nth-child(4)){justify-content:flex-start;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#d9b858 #0003;padding-bottom:5px}.food-options:has(button:nth-child(4)) button{flex:0 0 auto;scroll-snap-align:center;padding-inline:12px;white-space:nowrap}
@media(min-width:700px) and (min-height:551px){.food-options:has(button:nth-child(4)){justify-content:center}}

.home-best .best-digits{position:relative;display:inline-block;width:5ch;min-width:5ch;text-align:right;font-variant-numeric:tabular-nums;letter-spacing:0}.best-ghost{display:block;opacity:.22}#home-best-score{position:absolute;inset:0;text-align:right;white-space:nowrap}


#food-name{display:block;height:28px;max-width:160px}#food-name .brush-label{display:block;height:28px;width:auto;max-width:160px;object-fit:contain;object-position:left center}.hud-left .delivery-tag{margin-top:3px;line-height:1}
@media(max-height:550px){#food-name,#food-name .brush-label{height:24px}}

.delivery-sparkles{position:absolute;inset:0;pointer-events:none;z-index:2;overflow:hidden}.delivery-sparkles[hidden]{display:none}.delivery-sparkles span{position:absolute;color:#fff7d4;text-shadow:0 0 5px #ffdf76,0 0 12px #e6b43c90;opacity:0;transform:scale(.4);font-family:Arial,sans-serif}.delivery-sparkles.active span{animation:delivery-glint 1.8s ease-in-out var(--delay) infinite}.delivery-sparkles.still span{animation:none;opacity:.65;transform:none}@keyframes delivery-glint{0%,100%{opacity:0;transform:scale(.45) rotate(-8deg)}35%,55%{opacity:1;transform:scale(1) rotate(8deg)}}
#food-name{height:40px;max-width:190px}#food-name .brush-label{height:40px;max-width:190px}.hud-left .delivery-tag{margin-top:5px}
@media(max-height:550px){#food-name,#food-name .brush-label{height:32px;max-width:170px}}

.food-rating #food-level span.half{color:transparent;background:linear-gradient(90deg,var(--ui-yellow) 50%,#f6f1e333 50%);background-clip:text;-webkit-background-clip:text}
.food-stage .food-caption{background:transparent;padding:4px 10px;text-shadow:0 2px 3px #111,0 0 6px #111c}.food-stage .food-caption span,.food-stage .food-caption small{color:var(--ui-white)}

/* Generated gold brush lettering, actual transparent image assets. */
.dialog-brush{display:block;width:100%;height:100%;object-fit:contain}
#notice{width:min(440px,calc(100% - 32px));height:84px;padding:0;background:transparent;border:0;box-shadow:none}
#paused h2,#ranking-title{height:64px;width:min(300px,100%);margin-inline:auto}
.result-card #result-title{height:54px;width:100%;margin:6px 0 12px}
#paused #resume .dialog-brush{height:38px;width:min(260px,100%);margin:auto}
.result-screen.failed .food-caption,.food-stage .food-caption{border:0;border-bottom:0;box-shadow:none}
.hud-left .delivery-tag{display:flex;align-items:center;gap:7px}
.hud-left .delivery-tag .food-icon{display:block;width:44px;height:44px;object-fit:contain;flex:0 0 44px}
@media(max-height:550px){#paused h2,#ranking-title{height:48px}.result-card #result-title{height:42px}.hud-left .delivery-tag .food-icon{width:36px;height:36px;flex-basis:36px}}
.result-card #result-title{position:relative;height:76px;overflow:hidden}
.result-card #result-title .dialog-brush{position:absolute;left:0;top:50%;width:100%;height:auto;max-height:none;transform:translateY(-50%)}
@media(max-height:550px){.result-card #result-title{height:60px}}

/* Result title overlays the top of the food scene. */
.food-stage #result-title{position:absolute;z-index:4;left:50%;top:8px;transform:translateX(-50%);width:min(460px,calc(100% - 32px));height:76px;margin:0;overflow:hidden;pointer-events:none}
.food-stage #result-title .dialog-brush{position:absolute;left:0;top:50%;width:100%;height:auto;max-height:none;transform:translateY(-50%)}
@media(max-height:550px){.food-stage #result-title{height:60px;top:4px;width:min(400px,calc(100% - 32px))}}
.result-card>.eyebrow{display:block;font-size:20px;line-height:1.25;letter-spacing:.1em;margin-bottom:14px}
@media(max-height:550px){.result-card>.eyebrow{font-size:18px;margin-bottom:10px}}
.food-stage #result-title{top:24px;width:min(390px,calc(100% - 72px));height:68px}
@media(max-height:550px){.food-stage #result-title{top:16px;width:min(350px,calc(100% - 64px));height:56px}}
/* Shared gameplay alignment rails. */
#game{--hud-gutter:20px;--hud-top:24px}
.hud-left{left:max(var(--hud-gutter),env(safe-area-inset-left));top:max(var(--hud-top),env(safe-area-inset-top));padding:0;width:200px}
.hud-right{right:max(var(--hud-gutter),env(safe-area-inset-right));top:max(var(--hud-top),env(safe-area-inset-top));gap:12px}
.hud-right .map{padding-inline:0}
.hud-right #pause{margin-right:-10px}
#game[data-screen="playing"] .audio-toggle,#game[data-screen="paused"] .audio-toggle,#game[data-screen="countdown"] .audio-toggle{right:calc(var(--hud-gutter) + 34px);top:max(var(--hud-top),env(safe-area-inset-top))}
.speed{right:max(var(--hud-gutter),env(safe-area-inset-right))}
#controls{padding-left:max(var(--hud-gutter),env(safe-area-inset-left));padding-right:max(var(--hud-gutter),env(safe-area-inset-right))}
#controls .control-row{max-width:none;width:100%}
.quality-heading{gap:4px}.quality-heading>strong{margin-left:auto}.quality-heading>span{margin-right:0}.quality-heading>small{white-space:nowrap}
@media(min-width:900px){#game{--hud-gutter:40px;--hud-top:32px}.hud-left{width:220px}.map{width:160px}#minimap{width:160px}}
@media(max-width:359px){#game{--hud-gutter:16px;--hud-top:20px}.hud-left{width:168px}}
@media(max-height:550px){#game{--hud-gutter:24px;--hud-top:16px}.hud-left{width:180px}.hud-right .map{width:92px}.hud-right #minimap{width:92px}}
#controls .tilt{margin-bottom:6px;transform:translateY(6px)}
.tilt-bar{height:8px;margin-top:6px}
.tilt-bar i{height:16px;top:-4px}
@media(max-height:550px){#controls .tilt{margin-bottom:4px;transform:translateY(3px)}}
@media(max-width:699px){#controls .tilt{margin-bottom:14px;transform:none}}
@media(max-width:699px) and (max-height:550px){#controls .tilt{margin-bottom:8px;transform:none}}
.map-title{border-bottom:0}

#paused #resume{font:italic 900 22px/1.2 Arial,sans-serif;letter-spacing:.04em}

.map-title{align-items:baseline}#remaining{white-space:nowrap}#remaining-number{font-size:1.2em;font-weight:900;font-variant-numeric:tabular-nums}#remaining>span{font-size:1em}

#paused .audio-settings{margin:18px 0 22px}
#paused #quit{display:block;width:auto;min-width:120px;min-height:40px;margin:18px auto 0 0;padding:10px 14px;font:italic 800 12px/1.2 Arial,sans-serif;letter-spacing:.05em;text-align:left;background:#ffffff0d;border:0}
@media(max-height:550px){#paused .audio-settings{margin:12px 0 16px}#paused #quit{margin-top:12px}}
.home-best strong{font-size:38px;line-height:1.1}
@media(max-height:550px){.home-best strong{font-size:34px}}
/* Mild scene grade, leaving HUD typography and accent colors untouched. */
#world{filter:brightness(1.06) saturate(1.09)}
#food3d-canvas{filter:brightness(1.04) saturate(1.06)}
.hud-left::before{display:none;content:none;background:none}
#hud .hud-left,#hud .hud-card{background:transparent;box-shadow:none}
#hud .hud-left :is(small,strong,span){text-shadow:0 2px 2px #101614,0 0 5px #101614e6}
@media(min-width:700px){#controls .tilt{position:absolute;left:50%;bottom:max(40px,calc(env(safe-area-inset-bottom) + 16px));margin:0;transform:translateX(-50%)} }
@media(min-width:700px) and (max-height:550px){#controls .tilt{bottom:25px}}

#game:is([data-screen="playing"],[data-screen="countdown"],[data-screen="crashing"],[data-screen="paused"])>#audio-toggle{display:none}
#pause-audio-toggle{flex:0 0 auto;min-height:40px;padding:8px 10px;font:italic 800 12px/1 Arial,sans-serif;background:#ffffff0d;white-space:nowrap}
#paused .audio-settings{gap:10px}#paused .audio-settings input{min-width:0;flex:1}
#paused #resume{min-height:56px;padding:14px 20px;font-size:19px}
.curve-alert{position:absolute;left:50%;top:22%;transform:translateX(-50%);width:86px;height:86px;z-index:5;pointer-events:none;filter:drop-shadow(0 2px 3px #0007)}.curve-alert[hidden]{display:none}.curve-alert img{width:100%;height:100%;object-fit:contain}
@media(max-width:699px){.curve-alert{top:25%;width:70px;height:70px}}
@media(max-height:550px){.curve-alert{top:19%;width:64px;height:64px}}

.result-ranking-button{position:absolute;left:16px;top:16px;z-index:7;width:auto;min-height:40px;padding:10px 14px;font:italic 800 12px/1.2 Arial,sans-serif;background:#181d20b8}
.result-rank{text-align:center;color:var(--ui-yellow);font:italic 900 18px/1.3 Arial,sans-serif;margin:16px 0 12px}
.result-rank[hidden]{display:none}
@media(max-width:699px){.food-stage #result-title{top:48px}}
#game:not([data-screen="home"]):not([data-screen="select"])>#audio-toggle{display:none}

.result-rank:not([hidden]),.result-ranking-button.is-ranked{animation:rank-pulse 2.2s ease-in-out infinite}
.result-ranking-button.is-ranked{background:var(--ui-yellow);color:var(--ui-ink)}
@keyframes rank-pulse{0%,100%{filter:brightness(1);opacity:.88}50%{filter:brightness(1.12);opacity:1}}
@media(prefers-reduced-motion:reduce){.result-rank:not([hidden]),.result-ranking-button.is-ranked{animation:none}}

.result-card button.result-rank{display:block;width:100%;min-height:44px;padding:8px 0;border:0;background:transparent;font:italic 900 18px/1.3 Arial,sans-serif;color:var(--ui-yellow);cursor:pointer}
.result-card button.result-rank[hidden]{display:none}

.result-grade-summary{text-align:center;margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid var(--ui-rule)}
#delivery-grade{display:block;height:70px;font:italic 900 68px/.95 var(--font-display);color:var(--ui-yellow)}
#delivery-grade[data-grade="A"]{color:#e55740}#delivery-grade[data-grade="B"]{color:#e99035}#delivery-grade[data-grade="C"]{color:#79a56c}#delivery-grade[data-grade="D"]{color:#9186c4}#delivery-grade[data-grade="FAILED"]{color:var(--ui-red);font-size:36px;padding-top:16px}
.result-condition-score{display:flex;align-items:baseline;justify-content:center;gap:10px;margin-top:4px}
.result-condition-score>span{font:italic 800 12px Arial,sans-serif;letter-spacing:.06em}
.result-condition-score #quality-result{font:italic 900 28px/1 Arial,sans-serif;color:var(--ui-white);font-variant-numeric:tabular-nums}
.result-condition-score #quality-result .value-unit{font-size:.6em}
@media(max-width:699px){.result-card>.eyebrow{margin-bottom:6px}#delivery-grade{height:58px;font-size:56px}.result-condition-score #quality-result{font-size:25px}.result-grade-summary{margin-bottom:8px;padding-bottom:10px}}

#delivery-grade{height:84px;display:flex;align-items:center;justify-content:center}
#delivery-grade .grade-art{display:block;height:96px;width:144px;object-fit:contain}
#delivery-grade[data-grade="SS"] .grade-art{transform:scale(1.12)}
@media(max-width:699px){#delivery-grade{height:68px}#delivery-grade .grade-art{height:80px;width:128px}}
@media(max-width:699px){
 .result-card>.eyebrow{text-align:center}
 .result-grade-summary{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px;padding:4px 0 12px}
 .result-grade-summary #delivery-grade{justify-content:center;height:76px}
 .result-grade-summary .result-condition-score{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;margin:0}
 .result-condition-score>span{font-size:12px}
 .result-condition-score #quality-result{font-size:30px}
}

.result-screen:not(.failed) .food-stage #result-title{display:none}
@media(max-width:699px){
 .result-grade-summary{grid-template-columns:112px 128px;justify-content:center;gap:4px}
 .result-grade-summary #delivery-grade{width:112px}
 .result-grade-summary #delivery-grade .grade-art{width:112px}
}

.result-condition-score[hidden],.result-retained-row[hidden]{display:none}
@media(max-width:699px){
 .result-grade-summary{grid-template-columns:112px minmax(0,150px);gap:4px}
 .result-grade-summary .total{display:grid;grid-template-columns:auto auto;justify-content:center;align-items:baseline;column-gap:5px;row-gap:4px;border:0;margin:0;padding:0}
 .result-grade-summary .total>span{grid-column:1/3;text-align:center;font-size:12px}
 .result-grade-summary .total>strong{font-size:40px;line-height:1}
 .result-grade-summary .total>small{font-size:12px}
 .result-retained-row{display:flex}.result-retained-row #quality-result{font:italic 900 17px/1 Arial,sans-serif;color:var(--ui-yellow)}
}
@media(max-width:699px){
 .result-grade-summary .total{justify-content:start;justify-self:start;text-align:left}
 .result-grade-summary .total>span{text-align:left}
}

.home-content #ranking-home{display:block;align-self:center;flex-shrink:0;min-height:40px;padding:10px 18px;margin:0;background:#181d20b8;font:italic 800 12px/1.2 Arial,sans-serif;letter-spacing:.06em}
.home-content h1.game-logo{margin-top:12px}
.home-content .app-version{display:block;margin:14px 0 0;font:600 11px/1.3 Arial,sans-serif;color:var(--ui-muted);letter-spacing:.06em;text-shadow:0 1px 2px #111}
@media(max-height:550px){.home-content h1.game-logo{margin-top:8px}.home-content .app-version{margin-top:8px}}

.home-content #ranking-home{display:flex;align-items:center;justify-content:center;gap:9px;background:var(--ui-yellow);color:var(--ui-ink);min-height:44px;padding:10px 20px;box-shadow:0 3px 10px #0003}
.ranking-trophy{width:21px;height:21px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.home-content #ranking-home:hover{background:#ffe18a}

/* Keep all brush strokes visible rather than trimming the image box. */
.result-screen.failed .food-stage #result-title{height:auto;min-height:0;overflow:visible;line-height:0}
.result-screen.failed .food-stage #result-title .dialog-brush{position:static;display:block;transform:none;width:100%;height:auto;max-height:none;object-fit:contain}

@media(max-width:699px){.result-screen.failed .food-stage #result-title{display:none}}

.mode-options button{clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%)}
#delivery-grade[data-grade="FAILED"]{padding-top:0}
#delivery-grade[data-grade="FAILED"] .grade-art{width:220px;height:84px;max-width:100%;object-fit:contain}
@media(max-width:699px){#delivery-grade[data-grade="FAILED"] .grade-art{width:112px;height:68px}}

#game[data-screen="finishing"] #pause{visibility:hidden}

.mode-options button{flex-direction:column;gap:3px;padding:8px 4px}
.mode-options .mode-pass-art{display:block;width:100%;height:38px;object-fit:contain}
.mode-options button small{display:block;font:italic 800 11px/1.3 Arial,sans-serif;letter-spacing:.06em}
.section-heading.delivery-heading{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:20px;width:min(560px,100%)}
.delivery-heading .selected-food-heading,.delivery-heading .selected-pass-heading{min-width:0}
.delivery-heading #food-preview-title .brush-label{width:100%;height:68px}
.delivery-heading #selected-pass-art{display:block;object-fit:contain;width:100%;height:68px}
.delivery-heading #delivery-meta{font-size:12px;margin-top:4px}
.home-content #ranking-home{background:transparent;box-shadow:none;padding:0;min-height:44px;width:150px}
.home-content #ranking-home img{display:block;width:150px;height:48px;object-fit:contain}
.home-content #ranking-home:hover{background:transparent;filter:brightness(1.12)}
.ui-icon-definitions{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.ui-icon{display:inline-block;vertical-align:middle;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;flex:0 0 auto}
.primary>.ui-icon{margin-left:auto}
.pc-key .ui-icon{width:14px!important;height:14px!important}
#pause .ui-icon,#ranking-close .ui-icon{width:22px;height:22px}
@media(max-height:550px){.mode-options .mode-pass-art{height:30px}.delivery-heading #food-preview-title .brush-label,.delivery-heading #selected-pass-art{height:44px}.section-heading.delivery-heading{gap:16px}.home-content #ranking-home{min-height:40px}.home-content #ranking-home img{height:44px}}

/* Shared food carousel: selected name stays centered at both endpoints. */
.food-options:has(button:nth-child(4)){position:relative;justify-content:flex-start;padding-inline:calc(50% - 56px);overflow-x:hidden;scrollbar-width:none;scroll-snap-type:none;touch-action:pan-y;cursor:grab;user-select:none}
.food-options:has(button:nth-child(4)) button{flex:0 0 112px;min-width:112px;padding-inline:4px}
.food-preview-stage{touch-action:pan-y;cursor:grab}
.food-choice-help{display:block;text-align:center;margin:-6px 0 2px;color:var(--ui-muted);font:700 11px/1.5 Arial,sans-serif;letter-spacing:.03em}
@media(max-height:550px){.food-choice-help{grid-column:2;grid-row:2;align-self:start;margin:0}.food-picker .food-specs{padding-top:23px}}

.food-step{display:none}
@media(min-width:700px) and (pointer:fine){
 .food-step{display:grid;place-items:center;position:absolute;z-index:5;top:50%;transform:translateY(-50%);width:44px;height:44px;min-height:44px;padding:0;background:#182023dd;color:var(--ui-yellow);border:0;clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%);cursor:pointer}
 .food-step-prev{left:0}.food-step-next{right:0}
 .food-step:hover{background:var(--ui-yellow);color:#182023}
 .food-step:disabled{opacity:.25;cursor:default;background:#182023dd;color:var(--ui-yellow)}
 .food-step:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--ui-yellow)}
}
/* Food rendering is decorative; selection gestures belong to the stage. */
#food3d-canvas{pointer-events:none}
.food-step:active{transform:translateY(-50%)}

/* PC result: title, grade and retained score share the top row. */
@media(min-width:700px){
 .result-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(88px,.85fr) minmax(0,1.25fr);column-gap:12px;align-items:center}
 .result-card> *{grid-column:1 / -1}
 .result-card>.eyebrow{grid-column:1;grid-row:1;width:8ch;max-width:100%;margin:0;text-align:left;font-size:clamp(19px,1.8vw,28px);line-height:1.25}
 .result-card>.result-grade-summary{display:contents}
 .result-card .result-grade-summary>#delivery-grade{grid-column:2;grid-row:1;min-width:0;height:108px}
 .result-card .result-grade-summary>#delivery-grade .grade-art{width:100%;max-width:140px;height:108px;object-fit:contain}
 .result-card .result-grade-summary>.result-condition-score{grid-column:3;grid-row:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;margin:0}
 .result-card .result-condition-score>span{font-size:16px}
 .result-card .result-condition-score #quality-result{font-size:clamp(32px,3.3vw,48px);white-space:nowrap;line-height:1.1}
 .result-card>.score-row:has(#base-result){border-top:1px solid var(--ui-rule);margin-top:14px;padding-top:16px}
 .result-card .total{margin-top:12px;padding-top:16px}
 .result-card button.result-rank{margin-top:12px}
}

/* Never expose the old 2D food approximation while actual GLBs load or fail. */
#preview-food,#food-canvas{visibility:hidden!important}

/* Shared v1.0.1 carousel fade; controls live outside this masked rail. */
.course-options,.food-options{--carousel-fade:28px;-webkit-mask-image:linear-gradient(to right,transparent,#000 var(--carousel-fade),#000 calc(100% - var(--carousel-fade)),transparent);mask-image:linear-gradient(to right,transparent,#000 var(--carousel-fade),#000 calc(100% - var(--carousel-fade)),transparent)}
@media(max-width:699px){.course-options,.food-options{--carousel-fade:22px}}
/* v1.0.1 final TOP: difficulty headings, six course buttons, best, START. */
.mode-options{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:10px}
.course-column{display:flex;min-width:0;flex-direction:column;gap:6px}
.course-difficulty{font:italic 900 12px/1.4 Arial;color:var(--ui-white);letter-spacing:.04em}
.mode-options .course-column button{width:100%;min-height:52px;height:52px;padding:4px;min-width:0}
.mode-options .course-column .mode-pass-art{height:34px;max-width:100%}
.mode-options .course-column .new-pass-name{font:italic 900 21px/1.2 'Hiragino Mincho ProN','Yu Mincho',serif;white-space:nowrap}
.home-best{margin:0 0 10px}
@media(max-width:699px){.mode-options .course-column button{height:46px;min-height:46px}.mode-options .course-column .mode-pass-art{height:29px}.mode-options .course-column .new-pass-name{font-size:18px}.course-difficulty{font-size:11px}}
@media(max-height:650px){.home-name{gap:4px;margin-bottom:7px}.home-name input{min-height:40px;padding:8px 12px}.mode-options .course-column button{height:40px;min-height:40px}.home-space{min-height:8px}.home-best{margin-bottom:6px}.home-content .primary{min-height:44px}.home-content .app-version{margin-top:7px}}

#selected-pass-name{font:italic 900 clamp(26px,4vw,40px)/1.3 'Hiragino Mincho ProN','Yu Mincho',serif;color:var(--ui-white)}
.course-brief{font:700 11px/1.45 Arial,sans-serif;color:var(--ui-muted);margin:0 0 7px;text-align:center}
@media(max-height:650px){.home-content h1.game-logo{width:min(300px,70vw);margin-top:6px}.home-content #ranking-home{min-height:36px;height:36px}.home-content #ranking-home img{height:36px}.course-brief{font-size:10px;margin-bottom:4px}}

/* Compact phone result: PC score hierarchy, sized for Safari's visible viewport. */
@media(max-width:699px){
 .result-screen{height:100%;overflow-y:auto;padding-bottom:env(safe-area-inset-bottom,0px)}
 .result-screen .food-stage{height:clamp(130px,26dvh,200px);min-height:130px;flex-shrink:0}
 .result-card{padding:10px 20px 12px}
 .result-card>.eyebrow{font-size:18px;margin:0 0 5px;text-align:center}
 .result-grade-summary{grid-template-columns:88px 130px;gap:8px;padding:0 0 7px;margin:0 0 4px}
 .result-grade-summary #delivery-grade{width:88px;height:62px}
 .result-grade-summary #delivery-grade .grade-art{width:88px;height:62px;object-fit:contain}
 .result-grade-summary .result-condition-score{align-items:flex-start;gap:3px}
 .result-condition-score #quality-result{font-size:30px}
 .result-card .score-row{padding:3px 0;font-size:11px;min-height:23px}
 .result-card .score-row strong{font-size:15px}
 .result-card .total{margin-top:5px;padding-top:7px;gap:7px}
 .result-card .total strong{font-size:36px;line-height:1}
 .result-card .total>span,.result-card .total>small{font-size:11px}
 .result-card button.result-rank{margin:3px 0;min-height:32px;padding:4px 0;font-size:16px}
 .result-card .actions{margin-top:6px;gap:10px}
 .result-card .actions button{min-height:44px;padding:9px 14px}
}
@media(max-width:699px) and (max-height:650px){
 .result-screen .food-stage{height:23dvh;min-height:110px}
 .result-card{padding-top:6px;padding-bottom:8px}
 .result-grade-summary #delivery-grade,.result-grade-summary #delivery-grade .grade-art{height:52px}
 .result-card .score-row{min-height:21px;padding:2px 0}
}
/* Phone announcements stay clear of the delivery numbers. */
@media(max-width:699px){
 #notice{width:min(280px,74vw);height:58px;top:38%}
 #countdown .brush-label{width:min(48vw,210px);height:min(25dvh,145px)}
 .comic-impact{width:140px;height:92px;left:48%;top:41%}
 .comic-drift{width:150px;height:80px;top:56%}
 .curve-alert{top:max(190px,30dvh);width:58px;height:58px}
}
#pause .ui-icon{filter:drop-shadow(0 2px 2px #101614) drop-shadow(0 0 3px #101614b3)}
@media(max-width:699px){
 #controls .tilt{position:absolute;left:max(var(--hud-gutter),env(safe-area-inset-left));bottom:calc(max(16px,env(safe-area-inset-bottom)) + 80px);width:calc(100% - 154px);max-width:270px;margin:0;transform:none}
 .speed{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 78px);right:max(var(--hud-gutter),env(safe-area-inset-right));padding:0}
 .speed strong{font-size:38px;line-height:1}
 .speed span{font-size:11px}
}
@media(max-width:699px){
 #countdown:is([data-brush-label="3"],[data-brush-label="2"],[data-brush-label="1"]) .brush-label{width:min(24vw,105px);height:min(12.5dvh,72.5px)}
}
/* Six passes, circular selection with a fixed centered active card. */
.mode-options.course-carousel{position:relative;display:block;height:82px;min-height:82px;margin:4px 0 8px}
.course-track{position:absolute;inset:0 26px;overflow:hidden;touch-action:pan-y;mask-image:linear-gradient(90deg,transparent,#000 13%,#000 87%,transparent);-webkit-mask-image:linear-gradient(90deg,transparent,#000 13%,#000 87%,transparent)}
.course-track button{position:absolute;left:50%;top:0;width:46%;height:78px;min-height:0;padding:6px 4px;display:flex;flex-direction:column;gap:2px;transform:translateX(calc(-50% + var(--course-offset)*108%));opacity:.65;transition:transform .2s ease,opacity .2s ease}
.course-track button[aria-pressed=true]{opacity:1}
.course-track .mode-pass-art{width:100%;height:44px;object-fit:contain}
.course-track button small{font:italic 800 10px/1.2 Arial,sans-serif;color:inherit;letter-spacing:.08em}
.mode-options .course-arrow{position:absolute;top:15px;width:28px;height:48px;min-height:44px;padding:4px;background:transparent;border:0;color:var(--ui-white)}
.course-arrow .ui-icon{width:22px;height:22px;filter:drop-shadow(0 1px 2px #000)}
.course-prev{left:0}.course-next{right:0}
@media(max-width:699px){.mode-options.course-carousel{height:72px;min-height:72px}.course-track button{height:68px}.course-track .mode-pass-art{height:36px}}
@media(prefers-reduced-motion:reduce){.course-track button{transition:none}}
.course-track{user-select:none;-webkit-user-select:none}
.course-track img{pointer-events:none;-webkit-user-drag:none}
/* Give the carousel arrows the same cut-corner button affordance. */
.mode-options .course-arrow{top:12px;width:36px;height:48px;padding:8px;background:#242c2ef2;color:var(--ui-white);clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%);box-shadow:inset 0 -2px 0 #ffffff24}
.mode-options .course-arrow:hover,.mode-options .course-arrow:focus-visible{background:var(--ui-yellow);color:var(--ui-ink)}
.course-track{inset-inline:40px}
@media(max-width:699px){.mode-options .course-arrow{top:10px;height:44px}}
.ranking-tabs.course-carousel{flex-shrink:0;width:100%}
.ranking-tabs.course-carousel .course-track button{border-radius:0}
/* Accepted rank is the single success message; preserve pending/error notices. */
.result-card:has(#result-rank:not([hidden])) #ranking-save-status{display:none}
.result-card button.result-rank{margin:4px 0;min-height:32px;padding:4px 0;line-height:1.25}

/* Emergency touch HUD: derive status height from the actual control-row height. */
@media(max-width:899px) and (pointer:coarse){
 #game{--sp-control-row:90px;--sp-control-bottom:max(16px,env(safe-area-inset-bottom))}
 #controls{padding-bottom:var(--sp-control-bottom)}
 #controls .control-row,#controls #steer-pad{height:var(--sp-control-row)}
 #controls #brake{min-height:var(--sp-control-row)}
 #controls .tilt{position:absolute;left:max(var(--hud-gutter),env(safe-area-inset-left));bottom:calc(var(--sp-control-bottom) + var(--sp-control-row) + 14px);width:calc(100% - 154px);max-width:270px;margin:0;transform:none}
 #game .speed{bottom:calc(var(--sp-control-bottom) + var(--sp-control-row) + 12px);right:max(var(--hud-gutter),env(safe-area-inset-right));padding:0}
 #controls .pc-key{display:none!important}
}
@media(max-width:899px) and (pointer:coarse) and (max-height:550px){#game{--sp-control-row:64px}}
/* Road warning takes precedence over decorative central announcements. */
#game:has(.curve-alert:not([hidden])) #notice{visibility:hidden}

/* Road notices share the warning sign anchor; the sign retains display priority. */
#game{--road-notice-top:22%}
#notice,.curve-alert{top:var(--road-notice-top)}
#notice{width:min(280px,74vw);height:58px}
@media(max-width:699px){#game{--road-notice-top:max(190px,30dvh)}}
@media(min-width:700px) and (max-height:550px){#game{--road-notice-top:19%}}
#game[data-screen="playing"]{touch-action:none}

/* Keep asynchronous model preparation and countdown image failures visible. */
.food-model-status{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center;color:var(--ui-white);font:700 14px/1.6 Arial,sans-serif;pointer-events:none;text-shadow:0 2px 4px #182023;background:#18202355;z-index:2}
.brush-readable.brush-fallback{position:static;width:auto;height:auto;overflow:visible;clip-path:none;display:block;text-align:center}

/* Kankeri-style spinner, completed-work progress and retry for long preparation. */
#loading.preparing-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px}
.preparing-screen p{max-width:88vw;margin:0;line-height:1.6;letter-spacing:.1em}
.preparing-mark{width:26px;height:26px;border:2px solid #f6f1e333;border-top-color:var(--ui-yellow);border-radius:50%;animation:prepare-turn 1.5s linear infinite}
.preparing-progress{width:min(300px,78vw);font-size:13px}.preparing-progress>div{display:flex;justify-content:space-between;align-items:baseline;gap:16px}.preparing-progress strong{font-size:22px;font-variant-numeric:tabular-nums}.preparing-progress progress{width:100%;height:8px;accent-color:var(--ui-yellow);margin-top:12px}
.preparing-screen button{padding:12px 24px;background:var(--ui-yellow);color:var(--ui-ink)}
@keyframes prepare-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.preparing-mark{animation:none}}

#paused .pause-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
#paused .pause-actions #quit,#paused #pause-retry{width:100%;min-width:0;min-height:44px;margin:0;padding:10px 12px;font:italic 800 12px/1.2 Arial,sans-serif;justify-content:center;text-align:center}
#paused #pause-retry{background:#ffffff16}
#paused #pause-retry:disabled{opacity:.5}
@media(max-height:550px){#paused .pause-actions{margin-top:10px}}

/* Presentation-only split timer, beside DELIVERY TIME; independent of legacy CP rules. */
.hud-card{position:relative}
#time-trial-split{position:absolute;left:132px;top:0;min-width:142px;pointer-events:none;text-align:left;white-space:nowrap;filter:drop-shadow(0 1px 2px #101614)}
#time-trial-split strong{display:block;font:italic 900 12px/1.25 Arial,sans-serif;color:var(--ui-white);font-variant-numeric:tabular-nums}
#time-trial-split small{display:block;font:800 8px/1.3 Arial,sans-serif;color:var(--ui-muted);letter-spacing:.03em}
#time-trial-split[data-delta=behind] strong{color:#ffae88}
#time-trial-split[data-delta=ahead] strong{color:#a6e7c2}
@media(max-width:359px){#time-trial-split{left:112px;min-width:132px}#time-trial-split strong{font-size:11px}}
@media(max-height:550px){#time-trial-split{left:112px}#time-trial-split strong{font-size:11px}}

.time-trial-test-banner{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);z-index:9;pointer-events:none;white-space:nowrap;color:#ffdd77;background:#172021cc;padding:2px 5px;font:800 8px/1.2 Arial,sans-serif}

/* Persistent three-split panel, above the FOOD row and map. */
#time-trial-split{width:160px;min-width:0;white-space:nowrap}
#time-trial-split .split-context{font:800 7px/9px Arial,sans-serif;color:var(--ui-muted);overflow:hidden;text-overflow:ellipsis}
#time-trial-split .split-row{display:grid;grid-template-columns:22px 52px 1fr;gap:3px;align-items:baseline;height:14px;font:800 9.5px/14px Arial,sans-serif;font-variant-numeric:tabular-nums}
#time-trial-split .split-row strong{font:italic 900 9.5px/14px Arial,sans-serif}
#time-trial-split .split-row[data-state=next]>span:first-child{color:var(--ui-yellow)}
#time-trial-split .split-row[data-state=passed]>span:first-child{color:#a6e7c2}
#time-trial-split .split-row[data-delta=behind] strong{color:#ffae88}
#time-trial-split .split-row[data-delta=ahead] strong{color:#a6e7c2}
#time-trial-split .split-legend{font:700 6.5px/8px Arial,sans-serif;color:var(--ui-muted)}
@media(max-width:359px){#time-trial-split{width:132px}#time-trial-split .split-row{grid-template-columns:19px 44px 1fr;gap:2px;font-size:8.5px;height:13px;line-height:13px}#time-trial-split .split-row strong{font-size:8.5px;line-height:13px}}

/* Keep CP text crisp: one subtle shadow, without stacked HUD shadows. */
#hud #time-trial-split{filter:none;text-shadow:none}
#hud #time-trial-split :is(small,strong,span){filter:none;text-shadow:0 1px 1px #10161470}

/* Readable CP context and delta legend on bright scenery. */
#time-trial-split .split-context{font:800 9px/12px Arial,sans-serif;letter-spacing:0;color:#fff9e9}
#time-trial-split .split-legend{font:700 8px/11px Arial,sans-serif;letter-spacing:0;color:#fff9e9}
#hud #time-trial-split .split-context,#hud #time-trial-split .split-legend{text-shadow:0 1px 1px #10161499}

/* Split delta: faster green, slower red, equal white. */
#time-trial-split .split-row[data-delta=ahead] strong{color:#a6e7c2}
#time-trial-split .split-row[data-delta=behind] strong{color:#ff8e86}
#time-trial-split .split-row[data-delta=even] strong{color:#fff9e9}

.ghost-dialog{width:min(420px,calc(100vw - 32px));box-sizing:border-box;padding:24px;border:1px solid #59615c;background:#1b2325;color:#fff9e9;text-align:center;box-shadow:0 8px 28px #0005}
.ghost-dialog::backdrop{background:#101719b8}
.ghost-dialog h2{font:800 19px/1.5 Arial,sans-serif;margin:0 0 10px}
.ghost-dialog p{font:700 10px/1.4 Arial,sans-serif;color:#d6d5c9;margin:0 0 20px}
.ghost-dialog>div{display:flex;gap:12px}.ghost-dialog button{flex:1;min-height:48px;background:#efc85a;color:#192123;font:italic 800 15px Arial,sans-serif;clip-path:polygon(0 0,calc(100% - 10px) 0,100% 10px,100% 100%,0 100%)}
.ghost-dialog button:last-child{background:#354044;color:#fff9e9}.ghost-dialog button:focus-visible{outline:0;box-shadow:inset 0 0 0 2px #fff9e9}

/* Give the food block more separation from the split panel. */
.hud-left .delivery-tag{margin-top:17px}

/* Keep the numerical FOOD readout without the underline meter. */
#hud .quality-track{display:none}

/* Group FOOD quantity tightly with the selected dish artwork. */
#hud .hud-left{gap:4px}

/* Desktop timer is wider than the compact phone readout. */
@media(min-width:900px) and (min-height:551px){#time-trial-split{left:190px}}

/* Pause volume uses the same explicit sound state as TOP. */
#pause-audio-toggle{flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;display:grid;place-items:center;color:var(--ui-white);background:#ffffff0d}
.audio-state-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.audio-state-button .audio-waves{display:none}.audio-state-button .audio-off{display:block}
.audio-state-button[data-silent=false] .audio-waves{display:block}.audio-state-button[data-silent=false] .audio-off{display:none}
.audio-state-button[data-silent=true] .audio-waves{display:none}.audio-state-button[data-silent=true] .audio-off{display:block}
#paused .audio-settings{gap:10px}#paused .audio-settings label{flex:0 0 auto}
#paused .audio-settings input{width:0;min-width:0;flex:1}
#paused .audio-settings input:disabled{opacity:.35;filter:grayscale(1);cursor:not-allowed}
#pause-audio-toggle:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--ui-yellow)}

/* iOS game gestures must not select/copy art or open image callouts. */
#game,.ghost-dialog{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#game :is(img,canvas,svg),.ghost-dialog svg{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
#game button,#game input[type=range],.ghost-dialog button{touch-action:manipulation}
#game:is([data-screen=playing],[data-screen=countdown],[data-screen=finishing],[data-screen=crashing]){touch-action:none}
#game :is(input:not([type]),input[type=text],input[type=search],input[type=email],input[type=password],input[type=url],input[type=tel],input[type=number],textarea,[contenteditable]:not([contenteditable=false])){-webkit-user-select:text;user-select:text;-webkit-touch-callout:initial;touch-action:manipulation}
@media(pointer:coarse){#ranking-name{font-size:16px}}

/* Local candidate: give the phone portrait result dish about 20% more space. */
@media(max-width:699px) and (orientation:portrait){
 .result-screen .food-stage{height:clamp(156px,31.2dvh,240px);min-height:156px}
}
@media(max-width:699px) and (max-height:650px) and (orientation:portrait){
 .result-screen .food-stage{height:27.6dvh;min-height:132px}
}

/* Local centisecond clock: keep CP clear of the wider time readout. */
#hud #timer{font-size:30px;letter-spacing:-.04em}
#time-trial-split{left:130px;width:166px}
#time-trial-split .split-row{grid-template-columns:21px 61px 1fr}
@media(min-width:900px) and (min-height:551px){#hud #timer{font-size:42px}#time-trial-split{left:185px;width:200px}.split-row{font-variant-numeric:tabular-nums}}
@media(max-width:359px){#hud #timer{font-size:25px}#time-trial-split{left:110px;width:144px}#time-trial-split .split-row{grid-template-columns:19px 53px 1fr}}
@media(max-height:550px){#hud #timer{font-size:25px}#time-trial-split{left:114px}}
