#settings-dialog .setting:has(select){display:grid;grid-template-columns:minmax(0,1fr);gap:10px}#settings-dialog .setting select{min-width:0;width:100%;min-height:44px;padding:8px;color:var(--text);background:var(--field);border:1px solid var(--line);border-radius:6px}
.engagement-strip{display:grid;grid-template-columns:1fr auto;gap:4px 16px;padding:16px 2px;color:var(--muted);font-size:13px;line-height:1.5}
.engagement-strip p{margin:0;grid-column:1;overflow-wrap:anywhere}.engagement-strip #mastery-live{color:var(--text);font-weight:600}.engagement-strip button{grid-column:2;grid-row:1/4;align-self:center;white-space:normal}
.collection-link{font-size:12px;min-height:40px}.mastery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:24px}.mastery-world{min-width:0;border-top:1px solid var(--line);padding-top:16px}.mastery-world h3{font-size:17px;margin:0 0 10px}.mastery-world p{font-size:12px;line-height:1.7;margin:6px 0 12px;overflow-wrap:anywhere}.mastery-world .button{font-size:12px;white-space:normal;width:100%}.mastery-world img{width:100%;height:auto;display:block;margin:12px 0;border-radius:6px}.mastery-world summary,.play-feedback summary{padding:12px 0;cursor:pointer;font-size:13px}.mastery-actions{display:flex;gap:10px;flex-wrap:wrap}.mastery-actions .button{white-space:normal}.mastery-world details{margin-top:8px}
#reward-list{padding-left:20px;font-size:13px;line-height:1.9}.result-mastery{font-size:14px;line-height:1.6}.feedback-actions{display:flex;flex-wrap:wrap;gap:8px}.feedback-actions button{background:var(--hover);border:1px solid var(--line);border-radius:6px;min-height:44px;padding:8px 12px;font-size:12px}.cut-mastery{font-size:14px!important;line-height:1.5!important;color:#f8e3b4!important;margin-top:10px!important}.shared-challenge{padding:14px 0;pointer-events:auto}.shared-challenge h2{font-size:21px;margin:0 0 8px}.home-panel .shared-challenge p{font-size:12px;margin-bottom:8px}.home-mode:has(#shared-challenge:not([hidden])){min-height:940px}.home-mode:has(#shared-challenge:not([hidden])) .home-panel{top:36px;transform:none}.mastery-actions .button{width:auto;flex:1 1 150px}#collection-rewards{margin-top:24px;border-top:1px solid var(--line);padding:16px 0}#collection-rewards>summary{cursor:pointer;font-weight:600;padding:6px 0}
.aim-controls{position:absolute;z-index:5;bottom:78px;left:50%;transform:translateX(-50%);width:min(270px,calc(100% - 64px));padding:8px 14px;background:#0b1b23f2;color:#fff;border:1px solid #677c85;border-radius:8px;font-size:12px}.aim-controls label{display:flex;justify-content:space-between;gap:10px}.aim-controls input{width:100%;min-height:44px;margin:0;accent-color:#ffe3a0;touch-action:pan-x}.aim-controls small{display:block;font-size:10px;color:#d0dde3;text-align:center}
:root.game-focus{--play-top:225px}.game-focus .engagement-strip{position:fixed;z-index:4;top:calc(153px + env(safe-area-inset-top,0px));left:16px;right:16px;padding:4px 0;display:block;color:#e1e9e5;font-size:12px;max-height:72px;overflow:auto}.game-focus #synergy-live,.game-focus #mastery-live{display:none}.game-focus .engagement-strip[data-encounter=false] #mastery-live{display:block}.game-focus .engagement-strip[data-encounter=false] #encounter-live{display:none}.game-focus #precision-catch{position:fixed;z-index:10;bottom:calc(10px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 104px);background:#16272d;color:#fff;border:1px solid #879c9f;font-size:13px}.game-focus .aim-controls{bottom:calc(72px + env(safe-area-inset-bottom,0px))}.game-focus:has(#aim-controls:not([hidden])){--play-bottom:195px}
@media(max-width:600px){.mastery-grid{grid-template-columns:1fr}.engagement-strip{display:block;font-size:12px}.engagement-strip button{margin-top:10px}.aim-controls{bottom:88px}.home-panel .collection-link{min-height:38px;padding:9px 14px}.cut-mastery{font-size:13px!important}}
@media(max-height:550px){:root.game-focus{--play-top:130px}.game-focus .engagement-strip{top:calc(90px + env(safe-area-inset-top,0px));max-height:38px;font-size:10px}.game-focus:has(#aim-controls:not([hidden])){--play-bottom:140px}.game-focus .aim-controls{bottom:calc(52px + env(safe-area-inset-bottom,0px));padding:2px 10px;width:220px}.aim-controls small{display:none}.game-focus #precision-catch{min-height:44px;font-size:11px}}

/* A viewport-sized header keeps alerts from moving/rescaling the playfield. */
.stage{--play-header-height:min(32%,136px);--play-header-top:calc(6px + env(safe-area-inset-top,0px));--play-arena-top:calc(var(--play-header-top) + var(--play-header-height) + 6px)}
.stage .play-header{position:absolute;z-index:5;top:var(--play-header-top);left:calc(16px + env(safe-area-inset-left,0px));right:calc(16px + env(safe-area-inset-right,0px));display:grid;align-content:start;grid-auto-rows:max-content;gap:8px;height:var(--play-header-height);overflow:auto;overflow-anchor:none;overscroll-behavior:contain;background:linear-gradient(#08201ff5,#08201fe8);color:#eef5e9;pointer-events:auto}
.stage .play-header :is(.stage-top,.hud,.effects,.toast,.engagement-strip){position:relative;inset:auto;transform:none;width:100%;max-width:100%;min-width:0;margin:0}
.stage .play-header .stage-top{align-items:flex-start;overflow-wrap:anywhere}.play-header .stage-top>span{min-width:0}.play-header .stage-number{flex-shrink:0;max-width:48%;overflow-wrap:anywhere}
.stage .play-header .hud{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr) auto;gap:10px}.play-header .hud:before{display:none}.play-header .top-score{min-width:0;max-width:none;margin:0}.play-header .hud-player #score{white-space:normal;overflow-wrap:anywhere}.play-header .top-score strong{overflow-wrap:anywhere}
.stage .play-header .effects{flex-wrap:nowrap;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}.play-header .effects::-webkit-scrollbar{display:none}.play-header .effects:empty{display:none}.play-header .effect{flex-shrink:0}
.stage .play-header .engagement-strip{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:0;max-height:none;overflow:visible;color:#e1e9e5;font-size:12px;gap:4px 8px}.play-header #mastery-live{color:#eef5e9}.stage .play-header #precision-catch{position:static;transform:none;max-width:100%;width:auto;min-width:0;margin:0;padding:8px 10px;min-height:44px;max-inline-size:145px;background:#16272d;border:1px solid #879c9f;color:#fff}
.stage .play-header .toast{min-height:36px;padding:8px 12px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}.play-header .toast:not(.visible){display:none}.play-header .toast.visible{transform:none;pointer-events:auto}
.stage:not(.home-mode):not(.cinematic-mode) canvas{top:var(--play-arena-top);left:env(safe-area-inset-left,0px);width:calc(100% - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));height:calc(100% - var(--play-arena-top) - var(--play-bottom,96px) - env(safe-area-inset-bottom,0px))}
.home-mode .play-header,.cinematic-mode .play-header{display:none}
@media(max-height:550px){.stage{--play-header-top:calc(6px + env(safe-area-inset-top,0px))}.stage .play-header{gap:4px}.stage .play-header .engagement-strip{font-size:11px}.stage .play-header .toast{min-height:28px;padding:4px 10px;font-size:11px}.stage .play-header .stage-top{font-size:10px}.stage .play-header .hud{gap:8px}}

.scene-replay{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:4px 12px;margin:0 4px;background:transparent;color:#edf7ff;border:1px solid #70828d;border-radius:6px;font:inherit;cursor:pointer}
.scene-replay:focus-visible{outline:2px solid #fff;outline-offset:3px}
/* Medal cabinet: semantic tokens come from the authored page template. */
.medal-symbols{position:absolute;width:0;height:0;overflow:hidden}
.medal-token{--medal:#c6ff89;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:0;text-align:center;color:var(--text);overflow-wrap:anywhere}
.medal-token[data-medal=swift]{--medal:#9defff}.medal-token[data-medal=flawless]{--medal:#ddc4ff}.medal-token[data-medal=skill]{--medal:#ffcf95}
.medal-face{display:grid;place-items:center;width:76px;height:82px;max-width:100%;background:radial-gradient(ellipse at 30% 20%,#ffffffb0,transparent 48%),linear-gradient(145deg,var(--medal),#1a303c 80%);clip-path:polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%);filter:drop-shadow(0 8px 10px #0006);box-shadow:inset 0 0 0 4px #ffffff35}
.medal-face svg{width:52%;height:60%;fill:none;stroke:#071c25;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 0 #fff7)}
.medal-name{font-size:13px;line-height:1.25}.medal-state{font-size:10px;line-height:1.3;color:var(--muted)}.new-medal .medal-state{font-weight:800;letter-spacing:1.5px;color:var(--accent-text)}
.medal-token[data-earned=false] .medal-face{background:#23343b;box-shadow:inset 0 0 0 2px #788c954d;filter:none}.medal-token[data-earned=false] svg{stroke:#afc1c8;filter:none}.medal-token[data-earned=false] .medal-name{font-weight:500}
.medal-rack,.result-medals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:20px 0}
.mastery-world{padding:24px 20px;background:var(--hover);border:1px solid var(--line);border-radius:12px}.mastery-world h3{font-size:22px;margin-top:8px}.mastery-world .mastery-stamp{font-size:10px;letter-spacing:1.4px;color:var(--muted)}.mastery-world[data-mastered=true] .mastery-stamp{font-weight:800;color:var(--accent-text)}
.mastery-world p{line-height:1.6}.mastery-world summary{font-size:12px}.mastery-world .button{justify-content:center}.mastery-guide{margin:18px 0 26px;font-size:13px;line-height:1.7}.mastery-guide summary{cursor:pointer;padding:8px 0}.collection-heading .eyebrow{color:var(--accent-text);font-size:11px;letter-spacing:2px}.collection-heading h2{margin:10px 0}.collection-heading #mastery-summary{font-size:18px;color:var(--text)}
.collection-complete{display:flex;align-items:center;gap:22px;padding:24px 0;margin:20px 0;color:var(--text)}.collection-complete svg{width:90px;height:90px;flex:none;fill:none;stroke:var(--accent-text);stroke-width:2.5}.collection-complete span{font-size:11px;font-weight:800;letter-spacing:1.5px}.collection-complete h3{font-size:32px;margin:5px 0}.collection-complete p{margin:0;font-size:14px}
.mastery-result .result-score strong{font-size:32px}.mastery-result #result-medals{margin:24px 0}.mastery-result #result-collection{margin-bottom:12px;justify-content:center}.mastery-result .result-score{margin:12px 0}.mastery-result #result-bonuses{font-size:12px}

/* The ceremony uses the full arena, never the gameplay header's footprint. */
.mastery-celebration{position:absolute;inset:0;z-index:7;display:flex;flex-direction:column;align-items:center;overflow:auto;overscroll-behavior:contain;padding:max(26px,env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) max(22px,env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px));background:linear-gradient(#041019f5,transparent 40%,#041019e8 80%);color:#f7fbff;text-align:center;scrollbar-width:thin}
.award-heading{min-width:0;flex:none;width:min(760px,100%);padding:8px 45px 0}.award-heading .eyebrow{color:#ffe6a6;font-size:11px;font-weight:800;letter-spacing:2px;margin:0 0 10px}.award-heading h2{font-size:clamp(30px,4.5vw,58px);line-height:1.05;letter-spacing:-1.4px;margin:0;text-wrap:balance;text-shadow:0 3px 24px #000}.award-heading>p:last-child{font-size:16px;margin:10px 0;color:#cfdee6}
.award-prize-space{flex:1 0 130px;min-height:130px;pointer-events:none}.award-copy{min-width:0;flex:none;width:min(650px,100%);padding:12px 20px 8px;background:#06131de8;border-radius:16px}.award-medals{display:flex;justify-content:center;gap:22px;min-height:122px;margin-bottom:12px}.award-medals .medal-token{width:96px;color:#fff;opacity:0;transform:translateY(24px) scale(.65) rotateY(-45deg);transition:opacity .4s,transform .65s cubic-bezier(.2,1.3,.3,1)}.award-medals .medal-token.revealed{opacity:1;transform:none}.award-medals .medal-face{width:84px;height:92px}.award-medals .medal-state{color:#e1e8ed}.award-medals .new-medal .medal-state{color:#ffe6a6}.award-count{color:#ffe6a6;font-size:13px;font-weight:800;letter-spacing:1.4px;margin:12px 0}.award-unlocks{display:grid;gap:6px;margin:16px 0}.award-unlocks>span{color:#c1d9e7;font-size:10px;letter-spacing:2px}.award-unlocks strong{font-size:19px;color:#fff}.award-copy .button{justify-content:center;width:100%;margin-top:12px;white-space:normal}.award-hint{font-size:12px;color:#b9cbd6;margin:10px 0 0}.award-copy .small{color:#ffdda4}.award-copy .small:empty{display:none}
.stage:has(.mastery-celebration:not([hidden])) .arena-display{z-index:9;top:12px;left:12px;right:auto;bottom:auto}.mastery-celebration[data-tier=collection] .award-count{font-size:17px}.mastery-celebration[data-tier=collection] .award-heading .eyebrow{color:#c6ff89}
:root[data-reduced-motion=true] .award-medals .medal-token{transition:none;transform:none;opacity:1}
@media(max-width:600px){.mastery-grid{gap:14px}.mastery-world{padding:20px 14px}.medal-face{width:60px;height:66px}.medal-name{font-size:12px}.medal-state{font-size:9px}.mastery-celebration{padding:max(24px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}.award-heading{padding:12px 28px 0}.award-heading h2{font-size:34px}.award-copy{padding:14px 12px 8px}.award-medals{gap:8px}.award-medals .medal-token{width:72px}.award-medals .medal-face{width:66px;height:72px}.award-medals{min-height:108px}.award-count{font-size:11px}.award-prize-space{flex-basis:160px;min-height:160px}.award-hint{font-size:11px}.collection-complete{gap:14px}.collection-complete svg{width:64px;height:64px}}
@media(max-height:550px) and (min-width:601px){.mastery-celebration{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);align-items:center;gap:20px;padding:max(16px,env(safe-area-inset-top,0px)) max(60px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(60px,env(safe-area-inset-left,0px))}.award-heading{padding:0}.award-heading h2{font-size:32px}.award-prize-space{display:none}.award-copy{padding:10px 12px}.award-medals{gap:12px;min-height:90px;margin:0}.award-medals .medal-face{width:52px;height:58px}.award-medals .medal-name{font-size:11px}.award-count{margin:8px 0;font-size:11px}.award-unlocks{margin:8px 0}.award-unlocks strong{font-size:15px}.award-hint{font-size:10px}}

.award-heading h2{overflow-wrap:anywhere}.award-heading h2:focus{outline:none}

/* Compact, fixed reservation: transient messages never resize the arena. */
.stage .play-header{gap:2px}.stage .play-header .stage-top{font-size:10px;line-height:1.2}
.play-message{display:flex;gap:6px;align-items:center;min-width:0}.stage .play-header .play-message>.toast{flex:1;width:auto}.stage .play-header .play-message>.engagement-strip{flex:1;width:auto}
.stage .play-header .play-message:has(.toast.visible) .engagement-strip{flex:0 0 auto;display:block}.stage .play-header .play-message:has(.toast.visible) .engagement-strip:not(:has(button:not([hidden]))){display:none}
.stage .play-header #precision-catch{font-size:11px;padding:6px 8px;max-width:120px;min-height:44px}
.stage .play-header .hud{gap:6px;align-items:center}.stage .play-header .top-score{padding:2px 4px;border:0;background:transparent;min-height:44px}.stage .play-header .top-score strong{font-size:18px;line-height:1.1}.stage .play-header .top-score #top-player{margin-top:1px;font-size:10px}.stage .play-header .top-score>span:first-child{margin-bottom:1px}
.stage .play-header .hud-player{padding:3px 6px;background:transparent;border:0}.stage .play-header .hud-player #score{font-size:28px}.stage .play-header #score-chase{display:none}.stage .play-header .hud-actions{flex-direction:row;align-items:center;gap:6px;padding:0}.stage .play-header .hud-lives{min-width:34px}.stage .play-header .hud-lives>span{display:none}.stage .play-header .hud-lives .icon{width:12px;height:16px}.stage .play-header #pause{min-width:44px;min-height:44px;padding:8px}
.stage .play-header .top-score{line-height:1.1}.stage .play-header .hud-player>span{line-height:1.1;margin-bottom:1px}.stage .play-header .hud-player #score{line-height:1.1}
.stage .play-header .effect{font-size:10px;padding:2px 6px;gap:3px;border-radius:4px}.stage .play-header .effect .icon{width:12px;height:12px}
.stage .play-header .engagement-strip{font-size:11px;line-height:1.3;gap:0 6px}.stage .play-header .engagement-strip p:empty,.stage .play-header #synergy-live,.stage .play-header .engagement-strip[data-encounter=true] #mastery-live,.stage .play-header:has(.toast.visible) .engagement-strip p{display:none}
.stage .play-header .engagement-strip:not(:has(p:not(:empty))):not(:has(button:not([hidden]))){display:none}
.stage .play-header .toast{min-height:0;border:0;border-radius:0;background:transparent;text-align:left;padding:0 2px;font-size:11px;line-height:1.3}
@media(max-width:359px){.stage .play-header .hud-player #score{font-size:23px}.stage .play-header .top-score strong{font-size:15px}.stage .play-header .hud-actions{gap:2px}}
@media(max-height:550px){.stage{--play-header-height:min(30%,108px)}.stage .play-header .hud-player #score{font-size:24px}.stage .play-header .hud-combo{display:none}}
