/* A dedicated playfield and right rail keep the pointer objects clear of UI. */
:root{--rail-width:286px;--surface:#fff;--page:#fff;--text:#19271f;--muted:#647b6d;--edge:#dce5df}
body{background:var(--page);color:var(--text)}
#arena{position:fixed;inset:146px calc(var(--rail-width) + 32px) 78px 16px;left:16px;right:calc(var(--rail-width) + 32px);overflow:hidden;border:1px solid #e8eee9;border-radius:16px}
#arena>.hud{position:fixed;left:calc((100vw - var(--rail-width) - 32px)/2);top:22px;min-width:210px;padding:12px 17px;gap:22px;transform:translateX(-50%)}
.hud h1{font-size:10px}.level{font-size:22px}.clock{width:50px;height:50px}.clock-unit{font-size:8px}.clock #remaining{font-size:18px}.difficulty-label{font-size:9px}
#arena>.deaths-hud{position:fixed;left:18px;top:20px}.death-theme-row{display:flex;align-items:center;gap:8px}.death-count{font-size:14px;padding:8px 11px}#deaths{font-size:19px}.death-count svg{width:22px;height:22px}
.run-actions{margin-top:8px;gap:8px}.run-actions .quiet,.explorer-launch{min-width:80px;min-height:34px;font-size:11px;padding:8px 14px;border:1px solid #b6c8bd;border-radius:9px;background:var(--surface);color:var(--muted)}
.explorer-launch{display:inline-flex;margin-top:8px;white-space:nowrap;max-width:none;width:auto;text-align:center;line-height:1.3;flex-shrink:0}
.theme-toggle{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--edge);border-radius:50%;background:var(--surface);color:var(--muted);padding:7px}.theme-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5}.theme-toggle .sun-icon{display:none}
#arena>#controls{position:fixed;left:calc((100vw - var(--rail-width) - 32px)/2);bottom:28px}.quiet{font-size:11px}#arena>#home{position:fixed;bottom:20px;left:20px}#connection{font-size:9px;left:calc((100vw - var(--rail-width) - 32px)/2);max-width:420px;bottom:6px}
#sideRail{position:fixed;right:16px;top:18px;bottom:18px;width:var(--rail-width);display:flex;flex-direction:column;gap:10px;z-index:8;pointer-events:auto}
#sideRail>.account-hud{position:static;width:100%;max-width:none;justify-content:flex-end;flex-shrink:0;min-height:36px}#sideRail>.account-hud>span{display:none}#sideRail>.account-hud button{font-size:11px;padding:8px 13px;min-height:34px;max-width:100%}
#sideRail>.side-panel{position:static;left:auto;right:auto;top:auto;bottom:auto;transform:none;width:100%;padding:14px;border-radius:15px;max-height:none;opacity:1;flex-shrink:0;background:var(--surface);border-color:var(--edge);backdrop-filter:none;overflow:visible}
#sideRail>.stats-panel{order:3}#sideRail>.leaderboard-panel{order:2;display:flex;flex-direction:column;height:clamp(170px,calc(100dvh - 435px),340px);min-height:0;overflow:hidden}
#sideRail>.leaderboard-panel.collapsed{height:auto}#sideRail .leaderboard-panel .panel-body{display:flex;flex-direction:column;flex:1;min-height:0;padding-top:11px}#sideRail .leaderboard-panel.collapsed .panel-body{display:none}
#boardScroll{flex:1;min-height:35px;max-height:none}.leaderboard-panel.expanded #boardScroll{max-height:none}#boardLogin{font-size:10px;margin-top:8px}#boardLoading{font-size:10px!important;margin:4px 0;min-height:0}.leaderboard-panel select{font-size:11px;padding:7px;margin-bottom:10px}.board-tabs{margin-bottom:9px}.board-columns{font-size:9px}.board-row{font-size:11px;min-height:32px;grid-template-columns:minmax(0,1fr) 55px 40px;gap:6px}.board-columns{grid-template-columns:minmax(0,1fr) 55px 40px;gap:6px}
.panel-title{font-size:14px}.statistics-heading,.leaderboard-head{display:flex;align-items:center;gap:9px}.statistics-heading .panel-title,.leaderboard-head .panel-title{flex:1;width:auto}.reload-button{display:inline-grid;place-items:center;flex-shrink:0;align-self:center;width:27px;height:27px;border:1px solid #d8e0db;border-radius:5px;background:transparent;color:#8a938e;padding:5px;cursor:pointer}.reload-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.reload-button:hover{background:#f2f5f3}.reload-button:disabled{opacity:.45;cursor:wait}.reload-button[aria-busy=true] svg{opacity:.45}
#statsValues{grid-template-columns:minmax(0,1fr) auto;gap:8px 9px}#statsValues dt{font-size:11px;line-height:1.45}#statsValues dd{font-size:12px;line-height:1.45;max-width:106px;margin:0}#sideRail .tabs button{font-size:10px;padding:7px}#sideRail .stats-panel h2{font-size:11px;margin:12px 0;line-height:1.5}.stats-panel .panel-body{padding-top:11px}.stats-panel.collapsed .statistics-heading{flex-direction:row}.stats-panel.collapsed .statistics-heading .panel-title{width:auto}.leaderboard-panel[data-board=elo] .board-row,.leaderboard-panel[data-board=elo] .board-columns{grid-template-columns:minmax(0,1fr) 105px}
#intro,#result{width:min(590px,calc(100% - 36px));top:49%;max-height:calc(100% - 22px)}#intro{padding:16px 8px}#intro h2{margin:14px 0 18px}.intro-title{font-size:clamp(25px,3vw,42px)}.intro-lead{font-size:15px}.center-copy p{font-size:12px}#result{padding:18px}#result h2{font-size:30px}#resultDetail{font-size:12px;line-height:1.65;margin:17px 0}.center-copy .start-link{font-size:11px;padding:11px 17px}
#objectsLayer{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden}.game-object{position:absolute;display:block;transform:translate(-50%,-50%);pointer-events:none}.game-object svg{display:block;width:100%;height:100%;overflow:visible}.game-object.mine svg{fill:#35423c;stroke:#f3f6f4;stroke-width:1.6;filter:drop-shadow(0 1px 2px #0005)}.game-object.mine .mine-shine{fill:#e9f1ec;stroke:none}.game-object.token svg{fill:#f1cd5a;stroke:#8c6d19;stroke-width:1.3;filter:drop-shadow(0 1px 2px #0002)}.game-object.token path{fill:#fff3ad;stroke:#c49322;stroke-width:.8}
#mineCountdown{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;background:#ffffff30;pointer-events:none;text-shadow:0 1px 16px #fff}#mineCountdown[hidden]{display:none}#countdownNumber{font-size:76px;font-weight:500;line-height:1;color:var(--text)}#mineCountdown small{font-size:12px;color:var(--text);background:var(--surface);padding:8px 14px;border-radius:99px}.clock-unit{max-width:60px;text-align:center}
#openSyncRecovery{position:fixed;z-index:12;left:20px;bottom:58px;border-color:#c8b67b;background:#fffbef;color:#756133;font-size:11px}#syncRecoveryText{white-space:pre-line}.accounts-dialog{width:min(720px,calc(100vw - 24px))}#accountSearchForm{display:flex;align-items:end;gap:10px;margin:16px 0}#accountSearchForm label{flex:1;display:grid;gap:7px;font-size:12px}.account-row{border:1px solid var(--edge);border-radius:10px;padding:14px;margin:12px 0;display:grid;gap:10px}.account-row h3{font-size:14px;font-weight:500;margin:0}.account-row p{font-size:12px;color:var(--muted);margin:0}.account-row .account-actions{display:flex;gap:8px;flex-wrap:wrap}.account-row button{font-size:11px;padding:8px 11px}.account-row[data-banned=true]{border-color:#c7a0a0}
body[data-developer-open=true]{--developer-width:clamp(300px,30vw,430px);--developer-stats-width:var(--rail-width)}body[data-developer-open=true] #arena{left:16px;right:calc(var(--rail-width) + var(--developer-width) + 48px);top:146px;bottom:78px}body[data-developer-open=true] #sideRail{right:calc(var(--developer-width) + 32px)}body[data-developer-open=true] #developerPanel{width:var(--developer-width)}body[data-developer-open=true] #arena>.hud{position:fixed;left:calc((100vw - var(--rail-width) - var(--developer-width) - 48px)/2);top:20px}body[data-developer-open=true] #arena>.deaths-hud{position:fixed;left:16px;top:20px}body[data-developer-open=true] #arena>.center-copy{width:calc(100% - 24px);max-height:calc(100% - 16px)}body[data-developer-open=true] #arena>#controls{position:fixed;left:calc((100vw - var(--rail-width) - var(--developer-width) - 48px)/2);right:auto;bottom:27px;transform:translateX(-50%)}body[data-developer-open=true] #arena>#home,body[data-developer-open=true] #arena>#connection{display:none}
body[data-theme=dark]{--page:#10171b;--surface:#192228;--text:#e7eee9;--muted:#adbbb3;--edge:#34423b;color-scheme:dark;background:var(--page);color:var(--text)}body[data-theme=dark] .sun-icon{display:block}body[data-theme=dark] .moon-icon{display:none}body[data-theme=dark] #line{background:#000}body[data-theme=dark] #playfield{background:#10171b}body[data-theme=dark] #arena{border-color:#2b3931}body[data-theme=dark] .hud,body[data-theme=dark] .side-panel,body[data-theme=dark] dialog,body[data-theme=dark] #developerPanel,body[data-theme=dark] .toast,body[data-theme=dark] .death-count,body[data-theme=dark] .quiet,body[data-theme=dark] .start-link,body[data-theme=dark] .outlined,body[data-theme=dark] .cycle,body[data-theme=dark] #restoreStatus{background:var(--surface);border-color:var(--edge);color:var(--text)}body[data-theme=dark] #intro{background:transparent}body[data-theme=dark] #intro::before{background:radial-gradient(ellipse closest-side,#192228fa 30%,#192228f0 70%,#19222800 100%)}body[data-theme=dark] #result{background:#192228f5;color:var(--text)}body[data-theme=dark] .intro-lead,body[data-theme=dark] .intro-title,body[data-theme=dark] .center-copy h2,body[data-theme=dark] #resultDetail,body[data-theme=dark] #statsValues dd,body[data-theme=dark] h1,body[data-theme=dark] h2,body[data-theme=dark] h3,body[data-theme=dark] label{color:var(--text)}body[data-theme=dark] .subtle,body[data-theme=dark] p,body[data-theme=dark] #statsValues dt,body[data-theme=dark] .difficulty-label,body[data-theme=dark] .board-row>span,body[data-theme=dark] .micro,body[data-theme=dark] .message-preview{color:var(--muted)}body[data-theme=dark] .tabs,body[data-theme=dark] input,body[data-theme=dark] textarea,body[data-theme=dark] select,body[data-theme=dark] .message-card,body[data-theme=dark] .achievement-card,body[data-theme=dark] .bulk-fields{background:#111a1e;border-color:var(--edge);color:var(--text)}body[data-theme=dark] .tabs button.selected{background:#2b3c32;color:#f2f6f3}body[data-theme=dark] .tabs button{color:var(--muted)}body[data-theme=dark] .board-row,body[data-theme=dark] .board-columns{border-color:var(--edge)}body[data-theme=dark] .board-row.is-me,body[data-theme=dark] .self-dock{background:#21382b}body[data-theme=dark] .level-stats-dialog th{background:#23372b}body[data-theme=dark] .level-stats-dialog th[aria-sort=descending],body[data-theme=dark] .level-stats-dialog th[aria-sort=ascending]{background:#34513d}body[data-theme=dark] .level-stats-dialog th button{color:#e5efe7}body[data-theme=dark] .level-stats-dialog tr:nth-child(even){background:#15251c}body[data-theme=dark] .level-stats-dialog td,body[data-theme=dark] .level-stats-dialog th{border-color:var(--edge)}body[data-theme=dark] #developerPanel>.dialog-head,body[data-theme=dark] .bulk-dialog>.dialog-head{background:var(--surface)}body[data-theme=dark] #mineCountdown{background:#10171b30;text-shadow:0 1px 16px #000}body[data-theme=dark] .reload-button:hover{background:#27382e}body[data-theme=dark] .clock-track{stroke:#34423b}body[data-theme=dark] #timerArc{stroke:#c9e3d3}body[data-theme=dark] .graph .axes{stroke:#53645b}
@media(max-width:1100px){:root{--rail-width:254px}#arena>.hud{left:calc((100vw - var(--rail-width) - 32px)/2 + 60px);min-width:180px}.hud{gap:12px}#sideRail>.side-panel{padding:12px}#statsValues{gap:7px 7px}#statsValues dt{font-size:10px}#statsValues dd{font-size:11px;max-width:100px}body[data-developer-open=true]{--rail-width:220px;--developer-width:300px}.deaths-hud .death-count{font-size:12px}#deaths{font-size:16px}.intro-title{font-size:clamp(23px,3vw,35px)}}
@media(max-width:900px){:root{--rail-width:112px}body[data-side-expanded=true]{--rail-width:min(225px,48vw)}#arena{inset:146px calc(var(--rail-width) + 20px) 74px 8px;left:8px;right:calc(var(--rail-width) + 20px)}#sideRail{right:8px;top:14px;bottom:14px;gap:8px}#sideRail>.account-hud{min-height:30px}#sideRail>.account-hud button{font-size:10px;padding:7px 9px;white-space:normal}#sideRail>.side-panel.collapsed{width:100%!important;padding:10px 9px}#sideRail .panel-title{font-size:11px;gap:5px}#sideRail .reload-button{width:23px;height:23px;padding:4px}#sideRail .leaderboard-head,#sideRail .statistics-heading{gap:5px}#expandBoard{display:none}#sideRail>.leaderboard-panel:not(.collapsed){height:clamp(200px,50dvh,430px)}#sideRail .tabs button{font-size:9px;padding:6px 3px}#sideRail .board-columns,#sideRail .board-row{font-size:9px;grid-template-columns:minmax(0,1fr) 32px 30px;gap:4px}#sideRail .leaderboard-panel[data-board=elo] .board-columns,#sideRail .leaderboard-panel[data-board=elo] .board-row{grid-template-columns:minmax(0,1fr) 84px}#sideRail .leaderboard-panel select{font-size:10px}#sideRail #statsValues{grid-template-columns:minmax(0,1fr) auto;gap:6px}#sideRail #statsValues dt,#sideRail #statsValues dd{font-size:10px}#sideRail #statsValues dd{max-width:84px}#sideRail .stats-panel h2{font-size:10px}#arena>.hud{top:18px;left:calc((100vw - var(--rail-width) - 20px)/2 + 45px);padding:10px;min-width:154px;gap:9px}.hud h1{font-size:8px}.level{font-size:18px}.clock{width:41px;height:41px}.clock #remaining{font-size:15px}.clock-unit{font-size:7px}.difficulty-label{font-size:7px;margin-top:4px}#arena>.deaths-hud{left:10px;top:15px}.death-theme-row{gap:5px}.death-count{padding:6px 8px;font-size:11px;gap:5px}.death-count svg{width:17px;height:17px}#deaths{font-size:16px}.theme-toggle{width:27px;height:27px;padding:5px}.run-actions{gap:5px;margin-top:7px}.run-actions .quiet{min-width:55px;min-height:29px;padding:6px 8px;font-size:10px}.explorer-launch{font-size:10px;min-height:29px;padding:7px 9px;min-width:0;margin-top:7px}#arena>#controls{left:calc((100vw - var(--rail-width) - 20px)/2);bottom:24px;gap:3px;max-width:calc(100vw - var(--rail-width) - 24px);flex-wrap:wrap;justify-content:center}#controls .quiet{font-size:9px;padding:6px}#arena>#home{display:none}#connection{left:calc((100vw - var(--rail-width) - 20px)/2);max-width:calc(100vw - var(--rail-width) - 28px);font-size:8px;bottom:5px}#intro,#result{width:calc(100% - 20px);top:49%;padding:10px;max-height:calc(100% - 20px)}.intro-lead{font-size:11px}.intro-title{font-size:clamp(16px,3.4vw,28px);white-space:normal}#intro h2{font-size:inherit}.center-copy p{font-size:11px;line-height:1.6}.center-copy .start-link{font-size:10px;padding:9px 12px;white-space:normal}.start-link>span{margin-left:5px}#result h2{font-size:22px}#resultDetail{font-size:10px}#openSyncRecovery{left:12px;bottom:58px;max-width:calc(100vw - var(--rail-width) - 24px);white-space:normal}body[data-developer-open=true]{--rail-width:112px;--developer-width:0px}body[data-developer-open=true] #arena{left:8px;right:calc(var(--rail-width) + 20px);top:146px;bottom:48dvh}body[data-developer-open=true] #sideRail{right:8px;top:14px;bottom:14px}body[data-developer-open=true] #developerPanel{left:8px;right:calc(var(--rail-width) + 20px);top:calc(52dvh + 8px);bottom:48px;width:auto;padding:14px}body[data-developer-open=true] #arena>.hud{position:fixed;top:18px;left:calc((100vw - var(--rail-width) - 20px)/2 + 45px);min-width:154px}body[data-developer-open=true] #arena>.deaths-hud{position:fixed;left:10px;top:15px;bottom:auto}body[data-developer-open=true] #arena>.center-copy{width:calc(100% - 12px);padding:6px;top:49%;max-height:calc(100% - 12px)}body[data-developer-open=true] #arena>#controls{position:fixed;bottom:9px;left:calc((100vw - var(--rail-width) - 20px)/2);right:auto;transform:translateX(-50%)}body[data-developer-open=true] #sideRail>.stats-panel{position:static;max-height:none;width:100%}body[data-developer-open=true] #statsValues{grid-template-columns:minmax(0,1fr) auto!important}.base-colors{grid-template-columns:1fr}.color-stop{grid-template-columns:50px 1fr 1fr 22px;gap:4px}}
@media(max-height:680px) and (min-width:901px){#arena{top:132px;bottom:66px}#sideRail{top:12px;bottom:12px;gap:7px}#sideRail>.side-panel{padding:11px}#sideRail>.leaderboard-panel{height:170px}#statsValues{gap:5px 7px}#statsValues dt,#statsValues dd{font-size:10px;line-height:1.3}#sideRail .tabs button{padding:5px}#sideRail .stats-panel h2{margin:8px 0}.panel-body{padding-top:8px}}

body[data-theme=dark] #arena{background:var(--page)}
@media(max-width:900px){#arena{top:211px}#arena>.hud{top:132px;left:calc((100vw - var(--rail-width) - 20px)/2);min-width:128px;max-width:calc(100vw - var(--rail-width) - 30px)}body[data-developer-open=true] #arena{top:211px}body[data-developer-open=true] #arena>.hud{top:132px;left:calc((100vw - var(--rail-width) - 20px)/2);min-width:128px;max-width:calc(100vw - var(--rail-width) - 30px)}}

body[data-theme=dark] output,body[data-theme=dark] summary,body[data-theme=dark] .range-heading output,body[data-theme=dark] .slider-endpoints,body[data-theme=dark] .check,body[data-theme=dark] .micro-note,body[data-theme=dark] .message-row output,body[data-theme=dark] .death-message-card>summary>small{color:var(--muted)}
body[data-theme=dark] .graph{background:#15211b;border-color:var(--edge)}
@media(min-width:901px){body[data-developer-open=true] #arena>.hud{left:200px;transform:none;width:calc(100vw - var(--rail-width) - var(--developer-width) - 260px);min-width:0;max-width:350px;justify-content:space-between;gap:12px;padding:12px}}

@media(max-width:900px){#sideRail>.side-panel.collapsed .reload-button{display:none}}

/* Keep the Explorer beside its table title and preserve its existing button style. */
#statsPanel .explorer-launch{margin-top:0}
#controls .temporary{display:inline-block;color:#46564c;background:#edf0ed}
body[data-theme=dark] #controls .temporary{color:#e7eee9;background:#34423b}
@media(min-width:901px) and (max-width:1100px){body[data-developer-open=true]{--rail-width:254px}#statsPanel .statistics-heading{gap:4px}#statsToggle{font-size:12px;gap:4px}}
@media(max-width:900px){#statsPanel .statistics-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}#statsToggle{grid-column:1;grid-row:1}#statsPanel .explorer-launch{grid-column:1/-1;grid-row:2;justify-self:start}#refreshStatistics{grid-column:2;grid-row:1}#statsPanel.collapsed .explorer-launch{display:none}}

@media(min-width:901px) and (max-width:1100px){body[data-developer-open=true] #testBadge{display:block;width:max-content;margin:4px 0 0}}
@media(max-width:900px){body[data-developer-open=true][data-side-expanded=true]{--rail-width:min(225px,48vw)}}

.hud:has(.zone-allowance:not([hidden])){flex-wrap:wrap;row-gap:7px}
.zone-allowance{flex:0 0 100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;border-top:1px solid var(--edge);padding-top:7px;min-width:0;font-size:10px;line-height:1.35;color:var(--muted)}
.zone-allowance[hidden]{display:none}.zone-allowance strong{font-size:12px;font-weight:500;font-variant-numeric:tabular-nums;color:var(--text);white-space:nowrap}.zone-allowance small{grid-column:1/-1;font-size:8px}.zone-allowance[data-warning=true] strong{color:#b55743}body[data-theme=dark] .zone-allowance[data-warning=true] strong{color:#f3ac92}
/* Touch devices use the whole viewport; the compact controls float above play. */
body[data-mobile-layout=true] #arena,body[data-mobile-layout=true][data-developer-open=true] #arena{inset:0;left:0;right:0;top:0;bottom:0;width:100%;height:100dvh;border:0;border-radius:0}
body[data-mobile-layout=true] #sideRail,body[data-mobile-layout=true][data-developer-open=true] #sideRail{top:max(12px,env(safe-area-inset-top));right:max(10px,env(safe-area-inset-right));bottom:auto;width:112px;gap:8px;pointer-events:none}
body[data-mobile-layout=true][data-side-expanded=true] #sideRail{width:min(225px,48vw)}body[data-mobile-layout=true] #sideRail>.account-hud,body[data-mobile-layout=true] #sideRail>.side-panel{pointer-events:auto}
body[data-mobile-layout=true] #sideRail>.account-hud{min-height:30px}body[data-mobile-layout=true] #sideRail>.account-hud button{font-size:10px;padding:7px 9px;white-space:normal}
body[data-mobile-layout=true] #sideRail>.side-panel.collapsed{padding:10px 9px;width:100%!important}body[data-mobile-layout=true] #sideRail .panel-title{font-size:11px;gap:5px}body[data-mobile-layout=true] #sideRail>.side-panel.collapsed .reload-button,body[data-mobile-layout=true] #statsPanel.collapsed .explorer-launch,body[data-mobile-layout=true] #expandBoard{display:none}
body[data-mobile-layout=true] #arena>.hud,body[data-mobile-layout=true][data-developer-open=true] #arena>.hud{position:fixed;top:calc(58px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:auto;transform:none;width:min(220px,calc(100vw - 142px));min-width:0;max-width:none;padding:10px;gap:9px;row-gap:7px;justify-content:space-between}
body[data-mobile-layout=true] .hud h1{font-size:8px}body[data-mobile-layout=true] .hud .level{font-size:18px}body[data-mobile-layout=true] .clock{width:41px;height:41px}body[data-mobile-layout=true] .clock #remaining{font-size:15px}body[data-mobile-layout=true] .clock-unit{font-size:7px}body[data-mobile-layout=true] .difficulty-label{font-size:8px;margin-top:4px}body[data-mobile-layout=true] #testBadge{font-size:7px;margin-left:4px;padding:2px 3px}
body[data-mobile-layout=true] #arena>.deaths-hud,body[data-mobile-layout=true][data-developer-open=true] #arena>.deaths-hud{position:fixed;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));bottom:auto}
body[data-mobile-layout=true] .death-count{padding:6px 8px;font-size:11px;gap:5px}body[data-mobile-layout=true] .death-count svg{width:17px;height:17px}body[data-mobile-layout=true] #deaths{font-size:16px}body[data-mobile-layout=true] .theme-toggle{width:27px;height:27px;padding:5px}
body[data-mobile-layout=true] .run-actions{position:fixed;left:max(12px,env(safe-area-inset-left));bottom:calc(62px + env(safe-area-inset-bottom));margin:0;gap:5px}body[data-mobile-layout=true] .run-actions .quiet{min-width:55px;min-height:29px;padding:6px 8px;font-size:10px}
body[data-mobile-layout=true] #arena>#controls,body[data-mobile-layout=true][data-developer-open=true] #arena>#controls{position:fixed;left:50%;right:auto;transform:translateX(-50%);bottom:calc(12px + env(safe-area-inset-bottom));width:max-content;max-width:calc(100vw - 20px);gap:4px;flex-wrap:wrap;justify-content:center}body[data-mobile-layout=true] #controls .quiet{font-size:9px;padding:7px}
body[data-mobile-layout=true] #arena>#home{display:none}body[data-mobile-layout=true] #connection{left:50%;max-width:calc(100vw - 24px);bottom:1px;font-size:8px}body[data-mobile-layout=true] #openSyncRecovery{bottom:105px;left:12px;max-width:calc(100vw - 24px)}
body[data-mobile-layout=true] #intro,body[data-mobile-layout=true][data-developer-open=true] #arena>#intro{width:min(410px,calc(100% - 40px));top:50%;padding:18px 10px;max-height:calc(100dvh - 240px)}body[data-mobile-layout=true] .intro-lead{font-size:13px}body[data-mobile-layout=true] .intro-title{font-size:clamp(28px,7.5vw,40px);white-space:normal}body[data-mobile-layout=true] #intro h2{font-size:inherit}body[data-mobile-layout=true] .center-copy p{font-size:12px;line-height:1.7}body[data-mobile-layout=true] .center-copy .start-link{font-size:11px;padding:11px 14px}
body[data-mobile-layout=true] #result{width:min(500px,calc(100% - 32px));top:50%;max-height:calc(100dvh - 240px)}
body[data-mobile-layout=true] #developerPanel{left:8px;right:8px;top:52dvh;bottom:calc(52px + env(safe-area-inset-bottom));width:auto;padding:16px}

#arena>.hud:has(.zone-allowance:not([hidden])){width:248px;max-width:calc(100vw - var(--rail-width) - 48px);justify-content:space-between;column-gap:14px}
body[data-developer-open=true] #arena>.hud:has(.zone-allowance:not([hidden])){width:calc(100vw - var(--rail-width) - var(--developer-width) - 260px);max-width:248px}
body[data-mobile-layout=true] #arena>.hud:has(.zone-allowance:not([hidden])),body[data-mobile-layout=true][data-developer-open=true] #arena>.hud:has(.zone-allowance:not([hidden])){width:min(220px,calc(100vw - 142px));max-width:none;column-gap:9px}

body[data-mobile-layout=true] #statsPanel .statistics-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}body[data-mobile-layout=true] #statsToggle{grid-column:1;grid-row:1}body[data-mobile-layout=true] #statsPanel .explorer-launch{grid-column:1/-1;grid-row:2;justify-self:start}body[data-mobile-layout=true] #refreshStatistics{grid-column:2;grid-row:1}

.explorer-columns-toggle{white-space:nowrap;font-size:12px;padding:9px 12px}.explorer-columns{border:1px solid #dfe7e1;border-radius:12px;padding:14px;margin:12px 0;background:#f6f9f7}.explorer-column-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.explorer-column-groups fieldset{border:0;margin:0;padding:0;min-width:0}.explorer-column-groups legend{font-size:12px;font-weight:600;margin-bottom:8px}.explorer-column-groups label{display:flex;align-items:center;gap:8px;font-size:12px;margin:8px 0;cursor:pointer}.explorer-column-groups input{width:16px;height:16px;margin:0;accent-color:#527e60}.explorer-columns-footer{display:flex;align-items:center;gap:16px;justify-content:space-between}.explorer-columns-footer p{font-size:11px;line-height:1.6;max-width:720px;margin:8px 0 0}.explorer-columns-footer button{font-size:11px;white-space:nowrap}
body[data-theme=dark] .explorer-columns{background:#15251c;border-color:var(--edge)}body[data-theme=dark] .explorer-column-groups legend{color:var(--text)}
@media(max-width:650px){.level-stats-dialog .dialog-head{flex-wrap:wrap}.level-stats-dialog .dialog-head>div{flex-basis:calc(100% - 42px)}.level-stats-dialog .dialog-head>.close{order:-1}.level-stats-dialog .dialog-head>div{order:-2}.explorer-columns{padding:12px}.explorer-column-groups{grid-template-columns:1fr;gap:12px}.explorer-columns-footer{align-items:start;flex-direction:column;gap:8px}}

.cursor-style-label{display:grid;gap:8px;font-size:12px}.cursor-style-label select{width:100%;padding:9px;border:1px solid #dce4de;border-radius:8px;background:var(--surface);color:var(--text)}.cursor-style-preview{display:flex;align-items:center;gap:9px;font-size:10px}.cursor-style-preview>span{display:inline-grid;place-items:center;flex-shrink:0;width:32px;height:32px;border:1px solid var(--edge,#dce4de);border-radius:6px;background:var(--page,#fff)}.cursor-style-preview svg{display:block;width:16px;height:16px}.death-type-settings{border:1px solid var(--edge,#dce4de);border-radius:9px;padding:8px 10px;margin:12px 0}.death-type-settings legend{font-size:11px;padding:0 5px}.death-type-settings .check{font-size:10px;margin:7px 0;align-items:start}.death-type-settings input{flex-shrink:0}.death-type-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}.death-type-grid label{line-height:1.5}body[data-theme=dark] .cursor-style-label select{background:#111a1e;border-color:var(--edge);color:var(--text)}
@media(max-width:400px){.death-type-grid{grid-template-columns:1fr}}

.slider-pencil{display:inline-grid;place-items:center;flex-shrink:0;width:23px;height:23px;padding:4px;border:1px solid var(--edge,#dce4de);border-radius:5px;background:var(--surface,#fff);color:var(--muted,#60776a)}.slider-pencil svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}.slider-pencil[aria-expanded=true]{background:#e5efe8;color:#31513b}.exact-value-editor{display:grid;grid-template-columns:minmax(70px,1fr) auto auto;gap:7px;align-items:center;padding:10px;border:1px solid var(--edge,#dce4de);border-radius:9px;background:var(--surface,#fff);margin:8px 0}.exact-value-editor input{width:100%;min-width:0;padding:8px;border:1px solid var(--edge,#dce4de);border-radius:5px;background:var(--page,#fff);color:var(--text,#263e2f);font-size:12px}.exact-value-editor button{padding:7px 9px;font-size:10px}.exact-value-editor small{grid-column:1/-1;font-size:10px;color:var(--muted,#60776a)}.exact-value-editor .exact-value-error{color:#b64d4d}.exact-value-editor input[aria-invalid=true]{border-color:#b64d4d}.death-type-settings .check{display:flex!important;align-items:flex-start}.death-message-card .message-row input{background:var(--surface,#fff);color:var(--text,#263e2f);border-color:var(--edge,#dce4de)}body[data-theme=dark] .slider-pencil[aria-expanded=true]{background:#294033;color:var(--text)}
.clock>span{position:relative;z-index:1}.timer-color-state{grid-template-columns:38px minmax(0,1fr)!important}.timer-color-state>.timer-color-preview{grid-column:1;grid-row:1/3}.timer-color-state>.timer-color-pair,.timer-color-state>.parameter-with-bulk{grid-column:2}.timer-color-pair input[type=text]{min-width:74px!important}
@media(max-width:650px){.timer-color-state>.parameter-with-bulk{display:grid}.timer-color-state{padding:8px;gap:6px}}

.timer-color-editor{margin-top:12px}.timer-color-state{display:grid;grid-template-columns:38px minmax(0,1fr) minmax(0,1fr);gap:8px;align-items:center;border:1px solid var(--edge,#dce4de);border-radius:9px;padding:10px;margin:12px 0}.timer-color-state legend{font-size:11px;padding:0 5px}.timer-color-pair{font-size:10px;display:grid;gap:5px;min-width:0}.timer-color-pair>span{display:flex;gap:5px;align-items:center}.timer-color-pair input[type=color]{width:28px;height:27px;padding:2px;flex-shrink:0}.timer-color-pair input[type=text]{width:100%;min-width:0;font-size:10px;padding:6px 3px;border:1px solid var(--edge,#dce4de);border-radius:5px;background:var(--surface,#fff);color:var(--text,#263e2f)}.timer-color-pair input[aria-invalid=true]{border-color:#b64d4d}.timer-color-preview{display:grid;place-items:center;width:34px;height:34px;border:2px solid;border-radius:50%;font-size:12px;font-variant-numeric:tabular-nums}.timer-color-editor select{width:100%;padding:7px;border-radius:6px;background:var(--surface,#fff);color:var(--text,#263e2f);border:1px solid var(--edge,#dce4de)}.timer-color-editor .parameter-with-bulk{min-width:0}.timer-color-editor .parameter-with-bulk>.bulk-parameter{align-self:start}.clock .clock-unit{color:var(--timer-text,#8a948c)}#zoneAllowanceArc{stroke:#527e60;stroke-width:2;stroke-linecap:round;stroke-dasharray:169.646;stroke-dashoffset:0}body[data-theme=dark] #zoneAllowanceArc{stroke:#c9e3d3}.zone-allowance{grid-template-columns:38px minmax(0,1fr) auto;align-items:center}.zone-allowance .allowance-clock{grid-column:1;grid-row:1/3;width:36px;height:36px}.allowance-clock #zoneAllowanceRemaining{font-size:11px;font-variant-numeric:tabular-nums}.allowance-clock .clock-unit{font-size:5px}.zone-allowance small{grid-column:2/-1}.zone-allowance>strong{font-size:10px}.zone-allowance>span{font-size:9px}body[data-theme=dark] #developerPanel .exact-value-editor input,body[data-theme=dark] #developerPanel .message-row input{background:#111a1e;color:var(--text);border-color:var(--edge)}

/* v4.15: reserve the actual HUD height, with player controls in the account row. */
body:not([data-mobile-layout=true]) #arena{top:max(146px,var(--hud-clearance,146px))!important}
#arena>.deaths-hud{width:168px}.death-theme-row{width:100%}#arena .death-count{box-sizing:border-box;width:100%;justify-content:center;background:#192228;color:#e7eee9;border-color:#34423b}
body[data-theme=dark] #arena .death-count{background:#fff;color:#263e2f;border-color:#cbd8ce}
#arena .death-count #deaths{color:inherit}.run-actions{display:flex;width:100%}.run-actions button{flex:1;min-width:0}
#sideRail>.account-hud{gap:7px;flex-wrap:wrap;align-items:center}#sideRail>.account-hud #accountButton{min-width:0;max-width:calc(100% - 82px);overflow-wrap:anywhere}
#sideRail>.account-hud .settings-toggle,#sideRail>.account-hud .theme-toggle{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;min-height:34px;padding:7px;border:1px solid var(--edge,#b6c8bd);border-radius:50%;background:var(--surface,#fff);color:var(--muted,#60776a)}
.settings-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.player-settings{width:min(420px,calc(100vw - 32px))}.player-settings label{display:grid;gap:9px}.player-settings select{width:100%;padding:11px;border:1px solid var(--edge,#dce4de);border-radius:8px;background:var(--surface,#fff);color:var(--text,#263e2f)}.player-cursor-preview{display:grid;place-items:center;min-height:100px;border:1px solid var(--edge,#dce4de);border-radius:10px;margin:16px 0;background:var(--page,#fff)}.player-cursor-preview svg,.cursor-style-preview svg{width:auto;height:auto}.cursor-style-preview>span{width:72px;height:72px}
@media(max-width:900px){#arena>.deaths-hud{width:115px}#sideRail>.account-hud #accountButton{max-width:100%;flex:1 0 100%}#sideRail>.account-hud .settings-toggle,#sideRail>.account-hud .theme-toggle{flex-basis:29px;width:29px;height:29px;min-height:29px;padding:5px}}
body[data-mobile-layout=true] .run-actions{width:115px}

#developerPanel>.editor-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0 8px}#developerPanel>#resetLevelValues{width:100%;margin-bottom:16px}.sandbox-sessions{padding:12px;border:1px solid var(--edge,#dce4de);border-radius:10px;margin:12px 0}.sandbox-sessions h3{font-size:12px}.sandbox-sessions label{display:grid;gap:6px;margin:10px 0;font-size:11px}.sandbox-sessions input,.sandbox-sessions select{box-sizing:border-box;width:100%;padding:9px;border:1px solid var(--edge,#dce4de);border-radius:6px;background:var(--surface,#fff);color:var(--text,#263e2f)}.sandbox-sessions button{width:100%;font-size:11px}.sandbox-sessions p{font-size:10px;line-height:1.6}
.sandbox-sessions summary{font-size:12px;cursor:pointer}#developerPanel>.editor-actions button{border:1px solid var(--edge,#dce4de);border-radius:8px;padding:10px;background:var(--surface,#fff);color:var(--text,#263e2f)}
body[data-theme=dark] #developerPanel .sandbox-sessions input,body[data-theme=dark] #developerPanel .sandbox-sessions select{background:#111a1e;color:var(--text);border-color:var(--edge)}

.game-object[hidden]{display:none!important}

#layoutSelection{position:absolute;z-index:8;border:2px dashed #fff;outline:1px solid #19271f;transform:translate(-50%,-50%);pointer-events:none;box-sizing:border-box;border-radius:50%}#layoutSelection[hidden]{display:none!important}body[data-layout-editing=true] #arena{touch-action:none}#editObjectPositions{width:100%;font-size:11px;padding:11px}#layoutSelected{font-size:11px;color:var(--text);font-variant-numeric:tabular-nums}#objectLayoutStatus{font-size:10px}#objectLayoutControls:has(#objectLayoutLocked:checked){border-color:#8eaf99}

.game-object.mine svg,.game-object.token svg{filter:none}

#speedSettings{margin:8px 0 12px}#speedSettings>summary{font-size:.83rem}.speed-point{display:grid;grid-template-columns:1fr 1fr 28px;gap:6px;align-items:end;margin:8px 0}.speed-point label{min-width:0;font-size:.76rem}.speed-point input{box-sizing:border-box;width:100%;min-width:0}#speedPointStatus{color:var(--muted)}

.hud .token-goal{margin:5px 0 0;font-size:11px;font-weight:600;line-height:1.2;color:inherit}.token-goal[hidden]{display:none!important}

/* Expansion UI uses the existing surface palette in both themes. */
.account-hud #themeToggle{order:0}.account-hud #settingsButton{order:1}.account-hud #accountButton{order:2}.account-hud #accountPrompt{order:3}
.discord-join{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;text-decoration:none;font-size:9px;padding:5px 6px}.discord-join svg{width:15px;height:15px;flex:none}.leaderboard-head{gap:5px}.leaderboard-head .panel-title{min-width:0;font-size:13px}.leaderboard-head .reload-button{margin-left:auto}
body[data-theme=dark] #modesDialog .mode,body[data-theme=dark] .difficulty-choices button{color:#e4eee9;background-color:#202e29}body[data-theme=dark] #modesDialog .mode-name,body[data-theme=dark] #modesDialog .mode small{color:inherit;background:transparent}body[data-theme=dark] #modesDialog .mode.active,body[data-theme=dark] .difficulty-choices button.selected{background:#355344;color:#fff}body[data-theme=dark] #modesDialog .subtle{color:#b8c9bf}
#worldCanvas,#objectDrawingCanvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:5}#objectDrawingCanvas{z-index:20;pointer-events:auto;touch-action:none}#objectDrawingCanvas[hidden]{display:none!important}#virtualCursor{position:absolute;left:0;top:0;z-index:7;width:16px;height:16px;pointer-events:none;margin:-8px 0 0 -8px}#virtualCursor svg{width:100%;height:100%}
#arena>#cursorControlGate{z-index:8;width:min(590px,calc(100% - 36px));max-height:calc(100% - 22px)}
#arena>#cursorControlGate::before{background:radial-gradient(ellipse closest-side,var(--surface) 50%,transparent 100%)}
#livesHeart{width:24px;height:24px;fill:none;stroke:none}#livesHeart .heart-empty{fill:#78817c55;stroke:none}.death-count #lifeHeartFill{stroke:none}#deathIcon[hidden],#livesHeart[hidden]{display:none!important}
.adventure-value{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:9px 0;font-size:11px}.adventure-value>span{flex:1}
.editor-randomize{flex:0 0 auto;padding:4px 8px;font-size:10px}
.check>.editor-randomize{margin-left:auto}
.editor-randomized{font-size:10px;color:var(--muted,#6c8373)}
.adventure-value.editor-randomize-range{justify-content:flex-end;margin-top:-4px}
.editor-randomize-range>span{flex:0 0 auto}
.adventure-value.editor-randomize-range input{width:80px}
.adventure-value input.editor-randomized-input{padding-left:5px;padding-right:5px}
.editor-randomized-input::placeholder{font-size:10px}.adventure-value input{width:95px;min-width:0;padding:6px;font:inherit;color:inherit;background:var(--surface,#f4f7f5);border:1px solid var(--border,#ccd9d0);border-radius:7px}.adventure-editor select{width:100%;font:inherit;font-size:11px}.adventure-editor h4{font-size:12px;margin-top:16px}.adventure-editor .object-actions{display:flex;gap:5px;margin-top:8px}.adventure-editor p{line-height:1.6}.adventure-value input[aria-invalid=true]{outline:2px solid #c46d58}
body[data-theme=dark] .adventure-value input,body[data-theme=dark] .adventure-editor select{background:#26372e;color:#e4eee9;border-color:#536b5d}#mobileGate{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:28px;background:#f0f6f2;color:#1c3427;text-align:center;font:16px/1.7 system-ui}#mobileGate[hidden]{display:none!important}#mobileGate>div{max-width:450px}#mobileGate h1{font-size:30px}#mobileGate .share-options{display:grid;gap:10px;margin:18px 0}#mobileGate a{text-decoration:none}#gameLinkText{box-sizing:border-box;max-width:100%;width:100%;padding:10px;font-size:12px}body[data-mobile-blocked=true]>:not(#mobileGate){display:none!important}body[data-theme=dark] #mobileGate{background:#16241c;color:#e4eee9}
/* Stable power slots stay outside the playable field. */
.hud:has(.power-pocket:not([hidden])){flex-wrap:wrap}.power-pocket{display:flex;flex-basis:100%;justify-content:center;gap:6px}.power-slot{position:relative;display:grid;place-items:center;width:43px;height:43px;padding:6px;border:1px solid var(--border,#cad8cf);border-radius:9px;background:var(--surface,#fff);color:var(--text,#263b2d)}.power-slot svg{width:26px;height:26px}.power-slot kbd{position:absolute;top:1px;left:4px;font-size:9px}.power-slot:disabled{opacity:.55}.power-slot:not(:disabled):hover{border-color:#86a9dd;background:#dceafb}.power-pocket[hidden]{display:none}

/* Independent life and death totals share one row in every game mode. */
#arena>.deaths-hud{width:max-content;max-width:calc(100vw - 32px)}
#arena .death-theme-row>.death-count{width:auto;flex:0 0 auto;white-space:nowrap;gap:7px;padding:8px 11px;font-size:12px;min-height:43px}
#livesRemaining,#deaths{font-size:19px;font-weight:650;font-variant-numeric:tabular-nums}
#deathIcon{width:22px;height:22px;fill:none;stroke:currentColor}
body:not([data-mobile-layout=true]) #arena>.hud{top:var(--level-hud-top,var(--hud-base-top,22px))}
body[data-developer-open=true] #arena>.hud{--hud-base-top:20px}
@media(max-width:900px){#arena .death-theme-row>.death-count{font-size:11px;padding:6px 8px;gap:5px;min-height:36px}#livesRemaining,#deaths{font-size:16px}body:not([data-mobile-layout=true]) #arena>.hud{--hud-base-top:18px}}

/* Experience stays with the counters, above the reserved playable area. */
.experience-hud{position:relative;display:grid;grid-template-columns:34px 1fr;align-items:center;gap:9px;min-width:244px;padding-bottom:9px;box-sizing:border-box}
.experience-level{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:linear-gradient(145deg,#58b8ff,#2163bc);border:1px solid #6fc1fb;color:white;font-size:16px;font-weight:650;box-shadow:0 2px 6px #195da324}
.experience-meter{min-width:0}.experience-meter>span{display:block;font-size:10px;color:var(--muted);text-align:right;margin-bottom:5px;font-variant-numeric:tabular-nums}.experience-track{position:relative;height:7px;overflow:hidden;background:#dbe5ec;border-radius:8px;border:1px solid #c6d6e3}.experience-track>span{position:absolute;inset:0;background:linear-gradient(90deg,#3289d8,#6cc5ff);border-radius:inherit;transform:scaleX(0);transform-origin:left;transition:transform .7s cubic-bezier(.2,.7,.2,1);will-change:transform}.experience-hud[data-reset=true] .experience-track>span{transition:none}
.experience-notice{position:absolute;right:0;top:2px;z-index:2;background:#246fba;color:#fff;border:1px solid #75b9f1;border-radius:20px;padding:4px 9px;font-size:10px;white-space:nowrap;pointer-events:none;animation:xp-notice 1.8s ease both}.experience-notice[hidden]{display:none}.xp-confetti{position:absolute;left:17px;top:6px;pointer-events:none}.xp-confetti i{position:absolute;display:block;width:4px;height:6px;border-radius:1px;background:var(--spark);opacity:0}.experience-hud[data-celebrating=true] .xp-confetti i{animation:xp-spark 1s ease-out both}.experience-hud[data-celebrating=true] .experience-level{animation:xp-level .45s ease-out}
body[data-theme=dark] .experience-track{background:#1b2b37;border-color:#38516a}body[data-theme=dark] .experience-meter>span{color:#b5c9da}
@keyframes xp-spark{0%{opacity:0;transform:translate(0,0) rotate(0)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) rotate(200deg)}}@keyframes xp-level{50%{transform:scale(1.12)}100%{transform:scale(1)}}@keyframes xp-notice{0%{opacity:0;transform:translateY(3px)}15%,75%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.experience-track>span{transition:none}.experience-hud .xp-confetti{display:none}.experience-hud .experience-level,.experience-notice{animation:none!important}}

/* Gameplay guides and objects remain behind pass/retry copy. */
#arena>#intro,#arena>#result{z-index:8}#virtualCursor{z-index:9}

.mine-guides-control{position:fixed;transform:translateY(-100%);top:140px;left:18px;z-index:8;display:flex;align-items:center;gap:7px;margin:0;padding:3px 0;font-size:11px;line-height:18px;color:var(--muted);cursor:pointer;user-select:none}.mine-guides-control input{flex-shrink:0;margin:0;width:14px;height:14px;accent-color:#527e60;cursor:pointer}body[data-restoring=true] .mine-guides-control,body[data-mobile-blocked=true] .mine-guides-control{visibility:hidden}body[data-theme=dark] .mine-guides-control{color:var(--muted)}

.death-library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.death-library-heading h3{margin:0}.death-library-heading button{flex-shrink:0;font-size:10px}#deathLibraryContent[hidden]{display:none!important}

/* One aligned control column, a centered level card, and readable guide controls. */
body:not([data-mobile-layout=true]) #arena{right:auto!important;bottom:auto!important;top:var(--fitted-top,128px)!important;box-sizing:border-box}
#playHeader{position:fixed;left:12px;right:calc(var(--rail-width) + 32px);top:10px;min-height:104px;display:grid;grid-template-columns:minmax(280px,1fr) max-content minmax(180px,1fr);align-items:center;column-gap:20px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;z-index:7;scrollbar-width:thin;padding:2px 0 6px}
body[data-developer-open=true] #playHeader{right:calc(var(--rail-width) + var(--developer-width) + 48px)}
body[data-developer-open=true][data-level-editor-open=false] #sideRail>.leaderboard-panel,body[data-developer-open=true][data-level-editor-open=false] #sideRail>.stats-panel,body[data-developer-open=true][data-level-editor-open=false] #arena>.leaderboard-panel,body[data-developer-open=true][data-level-editor-open=false] #arena>.stats-panel{display:none!important}
body[data-level-editor-open=true][data-developer-open=true] #arena>#controls{position:fixed!important;left:50%!important;right:auto!important;bottom:12px!important;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 190px);flex-wrap:nowrap;z-index:20}
body[data-level-editor-open=true][data-developer-open=true] #arena>#controls select{box-sizing:border-box;min-width:108px;max-width:150px;height:36px;padding:0 10px;border:1px solid var(--edge);border-radius:999px;background:var(--surface);color:var(--text);font:inherit;font-size:11px}
body[data-level-editor-open=true][data-developer-open=true] #arena>#home{position:fixed!important;left:16px!important;right:auto!important;bottom:12px!important;height:36px!important;z-index:20}
body[data-level-editor-open=true][data-developer-open=false] #arena>#home{display:none!important}
#arena #playHeader>.deaths-hud{position:static!important;justify-self:start;width:280px!important;min-width:0;max-width:none;transform:none;margin:0}
#arena #playHeader .experience-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;width:100%;max-width:none;gap:8px;align-items:start}
#arena #playHeader .experience-row .experience-hud{width:100%;min-width:0;max-width:none;flex-shrink:1}
#arena #playHeader .notebook-button{box-sizing:border-box;width:34px;height:34px;min-width:0}
#arena #playHeader .death-theme-row,#arena #playHeader .run-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;max-width:none;gap:8px}
#arena #playHeader .death-theme-row>.death-count{box-sizing:border-box;width:100%;min-width:0;max-width:100%;justify-content:center;gap:7px;padding:8px 9px;font-size:12px;min-height:43px}
#arena #playHeader .death-count svg{width:22px;height:22px;flex-shrink:0}
#arena #playHeader #livesRemaining,#arena #playHeader #deaths{font-size:19px}
#arena #playHeader .run-actions>.quiet{box-sizing:border-box;width:100%;min-width:0;min-height:34px;font-size:11px;padding:8px 14px}
#arena #playHeader>.hud{position:static!important;justify-self:center;box-sizing:border-box;width:max-content;min-width:270px;max-width:420px;transform:none!important;left:auto;top:auto;margin:0;padding:12px 17px;gap:22px;flex-wrap:wrap}
#arena #playHeader .hud>div:first-child{min-width:0;flex:1}
#arena #playHeader .hud h1{font-size:10px}
#arena #playHeader .hud .level{font-size:22px;white-space:nowrap}
#arena #playHeader .hud .clock{width:50px;height:50px;flex:0 0 50px}
#arena #playHeader .hud .allowance-clock{width:36px;height:36px;flex:0 0 36px}
#arena #playHeader .hud #remaining{font-size:18px}
#arena #playHeader .hud .difficulty-label{font-size:9px}
#arena #playHeader .hud .token-goal{font-size:11px}
#arena #playHeader>.mine-guides-control{position:static;justify-self:start;transform:none;min-width:0;max-width:none;left:auto;top:auto;padding:10px 0;margin:0;font-size:11px;line-height:18px;gap:7px}
#arena #playHeader .mine-guides-control input{width:14px;height:14px}
body[data-mobile-layout=true] #playHeader{display:none}
/* Public role labels share one compact neutral treatment in both boards and profile. */
.role-tag{display:inline-block;flex:0 0 auto;vertical-align:middle;padding:2px 4px;border:1px solid #d4d8d6;border-radius:4px;background:#eff1f0;color:#68716c;font-size:7px;font-weight:600;line-height:1.2;letter-spacing:.045em;white-space:nowrap;text-transform:uppercase}.board-row>span.board-identity{display:flex;align-items:center;gap:4px;min-width:0}.board-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}#sideRail .account-hud #accountButton{display:inline-flex;align-items:center;justify-content:center;gap:5px}#accountButton .profile-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#accountButton>span:last-child{white-space:nowrap;flex:0 0 auto}body[data-theme=dark] .role-tag{background:#303735;border-color:#4d5652;color:#c1c8c4}

/* The sticky title covers the drawer padding all the way to its top edge. */
#developerPanel>.dialog-head{top:-25px;margin-top:-25px;margin-inline:-25px;padding:25px 25px 12px;background:var(--surface,#fff);isolation:isolate}
@media(max-width:900px){body[data-developer-open=true]:not([data-mobile-layout=true]) #developerPanel{left:auto;right:16px;top:16px;bottom:16px;width:300px;height:auto;max-height:none}body[data-developer-open=true]:not([data-mobile-layout=true]) #sideRail{right:332px}}

/* Restricted Sandbox areas remain visible without exposing private tools or data. */
#developerPanel [data-sandbox-restricted=true]{border-color:var(--edge);color:var(--muted);background:color-mix(in srgb,var(--surface) 92%,var(--muted) 8%)}
#developerPanel [data-sandbox-restricted=true]:not([data-sandbox-restriction-mode=control])>:not(h3):not(summary):not(.library-heading):not(.death-library-heading):not(.sandbox-permission-note){display:none!important}
#developerPanel [data-sandbox-restricted=true]>h3,#developerPanel [data-sandbox-restricted=true]>summary,#developerPanel [data-sandbox-restricted=true]>.library-heading,#developerPanel [data-sandbox-restricted=true]>.death-library-heading{opacity:.55;filter:grayscale(1)}
#developerPanel [data-sandbox-restricted=true][data-sandbox-restriction-mode=control]{opacity:.45;filter:grayscale(1);cursor:not-allowed}
#developerPanel .sandbox-permission-note{margin:8px 0;font-size:11px;line-height:1.5;color:var(--muted)}
#developerPanel button:disabled,#developerPanel input:disabled,#developerPanel select:disabled{cursor:not-allowed}
/* Compact, shared header controls stay inside their panel in either state. */
#sideRail>.side-panel{container-type:inline-size}
#sideRail .leaderboard-head,#sideRail #statsPanel .statistics-heading{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:4px;min-width:0;white-space:nowrap}
#sideRail .panel-heading{flex:1 1 auto;min-width:0;margin:0;font-size:12px;font-weight:500;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#sideRail #leaderboardToggle,#sideRail #statsToggle,#sideRail #refreshLeaderboard,#sideRail #refreshStatistics{display:inline-flex;align-items:center;justify-content:center;flex:0 0 24px;box-sizing:border-box;width:24px;min-width:24px;height:24px;min-height:24px;margin:0;padding:4px;border:1px solid var(--edge);border-radius:6px;background:var(--surface);color:var(--text);line-height:1;cursor:pointer}
#sideRail .panel-collapse>span:first-child{font-size:16px;line-height:1;color:inherit}
#sideRail .panel-collapse:hover,#sideRail .reload-button:hover{background:color-mix(in srgb,var(--surface) 90%,var(--text))}
#sideRail .panel-collapse:focus-visible{outline:2px solid var(--text);outline-offset:2px}
#sideRail .leaderboard-head>.reload-button svg,#sideRail .statistics-heading>.reload-button svg{width:14px;height:14px}
#sideRail #discordButton,#sideRail #openLevelStats{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;box-sizing:border-box;gap:4px;min-width:0;min-height:24px;max-width:none;margin:0;padding:4px 5px;font-size:9px;line-height:1.2;white-space:nowrap;text-align:center}
#sideRail #discordButton svg{width:13px;height:13px;flex:none}
#sideRail #openLevelStats{font-size:10px}
#sideRail .explorer-compact-icon{display:none;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
/* The very narrow collapsed rail keeps all actions as recognizable icons. */
@container (max-width:180px){
 #sideRail .panel-heading{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #sideRail #discordButton>span,#sideRail #openLevelStats>span{display:none}
 #sideRail #openLevelStats .explorer-compact-icon{display:block}
 #sideRail #discordButton,#sideRail #openLevelStats{width:24px;height:24px;padding:4px}
}

/* Give only the desktop right rail the smaller 75% reference size. */
@media(min-width:901px){
 :root,body[data-developer-open=true]{--rail-width:214.5px;--rail-scale:.75}
 body:not([data-mobile-layout=true]) #sideRail{zoom:var(--rail-scale);width:calc(var(--rail-width)/var(--rail-scale));top:calc(18px/var(--rail-scale));right:calc(16px/var(--rail-scale));bottom:calc(18px/var(--rail-scale));gap:10px}
 body[data-developer-open=true]:not([data-mobile-layout=true]) #sideRail{right:calc((var(--developer-width) + 32px)/var(--rail-scale))}
 body:not([data-mobile-layout=true]) #sideRail>.side-panel{padding:14px}
 body:not([data-mobile-layout=true]) #sideRail>.leaderboard-panel:not(.collapsed){flex:1 1 0;height:auto;min-height:135px}
 body:not([data-mobile-layout=true]) #sideRail>.stats-panel:not(.collapsed){flex:0 1 auto;min-height:0;overflow-y:auto}
 body:not([data-mobile-layout=true]) #sideRail #statsValues{gap:8px 9px}
 body:not([data-mobile-layout=true]) #sideRail #statsValues dt{font-size:11px;line-height:1.45}
 body:not([data-mobile-layout=true]) #sideRail #statsValues dd{font-size:12px;line-height:1.45;max-width:106px}
 body:not([data-mobile-layout=true]) #sideRail .tabs button{font-size:10px;padding:7px}
 body:not([data-mobile-layout=true]) #sideRail #statsHeading{font-size:11px;margin:12px 0;line-height:1.5}
}
/* Match the short-window fallback to the rail's scaled height, not the page HUD. */
@media(min-width:901px) and (max-height:510px){
 body:not([data-mobile-layout=true]) #sideRail{top:16px;bottom:16px;gap:7px}
 body:not([data-mobile-layout=true]) #sideRail>.side-panel{padding:11px}
 body:not([data-mobile-layout=true]) #sideRail #statsValues{gap:5px 7px}
 body:not([data-mobile-layout=true]) #sideRail #statsValues dt,body:not([data-mobile-layout=true]) #sideRail #statsValues dd{font-size:10px;line-height:1.3}
 body:not([data-mobile-layout=true]) #sideRail .tabs button{padding:5px}
 body:not([data-mobile-layout=true]) #sideRail #statsHeading{margin:8px 0}
}

/* Retry copy shrinks as one proportional unit; its eyebrow keeps its old size. */
#arena>#result:not(.success){transform:translate(-50%,-45%) scale(.8);transform-origin:center;animation:retry-arrive .45s cubic-bezier(.2,.8,.2,1) both}
#arena>#result:not(.success) #resultEyebrow{display:inline-block;transform:scale(1.25);transform-origin:center}
@keyframes retry-arrive{from{opacity:0;transform:translate(-50%,calc(-45% + 9px)) scale(.8)}to{opacity:1;transform:translate(-50%,-45%) scale(.8)}}
/* Temporary menus occupy the arena's lower edge instead of reserving a footer. */
body:not([data-mobile-layout=true]) #arena>#controls{position:absolute!important;left:50%!important;right:auto!important;bottom:12px!important;transform:translateX(-50%);max-width:calc(100% - 24px);z-index:10}
body[data-game-fullscreen=true][data-state=failed] #arena>#controls{display:flex!important}
body[data-state=countdown] #arena>#controls{display:none!important}
/* The home link shares the temporary menus' baseline inside the play area. */
body:not([data-mobile-layout=true]) #arena>#home{position:absolute!important;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;left:16px;right:auto;bottom:12px;height:var(--footer-row-height,36.5px);padding:0 12px;border:1px solid var(--edge);border-radius:999px;background:transparent!important;color:var(--muted);font-size:11px;line-height:1.2;text-decoration:none;transform:none;z-index:10}
body[data-game-fullscreen=true][data-state=failed] #arena>#home{display:inline-flex!important}
body[data-state=countdown] #arena>#home,body[data-state=playing] #arena>#home{display:none!important}
/* The simultaneous editor footer lives outside the clipped arena so its row remains visible. */
#editorScenarioDock[hidden]{display:none!important}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock:not([hidden]){position:fixed;left:var(--editor-scenario-left,0px);right:auto;width:var(--editor-scenario-width,100vw);top:var(--editor-scenario-top,calc(100vh - 48px));bottom:auto;height:36px;box-sizing:border-box;padding:0 16px;display:flex;align-items:center;gap:12px;overflow-x:auto;z-index:20;pointer-events:none}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #controls{position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;width:max-content;max-width:none;flex:none;margin:0 auto;z-index:auto;pointer-events:auto}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #controls select{box-sizing:border-box;min-width:108px;max-width:150px;height:36px;padding:0 10px;border:1px solid var(--edge);border-radius:999px;background:var(--surface);color:var(--text);font:inherit;font-size:11px;cursor:pointer}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #controls>.quiet{box-sizing:border-box;height:36px;margin:0;padding:0 12px;white-space:nowrap}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #modesButton,body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #achievementsButton,body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #developerButton{display:none!important}
body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock>#home{position:relative!important;left:auto;right:auto;top:auto;bottom:auto;order:-1;flex:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:36px;padding:0 12px;border:1px solid var(--edge);border-radius:999px;background:transparent!important;color:var(--muted);font-size:11px;line-height:1.2;text-decoration:none;transform:none;pointer-events:auto}
body[data-level-editor-open=true][data-developer-open=true][data-state=countdown] #editorScenarioDock{display:none!important}
body[data-level-editor-open=true][data-developer-open=true][data-state=playing] #editorScenarioDock{display:none!important}
@media(max-width:700px){body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock:not([hidden]){display:flex;align-items:center;justify-content:flex-start;gap:8px;pointer-events:auto}body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #controls{order:1;width:max-content;max-width:none;flex-wrap:nowrap;gap:4px;flex:none}body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock #controls .quiet{font-size:9px}body[data-level-editor-open=true][data-developer-open=true] #editorScenarioDock>#home{position:relative!important;left:auto;top:auto;flex:none;margin-left:0}}
body[data-level-editor-open=true][data-developer-open=false] #arena>#home{display:none!important}
.power-pocket-panel{--pocket-ready:#178a45}body[data-theme=dark] .power-pocket-panel{--pocket-ready:#4ade80}.power-pocket-panel.has-pocket-powers .power-pocket-footer>span,.power-slot.is-stocked kbd{font-weight:800;color:var(--pocket-ready)}
/* Play-area edges during the countdown and play: a bordered edge looks like a wall, an edge that ends the run like a death wall. */
#arena[data-play-edge]::after{content:"";position:absolute;inset:0;z-index:6;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .2s}#arena[data-play-edge]:is([data-state=countdown],[data-state=playing],[data-state=cursor-paused])::after{opacity:1}#arena[data-play-edge=wall]::after{border:6px solid #d3dce6;outline:1.6px solid #63758a;outline-offset:-3.8px}#arena[data-play-edge=death]::after{border:8px solid #81323b;outline:5.2px solid #f88357;outline-offset:-6.6px}
