/* Royal command board: original square geometry, persistent spell tabs. */
#game{max-width:720px;--tile:clamp(58px,10.5vw,92px);--field-height:var(--tile);margin:0 auto}
#game .gamegrid{display:flex;flex-direction:column;gap:14px;align-items:stretch}
#game .boardpanel{padding:13px 18px 10px;border:1px solid #ffdd81;border-radius:5px;background:linear-gradient(105deg,#061626d9,#05111fd9),url('/assets/ui/tiles/stone-3.webp') center/180px;box-shadow:inset 0 0 0 3px #091425,inset 0 0 0 4px #9b7235,inset 0 0 0 6px #07111e,0 16px 50px #0008;overflow:visible}
#game .boardpanel::before,#game .boardpanel::after{display:none}
#game .royal-corner{position:absolute;z-index:3;pointer-events:none;width:33px;height:33px;background:url('/assets/battle-v3817/corner.svg') center/contain no-repeat}
#game .corner-tl{left:-3px;top:-3px}#game .corner-tr{right:-3px;top:-3px;transform:rotate(90deg)}#game .corner-br{right:-3px;bottom:-3px;transform:rotate(180deg)}#game .corner-bl{left:-3px;bottom:-3px;transform:rotate(270deg)}
#game #battlefield{max-width:620px;margin:0 auto;padding:0}
#game .board,#game .colheads{gap:2px;grid-template-columns:repeat(6,var(--tile));justify-content:center}
#game .board{grid-template-rows:repeat(5,var(--tile))}
#game .tile{width:var(--tile);height:var(--tile);border-radius:3px;border-color:#b5a16a}
#game .tile.defense-row{border-radius:3px!important}
#game .colheads{font:18px/23px Georgia,serif;height:23px}
#game .tile img.chip{width:93%;height:93%;object-fit:contain}
#game .area-head{padding:7px 31px 7px 4px;min-height:75px;border-color:#9b6bce;border-radius:0;background:linear-gradient(105deg,#2c103b,#090d17 75%);box-shadow:inset 0 1px #e6c98622,inset 0 -1px #000;}
#game .area-head.player-footer{margin-top:7px}
#game .commander-portrait{width:70px;height:70px;flex:0 0 70px;margin:-6px 0 -6px -4px;box-shadow:0 0 0 2px #0a1525,0 0 0 3px #d3a34b,0 4px 10px #0008;border-color:#ffe09a}
#game .commander-identity{gap:10px}
#game .commander-copy>strong{font:600 17px Georgia,serif;color:#fff3dc}
#game .commander-copy>small{font-size:15px;color:#ded6c9}
#game .mini-stats{gap:12px;justify-content:flex-start;align-items:center;margin-top:7px;flex-wrap:nowrap}
#game .mini-stats>span{gap:4px;font:16px Georgia,serif}
#game .resource-gem{width:23px;height:23px;flex:none;filter:drop-shadow(0 1px 2px #0008)}
#game .health-track{width:78px;height:8px;margin-left:3px;border-color:#a98750;box-shadow:inset 0 0 0 1px #391018}
#game .health-fill{background:linear-gradient(#ff9b7d,#f4413c 45%,#9d1525)}
#game #myAP,#game #enemyAP{font-size:23px;font-weight:400}
#game #myAP::before,#game #enemyAP::before{font:14px Georgia,serif}
#game .area-head::after{right:3px;top:-4px;width:25px;height:79px;padding-top:13px;font-size:24px;filter:drop-shadow(0 2px 2px #000)}
#game .battle-divider{margin:11px -17px 5px;border-color:#e0b562;box-shadow:0 1px #553b1b}
#game .battle-divider::after{width:13px;height:13px;top:-8px;background:#7a5620;border-color:#ffe9a2;box-shadow:0 0 0 3px #1a1c20,0 0 0 4px #a47b37}
#game .battle-actions{max-width:610px;margin:17px auto 0}
#game #controls{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px;align-items:start}
#game #controls>button{display:flex;flex-direction:column;gap:7px;align-items:center;justify-content:flex-start;padding:4px 3px 10px;margin:0;width:100%;height:auto;min-height:118px;border:1px solid transparent;border-radius:15px;background:transparent;box-shadow:none;color:#f8e6bb;font:14px Georgia,serif;text-align:center;overflow-wrap:normal;transition:background .16s,border-color .16s}
#game #controls .action-emblem{display:flex;align-items:center;justify-content:center;width:64px;height:64px;flex:none;border:2px solid #d4ad60;border-radius:50%;background:radial-gradient(circle at 36% 22%,#335674,#122a43 56%,#07111e 78%);box-shadow:0 0 0 2px #091525,0 0 0 3px #84612c,inset 0 0 0 3px #061426,inset 0 0 0 4px #a58348,0 5px 12px #0007;color:#ffe6a1}
#game #controls .action-emblem svg{width:33px;height:33px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 2px 1px #000)}
#game #controls .action-caption{display:block;line-height:1.22;max-width:100%;min-height:36px}
#game #controls .action-caption small{display:block;font:10px/1.4 system-ui,sans-serif;color:#b7b8b9;margin-top:4px}
#game #controls>button:hover:not(:disabled){background:#dfb8580d;border-color:#c8a35a44;filter:none}
#game #controls>button:hover:not(:disabled) .action-emblem{color:#fff3bf;box-shadow:0 0 0 2px #091525,0 0 0 3px #e7c77b,inset 0 0 0 3px #061426,inset 0 0 0 4px #b99b57,0 0 18px #c99b3244}
#game #controls>button.active .action-emblem{background:radial-gradient(circle at 40% 25%,#9b542f,#3b1c1d 70%);border-color:#ffdb95;box-shadow:0 0 0 3px #76582b,0 0 16px #e8752455}
#game #controls>button:disabled{opacity:.4;filter:saturate(.45)}
#game button:focus-visible,.hand-card-dialog button:focus-visible{outline:2px solid #fff0aa;outline-offset:4px}
#game #cardTabs{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:9px;padding-top:12px;border-top:1px solid #b58a434d;counter-reset:hand}
#game #cardTabs>button{counter-increment:hand;position:relative;min-width:0;min-height:48px;padding:9px 6px 9px 22px;border:1px solid #a9874c;border-top:2px solid #e2bf76;border-radius:7px 7px 2px 2px;background:linear-gradient(#243a53,#0b1b30);box-shadow:inset 0 0 0 2px #07121e;color:#f9e2ab;font:13px/1.25 Georgia,serif;text-align:center;white-space:normal;overflow-wrap:anywhere}
#game #cardTabs>button::before{content:counter(hand);position:absolute;left:7px;top:50%;transform:translateY(-50%);font:12px Georgia,serif;color:#dcb76e}
#game #cardTabs>button:disabled{border-style:solid;opacity:.35}
#game #cards,#game .sidebar>h3,#game .sidebar-kicker{display:none!important}
#game .turn-actions{max-width:620px;margin:14px auto 0;border:1px solid #bc9347;border-radius:3px;padding:7px 9px;gap:12px;background:linear-gradient(#0c1a2a,#030a13);box-shadow:inset 0 0 0 2px #0d1723}
#game .turn-actions .gametop{min-width:0;flex-wrap:wrap;gap:5px}
#game #endTurn{min-width:155px;min-height:38px;border-radius:5px 12px 12px 5px;background:linear-gradient(#ffe9a3,#e6b348 48%,#c58b23);box-shadow:inset 0 1px #fff3be,inset 0 -2px #81571f,0 2px 5px #0008;font-size:15px;padding:7px 13px}
#game #endTurn::after{content:'❯';margin-left:12px;font-size:16px}
#game .action-lights{gap:6px}
#game .action-lights i{width:15px;height:15px;box-shadow:0 0 6px #eeb3467a,inset 0 1px 2px #fff9}
#game .action-lights i.spent{box-shadow:none}
#game .sidebar{background:#08121dd9;border:1px solid #826637;border-radius:6px;padding:12px 16px}
#game .sidebar details{margin:0;padding:9px 0;border-bottom:1px solid #a181422b;color:#cfc4ac;font-size:13px}
#game .sidebar details:last-child{border-bottom:0}
#game .sidebar summary{cursor:pointer;color:#e3c58c;font-family:Georgia,serif}
#game .sidebar .log{margin-top:10px}
#game #arcaneChoice{margin:12px 0}
.hand-card-dialog{border-radius:8px;border-color:#d9b168;background:radial-gradient(ellipse at top,#223b56,#071523 70%);box-shadow:inset 0 0 0 3px #09121e,inset 0 0 0 4px #896938,0 20px 70px #000b}
.hand-card-dialog header{padding-top:5px}
.hand-card-dialog #handCardContent .card-actions button{border-radius:22px;text-align:center;font-size:14px}
.hand-card-dialog .cast-button{background:linear-gradient(#f6d98c,#b88836);border-color:#ffe2a0;color:#211709;text-shadow:none}
@media(max-width:720px){
 #game{--tile:min(12.2vw,76px);--field-height:var(--tile)}
 #game .boardpanel{padding:10px 12px}
 #game .commander-copy>strong{font-size:15px}#game .commander-copy>small{font-size:13px}
 #game .commander-portrait{width:60px;height:60px;flex-basis:60px}
 #game .area-head{min-height:66px;padding-right:26px}
 #game .mini-stats{gap:8px}#game .mini-stats>span{font-size:14px}
 #game .health-track{width:56px}
 #game .area-head::after{height:70px;width:22px;font-size:22px}
 #game .battle-divider{margin-left:-11px;margin-right:-11px}
}
@media(max-width:480px){
 #game{--tile:calc((100vw - 64px)/6);--field-height:var(--tile)}
 #game .boardpanel{padding:9px 9px 8px}
 #game .colheads{height:21px;font-size:15px;line-height:21px}
 #game .area-head{padding:4px 20px 4px 0;min-height:56px}
 #game .commander-identity{gap:6px}
 #game .commander-portrait{width:47px;height:47px;flex-basis:47px;margin-left:0}
 #game .commander-copy>strong{font-size:12px}#game .commander-copy>small{font-size:11px}
 #game .mini-stats{gap:5px;margin-top:5px}
 #game .mini-stats>span{font-size:11px;gap:2px}
 #game .resource-gem{width:16px;height:18px}
 #game .health-track{width:34px;height:6px;margin-left:1px}
 #game #myAP,#game #enemyAP{font-size:17px}#game #myAP::before,#game #enemyAP::before{font-size:11px}
 #game .area-head::after{width:18px;height:57px;padding-top:10px;font-size:19px;right:1px}
 #game .battle-actions{margin-top:12px}
 #game #controls{gap:3px}
 #game #controls>button{font-size:11px;min-height:101px;padding:3px 1px 7px;gap:7px}
 #game #controls .action-emblem{width:49px;height:49px}
 #game #controls .action-emblem svg{width:26px;height:26px}
 #game #controls .action-caption small{font-size:9px}
 #game #cardTabs{gap:5px;padding-top:9px;margin-top:3px}
 #game #cardTabs>button{font-size:12px;min-height:46px;padding-left:18px}
 #game #cardTabs>button::before{left:5px;font-size:10px}
 #game .turn-actions{gap:6px;padding:6px;margin-top:11px}
 #game #endTurn{min-width:108px;min-height:35px;font-size:12px;padding:6px 8px}
 #game #endTurn::after{margin-left:6px;font-size:13px}
 #game .action-lights{gap:4px}#game .action-lights i{width:11px;height:11px}
 #game .battle-divider{margin-left:-8px;margin-right:-8px}
}
@media(max-width:359px){
 #game #controls{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px}
 #game #controls>button{min-height:102px}
 #game .health-track{width:23px}
 #game .mini-stats{gap:3px}
 #game .action-lights{order:0;width:auto}
 #game #turnInfo{font-size:10px}
}
@media(prefers-reduced-motion:reduce){#game #controls>button{transition:none}}
/* Frame follows the board width, avoiding the empty side margins of earlier versions. */
#game{width:min(100%,calc(var(--tile) * 6 + 54px))}
