/* Full-viewport mobile game shell; browser safe areas are respected. */
html,body{margin:0;min-height:100%;overscroll-behavior:none}body{overflow-x:hidden}.opening-brand .studio-card{transition:opacity .35s ease,transform .35s ease}.opening-brand.brand-out .studio-card{opacity:0;transform:scale(1.02)}
.opening-comic{padding:0;gap:0;overflow:hidden;display:block}.comic-scene{width:100%;height:100svh;position:relative;isolation:isolate;overflow:hidden}.comic-backdrop{position:absolute;inset:-30px;z-index:-2;background:var(--panel-art) center/cover;filter:blur(18px) brightness(.45);transform:scale(1.1)}.comic-stage{height:100%;width:min(100%,calc(100svh * .667));position:relative;margin:auto;background:var(--panel-art) center/cover;animation:cut-enter .4s ease-out both;cursor:pointer}.comic-heading{position:absolute;top:0;left:0;width:100%;padding:12px max(12px,env(safe-area-inset-right));background:linear-gradient(#071725bb,transparent);z-index:3}.comic-heading>span{color:#f5e4b2;font-size:8px;letter-spacing:1px}.comic-heading button{font-size:10px;background:#0f2637b3}.comic-stage .panel-number{top:65px;left:12px;font-size:12px}.comic-stage .speech{font-size:clamp(14px,2.4vw,22px);white-space:normal;max-width:82%;padding:10px 12px}.comic-stage .speech.blue{top:22%;left:4%}.comic-stage .speech.red{top:39%;right:3%}.comic-stage .comic-caption{bottom:125px;left:8px;right:8px;font-size:clamp(12px,2vw,16px);padding:10px}.comic-footer{position:absolute;bottom:0;left:0;width:100%;display:flex;flex-direction:column;gap:10px;padding:14px 14px calc(14px + env(safe-area-inset-bottom));margin:0;background:linear-gradient(transparent,#071725ee 30%);color:#fce7b4;min-height:106px;z-index:3}.comic-footer .primary{width:min(100%,380px);font-size:15px;min-height:46px;padding:10px}.comic-footer small{display:block;font-size:8px;color:#d1dcdf}.comic-dots{display:flex;gap:8px}.comic-dots i{height:5px;width:24px;border-radius:9px;background:#b5c1c444}.comic-dots i.active{background:#ffda85}.comic-dots i.done{background:#e8ba66aa}@keyframes cut-enter{from{opacity:0;transform:scale(1.03)}to{opacity:1;transform:scale(1)}}
.shell.game-shell{width:100%;max-width:none}.shell.battle-shell{padding:0;margin:0;max-width:none;width:100%;height:100svh;display:flex;flex-direction:column;overflow:hidden}.battle-shell>.topbar,.battle-shell>footer{display:none}.battle-shell>.battle{border:0;border-radius:0;box-shadow:none;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden}.battle-shell .battle-head{flex:none;padding:9px 18px;grid-template-columns:1fr 110px 1fr;gap:16px;padding-top:max(9px,env(safe-area-inset-top))}.battle-shell .clock-panel b{font-size:25px}.battle-shell .battle-field{height:auto;min-height:0;aspect-ratio:auto;flex:1}.battle-shell .battle-controls{flex:none;padding:9px 15px;gap:12px;grid-template-columns:1fr 1.5fr}.battle-shell .attacker>.portrait{width:55px;height:68px}.battle-shell .attacker p{display:none}.battle-shell .readouts{margin-top:4px;gap:15px}.battle-shell .readouts b{font-size:18px}.battle-shell .battle-controls .supporting{display:none}.battle-shell .skills{display:flex;gap:7px;overflow-x:auto}.battle-shell .skill{flex:1;min-width:90px;padding:8px;min-height:44px;font-size:12px}.battle-shell .skill small{font-size:9px}.precision-controls{display:flex;align-items:center;gap:14px;padding:6px 16px;flex:none;background:#0b2035}.precision-controls label{display:flex;gap:8px;align-items:center;font-size:11px;flex:1;min-width:0;white-space:nowrap}.precision-controls input{min-width:0;width:100%;min-height:22px;accent-color:#ffdc82;margin:0;padding:0}.precision-controls button{padding:6px 12px;min-height:34px;font-size:12px}.battle-shell .squad-strip{flex:none;display:flex;gap:6px;padding:4px 15px;overflow-x:auto;scrollbar-width:thin}.battle-shell .squad-strip>.member-card{flex:1;min-width:64px;max-width:150px}.battle-shell .squad-strip .portrait{height:47px;width:47px;margin:auto}.battle-shell .squad-strip .name{font-size:10px}.battle-shell .squad-strip .term{display:none}.battle-shell .squad-strip .info{width:20px;min-height:20px;font-size:9px}.battle-shell .battle-actions{flex:none;padding:5px 12px calc(5px + env(safe-area-inset-bottom));gap:8px}.battle-shell .battle-actions .log{font-size:10px;min-width:0;flex:1}.battle-shell .battle-actions .row{gap:5px;flex-wrap:nowrap}.battle-shell .battle-actions button{min-height:29px;padding:5px 8px;font-size:10px}.defense-menu{display:none}.battle-shell .field-status{top:8px;left:8px;font-size:10px;padding:5px 7px;max-width:65%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.battle-shell .wind{top:40px;left:8px;font-size:10px}.battle-shell .field-view-toggle{top:70px;left:8px;font-size:10px;min-height:29px;padding:5px 9px}.battle-shell .timing-meter{right:8px;top:8px;width:37px}.battle-shell .timing-meter strong{font-size:8px;padding:4px}.battle-shell .timing-meter .band{height:22px;font-size:9px}.battle-shell .endgame-note{top:105px;font-size:9px}
@media(max-width:720px){.battle-shell .battle-head{padding:6px 8px;gap:8px;grid-template-columns:1fr 65px 1fr}.battle-shell .battle-side strong{font-size:13px}.battle-shell .battle-side .name{font-size:9px;margin:1px 0}.battle-shell .hp-track{height:7px;margin:3px 0}.battle-shell .hp-text{font-size:8px}.battle-shell .clock-panel{font-size:9px}.battle-shell .clock-panel b{font-size:23px}.battle-shell .match-budget{font-size:9px;margin-top:1px}.battle-shell .battle-controls{padding:7px;gap:7px;grid-template-columns:1fr}.battle-shell .attacker{gap:7px}.battle-shell .attacker>.portrait{display:none}.battle-shell .attacker h3{margin:0;font-size:12px}.battle-shell .attacker>div{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;width:100%;gap:5px}.battle-shell .attacker .row{display:none}.battle-shell .readouts{gap:10px;margin:0;font-size:8px}.battle-shell .readouts b{display:inline;font-size:12px;margin-left:3px}.battle-shell .skill{min-height:36px;font-size:10px;padding:5px}.battle-shell .skills{gap:5px}.precision-controls{padding:4px 7px;gap:7px}.precision-controls label{font-size:9px;gap:4px}.precision-controls button{padding:5px 7px;min-height:32px;font-size:10px}.battle-shell .squad-strip{padding:3px 6px;gap:4px}.battle-shell .squad-strip>.member-card{min-width:49px}.battle-shell .squad-strip .portrait{height:34px;width:34px}.battle-shell .squad-strip .name{font-size:8px}.battle-shell .squad-strip .info{width:17px;min-height:17px;font-size:8px}.battle-shell .battle-actions .log{display:none}.battle-shell .battle-actions .row{width:100%;justify-content:space-between;flex-wrap:wrap}.battle-shell .battle-actions [data-defense]{display:none}.battle-shell .defense-menu{display:block}.battle-shell .battle-actions.defense-open [data-defense]{display:block}.battle-shell .battle-actions.defense-open .row{justify-content:start}.battle-shell .battle-actions button{font-size:9px}.shell.game-shell{padding:8px}.login{margin:0;border-radius:0;border:0;min-height:100svh}.login-art{min-height:230px}}
@media(orientation:landscape) and (max-height:600px){.battle-shell .battle-head{padding:4px 12px;grid-template-columns:1fr 90px 1fr}.battle-shell .battle-side .name,.battle-shell .match-budget{display:none}.battle-shell .hp-track{height:6px;margin:2px 0}.battle-shell .clock-panel b{display:inline;margin:0 8px;font-size:21px}.battle-shell .clock-panel{font-size:9px}.battle-shell .battle-side strong{font-size:12px}.battle-shell .hp-text{font-size:8px}.battle-shell .battle-controls{grid-template-columns:1fr 1.8fr;padding:3px 9px;gap:10px}.battle-shell .attacker>.portrait{display:none}.battle-shell .attacker h3{font-size:11px;margin:0}.battle-shell .attacker>div{display:flex;align-items:center;gap:8px}.battle-shell .attacker .row{display:none}.battle-shell .readouts{margin:0;gap:8px;font-size:8px}.battle-shell .readouts b{display:inline;font-size:12px;margin-left:2px}.battle-shell .skill{min-height:31px;padding:3px 7px;font-size:10px}.battle-shell .skill small{font-size:8px}.precision-controls{padding:3px 9px;gap:8px}.precision-controls input{min-height:16px}.precision-controls button{min-height:26px;padding:3px 10px;font-size:10px}.battle-shell .squad-strip{padding:2px 8px;gap:5px}.battle-shell .squad-strip .portrait{height:26px;width:26px}.battle-shell .squad-strip .name{font-size:8px}.battle-shell .squad-strip .pick{padding:2px}.battle-shell .squad-strip .info{width:16px;min-height:16px;font-size:8px}.battle-shell .battle-actions{padding:2px 8px}.battle-shell .battle-actions .log{display:none}.battle-shell .battle-actions .row{margin-left:auto}.battle-shell .battle-actions button{min-height:24px;font-size:9px;padding:3px 6px}.comic-stage{width:100%;background-position:center 60%;background-size:cover}.comic-stage .panel-number{top:60px}.comic-stage .speech{font-size:16px;max-width:42%}.comic-stage .speech.blue{left:5%;top:22%}.comic-stage .speech.red{right:6%;top:40%}.comic-stage .comic-caption{bottom:75px}.comic-footer{min-height:65px;gap:4px;padding:5px}.comic-footer .primary{min-height:32px;font-size:12px;padding:6px}.comic-footer small{display:none}}
@media(prefers-reduced-motion:reduce){.comic-stage{animation:none}}
.comic-stage .speech.chair{top:14%;left:28%;font-size:clamp(13px,2vw,18px);max-width:60%;transform:rotate(-4deg);color:#544b72;border-color:#544b72;z-index:2}
.comic-sfx{position:absolute;left:6%;bottom:26%;font-size:clamp(25px,5vw,43px);font-weight:1000;color:#ffe59d;-webkit-text-stroke:1px #672935;text-shadow:3px 3px #672935;transform:rotate(-12deg);pointer-events:none}
.poster-guide{padding:14px 18px;margin-bottom:14px;border:1px solid #eec76d66;border-radius:14px;background:#081724d9;box-shadow:0 8px 40px #0006}.poster-guide strong{font-size:clamp(17px,2.3vw,23px);color:#ffe49b}.poster-guide p{font-size:clamp(12px,1.5vw,15px);color:#f3f1e3;line-height:1.5;margin:7px 0}.poster-guide small{font-size:11px;color:#a9dae9}.opening-poster .poster-loading{width:min(92%,580px)}
@media(max-width:540px){.comic-stage .speech{font-size:16px;max-width:85%}.comic-stage .speech.blue{top:24%}.comic-stage .speech.red{top:40%}.comic-stage .speech.chair{top:13%;left:24%;font-size:14px}.poster-guide{padding:12px;margin-bottom:10px}.opening-poster .poster-title{top:8%}.opening-poster .poster-title p{font-size:13px}.opening-poster .poster-loading{bottom:calc(16px + env(safe-area-inset-bottom))}.poster-guide small{font-size:10px}}
@media(max-height:500px){.opening-poster .poster-title{top:4%}.opening-poster .poster-title h1{font-size:clamp(30px,6vw,52px)}.opening-poster .poster-title p{margin:3px 0;font-size:13px}.opening-poster .poster-loading{bottom:8px}.poster-guide{padding:8px 12px;margin-bottom:5px}.poster-guide strong{font-size:15px}.poster-guide p{font-size:11px;margin:3px 0}.poster-guide small{font-size:9px}.opening-poster progress{height:7px}}
.poster-guide p{word-break:keep-all;overflow-wrap:break-word}

.build-notice{position:fixed;z-index:10000;left:10px;right:10px;bottom:10px;background:#11283f;color:#fff;padding:12px;border:1px solid #ffc45c;border-radius:12px;font-size:13px;box-shadow:0 5px 25px #0009}.build-notice button{margin-left:8px}

/* Mobile combat is a landscape arena, not a stack of website panels. */
.battle-active .battle-shell{height:100dvh;max-height:100dvh}
.field-members{position:absolute;inset:0;pointer-events:none;z-index:2;contain:layout style}
.field-member{position:absolute;left:0;top:0;min-height:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;pointer-events:auto;touch-action:none;cursor:pointer;transform-origin:0 0}
.field-member:hover:not(:disabled){background:#fff5b51a}.field-member:focus-visible{outline:2px solid #ffe08e;outline-offset:-2px}
.field-member[hidden]{display:none}.field-member:disabled{pointer-events:none;opacity:1}
.battle-shell .arena-compact .battle-head{height:48px;min-height:48px;padding:4px max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left));grid-template-columns:1fr 108px 1fr;gap:12px;align-items:center}
.arena-compact .battle-head .battle-side strong{font-size:13px;line-height:14px}.arena-compact .battle-head .name{display:none}
.arena-compact .battle-head .hp-track{height:7px;margin:3px 0 2px}.arena-compact .battle-head .hp-text{font-size:10px;line-height:11px}
.arena-compact .battle-head .clock-panel{display:grid;grid-template-columns:1fr 40px;grid-template-rows:18px 18px;text-align:center;gap:0 4px;font-size:11px;white-space:nowrap}
.arena-compact .clock-panel .arena-round{grid-row:1;grid-column:1;align-self:end;color:#b0c9e2}.arena-compact .clock-panel small{grid-row:2;grid-column:1;font-size:10px;color:#d5e4f3}
.arena-compact .clock-panel b{grid-column:2;grid-row:1 / 3;font-size:30px;line-height:36px;margin:0}
.battle-shell .arena-compact .battle-field{flex:1;min-height:0;height:auto;touch-action:none;overflow:hidden}
.battle-shell .arena-compact .field-status{left:max(8px,env(safe-area-inset-left));top:6px;font-size:10px;max-width:54%;padding:5px 7px}
.battle-shell .arena-compact .wind{top:36px;left:max(8px,env(safe-area-inset-left));font-size:10px;background:#081b2ab3;padding:3px 5px;border-radius:5px;pointer-events:none}
.battle-shell .arena-compact .field-view-toggle{left:max(8px,env(safe-area-inset-left));top:62px;font-size:11px;min-height:40px;padding:6px 10px}
.battle-shell .arena-compact .timing-meter{width:30px;right:max(12px,env(safe-area-inset-right));top:56px;pointer-events:none}
.arena-compact .timing-meter strong{padding:3px;font-size:8px}.arena-compact .timing-meter .band{height:18px;font-size:10px}
.arena-compact .endgame-note{top:110px;pointer-events:none}
.mobile-combat-dock{position:absolute;z-index:4;display:flex;align-items:stretch;gap:7px;left:max(8px,env(safe-area-inset-left));bottom:max(8px,env(safe-area-inset-bottom));max-width:calc(100% - 64px);transition:opacity .12s}
.arena-member{display:flex;align-items:center;gap:5px;padding:3px 8px;min-height:46px;border:1px solid #e3c87b88;border-radius:10px;background:#091c30df;box-shadow:0 3px 12px #0004;text-align:left;color:#fff0c7}
.arena-member .portrait{width:31px;height:39px;margin:0;flex:none}.arena-member strong{display:block;font-size:13px;line-height:17px;white-space:nowrap}.arena-member small{display:block;font-size:9px;color:#bed1df}
.arena-opinion{display:block;font-style:normal;font-size:9px;line-height:11px;color:#ffd487}
.arena-skills{display:flex;align-items:stretch;gap:6px;min-width:0}.arena-skill{min-height:46px;min-width:104px;max-width:170px;padding:5px 9px;border:1px solid #607a92;background:#0b2039e8;border-radius:10px;color:#dce9f6;text-align:center}
.arena-skill strong{display:block;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arena-skill small{display:block;font-size:9px;margin-top:2px;color:#b7c8db}.arena-skill.selected{border-color:#ffe0a0;background:#624c1ce8;color:#fff0bc}
.arena-menu-button{position:absolute;right:max(8px,env(safe-area-inset-right));top:6px;z-index:8;font-size:22px;line-height:24px;width:44px;min-height:42px;padding:6px;border-radius:10px;background:#0a1c30e8;border:1px solid #60788d}
.arena-menu{position:absolute;top:54px;right:max(52px,env(safe-area-inset-right));z-index:9;width:260px;max-width:calc(100% - 80px);max-height:calc(100% - 62px);overflow-y:auto;overscroll-behavior:contain;padding:10px;background:#091a2cf7;border:1px solid #718399;border-radius:12px;box-shadow:0 8px 30px #0008}
.arena-menu header{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.arena-menu header>strong{font-size:13px}.arena-menu header button{width:40px;min-height:36px;padding:3px;font-size:24px}
.arena-menu-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.arena-menu button{min-height:40px;font-size:12px;padding:7px}.arena-menu details{margin-top:8px}.arena-menu summary{padding:10px 0;font-size:13px;cursor:pointer}.arena-menu label{display:flex;align-items:center;gap:8px;font-size:12px}.arena-menu input{width:100%;min-width:0;min-height:36px;padding:0;accent-color:#ffce67}
.mobile-aim-readout{position:absolute;z-index:5;left:50%;bottom:9px;transform:translateX(-50%);display:none;gap:12px;border:1px solid #ffc66d66;border-radius:8px;padding:6px 13px;background:#0a1b2ed9;color:#ffdd8a;pointer-events:none;font-size:15px}
.battle-field[data-pulling="true"] .mobile-aim-readout{display:flex}.battle-field[data-pulling="true"] .mobile-combat-dock{opacity:0;pointer-events:none}
.battle-field[data-flying="true"] .mobile-combat-dock{opacity:0;pointer-events:none}
.arena-compact .aim-handle{width:46px;height:46px;left:-23px;top:-23px;touch-action:none;box-shadow:0 0 0 3px #ffdf8522}
.arena-demo{min-height:46px;font-size:12px;padding:7px 12px}.rotation-prompt{display:none}
@media(orientation:portrait) and (max-width:720px), (orientation:portrait) and (pointer:coarse){
 .battle-active .rotation-prompt{display:flex;position:fixed;inset:0;z-index:9900;align-items:center;justify-content:center;flex-direction:column;gap:14px;background:#071725f5;padding:24px;text-align:center}
 .rotation-prompt>span{font-size:84px;color:#ffd788}.rotation-prompt>strong{font-size:22px;color:#ffe4a6}.rotation-prompt p{font-size:14px;color:#aac4dc;line-height:1.6}.rotation-prompt button{min-height:46px}
}
.opponent-preview{display:none;position:absolute;z-index:4;pointer-events:none;overflow:hidden;border:1px solid #f3c779;border-radius:10px;box-shadow:0 5px 20px #0008;background:#13283d}
.arena-compact .battle-field[data-aiming="true"] .opponent-preview{display:block}
.opponent-preview canvas{display:block;width:100%;height:100%}.opponent-preview>span{position:absolute;left:0;right:0;bottom:0;padding:5px;background:#061b2ad9;text-align:center;color:#ffe3a6;font-size:11px}
.arena-contestant.view-left{animation:arena-left .6s both}.arena-contestant.view-right{animation:arena-right .6s both}
@media(orientation:landscape) and (max-height:330px){
 .battle-shell .arena-compact .battle-head{height:42px;min-height:42px;padding-top:2px;padding-bottom:2px}.arena-compact .clock-panel b{font-size:26px}
 .mobile-combat-dock{bottom:4px}.arena-member,.arena-skill{min-height:42px}.arena-member .portrait{height:32px;width:27px}.arena-skill strong{font-size:11px}.arena-skill{padding:4px 7px;min-width:98px}
}
