:root{color-scheme:dark;--bg:#090b21;--text:#f8fbff;--muted:#b8c5e1;--accent:#67f7ff;--accent2:#ffcf5b;font-family:Inter,ui-rounded,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--bg);color:var(--text);overscroll-behavior:none}
body{position:fixed;inset:0;user-select:none}button{font:inherit;color:inherit;touch-action:manipulation;cursor:pointer}button:focus-visible{outline:3px solid var(--accent2);outline-offset:3px}button:disabled{opacity:.45;cursor:not-allowed}
#game-wrap{position:fixed;inset:0;overflow:hidden}#game{display:block;width:100%;height:100%;touch-action:none}
#screen{position:fixed;inset:0;z-index:4;display:grid;place-items:center;padding:max(14px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(26px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));pointer-events:none}
.card,.leaderboard-panel{width:min(94vw,490px);max-height:100%;min-height:0;display:none;flex-direction:column;gap:12px;padding:20px;border:1px solid #ffffff24;border-radius:24px;background:linear-gradient(180deg,rgba(18,22,64,.97),rgba(8,10,31,.96));box-shadow:0 24px 70px #0008;pointer-events:auto;overflow:hidden}
body.menu .card.menu,body.over .card.over,body.paused .card.paused,body.upgrades .card.upgrades,body.cosmetics .card.cosmetics,body.starter .card.starter,body.guide .card.guide,body.intro .card.intro{display:flex}
.card>header,.panel-footer,.card>.prominent,.card>footer{flex-shrink:0}.panel-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#7385bc55 transparent;padding:2px 3px 6px}
.panel-footer{display:flex;gap:10px;align-items:center;padding-top:10px;border-top:1px solid #ffffff19}.panel-footer>button{flex:1}.panel-footer .muted{flex:1;font-size:12px;text-align:right}
h1{font-size:clamp(30px,8vw,40px);line-height:1;margin:0;letter-spacing:-.045em;font-weight:950}h2{margin:0;font-size:clamp(25px,6vw,34px);letter-spacing:-.04em;line-height:1.1}h3{font-size:14px;margin:16px 0 8px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}p{line-height:1.45}.tagline{margin:8px 0 0;color:var(--muted);font-size:14px}.control-copy{font-size:12px;color:var(--muted);text-align:center;margin:8px 0}.muted{color:var(--muted)}.menu-header{display:flex;align-items:center;gap:14px}.logo{width:50px;height:50px;flex:0 0 50px;border:5px solid #67f7ff;border-left-color:#ffcf5b;border-radius:50%;box-shadow:0 0 26px #67f7ff40;background:radial-gradient(circle at 38% 30%,#fff,#67f7ff 30%,#211453 75%)}
.primary,.secondary,.shop-button{min-height:46px;border-radius:12px;padding:10px 14px;border:1px solid #ffffff24;font-size:14px;font-weight:800;background:#ffffff0d}.primary{background:linear-gradient(125deg,#67f7ff,#c9fff5 55%,#ffcf5b);color:#071221;border:0;box-shadow:0 10px 24px #67f7ff18}.prominent{width:100%;min-height:52px;font-size:18px}.compact{min-width:44px;min-height:44px;padding:8px 12px}.menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.actions{display:grid;gap:9px}.quick-legend{display:flex;justify-content:center;gap:20px;font-size:12px}.quick-legend>span{display:flex;align-items:center;gap:4px}.quick-legend img{width:30px;height:30px;object-fit:contain}i[data-object]{display:inline-flex}
.stat-grid,.result-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:10px 0}.stat-item,.result-item{text-align:center;background:#ffffff06;border-radius:10px;padding:8px 3px}.label{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);font-weight:800}.value{font-size:21px;font-weight:900;margin-top:3px;font-variant-numeric:tabular-nums}.big-score{font-size:clamp(40px,13vw,64px);font-weight:950;letter-spacing:-.05em;line-height:1.05;margin-top:10px}.card.over>header{text-align:center}.bank{font-size:13px;color:var(--accent2);margin-top:8px}.progress-target{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0}.progress-target strong{color:var(--text)}progress{width:100%;height:5px;display:block;margin-top:6px;border:0;border-radius:4px;overflow:hidden;background:#ffffff16;accent-color:var(--accent)}progress::-webkit-progress-bar{background:#ffffff16}progress::-webkit-progress-value{background:var(--accent)}
.shop-list,.guide-list{display:grid;gap:10px}.shop-row,.guide-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;border-bottom:1px solid #ffffff1c;padding:12px 0}.shop-title{display:flex;align-items:center;gap:8px;font-weight:850;font-size:15px}.shop-icon{display:inline-flex;width:36px;min-width:36px;justify-content:center;font-size:24px}.object-icon{width:36px;height:36px;object-fit:contain}.shop-copy{font-size:12px;color:var(--muted);line-height:1.5;margin-top:6px}.shop-copy strong{color:#ecf5ff}.shop-copy .next{display:block;color:#b3f9e3;margin-top:6px}.shop-meta{display:flex;gap:8px;margin-top:7px;font-size:11px;color:var(--muted);flex-wrap:wrap}.tiny-pill{border-bottom:1px solid #ffffff23}.shop-button{min-width:82px}.shop-button.equipped{border-color:#67f7ff55;color:var(--accent)}.guide-row{grid-template-columns:46px 1fr;align-items:start}.guide-row .object-icon{width:46px;height:46px}.guide-row h3{margin:0;color:var(--text);text-transform:none;font-size:16px;letter-spacing:0}.guide-row p{margin:5px 0;font-size:13px;color:var(--muted)}.guide-use{color:var(--accent)!important;font-size:12px!important}.terms{font-size:13px;color:var(--muted)}
#hud{position:fixed;z-index:3;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));display:none;justify-content:space-between;gap:10px;pointer-events:none}body.playing #hud,body.paused #hud{display:flex}.score-stack{width:min(100% - 54px,390px)}.score-main{font-size:34px;font-weight:950;line-height:1;font-variant-numeric:tabular-nums}.hud-line{display:flex;gap:12px;font-size:11px;color:var(--muted);margin-top:5px}.hud-line b{color:#fff}.hud-line>span{white-space:nowrap}#pause-button{pointer-events:auto;width:44px;height:44px;border:1px solid #ffffff30;border-radius:12px;background:#101532d9;font-size:21px;flex:0 0 auto}#extra-effects{font-size:10px;margin-top:4px;color:#b9ffcb;min-height:14px}#practice-bar{position:fixed;z-index:6;bottom:max(30px,env(safe-area-inset-bottom));left:12px;right:12px;display:flex;align-items:center;justify-content:center;gap:12px;padding:10px;border:1px solid #67f7ff55;background:#0b1434f0;border-radius:12px;font-size:13px}#practice-bar[hidden]{display:none}#practice-copy{max-width:350px}#practice-bar button{flex-shrink:0}
#toast{position:fixed;z-index:8;bottom:max(28px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:min(92vw,510px);width:max-content;background:#080d28f5;border:1px solid #a3d4ff66;border-radius:10px;padding:9px 13px;font-size:12px;color:#f8fbff;text-align:center;pointer-events:none;opacity:0;transition:opacity .12s}#toast.show{opacity:1}body:not(.playing) #copyright-mark{position:fixed;bottom:5px;left:0;right:0;font-size:9px;color:#8492b1;text-align:center;pointer-events:none;z-index:1}body.playing #copyright-mark{opacity:.6}body.over.death-input-locked .card.over button{opacity:.5;cursor:default}
.leaderboard-overlay{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:14px;background:#040617da;backdrop-filter:blur(10px)}.leaderboard-overlay[hidden]{display:none}.leaderboard-panel{display:flex;width:min(94vw,540px)}.leaderboard-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}.leaderboard-list{padding:0;margin:12px 0;list-style:none}.leaderboard-row{display:grid;grid-template-columns:42px 1fr auto;gap:10px;padding:12px 6px;border-bottom:1px solid #ffffff1e;font-size:14px}.leaderboard-player{overflow-wrap:anywhere}.leaderboard-rank{color:var(--muted)}.leaderboard-row.is-current{background:#67f7ff10;color:var(--accent)}#leaderboard-account-note,#leaderboard-status{font-size:13px;color:var(--muted)}
@keyframes warning-pulse{from{opacity:1}to{opacity:.65}}@keyframes combo-loss-flash{0%{color:#fff;text-shadow:none}25%{color:#ffb06e;text-shadow:0 0 9px #ff6d4a}100%{color:#fff;text-shadow:none}}@keyframes combo-loss-fall{0%{opacity:0;transform:translate(-50%,-12px) scale(1.18)}18%{opacity:1}100%{opacity:0;transform:translate(-50%,14px) scale(.9)}}.combo-stat{position:relative;display:inline-block}.combo-stat.combo-drop #combo{animation:combo-loss-flash .62s ease-out}.combo-stat.combo-drop #combo-loss{animation:combo-loss-fall .62s ease-out}.combo-stat #combo-loss{position:absolute;left:72%;top:100%;opacity:0;color:#ff9a72;font-weight:950;font-style:normal;font-size:11px;line-height:1;pointer-events:none;text-shadow:0 0 5px #ff6d4a;white-space:nowrap}
@media(max-width:380px){.card{padding:14px;gap:10px;border-radius:18px}.menu-header{gap:10px}.logo{width:42px;height:42px;flex-basis:42px}h1{font-size:30px}.tagline{font-size:12px}.shop-row{grid-template-columns:1fr}.shop-button{width:100%}.menu-grid .secondary{font-size:12px;padding:8px 5px}.hud-line{font-size:10px;gap:8px}.score-main{font-size:28px}.quick-legend{gap:10px}}
@media(max-height:500px) and (orientation:landscape){#screen{padding:8px 12px 19px}.card{width:min(95vw,590px);padding:12px;gap:8px}.card.menu{display:none}body.menu .card.menu{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;max-height:100%}.card.menu>.panel-scroll{grid-column:2;grid-row:1/4;height:100%;max-height:calc(100svh - 55px)}.card.menu>.panel-footer{grid-column:1;padding-top:5px}.card.menu>.prominent{grid-column:1}.menu-header{gap:8px}.menu-header .logo{width:38px;height:38px;flex-basis:38px}h1{font-size:27px}h2{font-size:24px}.big-score{font-size:32px;margin:4px 0}.card.over>header{display:flex;justify-content:space-between;align-items:center}.prominent{min-height:44px}.menu-grid{margin-top:8px;gap:5px}.tagline{font-size:12px}.card>header .tagline{margin-top:4px}.panel-footer{padding-top:5px}#hud{width:200px;right:auto;gap:6px}.score-stack{width:158px}.hud-line{gap:7px;font-size:9px;flex-wrap:wrap}.score-main{font-size:27px}#practice-bar{left:220px;font-size:11px}#practice-bar button{font-size:11px}#toast{left:auto;right:12px;bottom:10px;transform:none;max-width:calc(100vw - 240px)}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Reset stays separate from run controls; the confirmation never covers its buttons. */
.reset-entry{display:block;width:100%;margin-top:18px;border-color:#ff9d9d40;color:#e9c5ca}
.reset-panel{width:min(94vw,480px)}
.reset-panel p{font-size:14px;margin:0 0 12px;line-height:1.5}
.reset-panel strong{color:#b3f9e3}
.reset-panel .reset-error{color:#ffb5bc}
.reset-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.reset-confirm{border-color:#ff889466;background:#612332;color:#fff}
@media(max-height:500px) and (orientation:landscape){.reset-panel{gap:8px;padding:14px}.reset-panel p{font-size:12px}}

/* Two modes, one input scheme. Stage announcements are positioned relative to the arena centre. */
[hidden]{display:none!important}
.mode-picker,.board-picker{display:flex;gap:6px;flex-shrink:0}
.mode-picker button,.board-picker button{flex:1;min-height:44px;padding:8px;border:1px solid #ffffff30;background:#0b1331;border-radius:9px;font-weight:800;font-size:13px}
.mode-picker button[aria-pressed="true"],.board-picker button[aria-pressed="true"]{border-color:#67f7ff;background:#193547;color:#baffff}


#speed-rules{font-size:11px;color:#b8c5e1;margin-top:7px}
body[data-mode="speedrun"] #effect-bar,body[data-mode="speedrun"] #extra-effects{display:none}
body[data-mode="speedrun"] .result-grid{grid-template-columns:1fr}
body[data-mode="speedrun"] #score{font-size:clamp(25px,7vw,34px);white-space:nowrap}
body[data-selected-mode="speedrun"] .quick-legend{opacity:.55}
#result-ranking{color:#b8f7e0}
@media(max-height:500px) and (orientation:landscape){
 body.menu .card.menu{grid-template-rows:auto auto auto auto}
 .card.menu>.panel-scroll{grid-row:1/5}
 .card.menu>.mode-picker{grid-column:1;grid-row:2}
 .card.menu>.prominent{grid-row:3}
 .card.menu>.panel-footer{grid-row:4}
 .mode-picker button{min-height:36px}
 body[data-mode="speedrun"] #score{font-size:24px}
}

/* Rare currency/progress is shown only between runs; no additional playfield counter. */
.special-help{font-size:12px;line-height:1.5;color:var(--muted);margin:6px 0}
#special-bank{color:#d3a8ff}#special-error{color:#ffb5bc;font-size:13px}

/* The raised arena and planet share one centre; only active effects occupy fixed inner slots. */
#safe-area-probe{position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
#arena-ui{position:fixed;inset:0;z-index:2;pointer-events:none;display:none}
body.playing #arena-ui{display:block}
#effect-bar{position:absolute;width:0;height:0;pointer-events:none}
.effect{position:absolute;width:var(--effect-size);height:var(--effect-size);transform:translate(-50%,-50%);pointer-events:none;color:var(--effect-color);opacity:.56;filter:saturate(.68) brightness(.9);transition:opacity .16s ease,filter .16s ease}.effect.active{opacity:1;filter:none}.effect.inactive .effect-timer,.effect.inactive .effect-value{opacity:0}
.effect .object-icon{position:absolute;width:78%;height:78%;left:11%;top:4%;object-fit:contain;filter:drop-shadow(0 0 3px #02081bcc)}.effect.active .object-icon{filter:drop-shadow(0 0 7px var(--effect-color)) saturate(1.12)}
.effect-timer{position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke-width:2.3}
.timer-track{stroke:#ffffff18}.timer-left{stroke:currentColor;stroke-linecap:butt}
.effect.charged .effect-timer{opacity:.6}
.effect-value{position:absolute;left:50%;bottom:0;transform:translateX(-50%);font-size:clamp(9px,calc(var(--effect-size)*.32),15px);font-weight:900;line-height:1;color:#fff;font-variant-numeric:tabular-nums;text-shadow:0 1px 2px #030820,1px 0 2px #030820,-1px 0 2px #030820;white-space:nowrap}
.effect.warning{color:#ffda85}.effect.warning .timer-left{animation:warning-pulse .7s ease-in-out infinite alternate}
.effect.recovery{color:#c4d9ff}.effect.recovery .effect-value{color:#c4d9ff}
#run-cue{position:absolute;transform:translate(-50%,-50%);margin:0;padding:0;border:0;background:none;box-shadow:none;text-align:center;color:#f8fbff;font-weight:850;line-height:1.15;white-space:nowrap;pointer-events:none;text-shadow:0 2px 5px #030824,0 0 12px #071232}
#extra-effects,#speed-rules{display:none!important}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
body.playing #toast,body.playing #copyright-mark{display:none!important}
/* Practice guidance belongs beside the pause controls, never in the thumb area. */
#practice-bar{top:max(72px,calc(env(safe-area-inset-top) + 64px));bottom:auto;left:12px;right:12px;border:0;border-radius:0;background:#0b1434e8;padding:4px 8px;font-size:12px}
@media(max-height:500px) and (orientation:landscape){
 #hud{width:auto;right:max(12px,env(safe-area-inset-right))}.score-stack{width:145px}
 #practice-bar{left:12px;right:auto;top:110px;width:140px;flex-direction:column;font-size:11px}
}

.effect-glyph{position:absolute;width:90%;height:90%;left:5%;top:-2%;fill:none;stroke:var(--effect-color);stroke-width:2.4;stroke-linejoin:round;stroke-linecap:round;filter:drop-shadow(0 0 3px #02081b)}
#pause-status:empty{display:none}#pause-status{color:#ffb5bc;font-size:13px;line-height:1.4}

#heist-readout{font-size:13px;color:#ffe3a0}#heist-readout[hidden]{display:none}.mode-picker,.board-picker{flex-wrap:wrap}.mode-picker button,.board-picker button{flex:1;min-width:95px}

body[data-selected-mode="heist"] .quick-legend i[data-object="spark"]{background:#ffe3a0!important;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}

#heist-next-button[hidden]{display:none}

body[data-mode="heist"] .result-grid{grid-template-columns:1fr}body[data-mode="heist"] #final-score{font-size:clamp(24px,7vw,42px)}

body.perfect-store .card.perfect-store{display:flex}body[data-mode="speedrun"] #score,body[data-mode="perfect"] #score{display:none}
#mode-store-section[hidden],#hazard-legend[hidden],#menu-wallet-stat[hidden],#starter-button[hidden],#practice-button[hidden],#next-upgrade[hidden],#classic-guide-terms[hidden]{display:none!important}
.shared-wardrobe-note{font-size:12px;color:var(--muted);margin:6px 0}#mode-store-section h3{font-size:13px;margin:10px 0 4px}.perfect-store .big-score{font-size:32px}
body[data-mode="perfect"] .result-grid{grid-template-columns:1fr}

#reset-progress-button[hidden]{display:none!important}

body[data-selected-mode="perfect"] .quick-legend i[data-object="spark"]{background:#ddfaff!important;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}

.lifeline-art{display:block;height:64px}.lifeline-art img{width:64px;height:64px;object-fit:contain}

body[data-mode="perfect"] #hud-best-stat{display:none}

.bank-meter{--bank-fill:0%;display:inline-block;width:64px;height:10px;vertical-align:middle;background:#172c32;border:1px solid #8cffb866;border-radius:999px;overflow:hidden}.bank-meter i{display:block;width:var(--bank-fill);height:100%;background:linear-gradient(90deg,#46c98a,#a4ffcc);box-shadow:0 0 8px #8cffb8;transition:width .2s ease-out}.heist-result-label{display:block;font-size:24px}.heist-result-meter{display:block;width:min(100%,220px);height:18px;margin:12px auto 4px}

#heist-banked{display:inline-flex}#heist-banked i{flex-shrink:0}#heist-banked .carried-fill{width:var(--carried-fill,0%);background:repeating-linear-gradient(135deg,#ffcf69 0 5px,#dfa640 5px 7px);box-shadow:none}#heist-banked.ready{border-color:#ffdf94;box-shadow:0 0 8px #ffdf9488}#heist-banked.goal-lost{border-color:#ff5470;box-shadow:0 0 8px #ff547088}.heist-goal-status{color:#ffdf94;font-weight:900}.heist-goal-status.goal-lost{color:#ffb5bc}
