/* v0.9.4: viewport-first game layout */
body{margin:0}header{width:100%;max-width:none;min-height:56px;padding:7px 18px;flex-wrap:nowrap}.brand-emblem{width:38px;height:38px}.brand-emblem svg{width:28px;height:28px}.brand h1{font-size:24px}.brand small{font-size:8px}.wallet .stat{min-width:82px;padding:5px 10px}.wallet .stat b{font-size:20px}.header-actions{margin-left:auto}.studio-link{margin-left:auto}
main{width:100%;max-width:1800px;gap:10px;padding:10px;grid-template-columns:minmax(0,1fr) minmax(320px,365px)}
.arena{padding:10px;gap:6px;min-width:0}.arena>.head{margin:0;flex-shrink:0}.arena>.head h2{font-size:15px}.battlehud{margin:0;flex-shrink:0}.battlehud>div{padding:5px 9px}.battlehud b{font-size:20px}.battlehud small{font-size:10px}.notice-strip{min-height:25px;height:29px;padding:2px 8px;margin:0;overflow:hidden;flex-shrink:0}.notice{min-height:0}.board-legend{padding:0 2px;font-size:10px;flex-shrink:0}.board-shell{min-width:0;display:grid;place-items:center;width:100%}.board{width:100%;margin:0;max-width:100%;box-shadow:0 0 0 2px #080e1bb0,0 0 12px #76d7d118}.board canvas{width:100%;height:auto;aspect-ratio:900/420}.stage-tag{text-shadow:none}.wave-timer{margin:0;height:4px;flex-shrink:0}.controls{margin:0;flex-shrink:0;gap:5px}.controls button{min-height:30px;padding:5px 9px}.stage-control{margin:0;padding:6px 9px;flex-shrink:0}.stage-control button{min-height:33px}.stage-cap strong{font-size:16px}.stage-cap span b{font-size:14px}.capacity-track{height:4px}.boss-timer{margin:0;padding:3px;flex-shrink:0}
.bench{padding:6px;flex-shrink:0}.bench .head{margin:0 0 4px}.bench .head h2{font-size:12px}.inv-toolbar select,.inv-toolbar button{font-size:11px;padding:4px 6px}.bench .inventory{min-height:68px;height:68px;padding:3px;gap:5px}.bench-token{min-width:65px;width:65px;flex-basis:65px;gap:0;padding:2px}.bench-token .unit-art{width:34px;height:34px;font-size:18px}.bench-token strong{font-size:10px}.bench-token small{font-size:8px}.detail{margin:0;min-height:0;max-height:112px;padding:6px 9px;gap:4px;overflow:auto;flex-shrink:0}.detail-head strong{font-size:14px}.detail-actions button{padding:4px 7px;min-height:28px;font-size:11px}.statline span{font-size:10px;padding:2px 5px}.detail-head small{font-size:10px}
.right{gap:7px;min-width:0}.right>.cast-dock{order:0;flex-shrink:0;margin:0;padding:9px;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr));border-color:#91c7c6a0;box-shadow:0 6px 20px #01081760,inset 0 1px 0 #a1d8f21a}.cast-heading strong{font-size:14px}.cast-heading strong span{font-size:11px}.cast-wallet{font-size:11px;gap:7px}.dock-focus{padding:0;gap:5px}.dock-focus select{min-height:31px;font-size:13px;padding:4px 6px}.dock-focus label,.dock-focus button{font-size:11px}.right .cast-action{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto;gap:5px;padding:7px;align-items:stretch}.right .cast-card-label{grid-column:1/-1;min-height:0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px 4px;align-items:center;text-align:left}.cast-card-label b{font-size:12px}.cast-card-label small{font-size:10px}.right .cast-action button{min-height:36px;font-size:12px;padding:4px 3px;white-space:normal}.right .cast-action.gamble,.right .cast-action.select{grid-template-columns:1fr;grid-template-rows:auto auto}.right .cast-action.gamble button,.right .cast-action.select button{grid-column:1/-1}.auto-cast-bar{padding:6px;gap:5px;grid-template-columns:auto minmax(60px,1fr) auto}.auto-cast-bar select,.auto-cast-bar button{min-height:30px;padding:4px 6px;font-size:12px}.auto-cast-bar button{min-width:74px}.auto-cast-bar label{font-size:12px}.auto-cast-bar span{font-size:10px;line-height:1.2}.quick-auto{grid-column:1/-1;display:flex;gap:7px;flex-wrap:wrap;justify-content:space-between;font-size:10px;color:#c3d9eb}.quick-auto label{display:flex;gap:3px;align-items:center;white-space:nowrap}.quick-auto input{accent-color:#74d9bd;margin:0;width:15px;height:15px}
.right>.game-tabs{order:1;flex-shrink:0;margin:0;padding:4px}.game-tabs button{min-height:32px;padding:5px 3px;font-size:12px}.right>.side-screen{order:2;padding:9px;min-height:0;min-width:0}.side-screen .head{margin-bottom:5px}.side-screen .head h2{font-size:13px}.focus-progress{padding:8px}.focus-head strong{font-size:16px}.focus-bar{margin:5px 0}.focus-members{gap:4px;grid-template-columns:repeat(2,minmax(0,1fr))}.focus-member{min-height:29px;font-size:11px;padding:4px}.focus-combine{min-height:32px;margin-top:5px;padding:5px}.tour-box{padding:8px;margin:6px 0;gap:4px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start}.tour-box b{font-size:10px}.tour-box div{font-size:11px}.training-button{margin-top:5px;padding:6px;min-height:30px}.gamble-odds{margin-top:6px;padding:6px;gap:2px}.gamble-odds span{font-size:10px}.batch-actions{margin:4px 0}
@media(min-width:901px) and (min-height:560px){html,body{height:100%;overflow:hidden}body{display:flex;flex-direction:column;height:100dvh}header{flex-shrink:0}main{flex:1;min-height:0;grid-template-rows:minmax(0,1fr);align-items:stretch}.arena{height:100%;min-height:0;overflow:auto;scrollbar-width:thin}.board-shell{flex:1 0 140px;min-height:140px;container-type:size}.board{width:min(100cqw,calc(100cqh * 900 / 420))}.right{height:100%;min-height:0;overflow:hidden;grid-row:1}.right>.side-screen:not([hidden]){overflow:auto;scrollbar-width:thin;scrollbar-color:#557b99 #142033;flex:1}.right>.side-screen[hidden]{display:none!important}}
@media(max-width:900px){header{flex-wrap:wrap;gap:7px;padding:7px 9px}.brand h1{font-size:20px}.brand h1 span{font-size:12px}.brand-emblem{width:34px;height:34px}.brand-emblem svg{width:24px;height:24px}.brand small{font-size:7px}.studio-link{margin-left:0;font-size:8px}.header-actions{margin-left:0}.wallet{width:100%;display:flex;justify-content:stretch;gap:5px}.wallet .stat{flex:1;min-width:0;padding:4px 7px}.wallet .stat b{font-size:17px}main{display:flex;flex-direction:column;padding:6px;gap:6px}.arena,.right{display:contents}.arena>.head{order:0}.battlehud{order:1}.board-legend{order:2}.board-shell{order:3}.boss-timer{order:4}.wave-timer{order:5}.controls{order:6}.right>.cast-dock{order:7}.stage-control{order:8}.bench{order:9}.detail{order:10}.notice-strip{order:11}.right>.game-tabs{order:12}.right>.side-screen{order:13}.board{width:100%}.battlehud b{font-size:17px}.battlehud small{font-size:8px}.controls button{font-size:11px;padding:4px 6px}.right>.cast-dock{padding:7px;gap:5px}.right .cast-action{padding:5px}.right .cast-action button{min-height:37px}.quick-auto{font-size:11px}.detail{max-height:none}.board-shell .selectpop{position:fixed;bottom:calc(12px + env(safe-area-inset-bottom));right:12px;max-height:70dvh;overflow:auto;width:min(300px,calc(100vw - 24px));z-index:100}.right>.side-screen[hidden]{display:none!important}.focus-members{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:901px) and (max-height:559px){.right{align-self:start;position:sticky;top:4px}.right>.side-screen:not([hidden]){max-height:260px;overflow:auto}}
@media(max-width:420px){.cast-heading strong span{display:none}.right .cast-card-label{display:grid;gap:1px}.quick-auto{gap:4px}.quick-auto label{font-size:10px}.controls .wavebadge{display:none}}

@media(min-width:901px){.right>.detail{order:1;flex-shrink:0;max-height:118px}.right>.game-tabs{order:2}.right>.side-screen{order:3}}.notice-strip .toast{padding:0;min-height:0;animation:none;box-shadow:none;background:transparent;border:0;display:flex;align-items:center;gap:6px}.notice-strip .toast .mark{font-size:13px}.notice-strip .toast>div{display:flex;align-items:center;gap:6px;min-width:0}.notice-strip .toast small,.notice-strip .toast strong{display:inline;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:11px}.notice-strip .toast small{max-width:55%}.notice-strip .toast strong{color:#eaf5ff}
