*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.failure-presentation{position:absolute;z-index:7;border:3px solid #dae6ef;box-shadow:inset 0 0 0 2px #17223b,0 0 0 999px #02061180;pointer-events:none}
.failure-presentation header{display:flex;justify-content:space-between;gap:8px;padding:12px;background:linear-gradient(#060c22bb,transparent);font:900 16px/1.2 Arial,sans-serif;letter-spacing:2px;text-shadow:2px 2px #000}
.failure-presentation header b{color:#fff;background:#9d2737;padding:5px 9px}.failure-presentation header span{font-size:12px;padding:7px 0;color:#f8dda1}
.replay-controls{position:absolute;left:12px;right:12px;bottom:14px;display:flex;align-items:center;justify-content:center;gap:14px;pointer-events:auto}
.failure-presentation #skipFailure{padding:10px 15px;background:#172a48ed;border:1px solid #c5d3df;font-size:14px;min-height:44px}
.replay-button{width:58px;height:58px;flex:none;border:3px solid #e5edff;border-radius:50%;font-size:29px;box-shadow:0 3px 0 #050e23,0 0 12px #0009;touch-action:manipulation}.replay-b{background:linear-gradient(#55a8f5,#204a9c)}.replay-a{background:linear-gradient(#ef6374,#a31c36)}
.retirement-presentation{position:absolute;z-index:7;pointer-events:none}.retirement-presentation header{padding:18px 20px;background:linear-gradient(#060b18d9,transparent);text-shadow:1px 2px 3px #000}.retirement-presentation header span{font-size:clamp(22px,4vw,36px);font-weight:900;letter-spacing:3px;color:#f4d17b}.retirement-presentation h2{font-size:16px;line-height:1.4;margin:6px 0 0}.retirement-presentation button{position:absolute;right:14px;bottom:14px;pointer-events:auto;padding:10px 16px;min-height:44px;font-size:14px}.retirement-presentation small{margin-left:10px;color:#c8d5e9}
.failure-progress{position:absolute;bottom:0;left:0;right:0;height:4px;background:#0c1426}.failure-progress i{display:block;height:100%;background:#e9c64a}
.presentation-open #hud,.presentation-open .toolbar,.presentation-open .touch-controls,.presentation-open .final-hud{visibility:hidden}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#080b0d;color:#fff6db;font-family:Arial,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
body{display:flex;align-items:center;justify-content:center}
button{font:inherit;color:inherit;cursor:pointer;touch-action:none;border:2px outset #abb3bd;background:#263c66;padding:5px 8px;font-weight:700}
button:active,button.held{border-style:inset;transform:translateY(1px);background:#826b33}
button:focus-visible{outline:2px solid #ffff98;outline-offset:3px}
#arena{position:relative;width:min(100vw,133.333dvh);height:min(100dvh,75vw);overflow:hidden;isolation:isolate;background:#111d2c}
.audio-loading{min-width:min(290px,88vw)}.audio-loading h2{font-size:23px}.audio-loading p{margin:4px 0 0;color:#dbe8f5;font-size:18px;font-weight:bold}
#game{display:block;width:100%;height:100%;image-rendering:pixelated;touch-action:none}
.scanlines{position:absolute;inset:0;pointer-events:none;z-index:2;background:repeating-linear-gradient(0deg,#0000000b 0px,#0000000b 1px,transparent 1px,transparent 3px)}
#hud{position:absolute;z-index:3;left:12px;right:12px;top:12px;display:flex;justify-content:space-between;align-items:flex-start;text-shadow:1px 1px #000;pointer-events:none}
.event-title{padding:4px 7px;background:linear-gradient(90deg,#193a6fdf,#17376178);border-left:3px solid #f1c640}
.event-title>span{font-size:10px;font-weight:700}.event-title h1{margin:3px 0;font-size:18px;letter-spacing:-.5px}.event-title p{font-size:10px;margin:3px 0 0}.event-title b{font-size:13px;color:#ffdf61;margin-left:6px}
.timer{text-align:right;background:#1a315aca;border:1px solid #b5bac0;padding:3px 6px}.timer>span{display:block;font-size:10px}.timer strong{font:bold italic 27px/1 'Courier New',monospace;letter-spacing:-1px;color:#ffdf58;text-shadow:1px 1px #512b12}
.toolbar{position:absolute;z-index:4;right:12px;top:69px;display:flex;gap:4px}.toolbar button{font-size:11px;padding:4px 6px}
#callout{position:absolute;z-index:5;top:38%;left:50%;transform:translate(-50%,-50%);pointer-events:none;font-size:clamp(30px,5vw,50px);font-weight:900;font-style:italic;white-space:nowrap;color:#ffde57;text-shadow:2px 2px #9e331d,3px 3px #101b2c}
.final-hud{position:absolute;z-index:5;left:50%;bottom:96px;transform:translateX(-50%);width:min(250px,65vw);text-align:center;text-shadow:1px 1px #000;pointer-events:none}.final-hud>span{display:block;font-size:12px;letter-spacing:2px;color:#ffe370;font-weight:900}.final-hud>b{display:block;font:900 22px/1.2 'Courier New',monospace;margin:3px}.final-track{height:13px;background:#27394a;border:1px solid #d6d5aa;position:relative;overflow:visible}.final-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#45bf77,#e7da42)}.final-track em{position:absolute;right:-32px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#2d7bc7;border:2px solid #c7e6ff;font-style:normal;font-weight:900}.final-track em[data-a="true"]{background:#c23d4c;border-color:#ffc3c8}.final-hud small{display:block;margin-top:6px;font-size:11px;color:#dce7e9}
.start-panel{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);z-index:6;width:min(340px,88%);padding:10px 12px 12px;border:2px ridge #b7c0cc;background:#152e56eb;text-align:center}
.start-panel p{font-size:13px;font-weight:700;margin:0 0 9px}.start-panel>div{display:flex;gap:8px}
.primary{background:linear-gradient(#ffe497,#c79736);border:2px outset #ffe5a5;color:#32230e;font-size:14px;font-weight:800;min-height:38px;padding:8px 12px;flex:1}.primary span{margin-left:8px}.secondary{background:linear-gradient(#425f93,#203c6b);border:2px outset #8c9db4;font-size:12px;padding:7px 10px}
.touch-controls{position:absolute;z-index:5;left:14px;right:14px;bottom:8px;pointer-events:none}.action-pad{display:flex;justify-content:space-between;gap:10px;align-items:flex-end}
.touch-controls button{pointer-events:auto;width:60px;height:60px;border:2px outset #9ba6ad;background:#233245d9;border-radius:50%;padding:2px;box-shadow:1px 2px #0006}
.touch-controls button.held{background:#937c37;border-style:inset}.action-pad #jumpBtn{width:68px;height:68px;border-color:#b9ad80}.action-pad button>span{display:block;font-size:21px;line-height:1;margin-bottom:3px;color:#9fdaab}#jumpBtn>span{color:#eca09c}.action-pad button b{display:block;font-size:11px;line-height:1.25}.action-pad small{display:block;font-size:9px;line-height:1.2;margin-top:3px;color:#d5d8d9}
.action-pad button.cue{box-shadow:0 0 0 2px #e7da65,0 0 12px #fff04f55;background:#746432}.touch-controls button:disabled{opacity:.28;box-shadow:none;cursor:default;transform:none}
/* A transparent, character-anchored gauge: only the bar and animated button circles. */
.timing{position:absolute;left:50%;top:70%;z-index:4;width:180px;height:10px;transform:translateX(-50%);pointer-events:none;--cue-size:26px;--bar-height:10px;--settled:0}
.timing-track,.stability-track{position:relative;height:var(--bar-height);border-radius:8px;box-shadow:0 1px 3px #07101ecc}
.timing-track{background:#35d645}.timing-track i,.stability-track i{position:absolute;top:0;height:100%;border-radius:8px}
#goodZone{left:0;width:100%;background:#35d645}#justZone{background:#ffe83a;box-shadow:0 0 5px #ffee5566}#takeoffLine{width:3px;transform:translateX(-50%);background:#fff9ad;top:-3px;height:calc(var(--bar-height) + 6px)}
#timingNeedle,#stabilityNeedle{position:absolute;left:0;top:-5px;transform:translateX(-50%);width:5px;height:calc(var(--bar-height) + 10px);border-radius:4px;background:#fff;box-shadow:0 1px 3px #142132bb}
#timingNeedle::after{content:"";position:absolute;left:50%;top:50%;width:24px;height:24px;border:3px solid #8fff9a;border-radius:50%;transform:translate(-50%,-50%);opacity:0}
.timing[data-judgement="good"] #timingNeedle{background:#b5ffb2}.timing[data-judgement="just"] #timingNeedle{background:#ffec47;box-shadow:0 0 10px #ffef68}.timing[data-judgement="just"] #timingNeedle::after{border-color:#ffe642}
.timing[data-judgement="good"] #timingNeedle::after,.timing[data-judgement="just"] #timingNeedle::after{animation:judge-ring .75s ease-out both}
.gauge-button{position:absolute;left:0;top:calc(0px - var(--cue-size) - 8px);transform:translateX(-50%)}.balance-left{left:0}.balance-right{left:100%}
.stability-only{display:none}.balancing .jump-only{display:none}.balancing .stability-only{display:block}.stability-track{background:#345af0}
#stabilityZone{background:#ffe83a;box-shadow:0 0 5px #ffee5577}#stabilityZone::after{content:"";position:absolute;inset:0;border-radius:8px;background:#a5ff80;transform:scaleX(var(--settled));box-shadow:0 0 7px #b5ff68}
#stabilityCenter{left:50%;width:2px;background:#fff5af;transform:translateX(-50%)}#stabilityNeedle{left:50%;width:7px;background:#fff2a1}
.menu-open .timing,.menu-open .touch-controls{visibility:hidden}
@keyframes judge-ring{0%{opacity:1;transform:translate(-50%,-50%) scale(.55)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.8)}}
.overlay{position:absolute;inset:0;z-index:8;display:flex;align-items:center;justify-content:center;padding:20px;background:#07122375}.result-panel{width:min(350px,94%);padding:20px;background:linear-gradient(#2d487dea,#142a4fed);border:3px ridge #b7c1d0;text-align:center}.result-panel>span{font-size:11px;letter-spacing:2px}.result-panel h2{font-size:28px;color:#ffdf65;text-shadow:2px 2px #4c2112;margin:12px 0}.result-panel p{font-size:14px;line-height:1.7;margin:12px 0 18px}.result-panel button{display:block;width:100%;margin-top:10px}
.hidden{display:none!important}dialog{max-width:520px;max-height:84dvh;overflow:auto;background:#152d52;border:3px ridge #b0bcca;color:#fff5d8;padding:20px;font-size:14px;line-height:1.7}dialog::backdrop{background:#051022bb}dialog h2{font-size:19px}dialog dt{color:#ffe478;font-weight:700;margin-top:13px}dialog dd{margin:5px 0}.credits{font-size:11px;color:#b7c6d2}.credits a{color:#eee69f}#closeHelp{position:absolute;right:6px;top:6px;border:0;background:none;font-size:23px}
@media(max-width:750px){.event-title h1{font-size:16px}.timer strong{font-size:25px}}
@media(orientation:portrait){#arena{width:100vw;height:100dvh}#game{position:absolute;top:max(94px,13dvh);height:75vw;width:100%}.scanlines{top:max(94px,13dvh);height:75vw;bottom:auto}#hud{top:max(14px,env(safe-area-inset-top));left:10px;right:10px}.toolbar{top:76px;right:10px}.toolbar button{font-size:10px;padding:3px 5px}.touch-controls{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));top:calc(max(94px,13dvh) + 75vw - 74px);bottom:auto}.start-panel{bottom:max(28px,8dvh);width:min(340px,90%)}#callout{top:calc(max(94px,13dvh) + 30vw)}}
@media(orientation:landscape) and (max-height:540px){#hud{top:8px;left:9px;right:9px}.event-title h1{font-size:15px}.event-title>span,.event-title p{font-size:9px}.timer strong{font-size:24px}.toolbar{top:62px;right:9px}.toolbar button{font-size:10px;padding:3px 5px}.touch-controls{position:fixed;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom))}.action-pad{gap:8px}.action-pad button{width:56px;height:56px}.action-pad #jumpBtn{width:62px;height:62px}.action-pad button>span{font-size:19px}.start-panel{bottom:16px;padding:8px 10px}.start-panel p{font-size:12px}.result-panel{padding:16px}}

/* Left blue B and right red A counter the matching side of sway. Right A also starts the run and jump. */
.action-pad #jumpBtn{background:linear-gradient(#c8434d,#862632);border-color:#f39498;color:#fff7ee}
.action-pad #braceBtn{background:linear-gradient(#347bc9,#174988);border-color:#89b9ef;color:#f4f9ff}
.action-pad button>span,#jumpBtn>span{font-size:25px;font-weight:900;color:#fff;text-shadow:1px 2px #0005}
.action-pad #jumpBtn.held{background:#f05d65}.action-pad #braceBtn.held{background:#579fe9}
.action-pad #jumpBtn.cue{box-shadow:0 0 0 2px #ffd2d3,0 0 13px #f35b6977}.action-pad #braceBtn.cue{box-shadow:0 0 0 2px #badfff,0 0 13px #438cf477}
.touch-controls button:disabled{opacity:.42;box-shadow:none}
@media(orientation:landscape) and (max-height:540px){.action-pad button>span,#jumpBtn>span{font-size:22px}}

.touch-controls button{display:grid;place-items:center}.action-pad button>span,#jumpBtn>span{margin:0;font-size:28px;line-height:1}

/* Color-only demonstrations match the left B and right A touch controls. */
.action-cue{font-size:calc(var(--cue-size)*.5);font-weight:900;--cue:#cf4553;--cue-edge:#ffb3b9;--cue-glow:#ffb3b955;position:relative;display:grid;place-items:center;width:var(--cue-size);height:var(--cue-size);border:1px solid var(--cue-edge);border-radius:50%;background:radial-gradient(circle at 35% 28%,var(--cue-edge),var(--cue) 58%);color:#fff;box-shadow:0 2px #641d2a;text-shadow:0 1px #0006;transform-origin:center;will-change:transform}
.action-cue[data-button="B"]{--cue:#347fc8;--cue-edge:#abd8ff;--cue-glow:#abd8ff55;box-shadow:0 2px #153b70}
.action-cue::after{content:"";position:absolute;inset:-3px;border:1px solid var(--cue-edge);border-radius:50%;opacity:0;pointer-events:none}
.action-cue[data-action="press"]{animation:cue-press 1.8s ease-in-out infinite}.action-cue[data-action="press"]::after{animation:cue-tap-ring 1.8s ease-out infinite}
.action-cue[data-action="hold"]{animation:cue-hold 2.8s ease-in-out infinite}.action-cue[data-action="hold"]::after{animation:cue-hold-ring 2.8s linear infinite}
/* Rapid pulses demonstrate the rolling-hill climb. */
.action-cue[data-action="mash"]{animation:cue-press .38s ease-in-out infinite}.action-cue[data-action="mash"]::after{animation:cue-tap-ring .38s ease-out infinite}
.action-cue[data-pressed="true"]{animation:none;transform:translateY(2px) scale(.90);box-shadow:inset 0 2px #0005}.action-cue[data-pressed="true"]::after{animation:none;opacity:1;box-shadow:0 0 0 2px var(--cue-glow)}
.action-cue[data-active="false"],.action-cue[data-active="false"]::after{animation:none}.action-cue[data-needed="false"]{opacity:.35}.action-cue[data-needed="false"],.action-cue[data-needed="false"]::after{animation:none}.timing.paused .action-cue,.timing.paused .action-cue::after{animation-play-state:paused}
@keyframes cue-press{0%,10%,36%,100%{transform:translateY(0) scale(1)}18%,27%{transform:translateY(2px) scale(.86)}}
@keyframes cue-tap-ring{0%,17%,65%,100%{opacity:0;transform:scale(.8)}20%{opacity:.9;transform:scale(.85)}55%{opacity:0;transform:scale(1.35)}}
@keyframes cue-hold{0%,100%{transform:translateY(0) scale(1)}12%,90%{transform:translateY(2px) scale(.90);box-shadow:inset 0 2px #0005}}
@keyframes cue-hold-ring{0%,100%{opacity:0;box-shadow:0 0 0 0 var(--cue-glow)}12%,90%{opacity:1;box-shadow:0 0 0 2px var(--cue-glow)}}
@media(prefers-reduced-motion:reduce){#timingNeedle::after{animation:none!important}.action-cue,.action-cue::after{animation:none!important}.action-cue[data-action="hold"]{transform:translateY(2px) scale(.90)}.action-cue[data-action="hold"]::after{opacity:1}}


.debug-panel{width:min(430px,94vw);padding:18px}.debug-panel h2{margin:0 24px 14px 0}.debug-panel h3{font-size:13px;color:#ffe077;margin:15px 0 7px}.debug-starts{display:grid;grid-template-columns:1fr 1fr;gap:8px}.debug-starts button{min-height:44px;padding:7px;font-size:13px}.debug-starts button[aria-pressed="true"]{background:#75612d;border-color:#ffe17c}.debug-panel p{font-size:12px;color:#c3d0dc;margin:14px 0}.debug-panel #normalPlayBtn{width:100%;min-height:40px}#closeDebug{position:absolute;right:6px;top:6px;border:0;background:none;font-size:23px}



/* Before the first press, the floating cue is the entire instruction. */
.timing.start-only .timing-track{display:none}.timing.start-only #jumpCue{left:50%}
.timing.start-only .action-cue{filter:drop-shadow(0 0 4px #ff909055)}

/* The single next B action is attached to its world location, not an effort bar. */
.world-action{position:absolute;z-index:4;pointer-events:none;transform:translate(-50%,-100%);display:flex;align-items:center;flex-direction:column;--cue-size:32px}
.world-action .action-cue{font-size:calc(var(--cue-size)*.53);font-weight:900;line-height:1}
.world-action>i{display:block;width:2px;height:12px;background:#c4e6ff;box-shadow:0 1px 2px #07101e}
.world-action>i::after{content:"";position:absolute;bottom:-2px;left:calc(50% - 4px);width:8px;height:4px;border-radius:50%;background:#c4e6ff;box-shadow:0 0 3px #245c91}

/* Catch timing rises from the bottom; the B cue stays beside the yellow zone. */
.catch-gauge{position:absolute;z-index:4;width:60px;height:110px;pointer-events:none;--cue-size:30px}
.catch-track{position:relative;width:12px;height:100%;border-radius:6px;background:#205640;box-shadow:0 1px 3px #07101ecc}
.catch-track i{position:absolute;left:0;bottom:0;width:100%;border-radius:5px}
#catchFill{background:#42e779;height:0}#catchJustZone{background:#ffe539;box-shadow:0 0 7px #ffd84d88}
#catchNeedle{position:absolute;left:-4px;bottom:0;width:20px;height:4px;transform:translateY(50%);background:#fff9dc;border-radius:3px;box-shadow:0 1px 3px #142132}
.catch-button{position:absolute;left:24px;bottom:90%;transform:translateY(50%)}
.catch-button .action-cue{font-size:calc(var(--cue-size)*.53);font-weight:900}
.catch-gauge[data-just="true"] #catchBCue{border-color:#fff38b;box-shadow:0 0 0 2px #ffdf4a,0 0 12px #ffda5d99}
/* Rapid compression, impact rays and a tap-triggered flash make mashing explicit. */
.action-cue[data-action="mash"][data-active="true"]{animation:mash-impact .24s linear infinite;box-shadow:0 0 calc(3px + var(--tap-flash,0)*12px) #ffda67,0 2px #7f2532}
.action-cue[data-action="mash"][data-active="true"]::after{inset:-8px;border:2px solid #ffeb9e;animation:mash-ring .24s ease-out infinite}
.action-cue[data-action="mash"][data-active="true"]::before,.action-pad #jumpBtn.mash-mode::before{content:"";position:absolute;inset:-14px;pointer-events:none;background:repeating-conic-gradient(from 8deg,transparent 0deg 37deg,#fff5bb 38deg 43deg,transparent 44deg 45deg);-webkit-mask:radial-gradient(circle,transparent 0 54%,#000 56% 69%,transparent 71%);mask:radial-gradient(circle,transparent 0 54%,#000 56% 69%,transparent 71%);animation:mash-sparks .24s steps(2,end) infinite}
.action-pad #jumpBtn.mash-mode{position:relative;animation:mash-pad .24s ease-out infinite;box-shadow:0 0 0 2px #ffc65c,0 0 calc(8px + var(--tap-flash,0)*15px) #ffb14f99}
.action-pad #jumpBtn.mash-mode::before{inset:-17px;animation-duration:.22s}
.action-pad #jumpBtn.mash-mode>span{animation:mash-letter .24s ease-out infinite}
@keyframes mash-impact{0%,100%{transform:translate(0,0) scale(1.06)}18%,30%{transform:translate(1px,3px) scale(.78)}50%{transform:translate(-1px,-2px) scale(1.15)}70%{transform:translate(1px,0) scale(1)}}
@keyframes mash-ring{0%{opacity:1;transform:scale(.70)}65%,100%{opacity:0;transform:scale(1.3)}}
@keyframes mash-sparks{0%,100%{opacity:0;transform:rotate(0deg) scale(.8)}20%,65%{opacity:1;transform:rotate(12deg) scale(1.1)}}
@keyframes mash-pad{0%,100%{filter:brightness(1)}24%{filter:brightness(1.55)}58%{filter:brightness(1.08)}}
@keyframes mash-letter{0%,100%{transform:translateY(0) scale(1)}25%{transform:translateY(2px) scale(.84)}55%{transform:translateY(-1px) scale(1.1)}}
@media(prefers-reduced-motion:reduce){.action-cue[data-action="mash"],.action-cue[data-action="mash"]::before,.action-cue[data-action="mash"]::after,.action-pad #jumpBtn.mash-mode,.action-pad #jumpBtn.mash-mode::before,.action-pad #jumpBtn.mash-mode>span{animation:none!important}.action-pad #jumpBtn.mash-mode::before,.action-cue[data-action="mash"]::before{opacity:1}}


/* The selected device controls the HUD and touch targets independently of orientation. */
body{--device-pad:76px;--device-padB:72px;--device-letter:30px;--device-title:19px;--device-meta:11px;--device-timer:60px;--device-toolbar:12px;--device-instruction:14px}
.action-pad #jumpBtn{width:min(var(--device-pad),24vw,32dvh);height:min(var(--device-pad),24vw,32dvh)}
.action-pad #braceBtn{width:min(var(--device-padB),24vw,32dvh);height:min(var(--device-padB),24vw,32dvh)}
.action-pad button>span,.action-pad #jumpBtn>span{font-size:var(--device-letter)}
.event-title h1{font-size:var(--device-title)}.event-title>span,.event-title p,.timer>span{font-size:var(--device-meta)}.timer strong{font-size:var(--device-timer)}
.toolbar{top:calc(36px + var(--device-timer))}.toolbar button{font-size:var(--device-toolbar)}
body[data-device="ipad"] .touch-controls{left:24px;right:24px;bottom:16px}
body[data-device="ipad"] .secondary,body[data-device="ipad"] .primary,body[data-device="ipad"] .debug-starts button{font-size:16px;min-height:48px}
body[data-device="ipad"] dialog{font-size:17px;max-width:650px}body[data-device="ipad"] .result-panel{width:min(460px,94%)}
.balance-instruction{position:absolute;top:calc(var(--bar-height) + 7px);left:50%;transform:translateX(-50%);margin:0;font-size:var(--device-instruction);font-weight:800;line-height:1.25;white-space:nowrap;color:#fff9bd;text-shadow:0 1px 3px #000,1px 1px #000,-1px -1px #000}
@media(orientation:portrait){.toolbar{top:calc(39px + var(--device-timer))}.touch-controls,body[data-device="ipad"] .touch-controls{top:calc(max(94px,13dvh) + 75vw - min(var(--device-pad),24vw,32dvh) - 12px);bottom:auto}}

/* Temporary game title, input legend and explicit A-to-countdown action. */
.menu-open #hud{visibility:hidden}.menu-open .toolbar{top:12px}.menu-open #cameraBtn,.menu-open #soundBtn,.menu-open #pauseBtn{display:none}
.start-panel{top:50%;bottom:auto;transform:translate(-50%,-50%);width:min(620px,92%);max-height:calc(100% - 84px);overflow:auto;padding:22px 26px;border:2px solid #8cabc6;border-top:4px solid #ffe057;background:linear-gradient(145deg,#1c396bf7,#09192df7);box-shadow:0 8px 40px #0009;text-align:center;scrollbar-width:thin}
.start-panel .title-brand{display:block;margin-bottom:15px}.title-brand>span{font-size:12px;letter-spacing:.09em;color:#b8cce1}.title-brand h2{font-size:clamp(30px,5vw,48px);line-height:1.0;font-style:italic;letter-spacing:-1px;margin:8px 0 0;color:#fff4c6;text-shadow:2px 3px #66342a}.title-brand em{display:block;font-size:.53em;letter-spacing:.10em;color:#ffdc5a;margin-top:6px}
.device-select{display:flex;gap:8px;border:0;padding:0;margin:0 0 8px}.device-select legend{width:100%;padding:0;margin-bottom:7px;font-size:14px;font-weight:700}.device-select label{flex:1;position:relative}.device-select input{position:absolute;opacity:0}.device-select span{display:block;padding:9px 5px;border:2px solid #6784a7;border-radius:4px;background:#1c3259;font-size:16px;font-weight:800;cursor:pointer}.device-select input:checked+span{background:#ffdb69;color:#292443;border-color:#fff3b8}.device-select input:focus-visible+span{outline:2px solid white;outline-offset:3px}
.start-panel #deviceHint{font-size:13px;line-height:1.5;color:#c7d6e6;margin:8px 0 12px}.start-panel .title-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:10px}.title-controls p{display:flex;align-items:center;justify-content:center;gap:10px;margin:0;font-size:14px;line-height:1.55;text-align:left}.button-token{display:inline-grid;place-items:center;flex:none;width:40px;height:40px;border-radius:50%;font-size:24px;font-style:normal;color:white;border:2px solid #ffffff88;text-shadow:0 1px #0008;box-shadow:0 3px #0006}.button-token.red{background:linear-gradient(#ed6068,#a21f35)}.button-token.blue{background:linear-gradient(#57a8ec,#2153a7)}
.start-panel .title-actions{font-size:13px;color:#d5dfed;margin:4px 0 15px}.title-start{width:100%;display:flex;align-items:center;justify-content:center;gap:16px;border:2px outset #ffc5b8;background:linear-gradient(#a33448,#6a2138);padding:12px 10px;font-size:18px;line-height:1.4;min-height:86px}.title-start .button-token{width:54px;height:54px;font-size:34px}.title-start strong{font-size:clamp(20px,3vw,27px);color:#fff2aa}.title-start:active{background:#b53d4f}.start-panel .countdown-route{font-size:16px;color:#ffdf73;margin:10px 0 14px}.countdown-route span{display:block;font-size:13px;color:#d7e3ee;margin-top:4px}.start-panel .title-options{display:flex;gap:9px;justify-content:center}.title-options .secondary{min-height:36px}
@media(max-width:500px){.start-panel{padding:16px}.start-panel .title-controls{gap:6px}.title-controls p{gap:6px;font-size:12px}.title-controls .button-token{width:34px;height:34px;font-size:22px}.title-start{gap:10px;font-size:16px}.title-start strong{font-size:20px}}
@media(orientation:landscape) and (max-height:560px){.start-panel{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;max-height:calc(100% - 50px);width:min(720px,96%);padding:12px 16px}.start-panel .title-brand{grid-column:1;grid-row:1;margin:0;align-self:center}.title-brand>span{font-size:10px}.title-brand h2{font-size:27px;margin:4px 0}.title-brand em{font-size:12px;margin-top:3px}.device-select{grid-column:2;grid-row:1;margin:0;gap:5px;align-self:center}.device-select legend{font-size:12px;margin-bottom:5px}.device-select span{font-size:13px;padding:7px 3px}.start-panel #deviceHint{grid-column:1/-1;grid-row:2;margin:0;font-size:11px}.start-panel .title-controls{grid-column:1;grid-row:3;margin:0;gap:5px;align-self:center}.title-controls p{flex-direction:column;gap:4px;font-size:11px;line-height:1.3;text-align:center}.title-controls .button-token{width:30px;height:30px;font-size:20px}.start-panel .title-actions{grid-column:1;grid-row:4;margin:0;font-size:11px;align-self:center}.title-start{grid-column:2;grid-row:3/5;gap:8px;min-height:94px;padding:8px;font-size:14px}.title-start strong{font-size:16px}.title-start .button-token{width:38px;height:38px;font-size:25px}.start-panel .countdown-route{grid-column:1/-1;grid-row:5;font-size:13px;margin:0}.countdown-route span{display:inline;margin-left:10px;font-size:11px}.start-panel .title-options{grid-column:1/-1;grid-row:6}.title-options .secondary{font-size:11px;min-height:28px;padding:4px 10px}}

/* Mashing uses a freestanding animated button for every area. */
.mash-prompt{position:absolute;z-index:5;transform:translate(-50%,-50%);pointer-events:none;--cue-size:44px}
.menu-open .mash-prompt{visibility:hidden}
.event-title{padding:10px 13px;max-width:64%}.event-title h1{line-height:1.2;margin:6px 0}.event-title>span{display:block;line-height:1.25}.event-title p{margin:5px 0 0}.timer{padding:7px 10px}.timer>span{line-height:1.25}.toolbar{top:calc(56px + var(--device-timer));gap:5px}.toolbar button{padding:6px 9px;min-height:34px}
@media(max-width:600px){.event-title{padding:7px 9px;max-width:64%}.event-title h1{font-size:min(var(--device-title),5vw)}.event-title>span{font-size:min(var(--device-meta),3vw)}.toolbar{top:calc(50px + var(--device-timer));gap:3px}.toolbar button{padding:5px 6px;min-height:30px}.timer{padding:5px 7px}}
.mash-prompt .action-cue{font-size:calc(var(--cue-size)*.55);font-weight:900}

@media(max-width:600px){.toolbar{width:34%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.toolbar button{padding:5px 2px;min-width:0;overflow-wrap:anywhere}.menu-open .toolbar{width:auto;display:flex}}

/* The two marked actions share one continuous glider sequence, without a panel. */
.sequence-track{position:relative;height:var(--bar-height);border-radius:8px;background:#205640;box-shadow:0 1px 3px #07101ecc}
.sequence-track>i{position:absolute;top:0;height:100%;border-radius:6px}
#dragonSequenceFill{left:0;background:#42e779}
.sequence-zone{background:#ffe539;box-shadow:0 0 5px #ffd84d55}
.sequence-track>.sequence-line{top:-5px;height:calc(var(--bar-height) + 10px);width:2px;background:#fff5bb;transform:translateX(-50%)}
#dragonSequenceNeedle{position:absolute;left:0;top:-5px;width:5px;height:calc(var(--bar-height) + 10px);transform:translateX(-50%);background:white;border-radius:3px;box-shadow:0 0 4px #163a26}
.sequence-button{position:absolute;bottom:calc(var(--bar-height) + 13px);transform:translateX(-50%)}
.sequence-button[data-done="true"] .action-cue{box-shadow:0 0 0 2px #fff398,0 0 8px #ffe65388}
.dragon-sequence[data-just="true"][data-stage="jump"] #dragonBCue,.dragon-sequence[data-just="true"][data-stage="catch"] #dragonACue{border-color:#fff38b;box-shadow:0 0 0 2px #ffdf4a,0 0 12px #ffda5d99}

/* Cover the whole tapping surface, including the gaps and button labels. */
#arena{touch-action:manipulation}
.touch-controls,.action-pad,.touch-controls *{touch-action:none;-webkit-touch-callout:none}

.stage-select{display:flex;gap:8px;margin:10px 0 14px}.stage-select button{flex:1;border:2px outset #9cabb7;background:#263d62;color:#e7eced;padding:9px 8px;font-weight:bold}.stage-select button[aria-pressed="true"]{border-color:#ffe378;background:#5d4f27;color:#fff1a1}.world-action[data-just="true"] .action-cue{box-shadow:0 0 0 4px #ffe66a,0 0 18px #ffeb88}.result-panel #nextStageBtn{display:block;width:100%;margin-bottom:12px}.result-panel #nextStageBtn.hidden{display:none}
/* Circular half-turn cues stay centered on the moving log. */
.rolling-timing{position:absolute;z-index:4;transform:translate(-50%,-50%);pointer-events:none;--cue-size:32px;--ring-color:#f16974}
.rolling-timing[data-button="B"]{--ring-color:#64b1ff}
.rolling-timing svg{display:block;width:100%;height:100%;overflow:visible;fill:none;stroke-linecap:round;filter:drop-shadow(0 1px 2px #071018cc)}
.rolling-ring-base{stroke:#eaf3fa66;stroke-width:4}
#rollingRingFill{stroke:var(--ring-color);stroke-width:5}
.rolling-zone{stroke:#ffe848;stroke-width:8;opacity:.25}
.rolling-timing[data-button="A"] #rollingArcA,.rolling-timing[data-button="B"] #rollingArcB{opacity:1}
#rollingRingNeedle{stroke:#fff;stroke-width:4}
.rolling-timing[data-just="true"] #rollingRingNeedle{stroke:#fff06a;stroke-width:6}
.rolling-button{position:absolute;left:50%;transform:translate(-50%,-50%)}
.rolling-a{top:100%}.rolling-b{top:0}
.rolling-timing[data-hit="A"] #rollingCueA,.rolling-timing[data-hit="B"] #rollingCueB{opacity:1;box-shadow:0 0 0 3px #e9ff9a,0 0 14px #dcff69}
.menu-open .rolling-timing{visibility:hidden}
@media(orientation:landscape) and (max-height:560px){.start-panel .stage-select{grid-column:1/-1;grid-row:2;margin:0}.stage-select button{padding:5px;font-size:12px}.start-panel #deviceHint{grid-row:3}.start-panel .title-controls{grid-row:4}.start-panel .title-actions{grid-row:5}.start-panel .title-start{grid-row:4/6}.start-panel .countdown-route{grid-row:6}.start-panel .title-options{grid-row:7}}

/* The conveyor is the requested exception: stored launch power remains visible during mashing. */
.conveyor-gauge{position:absolute;z-index:4;pointer-events:none;transform:translateX(-50%);--cue-size:32px;--bar-height:10px}
.conveyor-track{height:var(--bar-height);position:relative;background:#173e38;border-radius:6px;box-shadow:0 1px 3px #000a;overflow:visible}
.conveyor-track>i{position:absolute;top:0;height:100%;border-radius:6px}#conveyorFill{left:0;width:0;background:#29e955}.conveyor-zone{left:var(--conveyor-zone-start,28.5%);width:var(--conveyor-zone-width,1.5%);background:#ffdf35;box-shadow:0 0 7px #fbea4b99}.conveyor-eighty{left:30%;width:2px;transform:translateX(-50%);background:#ffe94c}
#conveyorNeedle{position:absolute;top:-4px;width:4px;height:calc(var(--bar-height) + 8px);transform:translateX(-50%);background:#fffbd5;border-radius:2px;box-shadow:0 0 3px #101916}
#conveyorCue{position:absolute;left:calc(var(--cue-size)*-.5 - 6px);bottom:calc(100% + 4px);font-size:calc(var(--cue-size)*.53);font-weight:900}
.conveyor-scale{position:relative;height:18px;font:bold 12px/18px Arial;color:#fff7d1;text-shadow:1px 1px 2px #000}.conveyor-scale>span{position:absolute}.conveyor-scale>span:nth-child(2){left:30%;transform:translateX(-50%);color:#ffe35a}.conveyor-scale>span:last-child{right:0}
.conveyor-gauge[data-charging="false"] .conveyor-zone{opacity:.3}.conveyor-gauge[data-just="true"] #conveyorCue{box-shadow:0 0 0 3px #ffe759,0 0 13px #ffe568}.menu-open .conveyor-gauge{visibility:hidden}
.debug-stage-tabs{position:sticky;top:-18px;z-index:1;display:flex;gap:8px;padding:10px 0;background:#152d52;margin-bottom:8px}.debug-stage-tabs button{flex:1;min-height:44px;font-size:14px}.debug-stage-tabs button[aria-selected="true"]{background:#68582d;border-color:#ffe27a;color:#fff0a7}.debug-panel [hidden]{display:none!important}.debug-panel h3{font-size:14px}.debug-panel #normalPlayBtn{margin-top:6px}body[data-device="ipad"] .debug-stage-tabs button{font-size:18px;min-height:48px}

.lift-gauge{position:absolute;z-index:5;width:60px;height:130px;pointer-events:none;--cue-size:32px}
.lift-track{position:relative;width:12px;height:100%;background:#205640;border-radius:6px;box-shadow:0 1px 3px #07101ecc}
#liftFill{position:absolute;left:0;bottom:0;width:100%;height:0;background:#43e87a;border-radius:6px}
#liftNeedle{position:absolute;left:-3px;width:18px;height:4px;background:#faffdd;border-radius:2px;transform:translateY(50%)}
#liftPassLine,#liftCrouchLine,#liftStandLine{position:absolute;left:-4px;width:20px;height:2px;background:#e3d662;transform:translateY(50%)}
#liftPassLine{width:34px;background:#ffe26b;height:4px;box-shadow:0 0 4px #ffe45b88}
#liftCrouchLine,#liftStandLine{left:0;width:12px;opacity:.55}
.lift-a-anchor{position:absolute;left:calc(-1 * var(--cue-size) - 13px);bottom:0}.lift-b-anchor{position:absolute;left:30px;bottom:54%;transform:translateY(50%)}
.lift-gauge[data-ready="true"] #liftBCue{box-shadow:0 0 0 2px #ffe48b,0 0 9px #ffdc6d88}
.menu-open .lift-gauge{visibility:hidden}

/* 3rd-stage map inspection shares the game canvas, with no play gauges. */
.third-map-ui{position:absolute;inset:0;z-index:5;pointer-events:none}
.map-navigation{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);width:min(530px,92%);background:#142a47ed;border-top:2px solid #e9c659;padding:9px 12px;pointer-events:auto}
.map-area-row{display:flex;gap:7px}.map-area-row button{width:44px;flex:none}.map-area-row select{min-width:0;flex:1;background:#213b61;color:#fff1ce;border:1px solid #829ab1;font:700 15px Arial,Meiryo,sans-serif;padding:7px;touch-action:manipulation}.map-navigation button{min-height:40px;font-size:15px}
.map-navigation p{margin:7px 0;font-size:14px;line-height:1.45}.map-tools{display:flex;gap:5px}.map-tools button{flex:1;padding:5px}.map-tools #mapTitle{flex:1.7;font-size:13px}.map-navigation .map-help{color:#bfd0df;font-size:12px;margin:6px 0 0;text-align:center}
#mapMarkers button{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;width:34px;height:34px;min-height:34px;border-radius:50%;border:2px solid #ffe487;background:#183a62e8;color:#fff1a7;font:900 18px Arial;box-shadow:0 2px 5px #0007;padding:0}
#mapMarkers button[hidden]{display:none}#mapMarkers button[aria-pressed="true"]{background:#756129}
.third-map-open .touch-controls,.third-map-open .timing,.third-map-open .world-action,.third-map-open .mash-prompt,.third-map-open .catch-gauge,.third-map-open .rolling-timing,.third-map-open .conveyor-gauge,.third-map-open .lift-gauge,.third-map-open .dragon-sequence,.third-map-open #callout,.third-map-open .timer,.third-map-open .event-title p,.third-map-open #soundBtn,.third-map-open #pauseBtn{display:none!important}
.third-map-open .event-title{max-width:65%}.third-map-open .event-title h1{font-size:clamp(15px,2.1vw,23px);overflow-wrap:anywhere}.third-map-open .toolbar{top:12px;width:auto;display:flex}.third-map-open #cameraBtn{display:block}.third-map-open .toolbar button{font-size:14px;min-height:40px}.third-map-open #game{cursor:grab}.third-map-open #game:active{cursor:grabbing}
.stage-select button{white-space:nowrap;font-size:14px}
@media(orientation:portrait){.third-map-open #game{top:12dvh;height:calc(100dvh - 12dvh - 216px)}.third-map-open .scanlines{top:12dvh;height:calc(100dvh - 12dvh - 216px)}.third-map-open .map-navigation{bottom:max(12px,env(safe-area-inset-bottom));width:94%}.third-map-open .event-title{max-width:58%}.third-map-open .toolbar button{font-size:12px;padding:4px}.third-map-open #hud{top:max(12px,env(safe-area-inset-top))}}
@media(orientation:landscape) and (max-height:560px){.map-navigation{bottom:6px;padding:5px 8px;width:min(570px,79%)}.map-navigation #mapDetail,.map-navigation .map-help{display:none}.map-navigation{display:flex;gap:6px}.map-area-row{width:46%;gap:3px}.map-area-row button{width:30px}.map-area-row select{font-size:12px;padding:3px}.map-tools{width:54%;gap:3px}.map-tools button{font-size:13px;padding:2px}.map-tools #mapTitle{font-size:11px}.map-navigation button{min-height:38px}#mapMarkers button{width:29px;height:29px;min-height:29px;font-size:16px}.third-map-open .toolbar{top:8px}.third-map-open .toolbar button{min-height:30px;font-size:12px}.third-map-open .event-title h1{font-size:16px}}
body[data-device="ipad"] .map-navigation{width:min(650px,92%)}body[data-device="ipad"] .map-navigation button{min-height:46px}body[data-device="ipad"] #mapMarkers button{width:42px;height:42px;font-size:22px}

.map-burst-controls:not([hidden]){display:flex;gap:5px;flex-wrap:wrap;margin-top:5px}.map-burst-controls button{font-size:12px;flex:1;padding:5px;min-height:38px}
@media(orientation:portrait){.third-map-open:has(#mapBurstControls:not([hidden])) #game,.third-map-open:has(#mapBurstControls:not([hidden])) .scanlines{height:calc(100dvh - 12dvh - 265px)}}
@media(orientation:landscape) and (max-height:560px){.map-navigation:has(#mapBurstControls:not([hidden])){flex-wrap:wrap}.map-burst-controls{width:100%}}
#thirdOverviewBtn{display:none}body[data-title-stage="3"] #thirdOverviewBtn{display:inline-block}
#thirdNearHud{position:absolute;z-index:5;transform:translateX(-50%);pointer-events:none;--cue-size:36px;filter:drop-shadow(0 1px 2px #0008)}#thirdNearHud[hidden],#thirdNearHud [hidden]{display:none}.third-cue-row{display:flex;align-items:center;justify-content:space-between;gap:12px}#thirdNearHud[data-start="true"] .third-cue-row{justify-content:center;gap:10px}#thirdStartLabel{font-size:16px;white-space:nowrap;color:#fff4bc;text-shadow:0 1px 3px black}#thirdNearHud[data-start="true"] #thirdBCue{border:3px solid #ffe68b;box-shadow:0 0 0 2px #327eda,0 0 10px #ffe16d77}
.third-grip-row{display:flex;gap:8px;align-items:center}#thirdGripMeter{flex:1;background:#323e49}#thirdGripFill{display:block;height:100%;background:#7acb71}#thirdGripMeter.low #thirdGripFill{background:#ef8b62}
#thirdPower{margin-top:12px}#thirdPower>i{display:block;background:#35404c;height:7px;border:1px solid #c3c8a7;border-radius:4px;overflow:hidden}#thirdPowerFill{display:block;height:100%;background:#e9c460}#thirdPower.on-beat #thirdPowerFill{background:#fff1a3}
#thirdTiming{height:14px;position:relative;background:#3b7964;border:1px solid #c5dac2;border-radius:6px;margin-top:12px}#thirdTimingZone{position:absolute;top:0;bottom:0;background:#f0cf5f}#thirdTimingCursor{position:absolute;top:-3px;bottom:-3px;width:4px;background:white;transform:translateX(-50%)}#thirdTiming.ready{box-shadow:0 0 8px #ffe277}.third-rhythm-zone{position:absolute;left:0;top:0;bottom:0;width:28%;background:#9b5b66}.third-perfect-zone{position:absolute;left:78%;width:8%;top:0;bottom:0;background:#fff3b7;border-left:1px solid white;border-right:1px solid white}#thirdTiming.cliff-distance .third-rhythm-zone,#thirdTiming.cliff-distance .third-perfect-zone{display:none}
.third-play-open .timing:not(#salmonTransferGauge),.third-play-open .world-action,.third-play-open .mash-prompt,.third-play-open .catch-gauge,.third-play-open .rolling-timing,.third-play-open .conveyor-gauge,.third-play-open .lift-gauge,.third-play-open .dragon-sequence{display:none!important}
@media(orientation:portrait){.third-play-open .event-title h1{font-size:18px}}
/* Second-stage rhythm gauges share the game's compact red A / blue B cues. */
.salmon-rhythm,.spider-gauge,.salmon-condition{position:absolute;z-index:5;pointer-events:none}.salmon-rhythm svg{width:100%;height:100%;overflow:visible;filter:drop-shadow(0 1px 2px #0009)}
#salmonArcBase,#salmonArcFill{fill:none;stroke:#205640;stroke-width:10;stroke-linecap:round}#salmonArcFill{stroke:#49e77c}#salmonArcNeedle line{stroke:#fff8dc;stroke-width:4}.salmon-marker line{stroke:#fff9c3;stroke-width:3}.salmon-marker circle{fill:#d92e3e;stroke:#f7eab7;stroke-width:2}.salmon-marker[data-button="B"] circle{fill:#316cda}.salmon-marker text{fill:#fff;font:bold 15px Arial}.salmon-marker[data-current="true"] circle{stroke:#ffe332;stroke-width:4}.salmon-marker[data-mark="hit"]{opacity:.5}.salmon-marker[data-mark="miss"] circle{fill:#626569}
.salmon-condition{display:flex;flex-direction:column;align-items:center;gap:14px;transform:translateX(-50%)}.salmon-recovery-gauge{width:100%;height:8px;background:#253541;border:1px solid #d1dfd7;border-radius:4px;overflow:hidden;box-shadow:0 1px 3px #000a}#salmonRecoveryFill{display:block;height:100%;background:#f2d25e}
#salmonTransferFill{left:0;background:#42e779}#salmonTransferNeedle{position:absolute;top:-5px;height:calc(var(--bar-height) + 10px);width:4px;background:#fff;transform:translateX(-50%)}
#salmonWindupArc{fill:none;stroke:#b9a35a;stroke-width:10;stroke-linecap:round}.salmon-marker[data-locked="true"] circle{stroke:#a6b1b8;stroke-width:2}.salmon-rhythm[data-can-start="true"] #salmonMarker0 circle{stroke:#ffe251;stroke-width:5;filter:drop-shadow(0 0 5px #ffeb68)}
.spider-gauge{--cue-size:30px}#spiderFill{background:#42e779}#spiderZone{background:#ffe539}#spiderNeedle,#spiderLine,#spiderCatchLine{position:absolute;left:-5px;width:22px;height:3px;background:white;transform:translateY(50%)}#spiderLine,#spiderCatchLine{background:#ffee83;height:2px;width:27px}#spiderInstruction{position:absolute;bottom:-29px;left:8px;transform:translateX(-50%);font-size:11px;font-weight:bold;white-space:nowrap;color:#fff5ca;text-shadow:0 1px 3px black;margin:0}.spider-gauge[data-busy="true"]{opacity:.65}.spider-gauge[data-just="true"] .catch-track{box-shadow:0 0 8px #ffe575}
.menu-open .salmon-rhythm,.menu-open .salmon-condition,.menu-open .spider-gauge,.menu-open .second-transfer,.third-map-open .salmon-rhythm,.third-map-open .salmon-condition,.third-map-open .spider-gauge,.third-map-open .second-transfer{display:none!important}
#salmonTransferCenter{left:50%;top:-6px;height:calc(var(--bar-height) + 12px);width:2px;transform:translateX(-50%);background:#e9f0e6;z-index:2}#salmonTransferGauge[data-stage="jump"][data-in-zone="true"] #salmonACue,#salmonTransferGauge[data-stage="catch"][data-in-zone="true"] #salmonBCue{border-color:#fff39b;box-shadow:0 0 0 2px #ffdf4a,0 0 12px #ffda5d99}

#salmonTransferGauge[data-stage="success"] .sequence-track{box-shadow:0 0 0 2px #85f4a1,0 0 15px #49e77c88}#salmonTransferGauge[data-stage="success"] #salmonBZone{background:#64ed8b}#salmonTransferGauge[data-stage="success"] #salmonBCue{background:#208946;border-color:#b8ffd0;box-shadow:0 0 0 2px #49e77c,0 0 14px #49e77c99}#salmonTransferGauge[data-stage="success"] #salmonAButton{opacity:.35}

/* Reserve a stable width for the enlarged clock on every device. */
#hud{gap:10px}.event-title{min-width:0}.timer{flex:0 0 auto}.timer>span{font-size:max(14px,var(--device-meta))}.timer strong{display:block;min-width:6ch;white-space:nowrap;font-size:clamp(42px,12vw,var(--device-timer));font-variant-numeric:tabular-nums}.timer.urgent{background:#431924e8;border-color:#ff7474}.timer.urgent strong{color:#ff6262;text-shadow:1px 1px #510b13,0 0 8px #ff303044}

/* One shared stamina meter stays in the upper-right header throughout 3rd. */
#thirdStamina[hidden]{display:none}.third-play-open .timer{display:grid;grid-template-columns:1fr auto;gap:6px;width:clamp(185px,40vw,480px);padding:6px 9px}#thirdStamina{grid-column:1/-1}.third-play-open .third-grip-row{display:grid;grid-template-columns:1fr auto;font-size:clamp(22px,2.2vw,28px);gap:5px;font-weight:bold;text-align:left}#thirdStamina #thirdGripMeter{grid-row:2;grid-column:1/-1;height:20px;min-width:44px;border:2px solid #b9d2b8;border-radius:7px;overflow:hidden}#thirdStamina #thirdGripValue{text-align:right;font-variant-numeric:tabular-nums}#thirdStamina.recovered #thirdGripMeter{box-shadow:0 0 10px #9eff82}#thirdStamina.recovered #thirdGripFill{background:#b5ff86}.third-play-open .timer>span{font-size:12px;text-align:left;align-self:center}.third-play-open .timer strong{font-size:20px;min-width:0}.third-play-open .toolbar{top:calc(max(14px,env(safe-area-inset-top)) + 120px)}.third-play-open .event-title{max-width:calc(100% - clamp(185px,40vw,480px) - 10px)}

#thirdNearHud[data-sidewinder="true"] .third-cue-row{justify-content:center}

/* Compact transfer arc and independent left/right cliff judgements. */
.third-transfer-arc,#thirdCatchPrompt,.cliff-hand-gauge,#cliffTargetGauge{position:absolute;z-index:6;pointer-events:none;filter:drop-shadow(0 1px 3px #000b)}
.third-transfer-arc[hidden],#thirdCatchPrompt[hidden],.cliff-hand-gauge[hidden],#cliffTargetGauge[hidden],.cliff-hand-gauge [hidden]{display:none}
.third-transfer-arc svg{width:100%;height:100%;overflow:visible}#thirdTransferBase,#thirdTransferFill{fill:none;stroke:#205640;stroke-width:9;stroke-linecap:round}#thirdTransferFill{stroke:#49e77c}#thirdTransferNeedle line{stroke:#fff8dc;stroke-width:3}.third-transfer-arc[data-ready="true"] .salmon-marker[data-current="true"] circle{stroke:#ffe332;filter:drop-shadow(0 0 4px #ffdd49)}
#thirdCatchPrompt{transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:8px}#thirdCatchCue{border:3px solid #fff1aa;box-shadow:0 0 0 3px #111a,0 0 12px #ffe27199}.third-catch-time{height:6px;width:52px;border:1px solid #dceaff;background:#192736;border-radius:3px;overflow:hidden}#thirdCatchLife{display:block;height:100%;background:#f5df6b}#thirdCatchCount{font-size:14px;color:white}
.cliff-hand-gauge{width:14px;--cue-size:34px}.cliff-hand-gauge[data-current="false"]{opacity:.30}.cliff-hand-gauge[data-busy="true"][data-current="true"]{opacity:.6}.cliff-arm-label{position:absolute;top:-26px;left:7px;transform:translateX(-50%);white-space:nowrap;font-size:14px;color:#fff4c3}.cliff-hand-track{position:relative;height:100%;border:1px solid #bdcddd;background:#214d40;border-radius:5px}.cliff-hand-fill{position:absolute;bottom:0;width:100%;background:#42e779;border-radius:3px}.cliff-hand-zone{position:absolute;left:0;width:100%;background:#ffe539}.cliff-hand-needle{position:absolute;left:-5px;width:22px;height:3px;background:white;transform:translateY(50%)}.cliff-hand-button{position:absolute;left:27px;transform:translateY(50%)}#cliffLeftGauge .cliff-hand-button{left:auto;right:27px}.cliff-hand-gauge[data-just="true"] .cliff-hand-track{box-shadow:0 0 9px #ffe575}
#cliffTargetGauge{transform:translateX(-50%)}#cliffTargetGauge>b{display:block;text-align:center;font-size:14px;color:#e2f3ff;margin-bottom:7px}.cliff-target-track{position:relative;height:14px;border:1px solid #d7e3f2;border-radius:4px;background:linear-gradient(90deg,#de304d 0%,#e87b56 20%,#7488dd 33%,#249fee 38%,#249fee 62%,#7488dd 67%,#e87b56 80%,#de304d 100%)}.cliff-target-blue{position:absolute;left:38%;width:24%;height:100%;border-left:1px solid #c4f2ff;border-right:1px solid #c4f2ff}#cliffTargetNeedle{position:absolute;top:-3px;height:20px;width:3px;background:white;transform:translateX(-50%)}#cliffArrivalNeedle{position:absolute;top:20px;transform:translateX(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:7px solid #d8f4ff}#cliffTargetGauge[data-aligned="true"] .cliff-target-track{box-shadow:0 0 9px #56bcff88}
body:not(.third-play-open) .third-transfer-arc,body:not(.third-play-open) #thirdCatchPrompt,body:not(.third-play-open) .cliff-hand-gauge,body:not(.third-play-open) #cliffTargetGauge,.menu-open .third-transfer-arc,.menu-open #thirdCatchPrompt,.menu-open .cliff-hand-gauge,.menu-open #cliffTargetGauge{display:none}

/* A lost segment remains visible briefly while the stamina meter flashes red. */
#thirdStamina #thirdGripMeter{position:relative}#thirdGripLoss{position:absolute;inset:0 auto 0 0;background:#ffb7ae;pointer-events:none}#thirdGripFill{position:relative}
#thirdStamina.damaged #thirdGripMeter{border-color:#ff6e6e;box-shadow:0 0 13px rgb(255 55 55 / var(--loss-flash))}#thirdStamina.damaged #thirdGripFill{background:#ed4545}#thirdStamina.damaged #thirdGripValue{color:#ff7777}
#thirdNearHud[data-rotation="true"] .third-cue-row{flex-direction:column;gap:6px}#thirdNearHud[data-rotation="true"] #thirdStartLabel{font-size:14px}#thirdNearHud[data-rotation="true"][data-aligned="true"] #thirdBCue{border:3px solid #ffe889;box-shadow:0 0 12px #ffe589}#thirdNearHud[data-rotation="true"] #thirdBCue{opacity:.48;animation:none}#thirdNearHud[data-rotation="true"] #thirdBCue::after{animation:none}
.action-pad #braceBtn.mash-mode{position:relative}.action-pad #braceBtn.mash-mode::before{content:"";position:absolute;inset:-14px;pointer-events:none;background:repeating-conic-gradient(from 8deg,transparent 0deg 37deg,#fff5bb 38deg 43deg,transparent 44deg 45deg);-webkit-mask:radial-gradient(circle,transparent 0 54%,#000 56% 69%,transparent 71%);mask:radial-gradient(circle,transparent 0 54%,#000 56% 69%,transparent 71%);animation:mash-sparks .24s steps(2,end) infinite}
@media(prefers-reduced-motion:reduce){.action-pad #braceBtn.mash-mode::before{animation:none}}

/* Bevelled polygon-era wordmark with a deliberately simple two-button invitation. */
.start-panel .title-brand{margin-bottom:8px}.title-brand h2{margin:2px auto 4px;line-height:1}.title-brand img{display:block;width:min(440px,100%);height:auto;margin:auto;filter:drop-shadow(3px 5px 0 #03091c)}
.start-panel .title-controls{display:flex;align-items:center;justify-content:center;gap:16px;margin:12px 0 9px}.title-controls p{display:block;margin:0;font-size:18px;text-align:center}.title-controls strong{color:#ffdf71}.start-panel .title-actions{font-size:14px;line-height:1.5;margin:4px 0 12px}
.title-start{min-height:64px}.title-start .button-token{width:42px;height:42px;font-size:27px}.title-start strong{font-size:23px}.start-panel .countdown-route{font-size:14px;margin:10px 0}.countdown-route span{font-size:14px}
@media(max-width:500px){.title-brand img{width:310px}.start-panel .title-controls{gap:12px}.title-controls p{font-size:16px}.start-panel .title-actions{font-size:14px}}
@media(orientation:landscape) and (max-height:560px){.title-brand img{width:270px}.start-panel .title-controls{gap:10px;margin:0}.title-controls p{font-size:15px}.start-panel .title-actions{font-size:13px}.title-start{min-height:76px}.title-start strong{font-size:20px}.failure-presentation header{padding:8px}}

/* Pipe prompts stay anchored while the crossbar and athlete move. */
#pipePushHud,#pipeSwingHud{position:absolute;z-index:5;transform:translateX(-50%);pointer-events:none;filter:drop-shadow(0 2px 2px #000b);color:white}
#pipePushHud[hidden],#pipeSwingHud[hidden],#pipeSlipHint[hidden]{display:none}
.pipe-cues{display:flex;justify-content:space-between;margin:0 -16px 10px;--cue-size:34px}.pipe-push-track{position:relative;height:12px;border:1px solid #e7e8e8b0;background:#111c27b8;border-radius:6px;overflow:visible}
.pipe-push-track i{position:absolute;height:100%;top:0}.pipe-push-track #pipeLeftFill{right:50%;background:#5299ff;border-radius:5px 0 0 5px}.pipe-push-track #pipeRightFill{left:50%;background:#ff6268;border-radius:0 5px 5px 0}
.pipe-push-track b{position:absolute;top:-3px;height:18px;width:3px;background:#fff;transform:translateX(-50%)}.pipe-push-track em{position:absolute;left:50%;height:20px;top:-5px;width:2px;background:#fff9}
.pipe-scale{display:flex;justify-content:space-between;font-size:11px;margin-top:3px}.pipe-balance{position:relative;width:70%;height:16px;margin:9px auto 0}.pipe-balance:after{content:"";position:absolute;top:7px;left:50%;width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:8px solid #fff;transform:translateX(-50%)}#pipeBalanceLine{display:block;height:5px;border-radius:3px;background:#d8f0e7;transform-origin:center;box-shadow:0 0 0 1px #101d2b}
#pipePushHud[data-danger="true"] #pipeBalanceLine{background:#ff5353;box-shadow:0 0 9px #f33}#pipePushHud[data-busy="true"] .pipe-push-track b{background:#ffe87f}
#pipeSwingHud svg{width:100%;overflow:visible}#pipeSwingBase{stroke:#1d423bc4;stroke-width:10;fill:none;stroke-linecap:round}#pipeSwingFill{stroke:#60e6ba;stroke-width:5;fill:none;stroke-linecap:round}#pipeSwingZone{stroke:#ffdc54;stroke-width:13;fill:none}#pipeSwingNeedle line{stroke:white;stroke-width:3}
.pipe-pump-mark circle{fill:#d8535c;stroke:white;stroke-width:1.5}.pipe-pump-mark text{fill:white;font:bold 12px sans-serif}.pipe-pump-mark[data-current="true"] circle{stroke:#ffe676;stroke-width:4;fill:#ff6268}.pipe-launch-mark circle{fill:#327fe0;stroke:#ffe05d;stroke-width:2}.pipe-launch-mark text{fill:white;font:bold 14px sans-serif}.pipe-launch-mark[data-current="true"] circle{stroke:white;stroke-width:4;filter:drop-shadow(0 0 5px #ffe264)}#pipeSwingHud[data-slipping="true"] svg{opacity:.35}#pipeSlipHint{display:block;text-align:center;color:#ffe584;font-size:14px;margin-top:-16px}

#pipeLaunchLine line{stroke:#fff;stroke-width:4;stroke-linecap:round;filter:drop-shadow(0 0 2px #08111e)}.pipe-pump-mark[data-charging="true"] circle{fill:#ff7377;stroke:#fff;stroke-width:4}.pipe-pump-mark[data-capped="true"] circle{fill:#bc6266;stroke:#e6e7ef;stroke-width:2}

.pipe-pump-mark .pipe-hold-label{fill:#fff;font:bold 16px sans-serif;stroke:#132232;stroke-width:3px;paint-order:stroke;stroke-linejoin:round}

#thirdRecoveryHint{display:block;max-width:220px;margin-top:5px;color:#a8ffc5;font-size:14px;line-height:1.3;white-space:normal}#thirdRecoveryHint[hidden]{display:none}
#thirdStamina.recovering #thirdGripMeter{border-color:#b5ffcf;box-shadow:0 0 12px #61ff9c;animation:third-recovery-pulse 1.05s ease-in-out infinite}#thirdStamina.recovering #thirdGripFill{background:#81ffb0}#thirdStamina.recovering #thirdGripValue{color:#b5ffcf}
@keyframes third-recovery-pulse{0%,100%{opacity:1;filter:brightness(1.3)}50%{opacity:.45;filter:brightness(.8)}}
@media(prefers-reduced-motion:reduce){#thirdStamina.recovering #thirdGripMeter{animation:none;outline:2px solid #b5ffcf}}

#cliffTargetGauge [hidden]{display:none}#cliffTargetHint{display:block;margin-top:8px;text-align:center;font-size:12px;line-height:1.3;color:#e2f3ff}#cliffTargetGauge[data-kind="sidewinder"]>b{font-size:15px;line-height:1.25}#cliffTargetGauge[data-kind="sidewinder"][data-aligned="true"]>b{color:#8de0ff}

#thirdRecoveryGuide{margin-top:8px;text-align:center;color:#d4ffe3}#thirdRecoveryCaption{display:block;font-size:12px;font-weight:600;line-height:1.4;white-space:nowrap;text-shadow:0 1px 3px #000}
#thirdRecoveryProgress{width:min(96px,100%);height:6px;margin:6px auto 0;overflow:hidden;border:1px solid #9ed9b3;border-radius:4px;background:#172a24}#thirdRecoveryProgressFill{display:block;width:0;height:100%;background:#80edaa}#thirdRecoveryGuide[data-active="true"] #thirdRecoveryProgress{border-color:#dcffe8;box-shadow:0 0 6px #65eea477}

#thirdCatchLabel{font-size:14px;font-weight:700;line-height:1.2;color:#fff7ce;text-shadow:0 1px 3px #000}#thirdCatchLabel[hidden]{display:none}

/* Keep the third pole movement instruction visible beside its B jump cue. */
#thirdSidewinderMove{display:flex;align-items:center;justify-content:center;gap:6px;margin:0 auto 10px;padding:6px 8px;border:1px solid #f49a9f;border-radius:7px;background:#29121aee;color:#fff;font-size:16px;font-weight:800;white-space:nowrap;box-shadow:0 2px 5px #0008}#thirdSidewinderMove b{display:grid;place-items:center;flex:none;width:28px;height:28px;border:2px solid #ffc4c8;border-radius:50%;background:#b52c3a;color:white;font-size:19px;line-height:1}

#dragonHopCaption{display:none;font-size:14px;font-weight:800;color:#fff;text-align:center;text-shadow:0 1px 3px #000;margin-bottom:8px}.dragon-sequence[data-stage="hop"] #dragonHopCaption{display:block}.dragon-sequence[data-stage="hop"] #dragonAZone,.dragon-sequence[data-stage="hop"] #dragonALine,.dragon-sequence[data-stage="hop"] #dragonAButton,.dragon-sequence[data-stage="hop"] #dragonBLine{display:none}.dragon-sequence[data-stage="hop"] #dragonBButton{top:calc(100% + 10px);bottom:auto}.dragon-sequence[data-stage="hop"][data-just="true"] #dragonBCue{border-color:#fff38b;box-shadow:0 0 0 2px #ffdf4a,0 0 12px #ffda5d99}
.dragon-sequence[data-stage="hop"]{height:auto}
#catchCaption{position:absolute;bottom:-23px;right:0;white-space:nowrap;color:#fff;font-size:12px;font-weight:800;text-shadow:0 1px 3px #000}
.catch-gauge[data-waiting="true"] .catch-track{opacity:.7}
.catch-gauge[data-waiting="true"] #catchBCue{opacity:.5;animation:none}
.dragon-sequence[data-obstacle="screw"] #dragonHopCaption{font-size:10px;line-height:14px;margin-bottom:4px;text-align:left;white-space:nowrap}
.dragon-sequence[data-obstacle="screw"] #dragonBButton{left:calc(100% + 24px)!important;top:calc(18px + var(--bar-height)/2);bottom:auto;transform:translate(-50%,-50%)}
#screwMashHint{display:flex;flex-direction:column;align-items:center;gap:4px;color:#fff;font-size:14px;font-weight:900;text-shadow:0 2px 3px #000,0 0 4px #000;white-space:nowrap}
#screwActionCaption:empty{display:none}
#screwActionCaption{color:#fff;font-size:13px;font-weight:900;line-height:20px;text-shadow:0 2px 3px #000,0 0 4px #000;white-space:nowrap}
.catch-gauge[data-obstacle="screw"] .catch-track{outline:2px solid #ecf5ff;box-shadow:0 2px 6px #07101e}
.catch-gauge[data-obstacle="screw"] #catchCaption{left:calc(var(--cue-size)/2 - 28px);right:auto;top:calc(var(--cue-size) + 4px);bottom:auto;width:56px;text-align:center;font-size:11px;line-height:14px;white-space:nowrap}
.dragon-sequence[data-obstacle="screw"][data-timing-hidden="true"] #dragonSequenceTrack,.dragon-sequence[data-obstacle="screw"][data-timing-hidden="true"] #dragonHopCaption{visibility:hidden}
/* The takeoff B is attached to the blue runway line; catch B stays on the upright. */
.dragon-sequence[data-obstacle="screw"] #dragonBButton{display:none}

/* Same target band and markers, turned upright for the lift's vertical travel. */
#cliffTargetGauge[data-axis="vertical"]{height:calc(var(--cliff-target-span) + 40px)}
#cliffTargetGauge[data-axis="vertical"] .cliff-target-track{position:absolute;left:50%;top:calc(28px + var(--cliff-target-span)/2);width:var(--cliff-target-span);transform:translate(-50%,-50%) rotate(-90deg)}
