/* Floating controls keep the playmat size stable as the hand and log open. */
.shell:has(.tabletop),.shell.layout-ipad:has(.tabletop),.shell.hand-minimized:has(.tabletop){padding-bottom:76px;gap:6px}
.shell:has(.tabletop) .board{min-height:0;flex:1}
.shell:has(.tabletop) .turnbar{min-height:62px;gap:16px;padding:7px 12px}
.shell:has(.tabletop) .phase-current{min-width:0;flex:1}
.shell:has(.tabletop) .phase-current p{display:block;margin:3px 0 0;font-size:14px;line-height:1.3;color:#d6e4df;max-width:760px}
.shell:has(.tabletop) .phase-current h2{font-size:18px}
.tabletop .mat-half{grid-template-columns:110px 155px minmax(0,1fr) 65px;grid-template-rows:20px minmax(0,1fr) 62px;grid-template-areas:"player player player player" "command resources field piles" "camp camp camp piles";gap:5px 10px}
.tabletop .mat-half.opponent-half{grid-template-columns:65px minmax(0,1fr) 155px 110px;grid-template-rows:20px 62px minmax(0,1fr);grid-template-areas:"player player player player" "piles camp camp camp" "piles field resources command"}
.tabletop .mat-resources{grid-area:resources;align-self:center;display:flex;flex-direction:column;align-items:stretch;gap:8px;background:#11231ff2;border:1px solid #647c70;border-radius:9px;padding:10px;min-width:0}
.tabletop .mat-resource-line{display:flex;flex-direction:column;align-items:stretch;gap:7px;font-size:14px}
.tabletop .mat-resource-line>span{display:flex;align-items:center;gap:5px;white-space:normal}
.tabletop .mat-resource-line b{font-size:18px}.tabletop .supply-ready b{font-size:24px}
.tabletop .mat-resources .interception-meter{display:flex;flex-wrap:wrap;font-size:12px;gap:4px}
.tabletop .mat-resources .interception-meter strong,.tabletop .mat-resources .interception-meter b{display:block;font-size:12px}
.tabletop .mat-ability summary{font-size:12px;max-width:none;min-height:32px}
.shell:has(.tabletop) .bottom-game-bar{position:fixed;inset:auto 12px 8px;z-index:24;display:block;height:62px;pointer-events:none;background:none}
.shell:has(.tabletop) .phase-progress{position:absolute;right:0;bottom:0;width:205px;min-height:58px;pointer-events:auto;background:#14231ff5;border:1px solid #c6a563;border-radius:9px}
.shell:has(.tabletop) .hand-dock{position:absolute;bottom:0;left:290px;right:225px;max-height:none;pointer-events:none;background:transparent;border:0;box-shadow:none;overflow:visible}
.shell:has(.tabletop) .hand-dock .dock-head{pointer-events:auto;min-height:36px;background:transparent}
.shell:has(.tabletop) .dock-cards.card-hand{height:260px;min-height:260px;max-height:260px;overflow-x:auto;overflow-y:hidden;padding:25px 30px 8px;pointer-events:auto;align-items:flex-end}
.shell:has(.tabletop) .hand-dock .hand-card{width:160px;min-width:160px;flex-basis:160px}
.shell:has(.tabletop) .hand-peek-strip{pointer-events:auto;height:32px}
.shell:has(.tabletop) .ai-activity{position:fixed;left:12px;bottom:10px;width:270px;max-height:230px;z-index:26;margin:0;background:#142b32f5;border:1px solid #66838d;border-radius:9px;overflow:auto;padding:0}
.ai-log-toggle{width:100%;min-height:44px;text-align:left;padding:9px 12px;background:transparent;border:0;color:#f4cf83;font-size:14px}
.ai-activity [role=log]{padding:0 10px 8px;max-height:175px;overflow:auto}.ai-activity p{font-size:13px;line-height:1.35}
.shell:has(.tabletop) .mat-reports{bottom:250px;left:12px}
.shell:has(.tabletop) .attack-selection{position:absolute;bottom:85px;left:300px;right:235px;z-index:23;max-height:35vh;overflow:auto;background:#102620f5}
@media(max-width:1100px){
 .tabletop .mat-half{grid-template-columns:90px 125px minmax(0,1fr) 50px;gap:4px 6px}
 .tabletop .mat-half.opponent-half{grid-template-columns:50px minmax(0,1fr) 125px 90px}
 .tabletop .mat-resources{padding:6px;gap:4px}.tabletop .mat-resource-line{font-size:12px;gap:4px}
 .shell:has(.tabletop) .hand-dock{left:200px;right:190px}.shell:has(.tabletop) .phase-progress{width:175px}
 .shell:has(.tabletop) .ai-activity{width:185px}.shell:has(.tabletop) .attack-selection{left:205px;right:200px}
 .shell:has(.tabletop) .phase-pills{display:none}
}
@media(max-width:650px){
 .shell:has(.tabletop) .hand-dock{left:0;right:0;bottom:64px}
 .shell:has(.tabletop) .dock-cards.card-hand{height:220px;min-height:220px;max-height:220px}
 .shell:has(.tabletop) .hand-dock .hand-card{width:145px;min-width:145px;flex-basis:145px}
 .tabletop .mat-half{grid-template-columns:75px 96px minmax(0,1fr) 42px;grid-template-rows:17px minmax(0,1fr) 46px;gap:3px}
 .tabletop .mat-half.opponent-half{grid-template-columns:42px minmax(0,1fr) 96px 75px;grid-template-rows:17px 46px minmax(0,1fr)}
 .tabletop .mat-resources{padding:4px}.tabletop .mat-resource-line{font-size:12px;gap:3px}.tabletop .mat-resource-line b{font-size:15px}.tabletop .supply-ready b{font-size:19px}
 .tabletop .mat-resources .interception-meter strong{display:none}.tabletop .mat-ability summary{font-size:12px}
 .shell:has(.tabletop) .phase-current p{font-size:12px}.shell:has(.tabletop) .turnbar{padding:4px;min-height:60px}
 .shell:has(.tabletop) .attack-selection{left:8px;right:8px;bottom:140px}
 .shell:has(.tabletop) .ai-activity{max-width:calc(100vw - 205px)}
}
.shell:has(.tabletop) .hand-dock .hand-card>.card{width:100%;min-width:0;min-height:210px}
@media(max-height:800px){.tabletop .mat-resources{padding:5px;gap:3px}.tabletop .mat-resource-line{gap:3px}.tabletop .mat-resource-line .resource-icon{width:19px;height:19px}.tabletop .mat-ability summary{min-height:26px}}
@media(max-width:650px){.shell:has(.tabletop) .hand-dock .hand-card>.card{min-height:175px}}
/* Anchor the hand to the viewport center, independently of side controls. */
.shell:has(.tabletop) .hand-dock{left:50%;right:auto;width:min(1100px,calc(100vw - 580px));transform:translateX(-50%)}
.shell:has(.tabletop) .dock-cards.card-hand,.shell:has(.tabletop) .hand-peek-strip{justify-content:flex-start}
.shell:has(.tabletop) .dock-cards.card-hand>:first-child,.shell:has(.tabletop) .hand-peek-strip>:first-child{margin-inline-start:auto}
.shell:has(.tabletop) .dock-cards.card-hand>:last-child,.shell:has(.tabletop) .hand-peek-strip>:last-child{margin-inline-end:auto}
@media(max-width:1100px){.shell:has(.tabletop) .hand-dock{left:50%;right:auto;width:calc(100vw - 400px)}}
@media(max-width:650px){.shell:has(.tabletop) .hand-dock{left:50%;right:auto;width:calc(100vw - 24px)}}
.community-footer{display:flex;justify-content:center;flex-wrap:wrap;gap:12px 24px;margin-top:18px;padding-top:14px;border-top:1px solid #52675c}.community-footer a{color:#e9c987;font-size:14px;min-height:44px;display:flex;align-items:center;text-decoration:underline;text-underline-offset:4px}
/* Both players read from the same right-hand command area. */
.tabletop .mat-half,.tabletop .mat-half.opponent-half{grid-template-columns:minmax(0,1fr) 110px 155px;grid-template-rows:20px minmax(0,1fr) 62px;grid-template-areas:"player player player" "field command resources" "camp piles piles";gap:5px 10px}
.tabletop .mat-command,.tabletop .your-half .mat-command{align-self:center;max-height:100%;min-width:0}
.tabletop .mat-resources{align-self:center;max-height:100%;min-height:0;overflow:auto}
.tabletop .mat-piles{display:grid;grid-template-columns:1fr 1fr;align-items:stretch;gap:10px;min-width:0;min-height:0}
.tabletop .mat-piles .pile{min-height:0;height:100%;display:grid;grid-template-columns:22px 1fr auto;align-content:center;gap:4px;padding:8px;box-shadow:2px 2px 0 #64765b55}
.tabletop .mat-piles .pile small{display:none}.tabletop .mat-piles .pile strong{font-size:13px}.tabletop .mat-piles .pile b{font-size:20px}
@media(max-width:1100px){.tabletop .mat-half,.tabletop .mat-half.opponent-half{grid-template-columns:minmax(0,1fr) 90px 125px;gap:4px 6px}.tabletop .mat-piles{gap:6px}}
@media(max-width:650px){.tabletop .mat-half,.tabletop .mat-half.opponent-half{grid-template-columns:minmax(0,1fr) 70px 92px;grid-template-rows:17px minmax(0,1fr) 46px;gap:3px}.tabletop .mat-piles .pile{grid-template-columns:16px 1fr auto;padding:4px;gap:2px;min-height:44px}.tabletop .mat-piles .pile strong{font-size:11px}.tabletop .mat-piles .pile b{font-size:16px}.tabletop .mat-piles .pile .resource-icon{width:16px;height:16px}}
