/* Layout from the user's placement prototype: portrait battle, left rail, board, action, gear. */
:root{--prototype-width:min(calc(100vw - 24px),480px);--play-width:var(--prototype-width)}
.topbar{width:var(--prototype-width)!important;height:61px!important;padding:8px 0!important;margin:auto!important;display:flex!important;align-items:center!important}.brand{font-size:25px!important}.topbar .header-actions{margin-left:auto}.layout{width:var(--prototype-width)!important;max-width:none!important;margin:auto!important;padding:0 0 22px!important;display:flex!important;flex-direction:column!important;gap:12px!important}.chapter-row{order:0!important;width:100%!important;padding:0 2px!important}.arena{order:1!important;width:calc(100% - 62px)!important;align-self:flex-end!important;aspect-ratio:1!important;border-radius:16px!important;overflow:hidden!important;background:#799e6240!important;box-shadow:inset 0 0 0 2px #e9e8ae77!important}.arena canvas{width:100%!important;height:100%!important;aspect-ratio:1!important;object-fit:contain!important}.fighter-hud{left:34%!important;top:auto!important;bottom:8px!important;width:32%!important}.fighter-hud .hp-label{font-size:7px!important;line-height:10px!important;gap:3px!important}.fighter-hud .hp-track{height:5px!important;margin-top:1px}.combat-caption{order:2!important;align-self:flex-end!important;width:calc(100% - 62px)!important;min-height:16px!important;height:auto!important;line-height:16px!important;font-size:10px!important}.cast-label{bottom:22%!important;font-size:14px!important}.prototype-board-row{order:3!important;display:grid!important;grid-template-columns:50px minmax(0,1fr)!important;gap:12px!important;width:100%!important;align-items:center!important}.prototype-rail{display:flex;flex-direction:column;gap:14px;align-self:stretch;justify-content:center;padding-top:24px}.prototype-rail .quiet{width:50px!important;height:59px!important;min-height:59px!important;border-radius:14px!important;font-size:13px!important;font-weight:900!important;line-height:1.2!important;white-space:normal!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:0 5px!important;box-shadow:0 4px #b0924e!important}.prototype-rail #pool-open{width:50px!important;font-size:13px!important;border-radius:14px!important}.prototype-board-row>.board-panel{width:100%!important;order:initial!important;padding:0!important;margin:0!important}.board-heading{min-height:18px!important;margin-bottom:5px!important;padding:0 2px!important}.board-heading h2{font-size:12px!important}.board-heading>span{font-size:10px!important}.board-wrap{width:100%!important;max-width:none!important}.board{gap:4px!important}.cell{padding:5px 3px 9px!important}.cell .name{font-size:9px!important;line-height:11px!important;height:11px!important;min-height:11px!important}.spin-zone{order:4!important;position:static!important;left:auto!important;bottom:auto!important;transform:none!important;width:100%!important;height:auto!important;max-width:none!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:6px 0 2px 62px!important;margin:0!important;min-height:82px!important;background:none!important}.spin-zone .damage-readout{display:none!important}.spin-button{flex:0 1 240px!important;width:78%!important;height:80px!important;min-height:80px!important;padding:0 8px 6px!important;margin:auto!important}.spin-button span{font-size:28px!important;letter-spacing:3px!important}.loadout-panel{order:5!important;width:100%!important;max-width:none!important;margin:4px 0 0!important;padding:11px 10px 12px!important;align-self:stretch!important}.loadout-panel .section-title{margin-bottom:8px!important}#gear-rack>.rack-card{height:calc((var(--prototype-width) - 55px) / 6 + 25px)!important}.board-panel .board-hint,.board-panel .turn-banner,.board-panel .board-tools{display:none!important}.report,.learned{display:none!important}#original-special{order:4!important}.score-burst{position:fixed!important;inset:10% 0 30%!important;z-index:45!important;pointer-events:none!important}@media(max-width:360px){.prototype-board-row{grid-template-columns:44px minmax(0,1fr)!important;gap:8px!important}.prototype-rail .quiet,.prototype-rail #pool-open{width:44px!important;min-height:52px!important;height:52px!important;font-size:12px!important}.arena,.combat-caption{width:calc(100% - 52px)!important}.spin-zone{padding-left:52px!important}.cell .name{font-size:8px!important}.spin-button span{font-size:25px!important}}@media(min-width:761px){.arena canvas{aspect-ratio:1!important}.layout{padding-bottom:28px!important}}
/* Fit-tested viewport layouts. Portrait keeps the sketch; landscape uses two adjacent stages. */
@media(orientation:portrait){
 :root{--prototype-width:min(calc(100vw - 20px),620px,calc((100dvh - 170px)/2.17))}
 .topbar{height:50px!important;padding:5px 0!important}.brand{font-size:23px!important}
 .layout{gap:6px!important;padding-bottom:10px!important}
 .prototype-board-row{grid-template-columns:44px minmax(0,1fr)!important;gap:8px!important}
 .arena,.combat-caption{width:calc(100% - 52px)!important}
 .prototype-rail{gap:10px!important;padding-top:20px!important}.prototype-rail .quiet,.prototype-rail #pool-open{width:44px!important;height:48px!important;min-height:48px!important;font-size:12px!important}
 .combat-caption{min-height:14px!important;line-height:14px!important;font-size:9px!important}.board-heading{min-height:17px!important;margin-bottom:3px!important}
 .spin-zone{padding:0 0 0 52px!important;min-height:65px!important}.spin-button{height:64px!important;min-height:64px!important;flex-basis:210px!important}.spin-button span{font-size:25px!important}
 .loadout-panel{padding:7px 8px 8px!important;margin-top:0!important}.loadout-panel .section-title{min-height:18px!important;margin-bottom:4px!important}.loadout-panel .section-title h2{font-size:10px!important;line-height:18px!important;min-height:18px!important}
 #gear-rack>.rack-card{height:calc((var(--prototype-width) - 51px)/6 + 22px)!important;grid-template-rows:minmax(0,1fr) 22px!important}#gear-rack>.rack-card:before{bottom:22px!important}#gear-rack>.rack-card>span:not(.icon){height:22px!important;font-size:8px!important;line-height:11px!important}
}
@media(orientation:landscape){
 :root{--landscape-pane:min(calc((100vw - 70px)/2),calc(100dvh - 235px),640px);--prototype-width:calc(var(--landscape-pane)*2 + 28px)}
 .topbar{width:var(--prototype-width)!important;height:50px!important;padding:6px 0!important}
 .layout{width:var(--prototype-width)!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:26px auto 68px auto!important;column-gap:28px!important;row-gap:7px!important;padding:0 0 12px!important;align-items:start!important}
 .combat-panel{display:contents!important}.chapter-row{grid-column:1/3;grid-row:1;order:initial!important}
 .arena{grid-column:1;grid-row:2/5;width:100%!important;align-self:start!important;aspect-ratio:1!important}.combat-caption{grid-column:1;grid-row:4;width:100%!important;align-self:end!important;padding:0 8px!important;z-index:1}
 .prototype-board-row{grid-column:2;grid-row:2;grid-template-columns:44px minmax(0,1fr)!important;gap:8px!important;order:initial!important}
 .prototype-rail{gap:10px!important;padding-top:20px!important}.prototype-rail .quiet,.prototype-rail #pool-open{width:44px!important;height:48px!important;min-height:48px!important;font-size:12px!important}
 .spin-zone{grid-column:2;grid-row:3;order:initial!important;padding:0 0 0 52px!important;min-height:68px!important;height:68px!important}.spin-button{height:65px!important;min-height:65px!important;flex-basis:220px!important}
 .loadout-panel{grid-column:2;grid-row:4;order:initial!important;margin:0!important;padding:7px 8px 8px!important}.loadout-panel .section-title{min-height:18px!important;margin-bottom:4px!important}.loadout-panel .section-title h2{min-height:18px!important;line-height:18px!important;font-size:11px!important}
 #gear-rack>.rack-card{height:calc((var(--landscape-pane) - 51px)/6 + 22px)!important;grid-template-rows:minmax(0,1fr) 22px!important}#gear-rack>.rack-card:before{bottom:22px!important}#gear-rack>.rack-card>span:not(.icon){height:22px!important;font-size:8px!important;line-height:11px!important}
 .board-heading{margin-bottom:3px!important;min-height:18px!important}.board{gap:4px!important}
}
@media(orientation:portrait){:root{--prototype-width:min(calc(100vw - 20px),620px,calc((100dvh - 205px)/2.17))}}
@media(orientation:landscape){:root{--landscape-pane:min(calc((100vw - 70px)/2),calc((100dvh - 210px)/1.17),640px)}body{background-size:cover!important}.combat-caption{grid-row:3!important;align-self:start!important}}
#original-special:empty{display:none!important}#original-special{margin:0!important;min-height:0!important}@media(orientation:landscape){#original-special{grid-column:2!important;grid-row:5!important}}
@media(orientation:portrait) and (max-height:700px){.spin-button span{font-size:18px!important;letter-spacing:1px!important}.spin-button{padding-left:4px!important;padding-right:4px!important}.prototype-rail .quiet,.prototype-rail #pool-open{font-size:11px!important}}
/* 9:16 portrait: allocate the screen by rows instead of shrinking the entire page. */
@media(orientation:portrait){
 :root{--prototype-width:min(calc(100vw - 16px),calc(100dvh * .46),540px);--phone-gear:calc((var(--prototype-width) - 51px)/6)}
 body{min-height:100dvh!important}.topbar{height:38px!important;padding:2px 0!important;align-items:center!important}.brand{font-size:19px!important;line-height:1!important}.brand:after{font-size:7px!important;margin-top:2px!important}.topbar .quiet{width:30px!important;height:30px!important;min-height:30px!important;font-size:10px!important}
 .layout{height:calc(100dvh - 38px)!important;min-height:0!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:20px minmax(0,1fr) auto 50px auto!important;gap:5px!important;padding:0 0 max(5px,env(safe-area-inset-bottom))!important;align-items:stretch!important}
 .combat-panel{display:contents!important}.chapter-row{grid-column:1!important;grid-row:1!important;min-height:20px!important;align-items:center!important}.chapter-row h1{font-size:10px!important;line-height:14px!important;padding:2px 8px!important}.wallet{font-size:12px!important;line-height:16px!important;padding:1px 9px!important;min-width:54px!important}
 .arena{grid-row:2!important;grid-column:1!important;width:calc(100% - 52px)!important;height:100%!important;min-height:0!important;aspect-ratio:auto!important;justify-self:end!important;align-self:stretch!important}.arena canvas{width:100%!important;height:100%!important;object-fit:contain!important;aspect-ratio:auto!important}.fighter-hud{bottom:3px!important;left:30%!important;width:40%!important}.combat-caption{display:none!important}.cast-label{font-size:11px!important;bottom:24%!important}
 .prototype-board-row{grid-column:1!important;grid-row:3!important;grid-template-columns:44px minmax(0,1fr)!important;gap:8px!important;align-items:stretch!important}.prototype-rail{padding-top:19px!important;gap:10px!important}.prototype-rail .quiet,.prototype-rail #pool-open{height:44px!important;min-height:44px!important;width:44px!important;font-size:12px!important}.board-heading{height:18px!important;min-height:18px!important;margin-bottom:2px!important}.board-heading h2{font-size:11px!important;line-height:18px!important}.board-heading>span{font-size:10px!important}.cell{padding:4px 2px 7px!important}.cell .name{font-size:9px!important;line-height:11px!important}
 .spin-zone{grid-column:1!important;grid-row:4!important;min-height:50px!important;height:50px!important;padding:0 0 0 52px!important;align-items:center!important}.spin-button{height:49px!important;min-height:49px!important;flex:0 1 195px!important;width:85%!important;padding:0 5px 4px!important}.spin-button span{font-size:21px!important;letter-spacing:1px!important;line-height:1!important}
 .loadout-panel{grid-column:1!important;grid-row:5!important;padding:5px 7px 7px!important;margin:0!important;min-height:0!important}.loadout-panel .section-title{height:15px!important;min-height:15px!important;margin-bottom:4px!important}.loadout-panel .section-title h2{height:15px!important;min-height:15px!important;font-size:10px!important;line-height:15px!important}#gear-rack>.rack-card{height:var(--phone-gear)!important;grid-template-rows:minmax(0,1fr)!important;min-height:0!important}#gear-rack>.rack-card:before{bottom:0!important}#gear-rack>.rack-card>.icon{width:66%!important;transform:translateY(-1px)!important}#gear-rack>.rack-card>span:not(.icon){display:none!important}.loadout-panel .gear-rack{gap:7px!important}
 #original-special:not(:empty){position:fixed!important;bottom:4px;left:50%;transform:translateX(-50%);z-index:35;background:#fff2c8;border-radius:12px;padding:5px!important;max-width:96vw}
}
