.match-setup{display:inline-block;vertical-align:top;width:min(100%,420px);padding:12px}.match-curtain{text-align:center;padding:80px 16px}
.tactical-board{position:fixed;inset:54px 12px 10px;z-index:8;background:#10191e;display:grid;grid-template-columns:minmax(195px,23%) minmax(0,1fr) minmax(235px,25%);gap:12px;padding:10px;border:1px solid #334851;border-radius:12px;overflow:hidden;font-size:12px}
body:has(.page:not([hidden]) .tactical-board) header{display:none}body:has(.page:not([hidden]) .tactical-board) nav{height:46px;flex-wrap:nowrap;overflow:auto;padding:5px 12px;white-space:nowrap}body:has(.page:not([hidden]) .tactical-board) nav button{font-size:12px;padding:5px 10px}.page[hidden] .tactical-board{display:none}
.card-preview,.response-rail{min-width:0;background:#19262d;border:1px solid #334851;border-radius:8px;padding:12px;overflow:auto;scrollbar-width:thin}.card-preview>img{width:100%;max-height:48vh;object-fit:contain}.card-preview .canonical-text{white-space:pre-wrap;color:#e4ecee;line-height:1.5}.usage-ready{color:#b9e692}.usage-used{color:#f1bb73}.card-preview h2{font-size:16px}
.board-center{min-width:0;display:flex;flex-direction:column;overflow:hidden;gap:3px}.board-status{display:flex;gap:8px;align-items:center;flex-wrap:wrap;min-height:24px}.board-status button{font-size:10px;padding:3px 6px}.board-status span{color:#c8ee94}.player-field{flex:1;min-height:0;display:flex;flex-direction:column;gap:3px;padding:5px;border:1px solid #314954;border-radius:8px;background:radial-gradient(ellipse at center,#233943,#152229)}.player-field h3{font-size:11px;margin:0}.enemy-field{flex-direction:column}.own-field .leader-row{order:-1}.own-field h3{order:-2}.enemy-field .match-hand{order:-2}.enemy-field h3{order:-3}.own-field .resource-line{order:4}.own-field .match-hand{order:5}
.field-row{display:grid;grid-template-columns:52px minmax(0,1fr) 26px;gap:5px;min-height:0;flex:1}.match-slots{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;min-height:0}.unit-slot{border:1px dashed #5b6e73;border-radius:6px;min-height:60px;display:grid;place-items:center;min-width:0}.unit-slot>small{font-size:9px;color:#8ba1ad}.match-card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px;border:1px solid #6d828b;border-radius:5px;background:#142027;min-width:0;width:100%;height:100%;overflow:visible;color:#fff;cursor:pointer}.match-card img{display:block;width:100%;height:calc(100% - 14px);min-height:0;object-fit:contain;transition:transform .12s}.match-card.exhausted img{transform:rotate(18deg) scale(.84);filter:brightness(.75)}.match-card.exhausted{border-color:#f0ba72}.card-name{font-size:8px;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.card-stats{position:absolute;bottom:0;background:#101b23ef;width:100%;text-align:center;font-size:9px;line-height:14px;white-space:nowrap}.leader-row{height:clamp(58px,10vh,108px);display:flex;gap:12px;justify-content:center}.leader-slot,.location-slot{width:clamp(44px,5vw,78px);height:100%;display:grid;place-items:center}.location-slot{border:1px dashed #486373;border-radius:4px}.own-field .leader-row{flex-direction:row-reverse}.leader-row .card-name{display:none}
.resource-line{display:grid;grid-template-columns:repeat(10,1fr);gap:4px;margin:1px 55px}.indice{border:1px solid #94bca0;border-radius:3px;background:#417764;color:#efffe4;display:grid;place-items:center;height:20px;font-weight:bold}.indice.exhausted{transform:rotate(14deg) scale(.87);background:#7a5435;border-color:#d7ae80}.indice.empty{opacity:.2;background:transparent}.match-life{display:flex;flex-direction:column;gap:2px;justify-content:center}.life-back,.life-used,.hand-back,.deck-back{border:1px solid #708595;border-radius:3px;background:repeating-linear-gradient(45deg,#293f55,#293f55 5px,#1c2c3e 5px,#1c2c3e 10px);text-align:center}.match-life span{height:19px;font-size:9px}.life-used{opacity:.2}.pile-zones{display:flex;flex-direction:column;justify-content:center;gap:4px}.pile-zones button{font-size:8px;padding:4px 1px}.deck-back{font-size:9px;padding:7px 1px}.match-hand{display:flex;min-height:28px;gap:3px;overflow-x:auto;overflow-y:hidden;justify-content:center;height:clamp(48px,8vh,92px);flex-shrink:0;padding:2px}.match-hand .match-card{flex:0 0 clamp(32px,3.6vw,64px);width:clamp(32px,3.6vw,64px)}.enemy-field .match-hand{height:24px;min-height:24px;align-items:center}.hand-back{display:block;width:13px;height:20px;font-size:9px}
.response-rail{display:flex;flex-direction:column;gap:8px;overflow:hidden}.response-rail h2{font-size:14px;margin:0}.response-rail h3{font-size:12px;margin:0 0 4px}.response-rail p{font-size:11px;margin:3px 0}.priority-controls{flex-shrink:0;border-bottom:1px solid #536770;padding-bottom:8px}.priority-controls button{font-size:12px;font-weight:bold;padding:9px;margin-right:5px}.pass-response{background:#355e85}.end-turn{background:#586d32}.match-stack{max-height:12vh;overflow:auto;flex-shrink:0}.match-actions{overflow:auto;min-height:35px;max-height:27vh;flex:1}.match-actions label{display:block;font-size:11px}.match-actions select{font-size:11px;width:100%;padding:4px}.match-actions button{font-size:11px;padding:5px;margin:2px 0}.public-log{min-height:80px;overflow:auto;flex:1;border-top:1px solid #47606d;padding-top:8px}.public-log p{padding:4px 0;border-bottom:1px solid #263942}.match-choice{max-height:35vh;overflow:auto;flex-shrink:0}.choice-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.choice-gallery .match-card{height:110px}.choice-input{position:absolute;width:1px!important;height:1px!important;opacity:0;pointer-events:none}.candidate{box-shadow:0 0 0 2px #b2e970;cursor:pointer}.chosen{box-shadow:0 0 0 3px #ffd56c;background:#675c31}.not-candidate{opacity:.55;cursor:default}.zone-dialog{max-width:650px;width:85vw;max-height:80vh;background:#19262d;color:white;border:1px solid #71868e;border-radius:8px}.zone-dialog::backdrop{background:#0009}.network-settings-open{position:fixed;z-index:25;top:60px;left:20px;max-width:400px;max-height:80vh;overflow:auto;box-shadow:0 0 0 100vmax #0009}.network-config .close-settings{display:none}.network-settings-open .close-settings{display:block}.waiting-choice{color:#ffd56c}
@media(min-width:1700px){.tactical-board{font-size:14px}.card-name{font-size:10px}.card-stats{font-size:11px}.response-rail p,.match-actions select,.match-actions button{font-size:13px}}
@media(max-width:950px){.tactical-board{position:relative;inset:auto;display:grid;grid-template-columns:minmax(0,1fr);overflow:visible;height:auto}.card-preview{display:none}.board-center{height:700px}.response-rail{position:sticky;bottom:0;z-index:10;max-height:45vh}.response-rail .public-log{display:none}.response-rail .match-stack{max-height:60px}.field-row{grid-template-columns:35px minmax(0,1fr) 16px}.match-slots{gap:2px}.resource-line{margin:0 36px}.match-card .card-name{font-size:6px}.card-stats{font-size:7px}.page{padding:8px}.match-setup{width:100%}.match-actions select{max-width:100%}.network-settings-open{left:5px;right:5px}}
/* Both Leaders share the same central column; each Lieu sits on its owner's side. */
.leader-row{display:grid;grid-template-columns:repeat(3,clamp(44px,5vw,78px));justify-content:center}.leader-slot{grid-column:2;grid-row:1}.location-slot{grid-column:1;grid-row:1}.own-field .location-slot{grid-column:3}.resource-line{min-height:64px;flex-shrink:0;align-items:center;gap:3px;margin:1px 8px}.indice{height:56px;width:40px;margin:auto;background-image:url('../assets/system/indice.png');background-size:cover;color:transparent}.indice.exhausted{transform:rotate(90deg);background-image:url('../assets/system/indice.png');filter:none}.indice.empty{background-image:none;border-style:dashed}.match-life span{height:28px;margin-top:-5px}

@media(max-width:950px){.resource-line{min-height:32px;gap:1px;margin:0}.indice{width:18px;height:26px}}
/* Phase 6.2: functional TCG board, retaining the three-column layout. */
.tactical-board{grid-template-columns:minmax(210px,22%) minmax(0,1fr) minmax(250px,23%);gap:10px}
.player-identity{display:flex;align-items:center;gap:8px;flex-shrink:0;height:32px}.avatar{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:#47636c;color:#fff;font-size:12px;border:2px solid #809899}.player-identity strong{font-size:13px}.player-identity small{font-size:9px;color:#a3bac4}.player-badge{margin-left:auto;padding:4px 7px;border-radius:12px;background:#263e46;font-size:10px}.has-priority .player-badge{background:#acd878;color:#162421;box-shadow:0 0 12px #acd87855}.own-field{border-color:#6d9d79}.enemy-field{border-color:#566878}
.field-row{grid-template-columns:72px minmax(0,1fr) 76px;gap:8px}.own-field .pile-zones{grid-column:3;grid-row:1}.own-field .match-slots{grid-column:2;grid-row:1}.own-field .match-life{grid-column:1;grid-row:1}
.unit-slot{min-height:80px;padding:3px}.match-card img{max-height:100%;object-fit:contain}.match-card.exhausted img{transform:rotate(90deg) scale(.78);filter:none}.match-card .card-stats{font-size:10px;line-height:17px;border-radius:3px;background:#0b141eea}.selected-card{outline:3px solid #f1cf7b}.playable{border-color:#84ac7a}.drop-legal{outline:2px solid #b5f29a!important;box-shadow:inset 0 0 15px #80cf6533}.dragging{opacity:.45}.match-card[draggable=true]{cursor:grab}.match-card[draggable=true]:active{cursor:grabbing}
.zone-pile{position:relative;min-height:44px;width:62px!important;flex-shrink:0;border:1px solid #8ca2aa!important;border-radius:5px;background:repeating-linear-gradient(45deg,#243e4b,#243e4b 7px,#1b303c 7px,#1b303c 14px)!important;box-shadow:2px 2px 0 #0c1921,4px 4px 0 #657883;color:#e6f2f4;font-size:10px!important;padding:6px 3px!important;text-align:center}.zone-pile strong{display:block;font-size:20px}.pile-zones{gap:9px;align-items:center}.pile-zones [data-zone=equipment]{min-height:25px;box-shadow:none;background:#21323c!important}.zone-pile:hover{border-color:#d7e6b2!important}
.match-life{align-items:center;gap:0;justify-content:center}.match-life strong{font-size:11px;margin-bottom:9px}.match-life span{display:block;width:48px;height:65px;min-height:65px;flex-shrink:0;margin-top:-40px;border:1px solid #94aab8;box-shadow:1px 2px 2px #0008;color:transparent}.match-life span:first-of-type{margin-top:0}.life-back{background:repeating-linear-gradient(40deg,#456174,#456174 5px,#243a4e 5px,#243a4e 10px)}.life-used{border-style:dashed!important;background:transparent;box-shadow:none!important;opacity:.17}
.leader-row{height:clamp(72px,10vh,112px);grid-template-columns:repeat(3,clamp(55px,5.3vw,82px))}.leader-slot,.location-slot{width:clamp(55px,5.3vw,82px)}.leader-slot{border:1px solid #d5c38a;border-radius:5px}.enemy-field .leader-slot img{transform:rotate(180deg)}.enemy-field .leader-slot .exhausted img{transform:rotate(270deg) scale(.78)}.location-slot{background:#253a4266}.own-field .leader-row{order:-1}.own-field .resource-count{order:3}.resource-count{font-size:10px;color:#bdcebd;text-align:center;flex-shrink:0}.resource-line{min-height:52px;margin:0 77px;gap:2px}.indice{width:32px;height:45px}.indice.exhausted{transform:rotate(90deg);filter:none}
.match-hand{height:clamp(60px,9vh,108px);min-height:60px;overflow-y:visible;align-items:center;padding:3px 15px}.match-hand .match-card{flex-basis:clamp(40px,3.6vw,66px);transition:transform .12s;margin-left:calc(min(0px,(9 - var(--hand-count))*3px))}.match-hand .match-card:hover{transform:translateY(-7px);z-index:4}.enemy-field .match-hand{min-height:24px;height:24px;overflow:hidden}.preview-meta{color:#b7cdab;font-size:12px}.usage-used{color:#89949a}.public-log p{border-left:2px solid #7c9c7e;padding-left:7px}.flying-back{position:fixed;width:42px;height:58px;border:1px solid #a7c2d0;border-radius:4px;background:repeating-linear-gradient(45deg,#476478,#476478 5px,#223a4b 5px,#223a4b 10px);z-index:100;pointer-events:none}
@media(max-width:1200px) and (min-width:951px){.field-row{grid-template-columns:52px minmax(0,1fr) 50px;gap:3px}.zone-pile{width:44px!important;min-height:35px;font-size:8px!important}.match-life span{width:37px;height:50px;min-height:50px;margin-top:-32px}.resource-line{margin:0 35px}.indice{width:23px;height:32px}.player-identity small{display:none}.card-stats{font-size:8px!important}}
@media(max-width:950px){.tactical-board{grid-template-columns:minmax(0,1fr)}.board-center{height:970px}.field-row{grid-template-columns:43px minmax(0,1fr) 43px;gap:3px}.zone-pile{width:38px!important;font-size:8px!important;min-height:38px}.match-life span{width:32px;height:45px;min-height:45px;margin-top:-28px}.resource-line{margin:0;min-height:30px}.indice{width:18px;height:26px}.player-identity small{display:none}.match-hand{min-height:65px}.player-identity strong{font-size:11px}.player-badge{font-size:8px}.resource-count{font-size:9px}}
@media(prefers-reduced-motion:reduce){.match-card,.match-card img{transition:none!important}}
/* Keep the fixed-height field and resource rows from overlapping. */
.leader-row{height:clamp(70px,8.5vh,98px);flex-shrink:0}.match-hand{height:clamp(60px,8vh,88px);flex-shrink:0}.field-row{min-height:155px}.unit-slot{min-height:0}.pile-zones{gap:4px}.zone-pile{min-height:36px;padding:4px 2px!important}.deck-back.zone-pile{min-height:48px}.pile-zones [data-zone=equipment]{min-height:20px}.match-life span{height:56px;min-height:56px;margin-top:-35px}.match-life strong{margin-bottom:5px}
@media(min-width:951px) and (max-height:850px){.player-identity{height:25px}.avatar{height:24px;width:24px}.leader-row{height:62px}.match-hand{height:56px;min-height:56px}.field-row{min-height:105px}.zone-pile{min-height:23px;font-size:8px!important}.deck-back.zone-pile{min-height:30px}.zone-pile strong{font-size:13px}.pile-zones{gap:2px}.match-life span{height:40px;min-height:40px;margin-top:-27px}.resource-line{min-height:35px}.indice{width:23px;height:32px}.resource-count{font-size:8px}.card-stats{font-size:8px!important}}
.leader-row{grid-template-rows:minmax(0,1fr)}.leader-slot,.location-slot{min-height:0}.leader-slot .match-card,.location-slot .match-card{min-height:0;overflow:hidden}.indice.exhausted{background-size:cover;background-position:center}
/* Phase 6.2.2: resources and attachments, no independent equipment zone. */
.resource-line{margin:0 24px;min-height:62px;grid-template-columns:repeat(10,minmax(0,1fr));gap:2px}.indice{width:39px;height:55px;padding:0;background-position:center}.unit-slot{position:relative}.attached-equipment{position:absolute;right:0;bottom:19px;display:flex;gap:2px;z-index:2}.attached-equipment .match-card{width:24px;height:34px}.attached-equipment .card-name{display:none}.stack-source{display:flex;align-items:center;gap:8px}.stack-source button{padding:0;flex:0 0 34px;background:none}.stack-source img{width:34px;height:48px;object-fit:contain}.priority-controls label{display:flex;align-items:center;gap:8px;margin-bottom:7px}.priority-controls select{width:auto;font-size:11px;padding:3px}
@media(min-width:951px) and (max-width:1450px){.resource-line{margin:0 12px;min-height:44px}.indice{width:28px;height:39px}}
@media(max-width:950px){.resource-line{margin:0;min-height:32px}.indice{width:20px;height:28px}}
.stack-effect-text{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#b7c9d0}.stack-source>div{min-width:0}.stack-source small{font-size:10px;color:#d3eaa9}
