/* v0.12.6: one battle surface, compact controls, on-demand detail. */
html:has(.integrated-main),body:has(.integrated-main){height:auto;min-height:100%;overflow-y:auto;overflow-x:hidden}
body:has(.integrated-main){display:flex;flex-direction:column}
main.integrated-main,.touch-portrait main.integrated-main,.touch-landscape main.integrated-main{display:block;flex:1 0 auto;width:100%;max-width:1600px;margin:0 auto;padding:8px 12px;min-height:0}
.integrated-main .integrated-arena,.touch-portrait .integrated-main .integrated-arena,.touch-landscape .integrated-main .integrated-arena{display:flex;flex-direction:column;align-items:stretch;gap:5px;width:min(100%,max(760px,calc((100dvh - 295px) * 2.142857)));height:auto;min-height:0;max-width:1440px;margin:0 auto;padding:10px;overflow:visible;background:#141d2d;border:1px solid #3d485c;border-radius:10px;box-shadow:none}
.integrated-arena>*{order:0!important;min-width:0;flex-shrink:0}
.integrated-arena .battle-top{padding:0;gap:8px;min-height:37px}
.integrated-arena .battle-top .wallet .stat{background:transparent;box-shadow:none;border:0;padding:3px 7px;min-height:34px;min-width:0}
.integrated-arena .battle-top .wallet .stat b{font-size:25px}
.integrated-arena .wave-info{gap:7px;white-space:nowrap}
.integrated-arena .wave-info span{background:none;border:0;padding:3px 4px;font-size:12px}
.integrated-arena #remain{display:none}
.integrated-arena .battlehud{margin:0;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:#344054;border:1px solid #344054;border-radius:5px}
.integrated-arena .battlehud>div{background:#1c2739;padding:4px 10px;min-width:0}
.integrated-arena .battlehud small{font-size:10px;color:#acb8cc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.integrated-arena .battlehud b{font-size:19px;line-height:1.15;text-shadow:none}
.integrated-arena .wave-timer{margin:0;height:3px;border:0;border-radius:2px}
.integrated-arena .wave-timer i{background:#87d9c4;box-shadow:none}
.integrated-arena .board-shell,.touch-landscape .integrated-arena .board-shell{display:block;flex:none;min-height:0;width:100%;container-type:normal}
.integrated-arena .battle-deck,.touch-landscape .integrated-arena .battle-deck{width:100%;display:block;position:relative;min-width:0}
.integrated-arena .board,.touch-landscape .integrated-arena .board{width:100%;max-width:none;margin:0;border-radius:5px;box-shadow:none}
.integrated-arena .notice-strip,.touch-landscape .integrated-arena .notice-strip{position:absolute;left:8px;bottom:8px;max-width:55%;width:max-content;min-height:0;height:auto;display:block;background:#0b1221e8;border:1px solid #465970;border-radius:5px;padding:5px 8px;margin:0;pointer-events:none;z-index:6}
.integrated-arena .notice-strip:has(#notices:empty){display:none}
.integrated-arena .battle-toolbar{display:flex;align-items:stretch;flex-wrap:nowrap;gap:6px}
.integrated-arena .battle-toolbar .controls{flex:1 1 auto;gap:4px;flex-wrap:nowrap}
.integrated-arena .battle-toolbar .controls button{min-height:34px;padding:4px 10px;font-size:12px}
.integrated-arena .battle-toolbar #nextWave{margin-left:3px}
.integrated-arena .battle-toolbar .stage-control{flex:0 1 42%;min-width:180px;background:#1c2739;border:1px solid #344054;box-shadow:none;padding:3px 6px}
.integrated-arena .battle-toolbar #expandStage{min-height:32px;padding:4px 9px;font-size:12px}
.integrated-arena .stage-cap strong{font-size:14px}
.integrated-arena .stage-cap span{font-size:10px}
.integrated-arena .ultimate-strip{background:#1a2536;border:1px solid #364359;border-radius:5px;min-height:32px;padding:3px 6px}
.integrated-arena .ultimate-strip:has(#ultimateBar:empty){display:none}
.integrated-arena .ultimate-chip{min-height:27px;box-shadow:none}
.integrated-arena .cast-focus-row{display:flex;min-width:0}
.integrated-arena .dock-focus{display:flex;align-items:center;flex:1;gap:7px;padding:0}
.integrated-arena .dock-focus label{color:#adb9ca;white-space:nowrap;font-size:12px}
.integrated-arena .dock-focus select{flex:1;min-width:0;min-height:31px;font-size:13px;padding:4px 8px}
.integrated-arena .dock-focus button{min-width:72px;min-height:31px;color:#cbd5e1;white-space:nowrap}
.integrated-arena .cast-dock{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;background:none;padding:0;border:0;border-radius:0;box-shadow:none}
.integrated-arena .cast-main{display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0;min-height:43px;padding:7px 12px;border-radius:5px;border:1px solid #4d5d73;box-shadow:none;background:#29374b;color:#e9edf4;font-size:13px;font-weight:750;white-space:nowrap}
.integrated-arena .cast-main b{font-size:16px;font-variant-numeric:tabular-nums}
.integrated-arena .cast-main small{font-size:10px;font-weight:600;opacity:.82}
.integrated-arena .cast-main.primary{background:#d8c39c;border-color:#e5d1ad;color:#282622}
.integrated-arena .cast-gamble{background:#443849;border-color:#78647b;color:#f4d6e9}
.integrated-arena .cast-select{background:#254255;border-color:#4d748d;color:#d4eaf7}
.integrated-arena .cast-main:not(:disabled):hover{filter:brightness(1.12)}
.integrated-arena .battle-menu{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.integrated-arena .battle-menu button{min-height:32px;font-size:12px;margin:0;padding:4px 5px;box-shadow:none;background:#202b3c;border:1px solid #39475b;border-radius:5px;color:#d2dbe9;white-space:normal;word-break:keep-all}
.integrated-arena .battle-menu button.active{background:#384759;border-color:#9bb3c8;color:#fff}
#autoIndicator{font-size:9px;color:#9fe5cb;margin-left:3px}
.integrated-arena .studio-footer{margin:0;padding:0;min-height:13px}
.integrated-arena .studio-footer .studio-link{font-size:9px}
.integrated-main #detailParking{display:none!important}
.integrated-main .battle-drawer[hidden]{display:none!important}
.integrated-main .battle-drawer,.touch-portrait .integrated-main .battle-drawer,.touch-landscape .integrated-main .battle-drawer{position:fixed;inset:66px 12px 12px auto;width:min(370px,calc(100vw - 24px));height:auto;max-height:calc(100dvh - 78px);display:flex;flex-direction:column;gap:8px;background:#172131;border:1px solid #536177;box-shadow:0 8px 32px #0008;padding:12px;border-radius:9px;z-index:85;overflow:hidden;overscroll-behavior:contain}
.battle-drawer .drawer-head{display:flex;justify-content:space-between;align-items:center;flex:none;gap:10px}
.battle-drawer .drawer-head strong{font-size:16px}
.battle-drawer .drawer-head button{min-width:34px;min-height:32px;font-size:20px;padding:0;background:#29374a;box-shadow:none;border:1px solid #45536a}
.integrated-main .battle-drawer>.game-tabs{order:0;grid-template-columns:repeat(4,minmax(0,1fr));flex:none;background:none;padding:0;border:0}
.integrated-main .battle-drawer>.game-tabs button{min-height:33px;border-radius:5px}
.integrated-main .battle-drawer>.side-screen:not([hidden]){display:block;order:0;min-height:0;max-height:none;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;border:0;padding:0;background:none;box-shadow:none}
.battle-drawer .recipe-list,.battle-drawer .log{max-height:none;overflow:visible}
.battle-drawer .side-screen>.head{display:none}
.battle-drawer .quick-auto{display:flex;flex-wrap:wrap;gap:10px;margin:12px 0;font-size:12px}
.battle-drawer .auto-cast-bar{background:#202c3f;border-color:#435168;padding:8px}
.battle-drawer .automation-config{width:100%;min-height:36px}
#mobileDock,.touch-portrait #mobileDock{display:none!important}
@media(max-width:900px),(pointer:coarse){
 main.integrated-main,.touch-portrait main.integrated-main,.touch-landscape main.integrated-main{padding:5px max(5px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));display:block}
 .integrated-main .integrated-arena,.touch-portrait .integrated-main .integrated-arena,.touch-landscape .integrated-main .integrated-arena{width:100%;padding:6px;gap:5px}
 .integrated-arena .battle-top .wallet .stat b{font-size:20px}
 .integrated-arena .wave-info span{font-size:10px;padding:2px}
 .integrated-arena .battlehud>div{padding:4px 5px}
 .integrated-arena .battlehud small{font-size:8px}
 .integrated-arena .battlehud b{font-size:16px}
 .integrated-arena .battle-toolbar{flex-wrap:wrap;gap:4px}
 .integrated-arena .battle-toolbar .controls{flex:1 1 auto;min-width:0}
 .integrated-arena .battle-toolbar .controls button{min-height:38px;padding:4px 7px;font-size:11px}
 .integrated-arena .battle-toolbar .stage-control{flex:1 1 100%;min-width:0}
 .integrated-arena .battle-toolbar #expandStage{min-height:36px}
 .integrated-arena .cast-dock{gap:4px}
 .integrated-arena .cast-main{flex-direction:column;justify-content:center;gap:2px;min-height:49px;padding:5px 2px;font-size:11px}
 .integrated-arena .cast-main b{font-size:15px}
 .integrated-arena .cast-main small{font-size:9px}
 .integrated-arena .battle-menu{gap:4px}
 .integrated-arena .battle-menu button{font-size:10px;min-height:43px;padding:3px}
 .integrated-arena .dock-focus select,.integrated-arena .dock-focus button{min-height:34px}
 .integrated-main .battle-drawer,.touch-portrait .integrated-main .battle-drawer,.touch-landscape .integrated-main .battle-drawer{inset:auto 5px max(5px,env(safe-area-inset-bottom)) auto;width:calc(100vw - 10px);max-width:460px;max-height:72dvh;padding:10px;left:auto;right:5px}
 .integrated-arena .board .selectpop,.touch-portrait .integrated-arena .board-shell .selectpop{bottom:12px;max-height:65dvh}
}
@media(pointer:coarse) and (orientation:landscape){
 .integrated-main .integrated-arena,.touch-landscape .integrated-main .integrated-arena{max-width:760px}
 .integrated-arena .battle-toolbar .stage-control{flex:0 1 42%}
 .integrated-arena .cast-main{flex-direction:row;min-height:44px;padding:4px 8px}
 .integrated-main .battle-drawer,.touch-landscape .integrated-main .battle-drawer{inset:5px 5px 5px auto;width:min(360px,48vw);max-height:none}
}

/* v0.15.4 playtest controls */
.integrated-arena .ultimate-strip:has(#ultimateBar:empty){display:flex}.ultimate-strip .ultimate-auto{display:inline-flex;align-items:center;gap:5px;white-space:nowrap;padding:4px 8px;border:1px solid #64748b;border-radius:6px;background:#253448;color:#e5edf8;font-weight:700;cursor:pointer}.ultimate-strip .ultimate-auto:has(input:checked){background:#205a48;border-color:#78d7ac;color:#e1fff1}.ultimate-strip .ultimate-auto input{accent-color:#52c995;width:16px;height:16px;margin:0}.stage-control #sortBoard{white-space:nowrap;font-size:12px}.danger-warning{position:absolute;inset:0;z-index:2;pointer-events:none;border:3px solid #ff434e;border-radius:inherit;box-shadow:inset 0 0 48px #ff182f99;background:#fa112322;color:#fff;font-weight:900;text-align:center;padding-top:8px;text-shadow:0 1px 4px #600;animation:grd-danger-pulse 1.2s ease-in-out infinite}.danger-warning[hidden]{display:none!important}.danger-warning.danger-paused{animation-play-state:paused}@keyframes grd-danger-pulse{0%,100%{background:#fa11230b;box-shadow:inset 0 0 16px #ff182f55}50%{background:#fa112344;box-shadow:inset 0 0 55px #ff182faa}}@media(prefers-reduced-motion:reduce){.danger-warning{animation:none}}@media(max-width:760px){.ultimate-strip .ultimate-auto{font-size:11px;padding:3px 5px}.stage-control #sortBoard{font-size:10px;padding:5px}.danger-warning{font-size:12px}}

/* v0.15.5 compact roster, challenge and MVP */
.roster-traits{display:flex;flex-wrap:wrap;gap:2px 5px;align-items:center;padding:1px 4px 3px;line-height:1.25;min-width:0}.roster-traits span{color:var(--group-color,#e5d7ff);font-size:10px;font-weight:800;white-space:nowrap}.roster-traits small{color:#d2dceb;font-size:10px;overflow-wrap:anywhere}.challenge-panel{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border:1px solid #6aaec9;border-radius:6px;padding:4px 7px;background:#152f43;color:#d8f2ff;font-size:12px;font-weight:700}.challenge-panel[hidden],.challenge-panel [hidden],#resultMvpArt[hidden]{display:none!important}.challenge-panel button{margin-left:auto;padding:4px 9px;background:#214762;border-color:#7bc9ed;color:#ecfbff;font-weight:800}.challenge-hp{flex:1 1 100%;height:13px;background:#0b1b2a;border-radius:3px;position:relative;overflow:hidden}.challenge-hp i{display:block;height:100%;background:#549aba;transition:width .1s linear}.challenge-hp b{position:absolute;inset:0;text-align:center;font-size:10px;color:#fff;text-shadow:0 1px 2px #000;line-height:13px}#end>div{max-height:100%;max-width:100%;overflow:auto;padding:6px 14px}#resultMvpArt{margin:4px auto;max-width:min(90%,360px);height:clamp(42px,9vw,110px)}#resultMvpArt img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 5px #0008)}#end .show-summary{gap:2px;margin:4px 0}#end button{margin-top:6px}@media(max-width:760px){.challenge-panel{font-size:11px}#resultMvpArt{height:clamp(36px,8vw,80px)}#end>div{padding:4px 8px}}
