/* Shared compact presentation; Classic opts in through its v0.5.10 adapter. */
.quest-peek{position:absolute;left:0;top:12px;width:140px;text-align:left;padding:10px 12px;background:#102b39ee;border:1px solid #c7a56a;border-radius:9px;color:#fff0cb;z-index:2}
.quest-peek strong,.quest-peek span{display:block;float:none;font:14px/1.4 system-ui}.quest-peek strong{font-weight:700}.quest-peek span{font-size:13px;margin-top:4px}
#compact-quest-dialog,#compact-tools-dialog{width:min(540px,94vw);max-height:85dvh;overflow:auto;padding:18px;border-radius:12px}
.compact-close{display:block;position:sticky;top:0;margin:0 0 14px auto;z-index:10;background:#15303c;min-height:40px}
#compact-quest-dialog .battle-quest{margin:0;max-width:none}#compact-quest-dialog .battle-quest p,#compact-quest-dialog .battle-quest small{display:block;font-size:15px;line-height:1.5}#compact-quest-dialog .battle-quest button{min-height:44px;font-size:15px}
.compact-tool-actions{display:flex;flex-wrap:wrap;gap:8px}#compact-tools-dialog .layout-log{max-width:none;margin-top:14px}#compact-tools-dialog .layout-log ol{max-height:none}
body:has(.compact-battle) #card-inspector{max-height:calc(100dvh - 24px);max-width:1000px;overflow:auto;padding:16px}
body:has(.compact-battle) #close-inspector{position:sticky;top:0;z-index:5;display:block;margin:0 0 10px auto;min-height:40px;background:#15303c}
body:has(.compact-battle) #inspector-content>img{max-height:calc(100dvh - 120px)}
@media(min-width:1000px){
 body:has(.compact-battle){--battle-header:36px;min-height:0}
 body:has(.compact-battle)>header{height:var(--battle-header);padding:3px 14px;gap:12px;background:#0c1c25dd}
 body:has(.compact-battle)>header>a{font-size:17px;letter-spacing:2px}
 body:has(.compact-battle)>header button{padding:4px 8px;font-size:12px;min-height:27px}
 body:has(.compact-battle) .audio{gap:8px;flex-wrap:nowrap}body:has(.compact-battle) #music-select{padding:4px;font-size:12px;max-width:160px}
 body:has(.compact-battle)>footer{display:none}body:has(.compact-battle)>main{min-height:0}
 #app .battle.compact-battle{box-sizing:border-box;width:100%;max-width:none;height:calc(100dvh - var(--battle-header));min-height:0;margin:0;padding:4px 12px 6px;display:grid;grid-template-rows:28px minmax(0,1fr) 20px 14px clamp(130px,20dvh,190px);gap:4px}
 #app .compact-battle .battle-heading{margin:0;display:flex;align-items:center;gap:12px;min-height:0}
 #app .compact-battle .battle-heading h2{font-size:16px;margin:0}#app .compact-battle .battle-actions{display:flex;gap:8px;align-items:center;flex-wrap:nowrap}
 #app .compact-battle .battle-actions button{font:12px system-ui;padding:4px 9px;min-height:26px}#app .compact-battle .layout-picker{font:12px system-ui;gap:5px}#app .compact-battle .layout-picker select{padding:3px 7px;font:12px system-ui}
 #app .compact-battle .battle-grid{display:block;min-height:0;width:100%}
 #app .compact-battle .table{position:relative;display:grid;height:100%;min-height:0;padding:0;border:0;grid-template-columns:148px minmax(0,1fr) 148px;grid-template-rows:58px minmax(0,1fr) 18px minmax(0,1fr) 62px;gap:4px 10px;background:transparent;box-shadow:none}
 #app .compact-battle .enemy-staging{grid-column:2;grid-row:1;display:flex;justify-content:center;margin:0;align-self:stretch;min-width:0}
 #app .compact-battle .enemy-board{grid-column:2;grid-row:2}#app .compact-battle .player-board{grid-column:2;grid-row:4}
 #app .compact-battle .turn-line{grid-column:2;grid-row:3;margin:0;padding:1px 9px;font:11px system-ui;letter-spacing:1px;align-self:stretch;min-height:0;display:flex;align-items:center;justify-content:space-between}
 #app .compact-battle .player-row{grid-column:2;grid-row:5;display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;margin:0;gap:10px;min-width:0;align-self:stretch}
 #app .compact-battle .layout-rail{grid-row:1/-1;display:flex;align-items:center;pointer-events:none;min-width:0}
 #app .compact-battle .enemy-rail{grid-column:3;align-self:start;margin-top:35px}#app .compact-battle .player-rail{grid-column:1;align-self:end;margin-bottom:10px}
 #app .compact-battle .deck-stack{width:140px;flex-basis:140px;margin:auto;padding:0}#app .compact-battle .deck-cards,#app .compact-battle .deck-stack .sleeve,#app .compact-battle .empty-deck{width:126px;height:168px}#app .compact-battle .deck-stack b{top:138px;font-size:22px}#app .compact-battle .deck-stack>small{font-size:11px;margin-top:12px}
 #app .compact-battle .board{display:grid;grid-template-columns:repeat(6,minmax(0,180px));grid-template-rows:minmax(0,1fr);gap:8px;justify-content:center;padding:3px 4px;min-height:0;margin:0;overflow:visible;background:transparent;border:0;align-items:center}
 #app .compact-battle .board .card-wrap{position:relative;min-width:0;min-height:0;height:100%;max-height:220px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) 24px;gap:2px}
 #app .compact-battle .board .card.unit{grid-column:1/-1;display:grid;grid-template-rows:minmax(0,1fr) 28px 14px;min-height:0;height:100%;width:100%;padding:3px;position:relative;transform:none;overflow:hidden}
 #app .compact-battle .board .card .art{height:100%;min-height:0;width:100%;grid-row:1;margin:0;flex:auto}
 #app .compact-battle .board .card strong{grid-row:2;min-height:0;font:14px/1 Georgia;padding:1px;display:grid;align-items:center;overflow:hidden}
 #app .compact-battle .board .card-text{grid-row:3;font-size:0;padding:0;min-height:0;height:14px;margin:0;background:#0a1925dd;overflow:hidden}
 #app .compact-battle .board .unit-status{font:11px/14px system-ui;margin:0;white-space:nowrap;letter-spacing:0}
 #app .compact-battle .board .stats{position:absolute;bottom:45px;left:4px;right:4px;width:auto;height:28px;min-height:0;padding:0;margin:0;background:transparent;pointer-events:none}
 #app .compact-battle .stats .attack-badge,#app .compact-battle .stats .health-badge{width:28px;height:28px;font-size:21px;line-height:1}
 #app .compact-battle .board .cost{display:none}
 #app .compact-battle .inspect-card,#app .compact-battle .guard-unit{min-height:0;height:24px;margin:0;padding:3px 2px;font:12px/16px system-ui;white-space:nowrap;width:100%;border-radius:3px}
 #app .compact-battle .enemy-board .inspect-card{grid-column:1/-1}#app .compact-battle .board .empty-slot{min-height:0;height:100%;margin:0}
 #app .compact-battle .hero{display:flex;align-items:center;flex-direction:row;flex-wrap:nowrap;gap:8px;padding:3px 8px;min-height:0;height:100%;width:auto;max-width:420px;flex:0 1 420px;justify-content:start;text-align:left;border-radius:34px 10px 10px 34px}
 #app .compact-battle .hero .portrait{display:block;width:50px;height:50px;flex:0 0 50px;grid-area:auto}
 #app .compact-battle .hero>span:not(.portrait){flex:1;grid-area:auto}#app .compact-battle .hero strong{font-size:17px}#app .compact-battle .hero small{font:11px/1.3 system-ui}
 #app .compact-battle .hero b{position:static;grid-area:auto;font-size:28px;padding:5px;flex-shrink:0}#app .compact-battle .opponent-power{max-width:100px;font:11px/1.25 system-ui}
 #app .compact-battle .hero-power{min-width:118px;max-width:148px;height:58px;padding:4px 6px;gap:0;border-radius:12px;background:#162d3be8;flex-shrink:0}#app .compact-battle .hero-power>span{display:none}#app .compact-battle .hero-power strong{font-size:16px}#app .compact-battle .hero-power small{font:11px/1.25 system-ui}
 #app .compact-battle .gold{padding:3px 8px;margin:0;min-width:88px;background:#102b39d9}#app .compact-battle .gold strong{font-size:26px}#app .compact-battle .gold>span{font:10px system-ui;letter-spacing:0}#app .compact-battle .gold strong small{font-size:16px}
 #app .compact-battle #end-turn{min-width:112px;min-height:48px;padding:8px 12px;font:bold 16px Georgia;border-radius:9px;flex-shrink:0}
 #app .compact-battle .hint{min-height:0;margin:0;padding:2px 8px;font:12px/16px system-ui;display:flex;gap:8px;align-items:center;white-space:nowrap;overflow:hidden}#app .compact-battle .hint button{padding:0 8px;font:12px system-ui;height:20px}
 #app .compact-battle .hand-label{margin:0;padding:0;font:10px/14px system-ui;letter-spacing:1px}
 #app .compact-battle .hand{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));grid-template-rows:minmax(0,1fr);min-height:0;gap:6px;margin:0;padding:3px 4px 0;overflow:visible;align-items:stretch;justify-content:stretch}
 #app .compact-battle .hand .card-wrap{position:relative;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 24px;gap:2px;flex:auto}
 #app .compact-battle .hand .card{display:grid;grid-template-rows:minmax(0,1fr) 28px 26px;height:100%;min-height:0;min-width:0;width:100%;padding:3px;transform:none}
 #app .compact-battle .hand .art{min-height:0;height:100%;flex:auto;grid-row:1}#app .compact-battle .hand .card strong{font:13px/1 Georgia;min-height:0;padding:1px;grid-row:2;overflow:hidden}#app .compact-battle .hand .card-text{display:none}
 #app .compact-battle .hand .stats{grid-row:3;height:26px;min-height:0;padding:0;margin:0}#app .compact-battle .hand .stats>b:only-child{font-size:11px}#app .compact-battle .hand .cost{width:28px;height:28px;font-size:20px}
 #app .compact-battle .unavailable-label{position:absolute;top:32px;left:3px;right:3px;padding:1px;text-align:center;font:11px/13px system-ui;pointer-events:none;background:#091c2eeb;z-index:3}
 #app .compact-battle [data-feedback]::after{inset:0 0 auto 28px;font:11px/14px system-ui;padding:2px;pointer-events:none}
 #app .compact-battle .quest-peek{width:140px;top:0;left:0}
 /* Tabletop retains opposing corner portraits; Albion keeps both command posts left. */
 #app .compact-battle[data-layout=tabletop] .enemy-staging,#app .compact-battle[data-layout=albion] .enemy-staging{grid-column:1;grid-row:1/3;align-self:start}
 #app .compact-battle[data-layout=tabletop] .enemy-board,#app .compact-battle[data-layout=albion] .enemy-board{grid-row:1/3}
 #app .compact-battle[data-layout=tabletop] .player-board,#app .compact-battle[data-layout=albion] .player-board{grid-row:4/6}
 #app .compact-battle[data-layout=tabletop] .player-row{grid-column:3;grid-row:4/6;display:flex;flex-wrap:wrap;gap:4px;align-content:end}
 #app .compact-battle[data-layout=albion] .player-row{grid-column:1;grid-row:4/6;display:flex;flex-wrap:wrap;gap:4px;align-content:end}
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero{flex:1 1 100%;max-width:none;width:100%;height:auto;flex-wrap:wrap;border-radius:10px;justify-content:center;gap:3px}
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero>span:not(.portrait){order:3;flex:1 1 100%;text-align:center}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero strong{font-size:14px}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero .portrait{width:40px;height:40px;flex-basis:40px}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero b{font-size:25px;padding:0}
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .opponent-power{display:none}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero-power{height:44px;min-width:0;width:100%;max-width:none}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero-power>small{display:none}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) #end-turn{width:100%;min-height:32px;padding:4px}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .gold{min-width:0;padding:0 5px}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .gold>span{display:none}#app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .gold strong{font-size:22px}
 #app .compact-battle[data-layout=tabletop] .quest-peek{top:118px}#app .compact-battle[data-layout=albion] .player-rail{grid-column:3}#app .compact-battle[data-layout=albion] .enemy-rail{margin-top:0}#app .compact-battle[data-layout=albion] .quest-peek{left:auto;right:0;top:calc(50% - 30px)}
}
@media(max-width:999px){#app .compact-battle .table{position:relative}#app .compact-battle .quest-peek{position:relative;top:auto;left:auto;order:0;margin:0;grid-column:1/-1;grid-row:auto;width:160px}#app .compact-battle .battle-journal{display:none}body:has(.compact-battle) #inspector-content{display:block}body:has(.compact-battle) #inspector-content>img{max-height:34dvh;max-width:100%;display:block;margin:auto}}
@media(min-width:1000px){
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .opponent-power{display:block;flex:1 1 100%;order:4;max-width:none;text-align:center;font:10px/1.2 system-ui}
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero-power{height:48px}
 #app .compact-battle:is([data-layout=tabletop],[data-layout=albion]) .hero-power>small{display:block;font-size:10px}
 #app .compact-battle[data-layout=tabletop] .quest-peek{top:140px}
}
@media(min-width:1000px) and (max-height:800px){
 #app .compact-battle[data-layout=albion] .deck-cards,#app .compact-battle[data-layout=albion] .deck-stack .sleeve,#app .compact-battle[data-layout=albion] .empty-deck{width:112px;height:150px}
 #app .compact-battle[data-layout=albion] .deck-stack b{top:120px}
}
