@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800;900&family=Noto+Sans+JP:wght@400;600;800;900&display=swap');
:root{--red:#fa2149;--paper:#eeeae1;--muted:#87888d}*{box-sizing:border-box}body{margin:0;background:#111216;color:var(--paper);font-family:'Noto Sans JP',sans-serif;background-image:radial-gradient(#ffffff09 .7px,transparent .7px);background-size:5px 5px}button{font:inherit;cursor:pointer;color:inherit;background:none;border:1px solid #45464e;padding:10px 14px;transition:.2s}button:hover{border-color:var(--red);color:var(--red)}button:disabled{opacity:.4;cursor:default}header{height:82px;margin:0 4%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #34353b}.brand{font:900 36px 'Barlow Condensed',sans-serif;letter-spacing:-2px;color:var(--paper);text-decoration:none}.brand>span{color:var(--red)}.brand .tiny{font:700 10px sans-serif;letter-spacing:2px;color:var(--paper);margin-left:20px}.topnote{font:11px monospace;color:#999}.topnote b{color:var(--red);margin-left:24px}header button{font:10px monospace}main{max-width:1500px;padding:35px 4% 20px;margin:auto}.intro{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.eyebrow{font:700 11px monospace;letter-spacing:3px;color:var(--red)}h1{font:900 clamp(60px,6.7vw,100px)/.95 'Barlow Condensed',Impact,sans-serif;letter-spacing:-2px;margin:13px 0 14px}h1 em{display:inline-block;color:var(--red);font-style:italic}.sub{font-size:12px;color:#a9a9af;letter-spacing:1px}.stamp{transform:rotate(9deg);border:3px solid var(--red);color:var(--red);font-size:37px;font-weight:900;line-height:1.1;padding:10px 16px;text-align:center;margin-right:35px}.stamp small{display:block;font:7px monospace;margin-top:6px}.game{display:grid;grid-template-columns:minmax(0,1fr) 285px;border:1px solid #404149;box-shadow:10px 10px 0 #0003}.arena{min-width:0}.arenahead{display:flex;justify-content:space-between;background:#202126;padding:15px 20px;font-size:12px;font-weight:bold}.arenahead small{font:9px monospace;color:#898a90;margin-left:12px}.arenahead i{display:inline-block;background:var(--red);width:7px;height:7px;margin-right:9px}.stats{display:flex;gap:45px;padding:18px 25px;background:#16171c}.stats small{font:9px monospace;letter-spacing:1px;color:#8f9099;display:block}.stats strong{font:700 32px 'Barlow Condensed',sans-serif;display:block}.stats div:first-child strong{color:var(--red)}.stats strong span{color:#666;font-size:17px}.field{position:relative;overflow:hidden;background:#191b22}canvas{width:100%;display:block;touch-action:manipulation}.maplabel{position:absolute;top:17px;left:22px;font:700 11px monospace;letter-spacing:2px;color:#777b85;pointer-events:none}.maplabel span{font-size:9px;margin-left:10px}#banner{pointer-events:none;position:absolute;top:42%;width:100%;text-align:center;font:800 clamp(18px,2.4vw,34px) 'Barlow Condensed',sans-serif;letter-spacing:3px;text-shadow:0 2px 12px #000}#banner span{display:block;font:10px 'Noto Sans JP',sans-serif;letter-spacing:1px;margin-top:10px}footer{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#202126}footer span{font-size:10px;color:#aaa;flex:1}footer button{font-size:10px;padding:7px}aside{padding:24px 20px;background:#1b1c21;border-left:1px solid #404149}aside .eyebrow{font-size:9px;margin:0}h2{font-size:19px;margin:7px 0 22px}.card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;margin:10px 0;padding:13px 12px;background:#24252b;position:relative;border:1px solid #41424a}.card.active{border:1px solid var(--red);background:#3c202c;box-shadow:3px 3px 0 var(--red)}.icon{font-size:30px;color:var(--red);font-family:serif}.card strong{display:block;font-size:14px}.card small{display:block;color:#a4a4ac;font-size:9px;margin-top:4px}.card b{margin-left:auto;font:700 20px 'Barlow Condensed',sans-serif}.card b:before{content:'ENERGY ';font-size:10px}#detail{border-top:1px solid #3e3f47;margin-top:23px;padding-top:17px;min-height:115px}#detail small{font:10px monospace;color:var(--red);letter-spacing:2px}#detail p{font-size:11px;line-height:1.9;color:#a8a8b0}#start{background:var(--red);border:0;color:white;font-weight:900;width:100%;font-size:17px;padding:17px 19px;text-align:left;margin-top:12px;clip-path:polygon(0 0,100% 0,100% 80%,94% 100%,0 100%)}#start span{float:right}#start:hover{background:#ff4667}.hint{font-size:9px;color:#777981;line-height:1.8}.bottom{display:flex;justify-content:space-between;align-items:center;margin-top:22px;font:10px monospace;letter-spacing:1px;color:#686b75}.bottom button{font-size:10px;border:0}#upgrade,#sell{font-size:10px;padding:8px;margin-right:6px}@media(max-width:850px){.game{grid-template-columns:1fr}aside{border-left:0;border-top:1px solid #444;padding:20px}#cards{display:flex;gap:10px}.card{flex:1;flex-wrap:wrap}.card b{font-size:18px}.card small{display:none}.icon{font-size:22px}.topnote,.stamp,.brand .tiny{display:none}.stats{gap:30px}.intro{margin-bottom:20px}#detail{min-height:0}main{padding-top:25px}.bottom span:nth-child(2){display:none}.arenahead small{display:none}}

.energy{margin:12px 0}.energy small{font:800 20px 'Barlow Condensed',sans-serif;color:#78dfec;letter-spacing:1px}.energy strong{float:right;font:700 23px 'Barlow Condensed',sans-serif}.energy>div{height:7px;background:#353943;margin-top:8px}.energy i{display:block;background:#78dfec;height:7px;width:0;transition:width .3s}.skills{display:flex;gap:7px}.skills button{flex:1;font-size:10px;padding:10px 4px;border-color:#78dfec55}.skills small{display:block;font:8px monospace;color:#78dfec;margin-top:4px}

.icon{display:block;width:44px;height:48px;flex-shrink:0}.icon svg{display:block;width:100%;height:100%}#sell{display:block;width:100%;margin-top:8px;border-color:#fa2149;color:#fa2149}#sell[hidden]{display:none}

.audio-controls{position:relative;z-index:20}#audio-tab[aria-expanded="true"]{border-color:var(--red);color:var(--red)}#audio-panel{position:absolute;right:0;top:48px;width:min(300px,88vw);padding:20px;background:#202126;border:1px solid #fa2149;box-shadow:7px 7px 0 #0008}#audio-panel[hidden]{display:none}.audio-heading{display:flex;align-items:center;justify-content:space-between}.audio-heading strong{font-size:15px}#audio-close{border:0;font-size:23px;padding:0 5px}.track{font:9px monospace;letter-spacing:2px;color:#fa2149;margin:18px 0}.track span{display:block;font:600 16px "Noto Sans JP",sans-serif;color:#eeeae1;letter-spacing:1px;margin-top:7px}#audio-panel #sound{width:100%;font:700 12px monospace;padding:12px;margin-bottom:20px}#sound[aria-pressed="true"]{background:#fa2149;color:white;border-color:#fa2149}#audio-panel label{display:block;font-size:12px}#volume-value{float:right;font:12px monospace}#bgm-volume{width:100%;margin:15px 0;accent-color:#fa2149;cursor:pointer}#audio-status{font-size:10px;line-height:1.8;color:#a9a9af;margin:0}button:focus-visible,input:focus-visible{outline:2px solid #78dfec;outline-offset:3px}

main{padding-top:20px}.intro{margin-bottom:20px}.arenahead{align-items:center;gap:14px;padding:10px 16px;flex-wrap:wrap}.arenahead .brand{font-size:25px;line-height:1;white-space:nowrap}.arenahead .brand .tiny{display:none}.arenahead>span{flex:1}.arena-tools{display:flex;align-items:center;gap:16px;margin-left:auto}.arena-tools>span{font:9px monospace;color:#898a90}#audio-tab{font-size:10px;padding:7px 10px;white-space:nowrap}#audio-panel{top:38px;text-align:left}.audio-controls{font-weight:400}@media(max-width:600px){main{padding-top:12px}.arenahead{gap:8px;padding:9px 10px}.arenahead>span{font-size:10px}.arena-tools{gap:5px}.arena-tools>span{display:none}}

.recruit-box{padding:13px;background:#29232f;border:1px solid #b8a4ff66;margin-bottom:16px}.recruit-title{display:flex;justify-content:space-between;color:#b8a4ff;font:11px monospace}.recruit-title b{color:#eeeae1}#recruit{width:100%;margin:12px 0 8px;background:#b8a4ff;color:#15131b;border:0;font-weight:800;font-size:12px}#recruit:disabled{opacity:.4}#recruit-result{font-size:10px;line-height:1.7;display:flex;gap:10px;align-items:center}#recruit-result p{margin:3px 0;color:#b8b4c1}#recruit-result strong{display:block;font-size:19px}#recruit-result small{color:#b8a4ff;font:8px monospace}.recruit-portrait{width:54px;flex-shrink:0;animation:reveal .4s ease-out}.recruit-portrait svg{width:100%}.recruit-box details{margin-top:9px;font-size:9px;color:#aaa3b5;line-height:1.9}.recruit-box summary{cursor:pointer}.roster-label{font:9px monospace;color:#8b8d98;letter-spacing:1px}#cards{max-height:390px;overflow-y:auto;padding:0 5px 5px 0;scrollbar-width:thin;scrollbar-color:#5b5268 transparent}.card em{font:8px monospace;color:#b8a4ff;font-style:normal}.card:disabled{opacity:.38}.card:disabled:hover{border-color:#41424a;color:inherit}@keyframes reveal{from{transform:scale(.7) rotate(-10deg);opacity:0}to{transform:scale(1);opacity:1}}@media(max-width:850px){#cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:330px}.card{margin:0;padding:10px}.recruit-box{max-width:100%}}@media(prefers-reduced-motion:reduce){.recruit-portrait{animation:none}}

.se-controls{border-top:1px solid #45414b;margin-top:18px;padding-top:16px}.se-title{font:11px monospace;color:#78dfec;letter-spacing:1px;margin-bottom:12px}#se-toggle{width:100%;padding:10px;margin-bottom:16px;font:700 12px monospace}#se-toggle[aria-pressed="true"]{border-color:#78dfec;color:#78dfec;background:#78dfec15}#se-value{float:right;font:12px monospace}#se-volume{width:100%;margin:15px 0;accent-color:#78dfec;cursor:pointer}#se-test{width:100%;font-size:10px;padding:9px}.se-controls p{font-size:9px;color:#a9a9af;margin:10px 0 0}#audio-panel{max-height:75vh;overflow-y:auto}

.stage-strip{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#29202c;padding:10px 20px;border-bottom:1px solid #44313e}.stage-strip strong{font:700 14px monospace;letter-spacing:2px;color:#fa5471}.stage-strip>span{font-size:10px;color:#b3a8b7}@media(max-width:500px){.stage-strip{padding:10px;flex-wrap:wrap}.stage-strip>span{font-size:9px}}

html,body{height:100%;overflow:hidden}main{width:100%;max-width:none;height:100dvh;padding:10px 18px 6px;display:grid;grid-template-rows:48px minmax(0,1fr) 22px;gap:8px}.intro{margin:0;min-height:0}.intro .eyebrow,.intro .sub,.stamp{display:none}h1{font-size:38px;line-height:1;margin:0;letter-spacing:-1px}.game{min-height:0;grid-template-columns:minmax(0,1fr) 290px;box-shadow:none}.arena{display:flex;flex-direction:column;min-height:0}.arenahead{flex-shrink:0;flex-wrap:nowrap;padding:8px 12px}.arenahead small{display:none}.stage-strip{padding:7px 12px;flex-shrink:0}.stats{padding:8px 18px;gap:35px;flex-shrink:0}.stats strong{font-size:28px}.field{flex:1;min-height:0;container-type:size}canvas{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(100cqw,calc(100cqh * 5 / 3));height:auto;max-height:100%;object-fit:contain}.maplabel{top:8px;left:10px;font-size:9px}#banner{top:42%;font-size:clamp(15px,2vw,30px)}footer{padding:7px 12px;flex-shrink:0}aside{display:flex;flex-direction:column;min-height:0;padding:12px;gap:9px}aside>.hint{display:none}.squad-tabs{display:flex;gap:5px;flex-shrink:0}.squad-tabs button{flex:1;font-size:12px;padding:8px}.squad-tabs [aria-pressed=true]{color:#fa2149;border-color:#fa2149;background:#fa214914}#deploy-pane,#recruit-pane{min-height:0;flex:1}#deploy-pane[hidden],#recruit-pane[hidden]{display:none}#cards{display:grid;grid-template-rows:repeat(3,minmax(0,1fr));gap:6px;max-height:none;height:calc(100% - 47px);overflow:hidden;padding:0;grid-template-columns:1fr}.roster-label{margin-bottom:5px}.card{margin:0;min-height:0;padding:7px 9px;gap:8px;flex-wrap:nowrap}.card .icon{width:32px;height:37px}.card strong{font-size:12px}.card small{display:block;font-size:8px}.card b{font-size:19px}.command-panel{flex-shrink:0}#detail{min-height:0;margin:0;padding:7px 0 0}#detail small{font-size:9px}#detail p{font-size:10px;line-height:1.5;margin:5px 0}#upgrade{font-size:10px;padding:5px 8px}#sell{display:inline-block;width:auto;margin:3px 0 0;padding:5px 8px;font-size:9px}.combat-actions{flex-shrink:0}.energy{margin:0 0 7px}.energy small{font-size:19px}.energy strong{font-size:21px}.skills button{padding:7px 3px}#start{margin-top:8px;padding:11px 14px;font-size:15px}.bottom{margin:0;font-size:9px}.bottom button{padding:0}.recruit-box{height:100%;margin:0;padding:12px;overflow:auto}#audio-panel{max-height:min(70dvh,550px)}
@media(max-height:650px) and (min-width:701px){main{grid-template-rows:30px minmax(0,1fr) 18px;gap:5px;padding-top:5px}h1{font-size:27px}.stats{padding:4px 15px}.stats strong{font-size:23px}.stage-strip{padding:4px 12px}aside{gap:5px;padding:8px}.squad-tabs button{padding:5px}.card .icon{width:24px;height:29px}.card small{display:none}#detail p{font-size:9px;margin:3px 0;line-height:1.3}#detail p br:last-of-type{display:none}.energy small{font-size:17px}.energy strong{font-size:19px}.skills button{padding:4px}#start{padding:8px;margin-top:5px}}
@media(max-width:700px){main{padding:6px;grid-template-rows:26px minmax(0,1fr) 18px;gap:5px}h1{font-size:25px}.game{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) 250px}.arenahead{padding:5px 8px;gap:6px}.arenahead .brand{font-size:20px}.arenahead>span{font-size:9px}.arena-tools>span{display:none}#audio-tab{font-size:9px;padding:5px}.stats{padding:4px 10px;justify-content:space-between;gap:8px}.stats strong{font-size:23px}.stats small{font-size:8px}.stage-strip{padding:4px 8px}.stage-strip strong{font-size:10px}.stage-strip>span{font-size:8px}.maplabel{display:none}footer span{font-size:8px}footer button{font-size:9px;padding:4px}aside{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:28px minmax(0,1fr) auto;padding:7px;gap:6px;border-left:0}.squad-tabs{grid-column:1;grid-row:1}.squad-tabs button{padding:4px;font-size:10px}#deploy-pane,#recruit-pane{grid-column:1;grid-row:2 / 4}.command-panel{grid-column:2;grid-row:1 / 3;min-width:0}.combat-actions{grid-column:2;grid-row:3}#cards{display:grid;grid-template-columns:1fr;gap:4px;height:calc(100% - 44px)}.card{padding:3px 5px;gap:5px}.card .icon{width:22px;height:27px}.card strong{font-size:10px}.card small{display:none}.card b{font-size:14px}.card b:before{font-size:7px}#detail{padding:0;border:0}#detail p{font-size:9px;line-height:1.4}#detail small{font-size:8px;letter-spacing:1px}.energy small{font-size:16px}.energy strong{font-size:17px}.skills button{font-size:9px;padding:4px 2px}.skills small{font-size:7px}#start{padding:7px;font-size:13px;margin-top:5px}#upgrade,#sell{font-size:8px;padding:4px}.roster-label{font-size:7px}.recruit-box{padding:7px}.recruit-title{font-size:8px}#recruit{padding:8px 4px;font-size:10px;margin:7px 0}#recruit-result strong{font-size:14px}#recruit-result{font-size:8px;gap:5px}.recruit-portrait{width:30px}.recruit-box details{font-size:8px}.bottom span:nth-child(2){display:none}}

/* Stage menu stays beside the stage number; only the roster scrolls. */
.stage-strip{justify-content:flex-start;gap:18px;padding:8px 12px;flex-wrap:nowrap}
.stage-strip>strong{white-space:nowrap;flex-shrink:0}
.stage-strip #stage-info{margin-left:auto;text-align:right}
.stage-strip .squad-tabs{display:flex;gap:8px;flex-shrink:0}
.stage-strip .squad-tabs button{flex:none;min-width:110px;min-height:44px;padding:10px 22px;font-size:17px;font-weight:800;letter-spacing:1px}
#deploy-pane{display:flex;flex-direction:column;overflow:hidden}
#deploy-pane[hidden]{display:none}
.roster-label{flex-shrink:0;margin-bottom:8px}
#cards{display:flex;flex-direction:column;gap:8px;height:auto;min-height:0;flex:1;overflow-y:auto;overflow-x:hidden;padding:0 5px 5px 0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#fa2149 #26242c}
#cards .card{flex:0 0 auto;min-height:70px;max-width:100%;margin:0;padding:10px 9px}
#cards .card small{display:block}
@media(max-height:650px) and (min-width:701px){.stage-strip{padding:5px 12px}.stage-strip .squad-tabs button{font-size:16px;min-height:42px;padding:8px 20px}#cards .card{min-height:59px}}
@media(max-width:1000px) and (min-width:701px){.stage-strip #stage-info{font-size:9px;max-width:145px}.stage-strip{gap:12px}.stage-strip .squad-tabs button{min-width:90px;padding:10px 14px}}
@media(max-width:700px){.stage-strip{gap:12px;padding:6px 8px}.stage-strip>strong{font-size:11px;letter-spacing:1px}.stage-strip #stage-info{display:none}.stage-strip .squad-tabs{margin-left:auto;gap:6px}.stage-strip .squad-tabs button{min-width:94px;min-height:42px;font-size:15px;padding:8px 16px}aside{grid-template-rows:minmax(0,1fr) auto}#deploy-pane,#recruit-pane{grid-row:1 / 3}.command-panel{grid-row:1}.combat-actions{grid-row:2}#cards{display:flex;height:auto;gap:5px;padding-right:4px}#cards .card{min-height:52px;padding:6px 5px}#cards .card small{font-size:7px;line-height:1.4}.roster-label{margin-bottom:5px}}
@media(max-width:360px){.stage-strip{gap:6px}.stage-strip .squad-tabs button{min-width:80px;padding:8px 11px}}

#recruit-result{flex-wrap:wrap}#recruit-result .live-level-note{flex-basis:100%;margin-top:7px;padding:7px;background:#78dfec15;color:#78dfec;border-left:2px solid #78dfec}

/* Larger command deck to the right of the stage. */
.game{grid-template-columns:minmax(0,1fr) clamp(340px,29vw,430px)}
aside{padding:16px;gap:12px;background:#1b1c21}
aside>.squad-tabs{display:flex;gap:10px;flex-shrink:0}
aside>.squad-tabs button{flex:1;min-height:50px;padding:10px 20px;font-size:20px;font-weight:900;letter-spacing:2px}
#detail{padding-top:12px}
#detail small{font-size:12px;letter-spacing:2px}
#detail p{font-size:13px;line-height:1.8;margin:9px 0}
.energy{margin:0 0 12px}
.energy small{font-size:27px;letter-spacing:1px}
.energy strong{font-size:29px}
.energy>div,.energy i{height:10px}
.skills{gap:10px}
.skills button{font-size:14px;padding:12px 5px;min-height:60px}
.skills small{font-size:11px;margin-top:5px}
#start{font-size:22px;padding:17px 20px;margin-top:12px;min-height:63px}
#upgrade,#sell{font-size:12px;padding:7px 10px}
.stage-strip #stage-info{margin-left:auto}
@media(max-height:750px) and (min-width:701px){aside{padding:12px;gap:8px}aside>.squad-tabs button{min-height:46px;font-size:18px}#detail{padding-top:8px}#detail p{font-size:12px;line-height:1.6;margin:6px 0}.energy small{font-size:24px}.energy strong{font-size:26px}.skills button{min-height:52px;font-size:13px;padding:8px 4px}#start{font-size:20px;min-height:54px;padding:12px 16px}.energy{margin-bottom:9px}}
@media(max-width:1000px) and (min-width:701px){.game{grid-template-columns:minmax(0,1fr) 340px}}
@media(max-width:700px){.game{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) 300px}aside{padding:8px;gap:7px;grid-template-rows:44px minmax(0,1fr) auto}aside>.squad-tabs{grid-column:1 / 3;grid-row:1}aside>.squad-tabs button{font-size:17px;min-height:42px;padding:6px 14px}#deploy-pane,#recruit-pane{grid-row:2 / 4}.command-panel{grid-row:2}.combat-actions{grid-row:3}#detail{padding:0}#detail small{font-size:9px}#detail p{font-size:10px;line-height:1.4;margin:4px 0}.energy{margin-bottom:6px}.energy small{font-size:18px}.energy strong{font-size:20px}.energy>div,.energy i{height:7px}.skills{gap:5px}.skills button{min-height:38px;font-size:10px;padding:5px 2px}.skills small{font-size:8px;margin-top:2px}#start{font-size:15px;min-height:37px;padding:8px;margin-top:6px}#upgrade,#sell{font-size:9px;padding:4px}}

/* The menu starts alongside the actual playfield, below the shared HUD. */
@media(min-width:701px){
 .game{grid-template-rows:auto auto auto minmax(0,1fr) auto}
 .arena{display:contents}
 .arenahead{grid-column:1 / 3;grid-row:1}
 .stage-strip{grid-column:1 / 3;grid-row:2}
 .stats{grid-column:1 / 3;grid-row:3}
 .field{grid-column:1;grid-row:4;min-width:0}
 .game footer{grid-column:1;grid-row:5}
 .game aside{grid-column:2;grid-row:4 / 6;padding-top:0;gap:10px}
 aside>.squad-tabs{margin:0 -16px 0;padding:0;gap:0;border-bottom:1px solid #45414b}
 aside>.squad-tabs button{min-height:58px;border-top:0;border-right:0;border-bottom:0;border-left:1px solid #45414b;font-size:21px}
 aside>.squad-tabs button:first-child{border-left:0}
 aside>.squad-tabs [aria-pressed=true]{background:#fa214925;box-shadow:inset 0 -3px #fa2149}
}
@media(max-height:750px) and (min-width:701px){
 .game aside{padding-top:0;gap:7px}
 aside>.squad-tabs{margin-left:-12px;margin-right:-12px}
 aside>.squad-tabs button{min-height:48px;font-size:19px}
 #detail p{font-size:11px;line-height:1.5}
}

/* Keep the command deck alongside the map in narrow Codex panels too. */
@media(max-width:700px){
 .game{grid-template-columns:minmax(0,1fr) clamp(165px,36vw,250px);grid-template-rows:auto auto auto minmax(0,1fr) auto}
 .arena{display:contents}
 .arenahead{grid-column:1 / 3;grid-row:1}
 .stage-strip{grid-column:1 / 3;grid-row:2}
 .stats{grid-column:1 / 3;grid-row:3}
 .field{grid-column:1;grid-row:4;min-width:0}
 .game footer{grid-column:1;grid-row:5;flex-wrap:wrap;gap:4px}
 .game footer>span{flex-basis:100%}
 .game aside{display:flex;flex-direction:column;grid-column:2;grid-row:4 / 6;min-width:0;min-height:0;padding:0 8px 8px;gap:9px;border-left:1px solid #404149;border-top:0}
 aside>.squad-tabs{display:flex;flex-shrink:0;gap:0;margin:0 -8px;padding:0;border-bottom:1px solid #45414b}
 aside>.squad-tabs button{min-width:0;min-height:46px;flex:1;font-size:16px;letter-spacing:1px;padding:8px 4px;border-top:0;border-bottom:0;border-left:0}
 aside>.squad-tabs [aria-pressed=true]{box-shadow:inset 0 -3px #fa2149;background:#fa214925}
 #deploy-pane,#recruit-pane{flex:1;min-height:0}
 .command-panel,.combat-actions{flex-shrink:0}
 #detail small{font-size:9px}#detail p{font-size:10px;line-height:1.5}
 #cards .card{min-height:58px}
 #cards .card strong{font-size:11px}
 #cards .card .icon{width:26px;height:31px}
 .energy small{font-size:19px}.energy strong{font-size:20px}
 .skills button{min-height:42px;font-size:10px}
 #start{font-size:16px;min-height:43px}
 #banner{font-size:clamp(10px,2.5vw,17px);letter-spacing:1px;padding:0 5px}
 #banner span{font-size:8px;line-height:1.7}
}
@media(max-width:450px){.game aside{gap:6px;padding-left:6px;padding-right:6px}aside>.squad-tabs{margin:0 -6px}aside>.squad-tabs button{font-size:14px}.energy small{font-size:16px}.energy strong{font-size:17px}#detail p{font-size:9px}#cards .card{padding:5px 3px;gap:3px}#cards .card strong{font-size:10px}#cards .card .icon{width:22px;height:27px}}

@media(max-width:700px){canvas{top:0;transform:translateX(-50%)}#banner{top:min(42cqh,25.2cqw)}}

.card.locked{background:#17181c;border-color:#32343b;cursor:not-allowed;box-shadow:none}
.card.locked .icon{opacity:.18;filter:grayscale(1)}
.card.locked strong{color:#858791}.card.locked small,.card.locked b{opacity:.3}
.card.locked em{display:block;margin-top:4px;font:700 10px 'Noto Sans JP',sans-serif;color:#b0a5b3}
.card.locked:hover{border-color:#55515b;color:inherit}
#selection-status{flex-shrink:0;font-size:10px;line-height:1.5;color:#78dfec;padding:3px 0 7px}
@media(orientation:landscape) and (max-height:550px){
 main{padding:4px;height:100dvh;grid-template-rows:minmax(0,1fr);gap:0}
 .intro,.bottom{display:none}
 .game{grid-template-columns:minmax(0,1fr) clamp(220px,30vw,285px);grid-template-rows:auto auto auto minmax(0,1fr) auto}
 .arena{display:contents}.arenahead{grid-column:1 / 3;grid-row:1;padding:3px 8px;min-height:28px}
 .arenahead .brand{font-size:20px}.arenahead>span{font-size:10px}.arena-tools>span{display:none}
 #audio-tab{font-size:9px;padding:4px 8px}
 .stage-strip{grid-column:1 / 3;grid-row:2;padding:3px 8px;min-height:20px}.stage-strip strong{font-size:10px}.stage-strip #stage-info{font-size:8px}
 .stats{grid-column:1 / 3;grid-row:3;padding:3px 10px;gap:30px;justify-content:flex-start}.stats small{font-size:7px}.stats strong{font-size:20px;line-height:1.05}
 .field{grid-column:1;grid-row:4;min-width:0}.game footer{grid-column:1;grid-row:5;padding:3px 8px;min-height:23px;flex-wrap:nowrap}
 .game footer>span{flex-basis:auto;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.game footer button{font-size:9px;padding:3px 7px}
 .game aside{display:flex;flex-direction:column;grid-column:2;grid-row:4 / 6;min-height:0;padding:0 8px 5px;gap:4px;border-left:1px solid #404149;border-top:0}
 aside>.squad-tabs{margin:0 -8px;gap:0;flex-shrink:0}aside>.squad-tabs button{min-height:34px;padding:4px;font-size:15px}
 #deploy-pane,#recruit-pane{min-height:0;flex:1}.roster-label{font-size:7px;margin-bottom:2px}#selection-status{font-size:8px;padding:0 0 3px}
 #cards{gap:4px}#cards .card{min-height:43px;padding:4px 6px;gap:6px}#cards .card .icon{width:23px;height:28px}#cards .card strong{font-size:11px}#cards .card small{display:none}#cards .card b{font-size:16px}.card.locked em{font-size:8px;margin-top:2px}
 .command-panel{flex-shrink:0}#detail{display:none}#upgrade,#sell{font-size:9px;padding:3px 6px;margin:0}
 .combat-actions{flex-shrink:0}.energy{margin-bottom:4px}.energy small{font-size:17px}.energy strong{font-size:18px}.energy>div,.energy i{height:5px}.energy>div{margin-top:3px}
 .skills{gap:5px}.skills button{min-height:31px;padding:3px;font-size:10px}.skills small{font-size:7px;margin-top:1px}
 #start{min-height:32px;padding:6px 10px;margin-top:5px;font-size:14px}
 .recruit-box{padding:7px}#recruit{padding:6px;margin:6px 0;font-size:11px}#recruit-result strong{font-size:15px}#recruit-result p{font-size:9px}.recruit-portrait{width:32px}
 #audio-panel{max-height:calc(100dvh - 45px)}
}

.mobile-only{display:none}
@media(max-width:700px) and (orientation:portrait){
 main{padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);grid-template-rows:minmax(0,1fr);gap:0}.intro,.bottom{display:none}
 .game{display:flex;flex-direction:column;border:0;height:100%;padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))}
 .arena{display:contents}.arenahead{padding:6px 10px;min-height:40px}.arenahead>span{font-size:10px}#audio-tab{min-height:32px;font-size:11px;padding:6px 10px}
 .stage-strip{padding:5px 10px;min-height:27px}.stage-strip>strong{font-size:12px}.stats{padding:7px 12px;justify-content:space-between;gap:8px;min-height:55px}.stats small{font-size:9px}.stats strong{font-size:26px}
 .field{flex:1;min-height:0;width:100%;overflow:hidden;container-type:size}
 canvas{width:min(100cqw,60cqh);height:auto;max-height:100%;top:0;left:50%;transform:translateX(-50%);touch-action:manipulation}
 #banner{top:38%;font-size:18px;padding:0 12px;line-height:1.2;letter-spacing:1px}#banner span{font-size:11px;line-height:1.6}
 .maplabel{display:none}.game footer{min-height:42px;padding:3px 10px;gap:6px;flex-wrap:nowrap}.game footer>span{flex-basis:auto;font-size:10px;line-height:1.5}.game footer button{min-width:44px;min-height:36px;font-size:11px;padding:5px 8px}
 .game aside{display:contents}
 aside>.squad-tabs{display:flex;position:fixed;bottom:env(safe-area-inset-bottom,0px);left:0;right:112px;height:64px;margin:0;padding:7px 4px 7px 8px;gap:5px;background:#191b22;z-index:45;border:0}
 aside>.squad-tabs button{display:block;flex:1;min-width:0;min-height:48px;padding:8px 3px;font-size:14px;letter-spacing:0;border:1px solid #49444f;border-radius:8px}
 #start{display:block!important;position:fixed;bottom:calc(9px + env(safe-area-inset-bottom,0px));right:8px;width:100px;min-height:46px;padding:9px 6px;font-size:14px;margin:0;z-index:46;clip-path:none;border-radius:8px}#start span{display:none}
 #deploy-pane,#recruit-pane,.command-panel{display:none!important}
 .combat-actions{display:block;position:static;height:0;margin:0;padding:0}.combat-actions>.energy,.combat-actions>.skills{display:none}
 body[data-mobile-panel='deploy'] #deploy-pane,body[data-mobile-panel='recruit'] #recruit-pane{display:flex!important;flex-direction:column;position:fixed;left:8px;right:8px;bottom:calc(76px + env(safe-area-inset-bottom,0px));height:min(52dvh,400px);padding:18px 12px 12px;background:#20232d;border:1px solid #67606f;border-radius:14px;box-shadow:0 -10px 50px #000a;z-index:40;overflow:hidden}
 body[data-mobile-panel='deploy'] #deploy-pane{padding-bottom:64px}
 body[data-mobile-panel='deploy'] .command-panel{display:flex!important;position:fixed;bottom:calc(86px + env(safe-area-inset-bottom,0px));left:20px;right:20px;gap:8px;z-index:42;background:#20232d}body[data-mobile-panel='deploy'] #detail{display:none}
 #upgrade,#sell{min-height:44px;flex:1;font-size:12px;margin:0;padding:8px;white-space:normal}
 .roster-label{font-size:11px;margin-bottom:5px;padding-right:80px}#selection-status{font-size:12px;padding:3px 0 8px}
 #cards{display:flex;flex-direction:column;gap:8px;min-height:0;overflow-y:auto;flex:1;padding-right:4px}#cards .card{min-height:72px;padding:10px;gap:10px;border-radius:8px}#cards .card .icon{width:36px;height:42px}#cards .card strong{font-size:15px}#cards .card small{display:block;font-size:10px}#cards .card b{font-size:20px}.card.locked em{font-size:11px}
 body[data-mobile-panel='skills'] .combat-actions{position:fixed;left:8px;right:8px;bottom:calc(76px + env(safe-area-inset-bottom,0px));height:auto;padding:40px 16px 20px;background:#20232d;border:1px solid #67606f;border-radius:14px;z-index:40;box-shadow:0 -10px 50px #000a}
 body[data-mobile-panel='skills'] .combat-actions>.energy,body[data-mobile-panel='skills'] .combat-actions>.skills{display:flex}.combat-actions>.energy{flex-wrap:wrap;justify-content:space-between;gap:6px}.energy>div{flex-basis:100%;width:100%}.energy strong{font-size:27px}.energy small{font-size:24px}.skills button{min-height:64px;font-size:16px}.skills small{font-size:11px}
 #mobile-close{display:none;position:fixed;right:20px;bottom:calc(76px + env(safe-area-inset-bottom,0px) + min(52dvh,400px) - 42px);z-index:44;font-size:12px;min-height:36px;padding:6px 10px;border-radius:8px;background:#20232d}
 body[data-mobile-panel='deploy'] #mobile-close,body[data-mobile-panel='recruit'] #mobile-close{display:block}body[data-mobile-panel='skills'] #mobile-close{display:block;bottom:calc(230px + env(safe-area-inset-bottom,0px))}
 .recruit-box{padding:26px 10px 10px;overflow:auto;border:0;background:transparent}.recruit-title{font-size:12px}#recruit{min-height:50px;font-size:16px;margin:12px 0}.recruit-portrait{width:60px}#recruit-result strong{font-size:22px}#recruit-result p{font-size:12px}.recruit-box details{font-size:11px}#audio-panel{max-height:75dvh}
}

.save-controls{position:relative;z-index:70}#save-menu{font-size:11px;min-height:32px;padding:6px 10px;white-space:nowrap}.arena-tools{gap:8px}.save-heading{display:flex;align-items:center;justify-content:space-between}.save-heading strong{font-size:17px}#save-close{font-size:24px;padding:0 8px;border:0}#save-panel{position:fixed;top:70px;right:18px;width:min(330px,calc(100vw - 24px));padding:20px;background:#20232d;border:1px solid #78dfec;border-radius:12px;box-shadow:0 10px 50px #000b;max-height:80dvh;overflow:auto;z-index:100}#save-panel[hidden]{display:none}#save-panel p{font-size:12px;color:#bec0c9;line-height:1.8}#save-panel>button{display:block;width:100%;min-height:46px;margin:9px 0;font-size:14px;border-radius:6px}#save-game{background:#fa2149;border-color:#fa2149;font-weight:800}#save-panel small{font-size:10px;line-height:1.8;color:#9699a5}#save-panel #save-feedback{color:#78dfec}#save-info{border-top:1px solid #41434c;padding-top:10px}
@media(max-width:700px){.arenahead>span{max-width:100px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arena-tools{gap:4px}#save-menu{font-size:10px;min-height:32px;padding:5px 7px}#save-panel{top:52px;right:12px;padding:16px}.arenahead{gap:6px}}

/* High-visibility utility buttons, including touch displays. */
.arena-tools{gap:10px}
#save-menu,#audio-tab{min-height:46px;padding:10px 18px;border:2px solid transparent;border-radius:8px;font-size:15px;font-weight:900;line-height:1.2;white-space:nowrap;box-shadow:0 3px 0 #0007}
#save-menu{background:#70e8ee;color:#092a32;border-color:#a7ffff}
#audio-tab{background:#ffe16d;color:#352600;border-color:#fff0ad}
#save-menu:hover,#save-menu[aria-expanded=true]{background:#a7ffff;color:#092a32;border-color:white}
#audio-tab:hover,#audio-tab[aria-expanded=true]{background:#fff0ad;color:#352600;border-color:white}
@media(max-width:700px){.arenahead{min-height:58px;padding:6px 8px;gap:5px}.arena-tools{gap:6px}.arenahead>span{max-width:90px;font-size:9px}#save-menu,#audio-tab{min-height:44px;padding:9px 11px;font-size:14px}.arenahead .brand{font-size:20px}}
@media(max-width:380px){.arenahead>span{display:none}#save-menu,#audio-tab{padding:9px 10px}.arena-tools{margin-left:auto}}
@media(orientation:landscape) and (max-height:550px){.arenahead{min-height:48px;padding:3px 8px}#save-menu,#audio-tab{min-height:40px;padding:7px 14px;font-size:13px}}

.element-tag{display:inline-block;font:800 10px 'Noto Sans JP',sans-serif;line-height:1.5;border:1px solid var(--element-color);color:var(--element-color);border-radius:4px;padding:0 4px;margin-left:3px;vertical-align:middle;white-space:nowrap}.card.locked .element-tag{opacity:.35}.stage-strip #enemy-element{font:700 12px 'Noto Sans JP',sans-serif;white-space:nowrap;margin:0}.stage-strip{overflow:visible}
@media(max-width:700px){.stage-strip{gap:10px}.stage-strip #enemy-element{font-size:11px}.card strong .element-tag{font-size:9px}.card .element-tag{padding:0 3px}}
@media(orientation:landscape) and (max-height:550px){.stage-strip #enemy-element{font-size:9px}.card strong .element-tag{font-size:8px}}

#rules-open{font:700 12px 'Noto Sans JP',sans-serif;min-height:34px;padding:6px 13px;white-space:nowrap;color:#eeeae1;border:1px solid #777181;border-radius:6px;margin-left:auto}
#rules-open:hover{color:#ffe16d;border-color:#ffe16d}
#rules-dialog{padding:0;width:min(690px,calc(100vw - 24px));max-height:85dvh;background:#1c1f28;color:#eeeae1;border:1px solid #84778e;border-radius:14px;box-shadow:0 20px 80px #000b;overflow:hidden}
#rules-dialog::backdrop{background:#080b13b8;backdrop-filter:blur(4px)}
.rules-heading{height:auto;margin:0;padding:18px 22px;border-bottom:1px solid #46414e;display:flex;justify-content:space-between;align-items:center;background:#26212e}
.rules-heading small{font:10px monospace;color:#fa5474;letter-spacing:2px}.rules-heading h2{font-size:24px;margin:4px 0 0}
#rules-close{font-size:12px;padding:10px 14px;min-height:42px;border-radius:6px}
.rules-content{padding:0 22px 20px;overflow-y:auto;max-height:calc(85dvh - 95px);overscroll-behavior:contain}
.rules-content section{padding:18px 0;border-bottom:1px solid #393b47}.rules-content section:last-child{border:0}
.rules-content h3{font-size:16px;margin:0 0 10px;color:#78dfec}.rules-content p{font-size:13px;line-height:1.95;color:#c2c4ce;margin:8px 0}.rules-content strong{color:#eeeae1}.rules-content .rules-cycle{font-size:20px;font-weight:900;letter-spacing:2px;color:#ffe16d}
@media(max-width:700px){#rules-open{font-size:10px;min-height:29px;padding:4px 9px}.rules-heading{padding:14px 16px}.rules-heading h2{font-size:21px}.rules-content{padding:0 16px 16px}.rules-content p{font-size:13px}.rules-content h3{font-size:15px}}
@media(orientation:landscape) and (max-height:550px){#rules-open{min-height:24px;font-size:9px;padding:2px 8px}.rules-heading{padding:9px 16px}.rules-heading h2{font-size:18px}.rules-heading small{display:none}.rules-content{max-height:calc(85dvh - 65px)}}

#wave-warning{position:fixed;inset:0;z-index:65;display:flex;align-items:center;justify-content:center;pointer-events:none;background:radial-gradient(ellipse at center,#f5224940,#060a1440)}#wave-warning[hidden]{display:none}.warning-frame{position:absolute;inset:8px;border:3px solid #fa2149;box-shadow:inset 0 0 40px #fa214944,0 0 25px #fa214955;animation:warning-border 1s ease-in-out infinite alternate}.warning-card{position:relative;width:min(660px,92vw);padding:25px 20px 20px;background:#160f19ed;border-top:3px solid #fa2149;border-bottom:3px solid #fa2149;text-align:center;box-shadow:0 14px 60px #0009;animation:warning-entry .25s ease-out}.warning-card>p{color:#ffb7c5;font:700 13px monospace;letter-spacing:3px;margin:8px 0}.warning-card strong{display:block;color:#fa2149;font:900 clamp(48px,10vw,100px)/1 'Barlow Condensed',sans-serif;letter-spacing:8px;text-shadow:3px 3px 0 #000}.warning-card h2{font-size:clamp(18px,4vw,26px);margin:14px 0 8px;color:#fff}.warning-card h2+p{font:12px 'Noto Sans JP',sans-serif;letter-spacing:2px}.warning-stripe{height:10px;margin-top:20px;background:repeating-linear-gradient(135deg,#fa2149 0,#fa2149 12px,#210f1a 12px,#210f1a 24px)}@keyframes warning-border{from{opacity:.5}to{opacity:1}}@keyframes warning-entry{from{transform:translateY(-12px);opacity:0}to{transform:translateY(0);opacity:1}}@media(orientation:landscape) and (max-height:550px){.warning-card{padding:12px 18px}.warning-card strong{font-size:64px}.warning-card h2{font-size:20px;margin:8px 0}.warning-card>p{font-size:10px}.warning-stripe{margin-top:10px}}@media(prefers-reduced-motion:reduce){.warning-frame,.warning-card{animation:none}}

/* Map camera controls. */
@media(min-width:701px){.game{grid-template-rows:auto auto auto auto minmax(0,1fr) auto}.map-tools{grid-column:1;grid-row:4}.field{grid-row:5}.game footer{grid-row:6}.game aside{grid-row:4 / 7}}
.map-tools{display:flex;align-items:center;gap:9px;padding:5px 12px;background:#20232d;border-bottom:1px solid #363b48;min-height:40px;flex-shrink:0;font-size:11px}.map-tools label{white-space:nowrap;color:#a9edf3;font-weight:700}.map-tools input{width:clamp(85px,13vw,190px);min-width:65px;height:28px;accent-color:#78dfec;cursor:pointer}.map-tools output{font:700 12px monospace;min-width:37px;color:#fff}.map-tools button{font-size:10px;padding:5px 9px;min-height:30px;border-color:#78dfec;color:#78dfec;border-radius:4px}.map-tools small{color:#9b9eac;font-size:10px}#detail[hidden]{display:none!important}.command-panel:has(#detail[hidden]):has(#sell[hidden]){display:none!important}
@media(max-width:700px) and (orientation:portrait){.map-tools{padding:2px 10px;gap:7px;min-height:38px}.map-tools input{flex:1;max-width:160px}.map-tools small{display:none}.map-tools button{min-height:32px}}
@media(orientation:landscape) and (max-height:550px){.game{grid-template-rows:auto auto auto auto minmax(0,1fr) auto}.map-tools{grid-column:1;grid-row:4;min-height:30px;padding:0 8px;gap:6px}.map-tools input{height:24px}.map-tools small{display:none}.map-tools button{min-height:24px;padding:2px 6px}.field{grid-row:5}.game footer{grid-row:6}.game aside{grid-row:4 / 7}}

/* Keep zoom controls beside the rules button. */
.stage-actions{display:flex;align-items:center;gap:12px;margin-left:auto;min-width:0}.stage-actions .map-tools{padding:0;background:transparent;border:0;min-height:34px;gap:7px;flex-shrink:1}.stage-actions .map-tools small{display:none}.stage-actions #rules-open{margin-left:0;flex-shrink:0}.stage-actions .map-tools input{width:clamp(80px,10vw,150px);min-width:50px}.stage-actions .map-tools label{font-size:11px}.stage-actions .map-tools button{white-space:nowrap}
@media(min-width:701px),(orientation:landscape) and (max-height:550px){.game{grid-template-rows:auto auto auto minmax(0,1fr) auto}.field{grid-row:4}.game footer{grid-row:5}.game aside{grid-row:4 / 6}}
@media(max-width:700px) and (orientation:portrait){.stage-strip{flex-wrap:wrap;gap:4px 10px}.stage-actions{flex-basis:100%;width:100%;gap:8px;justify-content:space-between}.stage-actions .map-tools{flex:1;min-width:0;gap:6px}.stage-actions .map-tools input{width:60px;min-width:40px;max-width:150px;flex:1}.stage-actions .map-tools label{font-size:10px}.stage-actions .map-tools output{font-size:11px;min-width:31px}.stage-actions .map-tools button{font-size:9px;padding:4px 6px;min-height:30px}.stage-actions #rules-open{min-height:30px;padding:4px 8px}}

/* Core collapse and defeat presentation. */
#game-over[hidden]{display:none}#game-over{position:absolute;inset:0;z-index:12;display:grid;place-items:center;overflow:hidden;background:#0c0812d9;color:#eeeae1;text-align:center;isolation:isolate}.defeat-vignette{position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 25%,#ef174458);box-shadow:inset 0 0 0 2px #fa214980;pointer-events:none}.defeat-scan{position:absolute;inset:0;opacity:.24;background:repeating-linear-gradient(0deg,transparent 0,transparent 3px,#ef174423 4px);pointer-events:none}.defeat-content{position:relative;width:100%;padding:12px 16px}.defeat-code{color:#ff6588;letter-spacing:4px;font:700 10px monospace;margin:9px 0}.defeat-content h2{font:900 clamp(42px,6vw,82px)/.95 'Barlow Condensed',Impact,sans-serif;letter-spacing:3px;margin:12px 0;text-shadow:4px 4px 0 #000}.defeat-content h2 em{color:#fa2149;font-style:italic}.defeat-sub{font-size:16px;font-weight:900;letter-spacing:6px;margin:14px 0;color:#fff}.defeat-content #defeat-record{font:11px monospace;letter-spacing:1px;color:#a7a2b4;margin:16px 0}#defeat-retry{display:inline-flex;align-items:center;justify-content:space-between;gap:35px;min-height:46px;padding:12px 24px;border:1px solid #ff7290;background:#fa2149;box-shadow:4px 4px 0 #0006;color:#fff;font-size:14px;font-weight:900}#defeat-retry:hover{background:#ff5275;color:#fff;border-color:#fff}#defeat-retry:focus-visible{outline:3px solid #78dfec;outline-offset:5px}
.broken-core{position:relative;width:72px;height:72px;margin:0 auto 18px;filter:drop-shadow(0 0 12px #fa2149)}.broken-core span,.broken-core b{position:absolute;inset:15px;background:#fa2149;transform:rotate(45deg);clip-path:polygon(0 0,100% 0,45% 45%,30% 100%,0 100%)}.broken-core b{clip-path:polygon(100% 0,100% 100%,0 100%,55% 55%);transform:translate(8px,6px) rotate(45deg);background:#ff91a7}.broken-core:after{content:'';position:absolute;inset:-18px;border:1px solid #fa214955;border-radius:50%}.broken-core i{position:absolute;left:34px;top:34px;width:4px;height:12px;background:#fa2149;transform:rotate(var(--angle)) translateY(calc(-1 * var(--distance)));opacity:.35}
.defeated .field:has(.defeat-animate){animation:defeat-shake .65s ease-out}.defeat-animate .defeat-vignette{animation:defeat-impact 1.1s ease-out both}.defeat-animate .defeat-content{animation:defeat-reveal .65s .15s ease-out both}.defeat-animate .broken-core i{animation:core-shards 1.1s var(--delay) ease-out both}.defeat-animate .broken-core:after{animation:core-shockwave 1.1s ease-out both}.defeat-animate h2{animation:defeat-title .5s .25s ease-out both}
@keyframes defeat-impact{0%{background:#ff4268aa;opacity:1}100%{background:#fa214900;opacity:1}}@keyframes defeat-shake{0%,100%{translate:0 0}15%{translate:-6px 2px}35%{translate:5px -3px}55%{translate:-3px 1px}75%{translate:2px -1px}}@keyframes defeat-reveal{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}@keyframes core-shards{from{opacity:1;transform:rotate(var(--angle)) translateY(0) scale(1.5)}to{opacity:.15;transform:rotate(var(--angle)) translateY(calc(-1 * var(--distance))) scale(.5)}}@keyframes core-shockwave{from{transform:scale(.25);opacity:1}to{transform:scale(2.4);opacity:0}}@keyframes defeat-title{from{letter-spacing:12px;opacity:0;filter:blur(3px)}to{letter-spacing:3px;opacity:1;filter:blur(0)}}
@media(max-width:700px) and (orientation:portrait){.defeat-content h2{font-size:58px}.defeat-sub{font-size:15px}#defeat-retry{min-height:52px;font-size:16px}}
@media(orientation:landscape) and (max-height:550px){.broken-core{width:42px;height:42px;margin-bottom:6px}.broken-core span,.broken-core b{inset:8px}.broken-core i{left:20px;top:20px}.defeat-code{font-size:8px;margin:4px 0;letter-spacing:2px}.defeat-content h2{font-size:42px;margin:6px 0}.defeat-sub{font-size:12px;margin:6px 0}.defeat-content #defeat-record{font-size:9px;margin:7px 0}#defeat-retry{min-height:36px;padding:7px 18px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.defeated .field:has(.defeat-animate),.defeat-animate *{animation:none!important}.broken-core i{display:none}}

/* Large recruit reveal, usable on desktop and phones. */
#recruit-reveal{width:min(700px,calc(100vw - 24px));max-height:90dvh;padding:0;background:#181b24;color:#eeeae1;border:1px solid #f76387;border-radius:14px;box-shadow:0 20px 90px #000c;overflow:auto}#recruit-reveal::backdrop{background:#070a13bf;backdrop-filter:blur(5px)}.reveal-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 20px;border-bottom:1px solid #453341;font:700 11px monospace;letter-spacing:1px;color:#ff819e}.reveal-heading button{min-height:38px;padding:7px 11px;font-size:12px;letter-spacing:0;border-radius:5px}.reveal-card{text-align:center;padding:20px 20px 16px;position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 40%,#78dfec17,transparent 70%);animation:recruit-card-in .5s ease-out both}.reveal-card.rare{background:radial-gradient(ellipse at 50% 40%,#f4d38a24,transparent 70%)}.reveal-status{margin:0 0 10px;color:#78dfec;font:900 17px monospace;letter-spacing:3px}.rare .reveal-status{color:#ffe16d}.reveal-portrait{width:110px;height:120px;margin:0 auto 10px;filter:drop-shadow(0 0 18px currentColor)}.reveal-portrait svg{display:block;width:100%;height:100%}.reveal-rarity{color:#a2a6b4;font:10px monospace;letter-spacing:2px;margin:8px}.rare .reveal-rarity{color:#f4d38a}.reveal-card h2{font-size:34px;margin:8px 0;line-height:1.4}.reveal-card h2 span{color:#c3b3ff;font:700 18px monospace;margin-left:8px}.reveal-role{font-size:14px;color:#b7bac5;margin:12px 0}.reveal-element{margin:5px 0}.reveal-gain{font-size:14px;color:#78dfec;font-weight:700;padding:12px;margin:16px auto 0;background:#78dfec0b;border:1px solid #78dfec33;max-width:440px;border-radius:6px}.reveal-actions{display:flex;gap:12px;padding:0 20px 12px}.reveal-actions button{flex:1;min-height:50px;padding:10px;font-size:15px;border-radius:7px;font-weight:900}#recruit-again{background:#fa2149;border-color:#ff7391;color:#fff}.reveal-footnote{font-size:10px;line-height:1.7;color:#8f93a3;text-align:center;margin:0;padding:0 15px 14px}.gacha-rate-list{color:#f4d38a!important}#recruit-reveal button:focus-visible{outline:3px solid #78dfec;outline-offset:3px}
@keyframes recruit-card-in{from{opacity:0;transform:translateY(20px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:700px){.reveal-heading{padding:10px 12px;font-size:9px}.reveal-card{padding:16px 12px 12px}.reveal-card h2{font-size:30px}.reveal-status{font-size:14px;letter-spacing:2px}.reveal-gain{font-size:12px}.reveal-actions{padding:0 12px 12px;gap:8px}.reveal-actions button{font-size:13px;min-height:50px}.reveal-footnote{font-size:9px}}
@media(orientation:landscape) and (max-height:550px){#recruit-reveal{width:min(680px,96vw);max-height:96dvh}.reveal-heading{padding:5px 14px}.reveal-heading button{min-height:30px;padding:4px 9px}.reveal-card{padding:8px 16px;display:grid;grid-template-columns:120px 1fr;column-gap:15px;align-items:center}.reveal-portrait{grid-column:1;grid-row:1 / 7;width:95px;height:104px;margin:auto}.reveal-status,.reveal-rarity,.reveal-card h2,.reveal-element,.reveal-role,.reveal-gain{grid-column:2;margin:3px 0}.reveal-card h2{font-size:25px}.reveal-status{font-size:12px}.reveal-role,.reveal-gain{font-size:11px}.reveal-gain{padding:7px;max-width:none}.reveal-actions{padding:5px 16px 8px}.reveal-actions button{min-height:36px;padding:6px;font-size:12px}.reveal-footnote{padding-bottom:6px;font-size:9px}}
@media(prefers-reduced-motion:reduce){.reveal-card{animation:none}}

#stage-energy-guide{width:min(490px,calc(100vw - 28px));max-height:90dvh;overflow:auto;border:1px solid #78dfec;border-radius:14px;background:#1b202b;color:#eeeae1;text-align:center;padding:28px 24px;box-shadow:0 20px 90px #000b}#stage-energy-guide::backdrop{background:#060a14bf;backdrop-filter:blur(4px)}#stage-energy-guide>small{font:10px monospace;color:#78dfec;letter-spacing:3px}#stage-energy-guide h2{font:900 40px 'Barlow Condensed',Impact,sans-serif;color:#78dfec;margin:10px 0 20px}#stage-energy-guide p{font-size:13px;line-height:1.9;color:#b3bac9}#stage-energy-guide .stage-energy-lead{font-size:21px;line-height:1.6;font-weight:900;color:#fff;margin:10px 0}#stage-energy-value{display:block;font:900 36px 'Barlow Condensed',Impact,sans-serif;color:#ffe16d;margin:15px 0}#stage-energy-guide>div{display:flex;gap:9px;margin-top:20px}#stage-energy-guide button{flex:1;min-height:48px;border-radius:6px;font-size:13px;font-weight:900;padding:10px 8px}#stage-energy-recruit{background:#fa2149;border-color:#ff7290;color:white}#stage-energy-guide .stage-energy-note{font-size:10px;margin:13px 0 0}#stage-energy-guide button:focus-visible{outline:3px solid #ffe16d;outline-offset:3px}
@media(orientation:landscape) and (max-height:550px){#stage-energy-guide{padding:12px 22px;max-height:96dvh}#stage-energy-guide h2{font-size:28px;margin:5px}#stage-energy-guide .stage-energy-lead{font-size:16px;line-height:1.4;margin:5px}#stage-energy-value{font-size:26px;margin:6px}#stage-energy-guide p{font-size:11px;line-height:1.5;margin:6px}#stage-energy-guide>div{margin-top:10px}#stage-energy-guide button{min-height:38px}}

/* Desktop placement opens a full roster picker. */
#deploy-picker{width:min(940px,calc(100vw - 32px));max-height:88dvh;padding:0;overflow:hidden;background:#1b1e28;color:#eeeae1;border:1px solid #78dfec;border-radius:14px;box-shadow:0 20px 90px #000b}#deploy-picker[open]{display:flex;flex-direction:column}#deploy-picker::backdrop{background:#060a14bf;backdrop-filter:blur(4px)}.deploy-picker-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:18px 22px;border-bottom:1px solid #3d4354;background:#222532;flex-shrink:0}.deploy-picker-heading small{color:#78dfec;font:700 10px monospace;letter-spacing:3px}.deploy-picker-heading h2{font-size:23px;margin:4px 0 0;line-height:1.4}.deploy-picker-heading button{font-size:12px;min-height:40px;padding:8px 14px;border-radius:6px;white-space:nowrap}#deploy-picker-hint{font-size:12px;line-height:1.8;color:#b2b8c9;padding:0 22px;margin:14px 0;flex-shrink:0}#deploy-picker-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-height:0;overflow-y:auto;padding:0 22px 18px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#78dfec #222532}#deploy-picker-cards .card{display:flex;gap:10px;align-items:center;min-height:112px;max-width:100%;margin:0;padding:14px 10px;flex-wrap:nowrap;border-radius:8px}#deploy-picker-cards .card .icon{display:block;width:42px;height:49px;flex-shrink:0}#deploy-picker-cards .card svg{width:100%;height:100%}#deploy-picker-cards .card>span:nth-child(2){min-width:0}#deploy-picker-cards .card strong{font-size:15px;line-height:1.6}#deploy-picker-cards .card small{display:block;font-size:10px;line-height:1.6}#deploy-picker-cards .card b{flex-shrink:0;font-size:22px}#deploy-picker-cards .card em{font-size:11px}#deploy-picker-cards .card .element-tag{font-size:9px}#deploy-picker-cards .card.locked{opacity:.45}#deploy-picker-cards .card.locked .icon{opacity:.5}#deploy-picker-cards .card.locked em{font-size:10px}.deploy-picker-footer{flex-shrink:0;padding:12px 22px;margin:0;border-top:1px solid #3d4354;color:#858fa7;font-size:11px;line-height:1.6}#deploy-picker button:focus-visible{outline:3px solid #78dfec;outline-offset:3px}
@media(max-width:850px){#deploy-picker-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.deploy-picker-heading{padding:12px 16px}.deploy-picker-heading h2{font-size:20px}#deploy-picker-hint{padding:0 16px;font-size:11px}#deploy-picker-cards{padding:0 16px 14px;gap:9px}#deploy-picker-cards .card{min-height:96px}.deploy-picker-footer{padding:10px 16px}}
@media(orientation:landscape) and (max-height:550px){#deploy-picker{max-height:94dvh}.deploy-picker-heading{padding:8px 14px}.deploy-picker-heading h2{font-size:19px}.deploy-picker-heading small{font-size:8px}#deploy-picker-hint{margin:8px 0}#deploy-picker-cards .card{min-height:82px;padding:10px}.deploy-picker-footer{padding:7px 14px}}

/* Gacha fits within the viewport, with actions always visible. */
#recruit-reveal{width:min(760px,calc(100vw - 24px));height:min(600px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);overflow:hidden}#recruit-reveal[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto}#recruit-reveal .reveal-heading{min-height:0;padding:10px 18px}#recruit-reveal-body{min-height:0;overflow:hidden;display:flex;flex-direction:column}#recruit-reveal .reveal-card{width:100%;flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:clamp(3px,1dvh,9px);padding:10px 16px}#recruit-reveal .reveal-status{font-size:clamp(12px,2.3dvh,17px);margin:0}#recruit-reveal .reveal-portrait{width:clamp(48px,15dvh,110px);height:clamp(52px,17dvh,120px);margin:0}#recruit-reveal .reveal-rarity{font-size:10px;margin:0}#recruit-reveal .reveal-card h2{font-size:clamp(22px,4.3dvh,34px);margin:0}#recruit-reveal .reveal-element,#recruit-reveal .reveal-role{margin:0;font-size:12px}#recruit-reveal .reveal-gain{margin:3px 0 0;padding:9px 12px;width:100%;font-size:12px}#recruit-reveal .reveal-actions{flex-shrink:0;padding:8px 16px 10px;gap:10px}#recruit-reveal .reveal-actions button{min-height:44px;padding:8px;font-size:14px}#recruit-reveal .reveal-footnote{padding:0 16px 10px;font-size:9px;line-height:1.5}
.recruit-menu{display:flex;flex-direction:column;gap:10px;min-height:0;height:100%;padding:12px 18px 4px}.recruit-menu-intro{text-align:center;flex-shrink:0}.recruit-menu-intro h2{font-size:25px;margin:0 0 4px}.recruit-menu-intro p{font-size:12px;color:#b6b6ca;margin:0}.gacha-pool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:8px;min-height:0;flex:1}.gacha-pool-card{display:grid;grid-template-columns:36px minmax(0,1fr) auto;grid-template-rows:1fr auto;align-items:center;column-gap:7px;background:#252936;border:1px solid #5f566f;border-radius:7px;padding:8px;min-width:0;min-height:0}.pool-portrait{display:block;grid-row:1 / 3;max-height:54px;height:100%;min-height:0}.pool-portrait svg{height:100%;width:100%}.gacha-pool-card strong{font-size:13px;white-space:nowrap}.gacha-pool-card b{font:700 14px monospace;color:#ffe16d}.gacha-pool-card small{font-size:9px;color:#b3a2c9;grid-column:2 / 4}.gacha-pool-card.unowned{background:#1b1e28;border-color:#3f394a}.gacha-pool-card.unowned .pool-portrait{opacity:.55}.recruit-menu-note{flex-shrink:0;font-size:10px;color:#8994a7;text-align:center;margin:0}
@media(max-width:700px){#recruit-reveal .reveal-heading{padding:8px 12px}#recruit-reveal .reveal-card{padding:10px 12px}#recruit-reveal .reveal-actions{padding:6px 12px 9px}.recruit-menu{padding:10px 10px 2px;gap:8px}.recruit-menu-intro h2{font-size:21px}.recruit-menu-intro p{font-size:10px}.gacha-pool-grid{gap:6px}.gacha-pool-card{grid-template-columns:1fr auto;grid-template-rows:minmax(0,1fr) auto auto;text-align:center;gap:3px;padding:6px}.pool-portrait{grid-row:1;grid-column:1 / 3;max-height:56px;height:100%;width:100%;margin:auto}.gacha-pool-card strong{font-size:11px;grid-column:1;grid-row:2}.gacha-pool-card b{font-size:11px;grid-column:2;grid-row:2}.gacha-pool-card small{font-size:8px;grid-column:1 / 3;grid-row:3}.recruit-menu-note{font-size:9px}}
@media(max-height:550px){#recruit-reveal{width:min(740px,calc(100vw - 18px));height:calc(100dvh - 18px);max-height:calc(100dvh - 18px)}#recruit-reveal .reveal-heading{padding:4px 12px}#recruit-reveal .reveal-heading button{min-height:30px;padding:4px 9px}#recruit-reveal .reveal-card{display:grid;grid-template-columns:100px minmax(0,1fr);grid-template-rows:repeat(6,minmax(0,auto));column-gap:12px;row-gap:2px;padding:6px 14px;text-align:center;align-content:center}#recruit-reveal .reveal-portrait{grid-column:1;grid-row:1 / 7;width:90px;height:100px}#recruit-reveal .reveal-status,#recruit-reveal .reveal-rarity,#recruit-reveal .reveal-card h2,#recruit-reveal .reveal-element,#recruit-reveal .reveal-role,#recruit-reveal .reveal-gain{grid-column:2;margin:0}#recruit-reveal .reveal-card h2{font-size:25px}#recruit-reveal .reveal-status{font-size:12px}#recruit-reveal .reveal-gain{font-size:10px;padding:5px}#recruit-reveal .reveal-role{font-size:10px}#recruit-reveal .reveal-actions{padding:4px 12px 6px}#recruit-reveal .reveal-actions button{min-height:36px;padding:5px;font-size:12px}#recruit-reveal .reveal-footnote{padding-bottom:5px;font-size:8px}.recruit-menu{gap:4px;padding:5px 12px}.recruit-menu-intro{display:flex;justify-content:center;align-items:center;gap:12px}.recruit-menu-intro h2{font-size:17px;margin:0}.recruit-menu-intro p{font-size:10px}.recruit-menu-note{font-size:9px}.gacha-pool-grid{gap:4px}.gacha-pool-card{padding:4px;grid-template-columns:26px minmax(0,1fr) auto;grid-template-rows:1fr auto;column-gap:5px}.pool-portrait{grid-row:1 / 3;grid-column:1;width:26px;height:100%;max-height:36px}.gacha-pool-card strong{grid-row:1;grid-column:2;font-size:11px}.gacha-pool-card b{grid-row:1;grid-column:3;font-size:11px}.gacha-pool-card small{grid-row:2;grid-column:2 / 4;font-size:8px}}

/* All-out barrage: cut-in, target locks, tracer beams and shockwaves. */
#burst-effect[hidden]{display:none}#burst-effect{position:absolute;inset:0;z-index:10;overflow:hidden;pointer-events:none;isolation:isolate}.barrage-flash{position:absolute;inset:0;background:radial-gradient(ellipse at center,#ffdfb063,#fa214934 55%,#11162600);animation:barrage-flash 1s ease-out both}.barrage-frame{position:absolute;inset:5px;border:2px solid #78dfec;box-shadow:inset 0 0 40px #fa214966,0 0 20px #78dfec66;animation:barrage-fade 1.3s ease-out both}.barrage-streaks{position:absolute;inset:-50%;background:repeating-linear-gradient(155deg,transparent 0,transparent 50px,#78dfec77 51px,#78dfec00 53px,transparent 90px,#fa214955 91px,transparent 95px);animation:barrage-streaks .65s ease-out both}.barrage-band{position:absolute;left:-8%;right:-8%;top:33%;padding:10px 15%;background:linear-gradient(100deg,#200d23ed,#fa2149ef 55%,#640e35ed);border-top:2px solid #ff8ca5;border-bottom:2px solid #78dfec;box-shadow:0 8px 50px #000b;transform:rotate(-6deg);animation:barrage-cut-in 1.3s cubic-bezier(.2,.7,.2,1) both}.barrage-band small{display:block;font:800 9px monospace;letter-spacing:2px;color:#baffff}.barrage-band strong{display:block;font:900 clamp(30px,5.6cqw,68px)/1.1 'Noto Sans JP',sans-serif;letter-spacing:8px;color:white;text-shadow:4px 4px 0 #220c25;margin:7px 0;white-space:nowrap}.barrage-band span{display:block;font:900 clamp(14px,2.6cqw,28px) 'Barlow Condensed',Impact,sans-serif;letter-spacing:5px;color:#ffdb7d}.barrage-lock{position:absolute;width:clamp(30px,6cqw,65px);aspect-ratio:1;border:2px solid #78dfec;border-radius:50%;box-shadow:0 0 20px #78dfec88;animation:barrage-lock 1s ease-out both}.barrage-lock:before,.barrage-lock:after{content:'';position:absolute;background:#78dfec}.barrage-lock:before{width:140%;height:1px;left:-20%;top:50%}.barrage-lock:after{height:140%;width:1px;top:-20%;left:50%}.lock-a{top:20%;left:17%}.lock-b{bottom:15%;left:48%;animation-delay:.08s}.lock-c{top:18%;right:13%;animation-delay:.16s}.field:has(#burst-effect:not([hidden])){animation:barrage-shake .35s ease-out}
@keyframes barrage-cut-in{0%{opacity:0;translate:-110% 0}14%,65%{opacity:1;translate:0 0}100%{opacity:0;translate:110% 0}}@keyframes barrage-streaks{from{opacity:0;translate:-25% 15%}25%{opacity:1}to{opacity:0;translate:25% -15%}}@keyframes barrage-flash{0%{opacity:.85}35%{opacity:.25}100%{opacity:0}}@keyframes barrage-fade{0%,60%{opacity:1}100%{opacity:0}}@keyframes barrage-lock{0%{scale:2;opacity:0;rotate:-40deg}25%,55%{scale:1;opacity:1;rotate:0deg}100%{scale:1.5;opacity:0}}@keyframes barrage-shake{0%,100%{translate:0 0}20%{translate:-5px 2px}45%{translate:4px -2px}70%{translate:-2px 1px}}
@media(max-width:700px) and (orientation:portrait){.barrage-band{top:38%;padding-top:16px;padding-bottom:16px}.barrage-band strong{font-size:42px;letter-spacing:6px}.barrage-band small{font-size:8px;letter-spacing:1px}.barrage-band span{font-size:20px;letter-spacing:3px}}
@media(prefers-reduced-motion:reduce){.field:has(#burst-effect:not([hidden])),#burst-effect *{animation:none!important}.barrage-flash,.barrage-streaks,.barrage-lock{display:none}.barrage-band{transform:none;top:35%;opacity:.9}}

/* Roster cards show ownership without probability labels. */
.gacha-pool-card{grid-template-columns:36px minmax(0,1fr)}.gacha-pool-card small{grid-column:2}
@media(max-width:700px){.gacha-pool-card{grid-template-columns:1fr}.pool-portrait{grid-column:1}.gacha-pool-card strong{grid-column:1}.gacha-pool-card small{grid-column:1}}
@media(max-height:550px){.gacha-pool-card{grid-template-columns:26px minmax(0,1fr)}.pool-portrait{grid-column:1}.gacha-pool-card strong{grid-column:2}.gacha-pool-card small{grid-column:2}}

/* Longer visual/sound sequence; the skill remains 65 damage and 6 seconds. */
.barrage-band,.barrage-frame{animation-duration:2.8s}.barrage-flash{animation-duration:1.8s}.barrage-lock{animation-duration:2.2s}.barrage-streaks{animation-duration:1.2s;animation-iteration-count:2}

.gacha-pool-card.summoned{border-color:#78dfec;background:#283943;box-shadow:inset 0 0 0 1px #78dfec55,0 0 16px #78dfec22;animation:summoned-card .65s ease-out}.gacha-pool-card.summoned small{color:#78dfec;font-weight:900}.recruit-menu-note{line-height:1.5;color:#b0dbe0}
@keyframes summoned-card{from{box-shadow:inset 0 0 0 2px #fff,0 0 25px #78dfec88}to{box-shadow:inset 0 0 0 1px #78dfec55,0 0 16px #78dfec22}}
@media(prefers-reduced-motion:reduce){.gacha-pool-card.summoned{animation:none}}

/* Prominent gacha action and explicit per-pull confirmation. */
.squad-tabs #recruit-tab{background:#b89aff;color:#21132f;border-color:#e4d5ff;box-shadow:inset 0 -3px #7653ac,0 0 16px #b89aff22;font-weight:900}.squad-tabs #recruit-tab:hover:not(:disabled){background:#dbc7ff;color:#21132f;border-color:#fff}#recruit-tab:focus-visible{outline:3px solid #78dfec;outline-offset:3px}#recruit-again{background:#b89aff;color:#21132f;border-color:#e4d5ff}#recruit-again:hover:not(:disabled){background:#dbc7ff;color:#21132f}
#gacha-confirm{width:min(400px,calc(100vw - 28px));max-height:90dvh;padding:24px;background:#20212e;color:#eeeae1;border:1px solid #cbb5ff;border-radius:14px;box-shadow:0 18px 80px #000c;text-align:center}#gacha-confirm::backdrop{background:#080a14b8;backdrop-filter:blur(4px)}#gacha-confirm>small{font:10px monospace;letter-spacing:3px;color:#cbb5ff}#gacha-confirm h2{font-size:21px;margin:12px 0 18px;line-height:1.4}#gacha-confirm-cost{font:900 32px 'Barlow Condensed',Impact,sans-serif;color:#e2d2ff}#gacha-confirm-balance{font-size:12px;color:#acb0c4;margin:12px 0 20px}#gacha-confirm>div{display:flex;gap:10px}#gacha-confirm button{flex:1;min-height:46px;border-radius:7px;font-size:13px;font-weight:900;padding:9px 8px}#gacha-confirm-yes{background:#b89aff;color:#21132f;border-color:#e4d5ff}#gacha-confirm button:focus-visible{outline:3px solid #78dfec;outline-offset:3px}
@media(max-height:420px){#gacha-confirm{padding:14px 22px}#gacha-confirm h2{font-size:18px;margin:7px 0}#gacha-confirm-cost{font-size:26px}#gacha-confirm-balance{margin:7px 0 12px}#gacha-confirm button{min-height:36px}}

/* A desktop ad occupies only the spare map margin, outside the playable canvas. */
.game{position:relative}
.game>.left-ad{position:absolute;z-index:3;padding:0;margin:0;background:#14171e;border:0;color:#959ba9;text-align:center}
.game>.left-ad[hidden]{display:none!important}
.left-ad-label{display:block;height:22px;font:10px/22px 'Noto Sans JP',sans-serif;letter-spacing:2px}
#left-ad-unit{display:block;margin:0}
.field[data-left-ad-active="true"] canvas{left:auto;right:0;transform:translateY(-50%)}
.field[data-left-ad-active="true"] .maplabel{left:calc(100% - var(--left-ad-board-width) + 10px)}
.field[data-left-ad-active="true"] #banner{left:calc(100% - var(--left-ad-board-width));width:var(--left-ad-board-width)}
.field[data-left-ad-active="true"] #burst-effect,.field[data-left-ad-active="true"] #game-over{left:auto;right:0;width:var(--left-ad-board-width)}
@media(max-width:1000px),(max-height:550px){.game>.left-ad{display:none!important}}

/* The final victory keeps the playfield and the separate ad rail in their own bounds. */
#banner.clear-banner{color:#eeeae1;font-weight:900;font-size:clamp(28px,5vw,68px);letter-spacing:2px;text-shadow:3px 3px 0 #fa2149,-1px -1px 0 #78dfec,0 8px 24px #000;animation:clear-banner-in .7s cubic-bezier(.16,1,.3,1) both}
#banner.clear-banner span{color:#78dfec;font-weight:800;font-size:clamp(11px,1.3vw,16px);letter-spacing:2px;text-shadow:0 2px 12px #000}
@keyframes clear-banner-in{from{opacity:0;filter:blur(8px);transform:translateY(20px) scale(.86)}to{opacity:1;filter:blur(0);transform:translateY(0) scale(1)}}
@media(max-width:700px){#banner.clear-banner{font-size:clamp(28px,7vw,44px);letter-spacing:0}#banner.clear-banner span{font-size:11px;letter-spacing:1px}}
@media(prefers-reduced-motion:reduce){#banner.clear-banner{animation:none;text-shadow:2px 2px 0 #fa2149,0 4px 16px #000}}

/* Owned units with insufficient ENERGY remain distinct from unowned units. */
#cards .card.unaffordable:disabled,#cards .card.unaffordable:disabled:hover{opacity:1;background:#191c23;border-color:#343944;box-shadow:none;cursor:not-allowed;color:#858b99}
#cards .card.unaffordable .icon{filter:grayscale(1);opacity:.28}
#cards .card.unaffordable strong{color:#858b99}
#cards .card.unaffordable small,#cards .card.unaffordable em{color:#727988}
#cards .card.unaffordable b{color:#ff829a}
.placement-unavailable{display:inline-block;margin:3px 0 0 3px;padding:1px 4px;border:1px solid #ff829a66;border-radius:3px;background:#fa214917;color:#ff9aad;font-size:10px;line-height:1.5;vertical-align:middle;white-space:nowrap}
#mobile-barrier,#mobile-burst,.mobile-burst-meter{display:none}
@media(max-width:700px) and (orientation:portrait){
 .game{padding-bottom:64px}
 .game footer{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px 54px;grid-template-rows:14px 48px;gap:3px 6px;min-height:72px;padding:3px 8px 4px}
 .game footer>#message{display:block;grid-column:1 / -1;grid-row:1;min-width:0;height:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;line-height:14px}
 .game footer>button{grid-row:2;min-width:0;min-height:44px;padding:4px;line-height:1.2}
 .game footer #mobile-barrier,.game footer #mobile-burst{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:8px;font-size:clamp(12px,3.5vw,15px);font-weight:900;letter-spacing:0;white-space:nowrap}
 #mobile-barrier{grid-column:1;background:#15323e;border-color:#78dfec;color:#b8f7ff}
 #mobile-burst{grid-column:2;background:#3c2830;border-color:#f4d38a;color:#ffe5a3}
 .game footer .mobile-skill-shortcut small{font-size:10px;font-weight:700;line-height:1}
 .game footer .mobile-skill-shortcut:disabled{opacity:.55;filter:saturate(.55)}
 #mobile-barrier.is-ready{background:#78dfec;color:#12202b;box-shadow:0 0 12px #78dfec33}
 #mobile-burst.is-ready{background:#f4d38a;color:#352323;box-shadow:0 0 12px #f4d38a33}
 .game footer>#speed{grid-column:3;font-size:10px}
 .game footer>#pause{grid-column:4;font-size:10px;white-space:normal}
 #skills-tab{display:none!important}
 .mobile-burst-meter{display:flex;flex:1;min-width:0;min-height:48px;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:3px;background:#111a23;border:1px solid #78dfec55;border-radius:8px;color:#78dfec}
 .mobile-burst-meter small{font:8px monospace;letter-spacing:.4px}
 .mobile-burst-meter output{font:800 15px monospace;color:#e6fbff;white-space:nowrap}
 .mobile-burst-meter>span{display:block;width:80%;height:3px;background:#353943}
 #mobile-energybar{display:block;height:3px;width:0;background:#78dfec;transition:width .2s}
 body[data-mobile-panel='deploy'] #deploy-pane,body[data-mobile-panel='recruit'] #recruit-pane,body[data-mobile-panel='skills'] .combat-actions{bottom:calc(144px + env(safe-area-inset-bottom,0px))}
 body[data-mobile-panel='deploy'] .command-panel{bottom:calc(154px + env(safe-area-inset-bottom,0px))}
 #mobile-close{bottom:calc(144px + env(safe-area-inset-bottom,0px) + min(52dvh,400px) - 42px)}
 body[data-mobile-panel='skills'] #mobile-close{bottom:calc(298px + env(safe-area-inset-bottom,0px))}
}
@media(orientation:landscape) and (max-height:550px){
 .combat-actions .skills button{min-height:36px;font-size:13px;font-weight:800;border-radius:6px}
 .combat-actions .skills small{font-size:10px}
 #barrier:not(:disabled){background:#78dfec;color:#12202b;border-color:#b8f7ff}
 #burst:not(:disabled){background:#f4d38a;color:#352323;border-color:#ffe5a3}
}

/* Keep the full currency name readable beside deployment costs. */
.card b:before{content:'ENERGY';display:block;font-size:8px;line-height:1.2;letter-spacing:.3px}

/* Skill readiness stays visible in every layout. */
#barrier:not(:disabled){background:#78dfec;color:#12202b;border-color:#c4faff;box-shadow:0 0 13px #78dfec44;font-weight:900}
#burst:not(:disabled){background:#f4d38a;color:#352323;border-color:#fff0ba;box-shadow:0 0 13px #f4d38a44;font-weight:900}
#barrier:disabled,#burst:disabled{background:#1a202b;color:#858b99;border-color:#3c4250;box-shadow:none}
#recruit-balance{display:block;flex-shrink:0;min-width:0;text-align:center;padding:12px 16px;color:#fff2bd;background:linear-gradient(100deg,#49341e,#302630);border-bottom:2px solid #f4d38a;font:900 34px/1.25 'Noto Sans JP',sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.3px;text-shadow:0 2px 0 #0008;overflow-wrap:anywhere}
#recruit-reveal[open]{grid-template-rows:auto auto minmax(0,1fr) auto auto}
@media(max-width:700px){#recruit-balance{font-size:30px;padding:12px 10px}}
@media(max-height:550px){#recruit-balance{font-size:24px;padding:6px 10px}}

/* Confirm the final wave while the intermission remains available for preparation. */
#final-wave-confirm{width:min(480px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto;padding:26px 22px;border:2px solid #fa5474;border-radius:14px;background:#1d202b;color:#eeeae1;text-align:center;box-shadow:0 20px 90px #000c}
#final-wave-confirm::backdrop{background:#080a14c9;backdrop-filter:blur(5px)}
#final-wave-stage{font:800 13px monospace;letter-spacing:2px;color:#ff829a}
#final-wave-confirm h2{font-size:23px;line-height:1.5;margin:12px 0}
#final-wave-boss{font-size:13px;line-height:1.8;color:#c0c8d8}
#final-wave-confirm .final-wave-caution{font-size:15px;line-height:1.6;color:#ffddb0;background:#fa214912;padding:12px;border:1px solid #fa547455;border-radius:7px;margin:16px 0}
#final-wave-confirm>div{display:flex;gap:10px}
#final-wave-confirm button{flex:1;min-height:48px;padding:10px 8px;font-size:14px;font-weight:900;border-radius:7px}
#final-wave-yes{background:#fa2149;border-color:#ff829a;color:#fff}
#final-wave-confirm button:focus-visible{outline:3px solid #78dfec;outline-offset:3px}
@media(max-width:400px){#final-wave-confirm{padding:20px 14px}#final-wave-confirm h2{font-size:20px}#final-wave-confirm button{font-size:12px}}
@media(max-height:550px){#final-wave-confirm{padding:14px 20px}#final-wave-confirm h2{font-size:20px;margin:7px 0}#final-wave-boss{margin:6px 0;font-size:12px}#final-wave-confirm .final-wave-caution{margin:10px 0;padding:6px}#final-wave-confirm button{min-height:40px;font-size:13px}}

/* A ready special has a bright fill, a lit frame and an explicit label. */
#barrier.is-ready,#mobile-barrier.is-ready{opacity:1;background:#78f4ed;color:#0b242b;border:2px solid #dbfffd;box-shadow:0 0 0 2px #78dfec66,0 0 18px #78dfec99;animation:skill-ready-glow 1.2s ease-in-out infinite alternate}
#burst.is-ready,#mobile-burst.is-ready{opacity:1;background:#ffd34f;color:#30200a;border:2px solid #fff4c6;box-shadow:0 0 0 2px #ffd34f77,0 0 20px #ffd34fbb;animation:skill-ready-glow 1.2s ease-in-out infinite alternate}
.skills button small,.game footer .mobile-skill-shortcut small{display:block;white-space:nowrap;font-size:10px;font-weight:900;line-height:1.15}
.skills button.is-ready small,.game footer .mobile-skill-shortcut.is-ready small{color:#102331;background:#ffffffc9;border-radius:3px;padding:2px 4px;max-width:85px;margin:3px auto 0;font-weight:900}
.game footer .mobile-skill-shortcut.is-ready small{margin:0;padding:1px 4px}
@keyframes skill-ready-glow{to{box-shadow:0 0 0 3px #ffffff88,0 0 26px #ffffff99}}
@media(orientation:landscape) and (max-height:550px){.skills button.is-ready small{margin-top:2px;padding:1px 4px}.skills button small{font-size:9px}}
@media(prefers-reduced-motion:reduce){#barrier.is-ready,#mobile-barrier.is-ready,#burst.is-ready,#mobile-burst.is-ready{animation:none}}

/* Give each stage boss a prominent name above its ability description. */
#final-wave-confirm h2{font:900 40px/1.2 'Noto Sans JP',sans-serif;color:#ffe6a3;letter-spacing:1px;margin:12px 0 16px;text-shadow:0 2px 0 #0008,0 0 16px #fa214944;overflow-wrap:anywhere}
@media(max-width:400px){#final-wave-confirm h2{font-size:30px;letter-spacing:.4px;margin:10px 0 14px}}
@media(max-height:550px){#final-wave-confirm h2{font-size:30px;line-height:1.1;margin:6px 0 8px}}

/* Keep readiness and exact gauge cost visible together, including narrow phones. */
.skills button.is-ready small,.game footer .mobile-skill-shortcut.is-ready small{display:flex;align-items:baseline;justify-content:center;gap:5px;max-width:none;padding:2px 4px}
.skills .skill-ready-state,.game footer .skill-ready-state,.skills .skill-cost,.game footer .skill-cost{flex:0 0 auto;color:#102331;font:900 11px/1.2 'Noto Sans JP',sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}
.game footer .mobile-skill-shortcut.is-ready small{gap:3px;margin:0;padding:1px}
.game footer .skill-ready-state,.game footer .skill-cost{font-size:10px}
@media(max-width:360px) and (orientation:portrait){.game footer{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 36px 44px}.game footer .skill-ready-state,.game footer .skill-cost{font-size:9.5px}}
@media(orientation:landscape) and (max-height:550px){.skills button.is-ready small{gap:3px;padding:1px 2px}.skills .skill-ready-state,.skills .skill-cost{font-size:10px}}
@media(max-width:700px) and (orientation:portrait){main{grid-template-columns:minmax(0,1fr)}.game{min-width:0;width:100%}.game>.arenahead,.game>.stage-strip,.game>.stats,.game>footer{min-width:0}.stage-actions .map-tools input{min-width:0}}
@media(max-width:360px) and (orientation:portrait){.game .stage-actions #install-open{font-size:0;padding:4px 6px}.game .stage-actions #install-open:after{content:'＋ アプリ';font-size:10px}}

#stage-energy-next[hidden],#stage-energy-recruit[hidden]{display:none!important}

/* Whole-game scaling; map world coordinates remain unchanged. */
body:has(#map-zoom) dialog{max-width:calc(100vw / var(--screen-zoom,1) - 24px)!important;max-height:calc(100dvh / var(--screen-zoom,1) - 24px)!important}body:has(#map-zoom) .nr-ending{width:calc(100vw / var(--screen-zoom,1));height:calc(100dvh / var(--screen-zoom,1));max-width:none!important;max-height:none!important}body:has(#map-zoom) .nr-ending .ending-content{min-height:calc(100dvh / var(--screen-zoom,1))}

@media(min-width:701px){html:has(body[data-screen-enlarged='true']),body[data-screen-enlarged='true']{overflow:auto;height:auto}body[data-screen-enlarged='true'] main{min-height:100dvh}}
@media(max-width:700px) and (orientation:portrait){body[data-screen-enlarged='true'] .stage-actions{flex-wrap:wrap;gap:6px}body[data-screen-enlarged='true'] .stage-actions .map-tools{flex:1 0 100%;width:100%}body[data-screen-enlarged='true'] .stage-actions #rules-open,body[data-screen-enlarged='true'] .stage-actions #install-open{flex:1;white-space:nowrap}body[data-screen-enlarged='true'] #mobile-barrier,body[data-screen-enlarged='true'] #mobile-burst{font-size:12px;white-space:normal;line-height:1.3}body[data-screen-enlarged='true'] aside>.squad-tabs{right:88px}body[data-screen-enlarged='true'] aside>.squad-tabs button{font-size:12px;padding-inline:2px;white-space:nowrap}body[data-screen-enlarged='true'] #start{width:76px;font-size:12px;padding-inline:3px}body[data-screen-enlarged='true'] .mobile-burst-meter output{font-size:12px}}

/* Four readable roster rows; remaining agents scroll inside the list. */
#cards{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;grid-auto-rows:calc((100% - 24px) / 4);gap:8px!important;flex:1;min-height:0;overflow-y:auto!important;overflow-x:hidden;align-content:start;scrollbar-width:thin;scrollbar-color:#78dfec #20232d;overscroll-behavior:contain}#cards .card{height:100%;min-height:0!important;margin:0;padding:8px 10px;gap:9px;border-radius:7px;overflow:hidden}#cards .card .icon{width:38px;height:44px;flex-shrink:0}#cards .card>span:nth-child(2){min-width:0;flex:1}#cards .card strong{font-size:15px;line-height:1.45}#cards .card small{font-size:11px;line-height:1.4;margin-top:3px}#cards .card b{font-size:22px;flex-shrink:0}#cards .card .agent-level{display:inline-flex;align-items:center;justify-content:center;min-width:45px;padding:1px 5px;margin:2px 0 0 4px;border:1px solid #8fe8f3;background:#112e3b;border-radius:4px;color:#e4fcff;font:900 18px/1.25 'Barlow Condensed',sans-serif;vertical-align:middle}.reveal-card h2 em{font-size:24px!important}.ending-agent>span{font-size:15px!important;font-weight:900}@media(max-height:550px){#cards .card{padding:5px 7px}#cards .card strong{font-size:13px}#cards .card small{display:none}#cards .card .icon{width:30px;height:36px}#cards .card .agent-level{font-size:17px}}

@media(min-width:701px){.game aside{padding:8px;gap:6px}.combat-actions .skills{gap:6px}.combat-actions .skills button{height:38px;min-height:38px;padding:3px;font-size:12px;line-height:1.1}.combat-actions .skills small{font-size:9px;margin-top:3px}.combat-actions #start{min-height:40px;padding:8px 10px;margin-top:6px;font-size:15px}#cards .card{padding:5px 8px}#cards .card .icon{width:31px;height:35px}#cards .card strong{font-size:14px}#cards .card small{display:none}#cards .card b{font-size:21px}}

/* Spend card space on readable agent information. */
#cards .card{padding:3px 6px!important;gap:6px!important}#cards .card .icon{width:36px!important;height:36px!important}#cards .card strong{font-size:18px!important;line-height:1.25}#cards .card small{font-size:12px;line-height:1.25;margin-top:2px}#cards .card b{font-size:24px!important;line-height:1.05}#cards .card .agent-level{font-size:22px!important;line-height:1.1;padding:0 4px;margin:0 0 0 3px;min-width:44px}#cards .card .element-tag{padding:1px 3px;margin-left:3px}@media(orientation:landscape) and (max-height:550px){#cards .card strong{font-size:16px!important}#cards .card .agent-level{font-size:20px!important}}

#cards .card small{display:block!important}@media(min-width:701px){.game aside{padding:6px;gap:4px}.roster-label{font-size:10px;line-height:1.15;margin-bottom:2px}#selection-status{font-size:11px;line-height:1.2;padding:1px 0 3px}#cards .card{padding:0 4px!important}#cards .card small{font-size:11px;line-height:1.1;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}

/* Make the gauge and advance action prominent while retaining four roster rows. */
@media(min-width:701px){.game>.stats{grid-column:1;grid-row:3}.game>aside{grid-column:2;grid-row:3 / 6}.combat-actions .energy{margin:0 0 12px}.combat-actions .energy small{font-size:32px;line-height:1.15}.combat-actions .energy strong{font-size:36px;line-height:1.1}.combat-actions .energy>div,.combat-actions .energy i{height:14px}.combat-actions .energy>div{margin-top:9px}.combat-actions #start{min-height:64px;font-size:24px;line-height:1.2;padding:15px 16px;margin-top:9px}#cards{grid-auto-rows:calc((100% - 24px) / 4)}}
@media(max-width:700px) and (orientation:portrait){.game{padding-bottom:72px}aside>.squad-tabs{height:72px}.mobile-burst-meter{min-height:56px}.mobile-burst-meter small{font-size:10px;letter-spacing:0}.mobile-burst-meter output{font-size:20px}.mobile-burst-meter>span,.mobile-burst-meter #mobile-energybar{height:5px}#start{min-height:56px;font-size:17px;padding:12px 6px}body[data-screen-enlarged='true'] #start{min-height:56px;font-size:16px}}

/* Larger battle skills, preserving the four-agent roster. */
@media(min-width:701px) and (hover:hover) and (pointer:fine){.combat-actions .skills button{height:60px;min-height:60px;font-size:18px;line-height:1.2;padding:6px 4px;border-width:2px}.combat-actions .skills small{font-size:12px;line-height:1.2;margin-top:5px}.combat-actions .skills .skill-ready-state,.combat-actions .skills .skill-cost{font-size:12px;line-height:1.2}}

/* Desktop tabs share the exact two-column width and gap of the battle skills. */
@media(min-width:701px) and (hover:hover) and (pointer:fine){.game aside>.squad-tabs,.combat-actions .skills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;min-width:0;margin:0;padding:0}.game aside>.squad-tabs button{width:100%;min-width:0;min-height:38px;height:38px;margin:0;padding:5px 8px;font-size:17px;line-height:1.25;letter-spacing:0;box-sizing:border-box;transform:none}.game aside>.squad-tabs #deploy-tab{box-shadow:none}}

/* Larger desktop role descriptions without reducing the four-agent view. */
@media(min-width:701px) and (hover:hover) and (pointer:fine){#cards .card small{font-size:14px;line-height:1.2;margin-top:1px;color:#c2c6d2}.game aside{padding:4px;gap:3px}.roster-label{font-size:9px;line-height:11px;margin-bottom:0}#selection-status{padding:0;line-height:13px}}

@media(min-width:701px) and (hover:hover) and (pointer:fine){#cards .card small{margin-top:4px}.game aside{gap:2px}.roster-label{line-height:10px}#selection-status{line-height:12px}.combat-actions #start{margin-top:6px}.combat-actions .energy{margin-bottom:9px}}

@media(min-width:701px) and (hover:hover) and (pointer:fine){main{gap:2px}.game aside>.squad-tabs button{height:50px;min-height:50px;padding:10px 8px}}

/* Anchor role descriptions near the card bottom instead of leaving unused space below. */
@media(min-width:701px) and (hover:hover) and (pointer:fine){#cards .card>span:nth-child(2){display:flex;flex-direction:column;justify-content:space-between;align-self:stretch;min-height:0;padding:1px 0 0}#cards .card strong{flex-shrink:0}#cards .card small{flex-shrink:0;margin-top:3px;margin-bottom:0;line-height:1.15}}

#selection-status[hidden]{display:none!important}

@media(min-width:701px) and (hover:hover) and (pointer:fine){#cards .card>span:nth-child(2){justify-content:flex-start;padding-top:1px}#cards .card small{margin-top:2px;line-height:1.2;color:#d2d6e1}}

/* Center the name and description together within desktop agent cards. */
@media(min-width:701px) and (hover:hover) and (pointer:fine){#cards .card>span:nth-child(2){justify-content:center;padding:0}#cards .card small{margin-top:6px}}
.site-info-nav{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px;padding:8px;font:12px/1.5 sans-serif}.site-info-nav a{color:#bceaf2;text-decoration:underline;background:none;border:0;padding:2px;font-size:12px}.site-info-nav a:focus-visible{outline:2px solid #78dfec;outline-offset:3px}
.game>.site-info-nav{grid-column:1/-1;padding:3px 6px;min-height:24px}

/* Keep site-information navigation out of the mobile game interface. */
@media(max-width:700px),(hover:none) and (pointer:coarse){.game>.site-info-nav{display:none}}
