:root{color-scheme:dark;--bg:#090b1c;--panel:#171938ee;--panel2:#272551;--ink:#f8f5ff;--muted:#bab9da;--cyan:#74e6ee;--violet:#b99cff;--gold:#ffd47c;--danger:#ff879f;--line:#b99cff40;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;min-width:320px;min-height:100%;background:radial-gradient(circle at 18% 0,#3c367355,transparent 40%),radial-gradient(circle at 100% 100%,#1e5d6950,transparent 40%),var(--bg);color:var(--ink)}body{overflow-x:hidden}html.wp-active-play body{overflow:hidden!important;overscroll-behavior:none!important}html.wp-active-play .classic-game{padding:0!important;gap:0!important;min-height:100dvh!important}html.wp-active-play .alien-game{padding:0!important;gap:0!important;min-height:100dvh!important}html.wp-active-play .site-header,html.wp-active-play .site-footer{display:none!important}html.wp-active-play .battle-stage{height:calc(100dvh - 56px)!important;min-height:0!important}html.wp-active-play .result-screen{min-height:100dvh!important;padding-bottom:56px!important;box-sizing:border-box!important}button,select{font:inherit;color:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible,canvas:focus-visible{outline:3px solid var(--gold);outline-offset:3px}.alien-game{width:min(100%,920px);min-height:100vh;margin:auto;padding:18px clamp(14px,3vw,30px) 24px;display:flex;flex-direction:column;gap:16px}.site-header,.hero-card,.public-guide,.battle-stage,.result-card,.site-footer{border:1px solid var(--line);background:var(--panel);box-shadow:0 20px 50px #0006;border-radius:24px}.site-header{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:start;padding:17px 20px}.brand{display:flex;align-items:center;gap:8px;color:var(--ink);text-decoration:none;font-weight:900;white-space:nowrap}.brand-mark{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:var(--cyan);color:#0b1728}.header-copy{min-width:0}.eyebrow,.guide-kicker,.result-kicker{margin:0;color:var(--cyan);font-size:.72rem;font-weight:900;letter-spacing:.14em;text-transform:uppercase}.header-copy h1{margin:5px 0 0;font-size:clamp(1.6rem,4vw,2.7rem);line-height:1}.tagline{margin:8px 0 0;color:var(--muted)}.locale-picker{display:grid;gap:5px;color:var(--muted);font-size:.76rem}.locale-picker select{min-width:130px;border:1px solid var(--line);background:#10112b;border-radius:12px;padding:9px}.hero-card{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center;padding:clamp(20px,5vw,44px)}.hero-art{min-height:270px;position:relative;overflow:hidden;border-radius:22px;background:radial-gradient(circle at 50% 52%,#5e55b755 0 12%,transparent 13%),linear-gradient(145deg,#11162f,#0b1f35 60%,#122d3b);border:1px solid var(--line)}.hero-art:after{content:"";position:absolute;inset:0;background-image:linear-gradient(#b99cff12 1px,transparent 1px),linear-gradient(90deg,#b99cff12 1px,transparent 1px);background-size:32px 32px;transform:perspective(400px) rotateX(58deg) translateY(40%);transform-origin:bottom}.planet{position:absolute;left:18%;bottom:19%;font-size:4.6rem;color:#74e6ee;filter:drop-shadow(0 0 20px #74e6ee88)}.hero-ship{position:absolute;z-index:2;left:53%;bottom:28%;font-size:5.8rem;color:var(--gold);filter:drop-shadow(0 8px 0 #24204f);animation:float 2.4s ease-in-out infinite}.radar{position:absolute;z-index:1;right:12%;top:17%;width:100px;height:100px;border:1px solid #74e6ee66;border-radius:50%;box-shadow:0 0 0 18px #74e6ee0c,0 0 0 36px #74e6ee08}.star{position:absolute;color:var(--violet);font-style:normal}.s1{left:16%;top:15%;font-size:1.5rem}.s2{right:22%;bottom:16%;font-size:1.2rem}.main-copy{display:grid;gap:16px}.status-pill{width:max-content;margin:0;padding:6px 10px;border-radius:999px;background:#ffd47c22;color:var(--gold);font-size:.76rem;font-weight:900}.lead{margin:0;color:var(--muted);line-height:1.75}.primary-action,.secondary-action,.icon-button,.touch-controls button{border:1px solid var(--line);border-radius:14px;min-height:46px;padding:10px 16px;transition:transform .15s ease,background .15s ease,border-color .15s ease}.primary-action{background:var(--cyan);color:#091528;border-color:transparent;font-weight:900}.secondary-action,.icon-button,.touch-controls button{background:#ffffff0e}.primary-action:hover,.secondary-action:hover,.icon-button:hover,.touch-controls button:hover{transform:translateY(-1px);border-color:var(--cyan)}.public-guide{padding:22px clamp(18px,4vw,34px)}.public-guide h2{margin:5px 0 16px;font-size:clamp(1.35rem,3vw,2rem)}.guide-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.guide-grid article{padding:16px;border-radius:17px;background:#090b1c88;border:1px solid var(--line)}.guide-grid h3{margin:0 0 10px;color:var(--gold)}.guide-grid ol{margin:0;padding-left:1.25rem;color:var(--muted);line-height:1.8}.guide-grid p{margin:0;color:var(--muted);line-height:1.7}.guide-note{margin-top:13px!important;color:var(--gold)!important;font-size:.9rem}.battle-screen{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.battle-stage{position:relative;width:min(100%,920px);height:calc(100dvh - 56px);min-height:420px;overflow:hidden;border-radius:0;background:#080b20;border-color:#74e6ee55}.battle-stage canvas{display:block;width:100%;height:100%;touch-action:none}.battle-hud{position:absolute;z-index:3;left:14px;right:14px;top:12px;display:flex;align-items:center;gap:12px;pointer-events:none}.battle-hud>*{pointer-events:auto}.battle-hud>div{display:grid;gap:2px;min-width:65px}.battle-hud>div:nth-of-type(2){margin-left:auto}.hud-label{font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:.1em}.battle-hud strong{font-size:1rem}.icon-button{width:44px;min-width:44px;padding:0;display:grid;place-items:center;font-size:1.2rem}.touch-controls{position:absolute;z-index:3;left:18px;right:18px;bottom:18px;display:flex;justify-content:center;gap:10px}.touch-controls button{width:62px;min-width:62px;padding:0;font-size:1.15rem;background:#111637dd}.touch-controls .fire-button{width:84px;min-width:84px;color:#071523;background:#74e6ee;font-weight:900}.battle-message{position:absolute;z-index:3;right:18px;bottom:24px;max-width:42%;margin:0;padding:9px 12px;border-radius:999px;background:#080b20cc;color:var(--muted);font-size:.85rem;text-align:right}.play-reserve{height:56px;width:min(100%,920px);margin:0 auto;padding:17px;color:#9f9dbe;text-align:center;font-size:.72rem;background:#080b20;border-top:1px solid #74e6ee33}.result-screen{display:grid;place-items:center;min-height:min(70vh,620px)}.result-card{width:min(100%,560px);padding:clamp(24px,6vw,48px);text-align:center}.result-card h2{margin:8px 0 12px;font-size:clamp(1.8rem,6vw,3rem)}.result-card>p:not(.result-kicker){color:var(--muted);line-height:1.65}.result-stats{display:flex;justify-content:center;gap:12px;margin:22px 0}.result-stats span{display:grid;gap:4px;min-width:110px;padding:12px;border:1px solid var(--line);border-radius:14px;background:#090b1c88}.result-stats b{color:var(--muted);font-size:.75rem;text-transform:uppercase}.result-stats strong{font-size:1.5rem;color:var(--gold)}.result-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}.site-footer{padding:12px 16px;color:var(--muted);font-size:.78rem;text-align:center}@keyframes float{50%{transform:translateY(-8px) rotate(4deg)}}@media(max-width:720px){.site-header{grid-template-columns:1fr auto}.brand{grid-column:1/-1}.hero-card,.guide-grid{grid-template-columns:1fr}.hero-art{min-height:190px}.battle-hud{gap:7px}.battle-hud>div{min-width:48px}.battle-hud strong{font-size:.82rem}.battle-message{right:12px;bottom:82px;max-width:48%;font-size:.75rem}}@media(max-width:480px){.alien-game{padding:10px 10px 16px}.site-header{padding:14px}.locale-picker{grid-column:1/-1}.locale-picker select{width:100%}.hero-card{padding:16px}.battle-hud{left:8px;right:8px;top:8px}.battle-hud>div:nth-of-type(2){margin-left:0}.battle-hud .icon-button{width:38px;min-width:38px}.touch-controls{left:8px;right:8px;bottom:10px}.touch-controls button{width:54px;min-width:54px}.touch-controls .fire-button{width:74px;min-width:74px}.battle-message{bottom:76px;right:8px}.play-reserve{height:56px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* v32 player-value repair: keep the complete Battle HUD readable while
   keeping the objective and direct controls in separate, stable tracks. */
.battle-hud{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:start;gap:12px}
.battle-hud>.hud-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(6px,1.8vw,18px);min-width:0;align-items:start}
.battle-hud>.hud-actions{display:flex;gap:8px;margin-left:0;min-width:0}
.hud-stat{display:grid!important;min-width:0!important;gap:2px!important}
.hud-label,.hud-stat strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.battle-message{top:72px;left:50%;right:auto;bottom:auto;width:min(80%,560px);max-width:none;text-align:center;border:1px solid #74e6ee44;box-shadow:0 8px 30px #0006}
.touch-controls{bottom:12px;padding:6px 10px;border:1px solid #74e6ee35;border-radius:18px;background:#080b20b8;box-shadow:0 8px 24px #0006}
@media(max-width:720px){.battle-hud{left:12px;right:12px;gap:8px}.battle-hud>.hud-stats{gap:6px}.hud-label{font-size:.58rem}.battle-hud strong{font-size:.86rem}.battle-message{top:64px;width:min(78%,520px);font-size:.75rem;line-height:1.25}}
@media(max-width:480px){.battle-hud{left:8px;right:8px;grid-template-columns:38px minmax(0,1fr) auto;gap:6px}.battle-hud>.hud-stats{gap:4px}.hud-label{font-size:.5rem;letter-spacing:.05em}.battle-hud strong{font-size:.74rem}.battle-hud>.hud-actions{gap:4px}.battle-message{top:58px;width:calc(100% - 24px);font-size:.74rem}.touch-controls{bottom:10px;padding:5px 8px}}
@media(max-width:700px) and (max-height:500px){.battle-hud{top:8px}.battle-message{top:58px;max-height:38px;overflow:hidden}.touch-controls{bottom:10px}}
.touch-controls{justify-content:flex-start}.touch-controls #leftBtn{order:1}.touch-controls #rightBtn{order:2}.touch-controls .fire-button{order:3;margin-left:auto}
.battle-hud{grid-template-columns:minmax(0,1fr) auto!important}.battle-hud>.hud-stats{grid-column:1;width:100%}.battle-hud>.hud-actions{grid-column:2}.battle-message{left:50%!important;transform:translateX(-50%)!important;width:min(80%,560px)!important}
@media(max-width:920px){.battle-hud>.hud-stats{padding-left:56px}}
@media(max-width:480px){.battle-hud>.hud-stats{padding-left:54px;gap:2px}.battle-message{width:calc(100% - 24px)!important}}
.leave-dialog{position:absolute;z-index:8;inset:0;display:grid;place-content:center;gap:12px;padding:24px;background:#050718cc;backdrop-filter:blur(5px);text-align:center}.leave-dialog[hidden]{display:none!important}.leave-dialog>*{max-width:520px;margin:0}.leave-kicker{color:var(--cyan);font-size:.72rem;font-weight:900;letter-spacing:.14em;text-transform:uppercase}.leave-dialog h2{font-size:clamp(1.35rem,4vw,2rem)}.leave-dialog>p:not(.leave-kicker){color:var(--muted);line-height:1.55}.leave-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}.leave-actions button{min-width:160px}
@media(max-width:480px){.leave-dialog{padding:18px 14px}.leave-actions{display:grid;grid-template-columns:1fr;gap:8px}.leave-actions button{width:100%;min-width:0}}
.touch-controls{padding:0;border:0;background:transparent;box-shadow:none}.battle-message{top:72px}
@media(min-height:600px){.battle-message{top:60px}}
@media(max-height:500px){.battle-message{top:86px}}
.result-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.result-stats span{min-width:0}.result-stats b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:480px){.result-stats{gap:6px}.result-stats span{padding:10px 6px}.result-stats strong{font-size:1.25rem}}
.battle-stage canvas{background:radial-gradient(circle at 50% 44%,#74e6ee18,transparent 38%),repeating-linear-gradient(90deg,#b99cff0a 0 1px,transparent 1px 48px),repeating-linear-gradient(0deg,#b99cff08 0 1px,transparent 1px 48px)}
.result-goal{margin:16px 0 0!important;padding:12px 14px;border:1px solid #ffd47c55;border-radius:14px;background:#ffd47c12;color:var(--gold)!important;font-weight:750}
.stage-screen{width:min(100%,920px);height:calc(100dvh - 56px);min-height:334px;display:flex;flex-direction:column;align-items:center;overflow:hidden}.stage-shell{width:min(100%,920px);height:100%;min-height:0;display:grid;grid-template-rows:auto 1fr auto;gap:12px;padding:16px 18px 12px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(145deg,#111633,#090b20 72%);box-shadow:0 20px 50px #0006;overflow:hidden}.stage-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;padding:2px 0}.stage-header h2{margin:4px 0 0;font-size:clamp(1.35rem,4vw,2.15rem)}.stage-header>strong{color:var(--gold);font-size:.8rem;white-space:nowrap}.stage-kicker{margin:0;color:var(--cyan);font-size:.7rem;font-weight:900;letter-spacing:.14em;text-transform:uppercase}.stage-grid.stage-rail{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(142px,1fr);grid-template-rows:1fr;gap:12px;align-items:stretch;min-height:0;padding:12px 4px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-inline:contain}.stage-card{display:grid;align-content:center;gap:10px;min-width:142px;min-height:164px;padding:16px;border:1px solid #b99cff55;border-radius:20px;background:linear-gradient(155deg,#282650,#11142f);color:var(--ink);text-align:left;scroll-snap-align:center;transition:transform .15s ease,border-color .15s ease,background .15s ease}.stage-card:hover,.stage-card:focus-visible{transform:translateY(-2px);border-color:var(--cyan)}.stage-card.selected{border-color:var(--gold);box-shadow:0 0 0 2px #ffd47c22,0 16px 30px #0004}.stage-card.locked{color:#8583a4;background:#111329;border-color:#ffffff15;cursor:not-allowed}.stage-card-number{color:var(--cyan);font-size:.78rem;font-weight:900;letter-spacing:.12em}.stage-card-name{font-size:1.15rem}.stage-card-power,.stage-card-status{color:var(--muted);font-size:.78rem;line-height:1.35}.stage-card-status{color:var(--gold);font-weight:800}.stage-card.locked .stage-card-status{color:#8583a4}.stage-tabs{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;color:var(--muted);font-size:.78rem}.stage-tabs>span{height:1px;background:var(--line)}.stage-tab{border:0;background:transparent;color:var(--gold);font-weight:900;letter-spacing:.08em;text-transform:uppercase}.stage-tab:focus-visible{outline-offset:5px}html.wp-active-play .stage-screen{min-height:100dvh!important;padding-bottom:56px!important;box-sizing:border-box!important}html.wp-active-play .stage-shell{height:calc(100dvh - 56px);min-height:0}html.wp-active-play .stage-screen .play-reserve{flex:0 0 56px}@media(max-width:720px){.stage-shell{padding:14px 12px 10px;border-radius:18px}.stage-grid.stage-rail{grid-auto-columns:minmax(136px,42vw);padding-inline:2px}.stage-card{min-width:136px;padding:14px}.stage-header{gap:10px}.stage-header>strong{font-size:.72rem}}@media(max-height:500px){.stage-shell{gap:6px;padding:10px 14px 8px}.stage-grid.stage-rail{padding-block:4px}.stage-card{min-height:132px;padding:11px;gap:6px}.stage-tabs{font-size:.7rem}}
body.wp-stage-select-active .stage-screen{padding-bottom:0!important;min-height:0!important}body.wp-stage-select-active .stage-shell{height:calc(100% - 56px)!important;min-height:0!important}body.wp-stage-select-active .stage-screen .play-reserve{height:56px!important;min-height:56px!important;flex:0 0 56px!important}

/* v53 Issue repair: give the Stage root game-specific art with a protective
   scrim, and keep the visible Stages tab a full touch target rather than
   text-height decoration. */
.stage-screen{isolation:isolate;background-image:linear-gradient(180deg,#080b20c9 0%,#080b20e8 100%),url("../../assets/alien-defender-cover.webp");background-position:center;background-size:cover;background-repeat:no-repeat}
.stage-screen::before{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(circle at 50% 12%,#74e6ee20,transparent 48%),linear-gradient(135deg,#080b20b8,#080b20d9 68%,#0e2634d9);pointer-events:none}
.stage-screen .stage-shell{background:linear-gradient(145deg,#111633d9,#090b20e8 72%)}
.stage-screen .stage-tab{display:inline-grid;place-items:center;min-height:44px;min-width:92px;padding:10px 16px}

/* v42 Result contract: keep recovery actions in three stable logical tracks. */
.result-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%}.result-actions button{width:100%;min-width:0;padding-inline:8px}
@media(max-width:480px){.result-actions{gap:6px}.result-actions button{padding-inline:4px;font-size:.84rem}}

/* v44 long campaign and persistent upgrade hangar. */
.stage-screen{position:relative}
.stage-shell{position:relative}
.stage-header-meta{display:grid;grid-template-columns:auto auto auto;align-items:center;gap:8px;justify-items:end}
.stage-header-meta>strong{color:var(--gold);font-size:.8rem;white-space:nowrap}
.stage-header h2{pointer-events:none}
.stage-header>div:not(.stage-header-meta):not(.wp-shell-settings){pointer-events:none}
.stage-screen .stage-header{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto auto!important;grid-template-rows:auto!important}
.stage-screen .stage-header>button{grid-column:1!important;grid-row:1!important}
.stage-screen .stage-header>.wp-shell-legacy-control{display:none!important}
.stage-screen .stage-header>h2{grid-column:2!important;grid-row:1!important;justify-self:start!important;align-self:center!important;width:max-content;max-width:100%;pointer-events:none}
.stage-screen .stage-header>.stage-header-meta{grid-column:3!important;grid-row:1!important;width:auto!important;justify-self:end!important}
.stage-screen .stage-header>.wp-shell-settings{grid-column:4!important;grid-row:1!important}
.stage-credits{color:var(--muted);font-size:.75rem;white-space:nowrap}
.stage-credits strong{color:var(--gold)}
.upgrade-panel{position:absolute;z-index:6;inset:10px;display:grid;align-content:start;gap:12px;padding:clamp(16px,4vw,28px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--cyan);border-radius:20px;background:linear-gradient(145deg,#171938 0%,#090b20 72%);box-shadow:0 20px 60px #000b}
.upgrade-panel[hidden]{display:none!important}
body.wp-upgrades-open .stage-shell{visibility:hidden}
.upgrade-header{display:flex;justify-content:space-between;align-items:start;gap:12px}
.upgrade-header.wp-stage-shell-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto 48px!important;grid-template-rows:48px!important;align-items:center!important;gap:10px!important}
.upgrade-header.wp-stage-shell-header>.wp-shell-legacy-control{display:none!important}
.upgrade-header.wp-stage-shell-header>h2{grid-column:1!important;grid-row:1!important;justify-self:start!important;width:auto!important;max-width:100%!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upgrade-header.wp-stage-shell-header>strong{grid-column:2!important;grid-row:1!important;justify-self:end!important;width:auto!important}
.upgrade-header.wp-stage-shell-header>.wp-shell-settings{grid-column:3!important;grid-row:1!important}
.upgrade-header h2{margin:4px 0 0;font-size:clamp(1.35rem,4vw,2rem)}
.upgrade-header>strong{color:var(--gold);white-space:nowrap}
.upgrade-copy{margin:0;color:var(--muted);line-height:1.5}
.upgrade-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.upgrade-card{display:grid;gap:6px;min-height:124px;padding:14px;border:1px solid var(--line);border-radius:16px;background:#ffffff0b;text-align:left}
.upgrade-card:hover:not(:disabled),.upgrade-card:focus-visible{border-color:var(--cyan);transform:translateY(-1px)}
.upgrade-card:disabled{opacity:.58;cursor:not-allowed}
.upgrade-card>strong{color:var(--ink)}
.upgrade-level,.upgrade-price{color:var(--muted);font-size:.78rem}
.upgrade-action{color:var(--gold);font-weight:900}
.stage-card-rule{color:var(--cyan);font-size:.7rem;line-height:1.3}
.result-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:620px){.stage-header-meta{grid-template-columns:auto auto;gap:5px}.stage-header-meta .stage-credits{grid-column:1}.stage-header-meta #shopBtn{grid-column:2;grid-row:1/3}.upgrade-list{grid-template-columns:1fr}.result-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.stage-screen .stage-header{grid-template-columns:auto minmax(0,1fr) auto!important;grid-template-rows:auto auto!important}.stage-screen .stage-header>button{grid-row:1 / span 2!important}.stage-screen .stage-header>h2{grid-column:2!important;grid-row:1!important}.stage-screen .stage-header>.stage-header-meta{grid-column:2!important;grid-row:2!important;justify-self:start!important}.stage-screen .stage-header>.wp-shell-settings{grid-column:3!important;grid-row:1!important}}

/* v44 interface convergence: the responsive Stage root already owns the
   full safe Canvas, so its inner shell and reserve must fill the logical
   width instead of becoming a second decorative phone card. */
.stage-screen{width:100%!important;max-width:920px!important;align-items:stretch!important}
.stage-screen .stage-shell{width:100%!important;max-width:none!important;height:100%!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;border-radius:0!important;border-inline:0!important;box-shadow:none!important}
body.wp-stage-select-active .stage-screen .stage-shell{height:100%!important}
/* The shared Stage scaler owns the real 56px physical reserve as a body
   sibling. Keeping this legacy in-root reserve would scale it down and leave
   a second blank band inside the Canvas. */
.stage-screen>.play-reserve{display:none!important}
.stage-card:is(.centered,.is-centered){border-color:var(--gold)!important;box-shadow:0 0 0 2px #ffd47c33,0 16px 30px #0006!important}
.stage-card:is(.centered,.is-centered):is(:hover,:focus-visible){transform:none!important}

/* Keep the five Battle stats on the same stable HUD row as Return and the
   sound/restart actions. The previous fallback grid put the stats on row two,
   directly underneath the live rule message. */
.battle-hud{grid-template-columns:48px minmax(0,1fr) auto!important;grid-template-rows:48px!important;align-items:start!important}
.battle-hud>.hud-stats{grid-column:2!important;grid-row:1!important;padding-left:0!important;width:auto!important;gap:clamp(4px,1.2vw,12px)!important}
.battle-hud>.hud-actions{grid-column:3!important;grid-row:1!important}
.battle-message{top:72px!important;bottom:auto!important}
@media(max-width:480px){.battle-hud{grid-template-columns:38px minmax(0,1fr) auto!important;grid-template-rows:38px!important}.battle-hud>.hud-stats{gap:2px!important}.battle-message{top:58px!important}}

/* Result remains inside Battle Canvas and reuses its reserve. Keep the live
   board inert behind an opaque result surface, with internal scrolling on
   short landscape screens. */
.battle-stage>#resultScreen{position:absolute;inset:0;z-index:7;width:100%;min-height:0;display:grid;place-items:center;overflow:auto;padding:clamp(12px,3vw,32px);background:linear-gradient(180deg,#080b20f5,#101331f8)}
.battle-stage[data-result-open="true"]>canvas,.battle-stage[data-result-open="true"]>.battle-hud,.battle-stage[data-result-open="true"]>.touch-controls,.battle-stage[data-result-open="true"]>.battle-message,.battle-stage[data-result-open="true"]>#leaveDialog{visibility:hidden!important;pointer-events:none!important}
.battle-stage>#resultScreen .result-card{margin:auto}
@media(max-height:520px){.battle-stage>#resultScreen{place-items:start center;padding-block:12px}.battle-stage>#resultScreen .result-card{margin:0 auto}}

/* Make the bounded rail discoverable: nine cards are visible at once, but
   the player can browse the full thirty-card campaign with a held drag. */
.stage-browse-hint{margin:-4px 0 0;color:var(--muted);font-size:.74rem;line-height:1.35;text-align:center}

/* Each touch owns one control so moving and firing can stay active together. */
.touch-controls button{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.touch-controls button.is-held{transform:translateY(1px) scale(.96);border-color:var(--gold);box-shadow:0 0 0 2px #ffd47c33}

/* v51 HUD readability repair: reserve a wider narrow-screen track for the
   full Firepower label instead of clipping it with the five equal tracks. */
@media(max-width:480px){.battle-hud>.hud-stats{grid-template-columns:repeat(3,minmax(0,1fr)) minmax(58px,1.2fr) minmax(0,1fr)!important}}

/* v52 responsive recovery repair: reserve the full back-control track on
   narrow RTL/LTR Battle headers, and use a compact two-column Result in short
   landscape so every recovery action remains visible without page scrolling. */
@media(max-width:480px){
  .battle-hud{grid-template-columns:48px minmax(0,1fr) auto!important}
}
@media(max-height:500px){
  #resultScreen.result-screen{min-height:100dvh!important;padding:8px 12px 56px!important;box-sizing:border-box!important;align-items:start!important}
  #resultScreen .result-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.9fr);column-gap:16px;align-items:center;width:min(100%,560px);max-height:calc(100dvh - 16px);overflow:auto;margin:0 auto;padding:14px 16px!important;text-align:center}
  #resultScreen .result-card>.result-kicker,#resultScreen .result-card>h2,#resultScreen .result-card>p:not(.result-kicker),#resultScreen .result-card>.result-goal{grid-column:1;margin-block:4px}
  #resultScreen .result-card>.result-stats,#resultScreen .result-card>.result-actions{grid-column:2}
  #resultScreen .result-card>h2{font-size:clamp(1.45rem,4vw,2.2rem);line-height:1.1;margin-block:3px 6px}
  #resultScreen .result-card>p:not(.result-kicker){line-height:1.3;margin-block:4px}
  #resultScreen .result-card>.result-goal{margin:5px 0!important;padding:7px 9px}
  #resultScreen .result-stats{gap:6px;margin:8px 0}
  #resultScreen .result-stats span{min-width:0;padding:6px 4px}
  #resultScreen .result-stats b{font-size:.65rem}
  #resultScreen .result-stats strong{font-size:1.05rem}
  #resultScreen .result-actions{gap:6px}
  #resultScreen .result-actions button{min-height:42px;padding-inline:4px;font-size:.8rem}
}

/* Keep the native Battle sound utility at the governed logical touch target
   on compact phones; the semantic marker is installed before shell startup. */
.battle-hud [data-wp-battle-utility]{width:44px!important;min-width:44px!important}
