@charset "UTF-8";
/* Physical card / mat skin; the layout below keeps every control inside one board. */
:root{--paper:#f4eddd;--ink:#303c35;--muted:#73786c;--edge:#c9bea5;--teal:#477c73;--rust:#b46b51;--gold:#bd9852;background:#deded1}
body{background:radial-gradient(ellipse at 50% 25%,#ecebe0,transparent 70%),repeating-linear-gradient(92deg,#7c765803 0 1px,transparent 1px 6px),#deded1}
button,.file-button{min-height:40px;border-radius:5px;padding:8px 14px;background:#f7f2e7;border-color:#c5bba6}button:hover,.file-button:hover{background:#fff9ec;border-color:#8a9c83}button.primary,.dark{background:var(--ink);border-color:var(--ink);box-shadow:0 3px 0 #192d25}button.primary:hover,.dark:hover{background:#476451}.eyebrow{font-size:9px;letter-spacing:1.8px}h1{font-size:21px;letter-spacing:1px}h2{font-size:20px}

/* A die-cut three-part mat, under the live command cards. */
.mat-area{max-width:1240px;margin:18px auto 0}.panels-heading{margin:0 0 10px;align-items:center}.panels-heading>span:last-child{font-size:10px;color:var(--muted)}.player-panels{display:block;width:100%}.player-mat{--player:var(--teal);display:grid;grid-template-columns:minmax(0,1fr) 190px minmax(0,1fr);gap:5px;position:relative;align-items:stretch;filter:drop-shadow(0 6px 3px #3b39291a)}.player-mat.side-b{--player:var(--rust)}.mat-wing,.mat-core{position:relative;isolation:isolate}.mat-wing{padding:18px 18px 13px;min-width:0}.mat-wing::before,.mat-core::before{content:"";position:absolute;inset:0;z-index:-2;background:repeating-linear-gradient(105deg,#82774e04 0 1px,transparent 1px 4px),#eee5ce;border:1px solid #afa180;box-shadow:inset 0 0 0 5px #e1d5b9,inset 0 0 0 6px #c4b897}.day-wing::before{clip-path:polygon(4% 0,100% 4%,100% 97%,3% 100%,0 90%,0 9%)}.night-wing::before{background-color:#dae0d1;clip-path:polygon(0 4%,96% 0,100% 9%,100% 90%,97% 100%,0 97%);box-shadow:inset 0 0 0 5px #cbd3be,inset 0 0 0 6px #aab89d}.mat-wing::after{content:"☀";position:absolute;right:18px;top:6px;font:40px Georgia;color:#b5a06124;z-index:-1}.night-wing::after{content:"☾";color:#6f836830;right:21px}.mat-wing.active-zone .zone-title>span:first-child{color:var(--player)}.mat-wing.active-zone::before{border-color:var(--player)}.zone-title{align-items:center;gap:8px;font-size:10px;color:#727966;margin:0 0 12px;min-height:20px}.zone-title>span:first-child{font:700 18px Georgia,"Microsoft YaHei",serif;letter-spacing:2px;color:#7b785e;white-space:nowrap}.zone-title>span:last-child{font-size:9px}.zone-slots{gap:8px}.empty-slot{height:125px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;border:1px dashed #9b987968;border-radius:6px;color:#9a9c80;background:#73653e05;font-size:10px;box-shadow:inset 0 0 0 3px #f6f1df44}.empty-slot::before{content:"◇";font:22px Georgia;color:#a6a48866}.mat-core{padding:12px 13px 8px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:3px}.mat-core::before{background-color:#f0e8d2;border:1px solid #9a9f80;clip-path:polygon(10% 0,90% 0,100% 7%,100% 93%,90% 100%,10% 100%,0 93%,0 7%);box-shadow:inset 0 0 0 4px #d9cfb1,inset 0 0 0 5px #b6b395}.mat-core-art{height:78px;width:108px;object-fit:contain;mix-blend-mode:multiply;filter:contrast(.95)}.mat-core-art img{width:100%;height:100%;object-fit:contain}.mat-race-title{font:750 17px Georgia,"Microsoft YaHei",serif;letter-spacing:3px;color:#384e3c}.mat-passive{font-size:9px;line-height:1.65;color:#697459;max-width:170px}.mat-resources{display:flex;justify-content:center;gap:13px;align-items:center;margin-top:auto;padding-top:7px;width:100%;border-top:1px solid #b9b28e66}.resource-stack{display:flex;gap:3px;align-items:center;flex-wrap:wrap;justify-content:center;font-size:10px;color:#63714f;max-width:78px}.resource-token{display:inline-grid;place-items:center;width:18px;height:18px;background:#d7b969;border:1px solid #a78949;border-radius:50%;box-shadow:0 2px 0 #9f854a;line-height:1;font:700 10px Georgia}.feather-stack .resource-token{border-radius:70% 15% 70% 15%;background:#496b59;color:#f0e5c8;border-color:#315b48;box-shadow:0 2px 0 #254735;transform:rotate(-15deg)}.mat-footer{font-size:9px;color:#7b8169;line-height:1.6;margin-top:4px}.preview-zone .zone-slots{outline:1px dashed #56785366;outline-offset:4px;border-radius:4px}.preview-card .command-card{outline:1px dashed var(--teal);outline-offset:2px}
/* Raised paper cards: art and text remain independently replaceable. */
.card-slot .detail-button{position:absolute;right:3px;bottom:3px;padding:2px 4px;min-height:23px;min-width:26px;width:auto;border:0;background:#f4eedfde;color:#5e6d54;font-size:9px;border-radius:4px;z-index:3}.card-slot:hover .detail-button{background:#fff7e8}.command-card{border:1px solid #a89a7d;border-bottom:3px solid #b9ac8a;border-radius:6px;background:#f8f0df;box-shadow:1px 3px 5px #50463123;transition:transform .16s,box-shadow .16s}.command-card:hover{background:#fbf4e6;transform:translateY(-4px);box-shadow:1px 7px 10px #50463125;z-index:3}.command-card.chosen{border:1px solid var(--teal);border-bottom-width:3px;outline:2px solid var(--teal);outline-offset:2px;transform:translateY(-5px);box-shadow:0 8px 12px #36594630}.command-card.spent{filter:saturate(.4);opacity:.65}.spent-stamp{position:absolute;top:48%;left:10%;right:10%;transform:rotate(-12deg);font-size:11px;letter-spacing:3px;text-align:center;border:1px solid #74795a;background:#ece7d5e6;color:#667454;padding:2px;pointer-events:none}.card-heading{background:#d8d5b8}.card-art{background:#f5eede;position:relative}.card-illustration{background:transparent;mix-blend-mode:multiply;object-position:50% 48%}.card-upgrade{background:#ece2c9;min-height:28px}.compact{min-height:125px}.compact .card-heading{padding:5px;font-size:10px;min-height:30px}.compact .card-art{height:70px}.compact .card-glyph{font-size:14px}.compact .card-upgrade{font-size:8px;padding:5px 31px 5px 5px;min-height:24px}.card-move .card-heading{background:#bccfc0}.card-gather .card-heading{background:#dec88d}.card-pounce .card-heading{background:#d8ac92}.card-special .card-heading{background:#c4b8d0}
#handTray:empty{display:none}#handTray{margin:13px auto 0;padding:12px 16px 15px;background:#f0ead9;border:1px solid #c4bba2;border-bottom:4px solid #bbad8d;border-radius:5px;max-width:1240px}.hand-tray-header{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#6e775e;margin-bottom:10px;gap:10px}.hand-cards{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:12px}.hand-cards .compact .card-art{height:83px}.hand-cards .compact{min-height:139px}dialog{border:1px solid #b6a680;border-radius:10px;background:repeating-linear-gradient(110deg,#85774703 0 1px,transparent 1px 4px),#f6efdd}dialog::backdrop{background:#2a3b32bf;backdrop-filter:blur(6px)}.setup-intro h2{font:700 28px Georgia,"Microsoft YaHei",serif;letter-spacing:1px}.setup-art{height:116px;gap:25px;margin:17px 0}.setup-art img{height:115px;width:180px;background:none;mix-blend-mode:multiply;border-radius:0}.map-source{background:#e7e6d1;border:1px solid #cecfb8;border-radius:5px}.card-dialog .command-card:hover{transform:none}.handoff-dialog::backdrop{background:#273a32;backdrop-filter:none}

.opponent-identity{display:flex;flex-direction:column;gap:2px;white-space:nowrap}
.opponent-orders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.opponent-period{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
.opponent-period-label{grid-column:1/-1;font-size:8px;line-height:1;text-align:left;letter-spacing:2px;padding-bottom:2px}
.opponent-period.current .opponent-period-label{color:var(--ink);font-weight:750}
.zone-title>:first-child{font:700 17px Georgia,"Microsoft YaHei",serif;letter-spacing:1px;white-space:nowrap}
.mat-wing.active-zone .zone-title>:first-child{color:var(--player)}
.mat-side-label{display:block;font:600 8px/1.5 system-ui,sans-serif;letter-spacing:1px;color:#79816a;margin-bottom:3px}
.mat-race-title h3{font:750 17px/1.25 Georgia,"Microsoft YaHei",serif;letter-spacing:2px}
.resource-label{font-size:9px}.resource-amount{font:750 17px/1 Georgia,serif;color:var(--ink)}
.resource-tokens{display:flex;justify-content:center;align-items:center;width:100%;padding:2px 0 4px}
.resource-token+.resource-token{margin-left:-7px}.resource-overflow{margin-left:4px;font-size:9px}
.hand-cards{grid-template-columns:repeat(10,minmax(0,1fr))}
.confirm-action{max-width:100%;flex-wrap:wrap}.confirm-action .small-help{flex:1;min-width:160px;overflow-wrap:anywhere}
.confirm-action button{flex-shrink:0;white-space:nowrap}.confirm-action .primary{min-width:132px}
.board-hover-tooltip{color:#384b37!important}.map-viewport svg .map-count-label{font-size:4px}
.slot-number{font:italic 23px/1 Georgia,serif;opacity:.55}.empty-slot::before{display:none}
.mat-passive strong{color:#566346;letter-spacing:.5px}.mat-passive p{line-height:1.65}

/* One viewport, one contained tabletop. Long content scrolls inside drawers. */
html,body{width:100%;height:100%;overflow:hidden}
body{background:#bec7b5}
[hidden]{display:none!important}
#gameShell{width:100%;max-width:none;height:100vh;height:100dvh;margin:0;padding:12px;overflow:hidden}
#boardTable{position:relative;isolation:isolate;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:100%;height:100%;min-height:0;padding:0;overflow:hidden;border:1px solid #9ca88e;border-radius:14px;background:#cbd4c3;box-shadow:0 3px 0 #96a38a,0 12px 32px #38452e25}
.table-hud{position:relative;z-index:20;display:grid;grid-template-columns:180px minmax(0,1fr) 120px;align-items:center;gap:24px;padding:10px 18px;min-height:76px;border-bottom:1px solid #a9b49b;background:linear-gradient(#e5e7d8ee,#d8deccf2)}
.board-brand{display:flex;align-items:center;gap:10px;font-size:17px;letter-spacing:2px;font-weight:800;white-space:nowrap}
.brand-mark{display:grid;place-items:center;flex-shrink:0;width:33px;height:36px;font:22px Georgia,serif;transform:rotate(-12deg)}
.board-brand small{display:block;font-size:7px;letter-spacing:2px;margin-top:3px}
.hud-button{display:flex;align-items:center;justify-content:center;gap:7px;font-size:11px;min-height:44px;background:#f5f2e0a6;border-color:#b9c1a6;white-space:nowrap}
.hud-button>span{font-size:22px;line-height:1}.hud-button[aria-expanded="true"]{background:var(--ink);color:var(--paper)}
.scoreboard{width:100%;max-width:850px;grid-template-columns:1fr 118px 1fr;gap:20px;margin:0 auto}
.score,.score.side-b{display:flex;min-width:0;gap:9px;min-height:48px;padding:0;background:none;border:0;box-shadow:none;border-radius:0}
.score-avatar{display:block;width:38px;height:38px;border:2px solid #fff6;background:#f5eedc}.score-name{font-size:12px;white-space:nowrap}
.score-resources{gap:9px;font-size:10px;margin-top:5px;color:#56664e;line-height:1.45}.score-points{font-size:28px;margin-top:0}.score-points small{font-size:10px}
.clock{gap:1px}.clock small,.clock span{font-size:9px;letter-spacing:.5px}.clock strong{font-size:21px;white-space:nowrap}
.board-workspace{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:minmax(0,1fr) auto;min-height:0;min-width:0;overflow:hidden;gap:0;background:#cbd4c3}
.board-scene{grid-column:1;grid-row:1;position:relative;min-width:0;min-height:0;overflow:hidden}
.scene-heading{position:absolute;inset:12px 14px auto;z-index:5;display:flex;align-items:start;justify-content:space-between;gap:12px;pointer-events:none}
.scene-heading>div:first-child{max-width:calc(100% - 108px)}.scene-heading h1{font-size:15px;letter-spacing:.8px;margin-top:3px;color:#52624a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-heading .eyebrow{font-size:7px;color:#6a795e}
.board-controls{display:flex;gap:5px;pointer-events:auto}.board-controls button{background:#f2f1e2e8;border-color:#aab59d;font-size:11px;width:42px;min-height:42px;padding:5px}.board-controls button:first-child{font-size:22px}
.board-scene .map-viewport{position:absolute;inset:56px 0 52px;width:100%;height:auto;min-height:0;border-radius:0;background:#cbd4c3;box-shadow:none}
.map-viewport canvas{display:block}.map-viewport svg{padding:8px;display:block;width:100%;height:100%}
.map-viewport svg .hex{stroke:#a6ae97;stroke-width:.5}.map-viewport svg .legal{stroke:#378894;stroke-width:2}.map-viewport svg .picked{stroke:#d49436;stroke-width:2.5}
.map-viewport svg text{font-size:5px;fill:#36463b}.map-viewport svg .bird-label{font-size:5px}.map-viewport svg .drop-label,.map-viewport svg .map-count-label{font-size:4px}
.scene-caption{position:absolute;inset:auto 14px 9px;display:flex;justify-content:space-between;gap:8px;align-items:center;pointer-events:none;color:#68795d}
.map-legend{display:flex;gap:12px;font-size:9px;border:0;padding:0;color:inherit;flex-wrap:wrap}.map-legend>span{display:flex;gap:4px;align-items:center}
.legend-dot{display:inline-block;width:8px;height:8px;border:2px solid;transform:rotate(30deg);border-radius:2px}.legal-dot{border-color:#378894;background:#d0ebdc}.selected-dot{border-color:#b48932;background:#f5df8a}
.map-gesture-hint{font-size:9px;white-space:nowrap}
.tile-info{position:absolute;left:50%;bottom:30px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 28px);text-align:center;font-size:10px;line-height:1.5;color:#43523e;background:#edf0dfe8;border:1px solid #b9c2a8;padding:4px 10px;border-radius:6px;pointer-events:none;min-height:0;max-height:44px;overflow:hidden}
.board-hover-tooltip{font-size:11px;max-width:220px;line-height:1.6;color:#384b37!important;background:#fff9e8ed!important;border:1px solid #b5bbaa!important;box-shadow:0 6px 15px #30403225!important}

/* Opponent cards stay individually face-up, in an optional public display. */
.opponent-drawer{position:absolute;right:12px;top:calc(100% + 8px);width:min(560px,calc(100vw - 48px));padding:16px;border:1px solid #a8b499;border-radius:8px;background:#eceddd;box-shadow:0 10px 25px #34452f28;max-height:60dvh;overflow:auto}
.opponent-strip{display:flex;align-items:center;gap:16px;color:#586653}.opponent-identity{font-size:10px}.opponent-identity strong{font-size:12px}.opponent-identity span{font-size:9px}
.opponent-orders{gap:12px;min-width:0;flex:1}.opponent-period{gap:4px}.opponent-period-label{font-size:9px;padding-bottom:4px}
.public-order-chip{width:100%;min-width:0;min-height:60px;padding:4px 2px;font-size:9px;text-align:center;background:#f5eedde8;border:1px solid #a5b199;border-bottom:3px solid #abb397;border-radius:4px;box-shadow:0 2px 4px #37463014;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow-wrap:anywhere}
.public-order-chip.spent{opacity:.55;filter:saturate(.2)}.public-order-chip.empty{background:transparent;box-shadow:none;border:1px dashed #aab39b}.public-order-chip .card-glyph{font-size:17px}

/* Action rail is always inside the table; its header remains reachable. */
.action-panel{position:relative;inset:auto;grid-column:2;grid-row:1 / 3;display:flex;flex-direction:column;align-self:stretch;min-width:0;min-height:0;margin:12px 12px 12px 0;padding:0;border:1px solid #b6b89c;border-top:3px solid var(--teal);border-radius:8px;background:#f0ecdc;box-shadow:0 4px 12px #40523312;overflow:hidden}
.action-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0;padding:12px;border:0;border-bottom:1px solid #d1cfb9;background:#ece9d6}
.action-heading h2{font-size:17px;margin-top:5px;overflow-wrap:anywhere}.action-heading .eyebrow{font-size:8px;letter-spacing:.8px}
.fold-button{min-height:36px;min-width:44px;font-size:10px;padding:6px 9px;background:#f6f1e466;border:1px solid #c6c5ad;white-space:nowrap}
.action-content{padding:12px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#aab298 transparent;scroll-padding-block:12px;flex:1}
.status{font-size:11px;line-height:1.65;color:#687260;margin:0 0 10px;padding:0;border:0}
#actionBody{display:flex;flex-direction:column;gap:10px;align-items:stretch;min-width:0}#actionBody>.wide{width:100%;min-width:0}
.action-context-summary{font-size:12px;font-weight:650;line-height:1.5}
.action-section{display:flex;flex-direction:row;gap:6px;align-items:center;flex-wrap:wrap}.section-label{font-size:10px;font-weight:650;margin-right:3px;flex-basis:100%}
.bird-button{width:auto;font-size:10px;padding:7px 9px;min-height:40px;flex:1;white-space:normal}.selected,.bird-button.selected{border-color:var(--teal);background:#e1ebdd}
.option-list{display:flex;flex-direction:column;gap:6px;max-height:none;max-width:100%;padding:2px;overflow:visible}
.option-button{width:100%;font-size:11px;padding:8px 10px;min-height:40px;white-space:pre-line;overflow-wrap:anywhere}
.option-button.chosen{border:1px solid var(--teal);box-shadow:inset 0 0 0 1px var(--teal);background:#e0e9d7}.context-options .option-button{font-size:10px}.route-options{width:100%;border-left:3px solid var(--gold);padding-left:8px}
.confirm-action{position:sticky;bottom:-12px;z-index:4;display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 -2px -2px;padding:10px 2px 4px;border-top:1px solid #c7c4ab;background:#f0ecdc;box-shadow:0 -6px 8px #f0ecdc;max-width:100%}
.confirm-action .small-help{flex-basis:100%;min-width:0;font-size:11px;overflow-wrap:anywhere}.confirm-action button{flex-shrink:0;white-space:nowrap}.confirm-action .primary{flex:1;width:auto;min-width:116px}.confirm-action .quiet{min-width:62px}
.map-option-alternatives{width:100%;font-size:11px;color:var(--muted)}.map-option-alternatives summary{font-size:11px;min-height:34px;padding-block:7px}.map-option-alternatives:not([open]){opacity:.85}
.small-help{font-size:11px}.error:not(:empty){padding:0;margin-top:8px}.plan-counter{font-size:13px}
.bid-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.bid-grid button{min-height:44px;font:700 21px Georgia}
.battle-score{display:flex;gap:12px;justify-content:space-around}.battle-score>div{display:flex;flex-direction:column;align-items:center;gap:5px;padding:6px;background:none}.battle-score strong{font:700 28px Georgia;margin:0}
#boardTable:not(.action-expanded) .action-panel{align-self:start}

/* One dock, four exclusive drawers: no duplicated commands or utility buttons. */
.board-drawer{grid-column:1;grid-row:2;display:flex;flex-direction:column;min-height:0;min-width:0;max-height:min(38dvh,340px);margin:0 12px 10px;padding:0;overflow:hidden;border:1px solid #b2b496;border-radius:9px;background:#e7e5d2;box-shadow:0 -2px 15px #4455320d}
.drawer-header{display:flex;align-items:center;gap:12px;flex-shrink:0;padding:8px 12px;border-bottom:1px solid #c3c6ad;background:#dedfc9}
.drawer-header h2{font-size:13px;letter-spacing:1px;white-space:nowrap}.drawer-hint{font-size:9px;color:#737c65}.drawer-header .fold-button{margin-left:auto}
.drawer-content{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a7af90 transparent;min-height:0;padding:12px;scroll-padding-block:12px}
.dock-panel{min-width:0;margin:0;max-width:none}.drawer-intro{font-size:12px;color:#677359;margin:0 0 12px;line-height:1.7}
.board-dock{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:5px 18px;border-top:1px solid #a8b196;background:#dbe0ca;z-index:15}
.dock-inscription{font:600 9px Georgia,serif;letter-spacing:2px;color:#7b8569;flex:1}.dock-inscription-end{text-align:right;font:10px system-ui;letter-spacing:2px}
.dock-switches{display:flex;gap:5px;justify-content:center}.dock-switches button{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;min-width:96px;min-height:44px;padding:8px 14px;background:#e8e9d8;border-color:transparent;font-size:11px;color:#657058}
.dock-switches button>span{font:17px Georgia;min-width:20px;text-align:center}.dock-switches button:first-child>span{font-size:11px}.dock-switches button>strong{font-weight:650}
.dock-switches button:hover{background:#f2f1de}.dock-switches button.is-active{background:var(--ink);color:#f4efd8;box-shadow:0 2px 4px #3c4e3020}
.dock-switches button.is-active::before{content:"";position:absolute;top:-6px;left:calc(50% - 4px);border-inline:4px solid transparent;border-bottom:5px solid var(--ink)}
/* Quiet utilities use line icons; names appear on the active tab and on hover.
   Every icon also has a persistent accessible name and native title tooltip. */
.dock-switches button:not(:first-child){min-width:48px;width:48px;padding-inline:10px}
.dock-switches button:not(:first-child)>strong{display:none}
.dock-switches button:not(:first-child).is-active{width:auto;min-width:90px}
.dock-switches button:not(:first-child).is-active>strong{display:inline}
.dock-icon{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.action-heading>div{min-width:0}
#boardTable[data-step="confirm"] .action-panel{border-top-color:var(--gold)}
#boardTable[data-phase="combat"] .action-panel,#boardTable[data-phase="reveal"] .action-panel{border-top-color:var(--rust)}
#boardTable[data-phase="upgrade"] .action-panel{border-top-color:#8b789d}
@media(min-width:761px){
 /* Planning is a full tray view; close it to inspect the undistorted board. */
 #boardTable[data-phase="planning"] .board-drawer{grid-row:1 / 3;max-height:none;margin:12px;z-index:8}
 #boardTable[data-phase="planning"].drawer-open .board-scene{visibility:hidden;pointer-events:none}
 #boardTable[data-phase="planning"] #dockMat{display:flex;flex-direction:column}
 #boardTable[data-phase="planning"] #handTray{order:-1;margin:0 0 12px}
 #boardTable[data-phase="planning"] .hand-cards .card-slot{flex-basis:104px}
}
.table-tools{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:8px 2px 16px}.table-tools h3{font:700 21px Georgia,"Microsoft YaHei",serif;margin:5px 0 10px}.table-tools p{font-size:11px;color:#68745b}
.tool-buttons{display:flex;flex-wrap:wrap;gap:8px}.tool-buttons button{font-size:12px;min-height:44px}
.table-reference{border-top:1px solid #c3c5ab;padding-top:12px;font-size:11px;color:#68745b;line-height:1.8}.table-reference a{display:inline-block;margin:5px 20px 0 0;min-height:32px}
#market{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}.contract{padding:14px;background:#f0eada;border:1px solid #c9c4ab;border-radius:5px}.contract p{font-size:11px}
.journal{padding:0;margin:0;border:0;background:none;font-size:12px;color:#647056}.journal ol{margin:0;padding-left:24px;max-height:none;overflow:visible;font-size:12px;line-height:1.7}.journal li{margin-bottom:8px;padding-left:4px}
.mat-area{max-width:none;margin:0}.panels-heading{gap:8px}.panels-heading>span:last-child{max-width:none}
.player-mat{grid-template-columns:minmax(0,1fr) 150px minmax(0,1fr);gap:4px}
.mat-wing{padding:13px 12px 10px}.zone-title{flex-wrap:wrap;align-items:start;gap:4px;margin-bottom:10px;min-height:24px}.zone-title>:first-child{font-size:14px;letter-spacing:.5px}
.zone-slots{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.empty-slot{height:113px}.mat-core{padding:10px 10px 8px}.mat-core-art{height:56px;width:86px}.mat-race-title h3{font-size:15px}
.mat-resources{gap:10px;padding-top:6px}.resource-amount{font-size:16px}.resource-token{width:16px;height:16px;font-size:9px}
.compact{min-height:113px}.compact .card-heading{min-height:30px;font-size:10px}.compact .card-art{height:52px}.compact .card-glyph{display:inline;font-size:12px}.compact .card-upgrade{padding:6px 31px 6px 5px;min-height:28px}
.card-slot .detail-button{min-height:28px;min-width:29px}.command-card.chosen,.command-card:hover{transform:translateY(-3px)}
#handTray{margin:12px 0 0;padding:10px 12px}.hand-tray-header{margin-bottom:6px}
.hand-cards{display:flex;gap:9px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;padding:6px 4px 10px;scrollbar-width:thin}
.hand-cards .card-slot{flex:0 0 94px;scroll-snap-align:start}.hand-cards .compact{min-height:119px}.hand-cards .compact .card-art{height:58px}
dialog{overscroll-behavior:contain}

@media(min-width:1600px){
 .board-workspace{grid-template-columns:minmax(0,1fr) 310px}.player-mat{grid-template-columns:minmax(0,1fr) 175px minmax(0,1fr)}
 .mat-core-art{height:70px;width:100px}.mat-wing{padding:15px 17px 12px}.compact .card-art{height:68px}.empty-slot{height:129px}.zone-slots{gap:9px}
}
@media(max-width:1200px){
 .table-hud{grid-template-columns:42px minmax(0,1fr) 106px;gap:12px;padding:9px 12px}.board-brand>span:last-child{display:none}
 .board-workspace{grid-template-columns:minmax(0,1fr) 252px}.scoreboard{grid-template-columns:1fr 95px 1fr;gap:14px}.score-avatar{width:31px;height:31px}.score-points{font-size:25px}.score-resources{gap:6px;font-size:9px}
 .player-mat{grid-template-columns:minmax(0,1fr) 124px minmax(0,1fr)}.mat-wing{padding:12px 10px 10px}.zone-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.zone-title>:first-child{font-size:13px}
 .mat-core{justify-content:center;gap:7px}.mat-resources{margin-top:5px}.mat-core-art{height:76px;width:90px}
 .drawer-hint,.dock-inscription{display:none}.board-dock{justify-content:center}.scene-caption{justify-content:center}.map-gesture-hint{display:none}.table-tools{align-items:start;gap:14px;flex-wrap:wrap}
}
/* On narrow screens the tray replaces the map area, not the action strip. */
@media(max-width:760px){
 #gameShell{padding:0;padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-left:env(safe-area-inset-left)}
 #boardTable{border-radius:0;border:0;box-shadow:none}
 .table-hud{grid-template-columns:minmax(0,1fr) 48px;gap:6px;min-height:70px;padding:7px 9px}.board-brand{display:none}.scoreboard{max-width:none;grid-template-columns:1fr 82px 1fr;gap:8px}
 .score,.score.side-b{gap:5px;min-height:48px}.score-avatar{display:none}.score-name{font-size:11px}.score-points{font-size:24px}.score-points small{font-size:9px}.score-resources{font-size:9px;gap:5px;max-width:130px;line-height:1.35;margin-top:4px}
 .clock strong{font-size:18px}.clock small,.clock span{font-size:8px;letter-spacing:0}
 .hud-button{min-width:44px;width:48px;min-height:50px;flex-direction:column;gap:2px;padding:4px;font-size:9px;white-space:normal}.hud-button>span{font-size:20px}
 .board-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}.board-scene{grid-column:1;grid-row:1}
 .scene-heading{inset:9px 10px auto}.scene-heading h1{font-size:13px;letter-spacing:0}.scene-heading .eyebrow{font-size:7px}.board-controls button{min-height:44px;width:44px}.board-scene .map-viewport{inset:57px 0 46px}
 .scene-caption{bottom:7px;inset-inline:10px}.map-legend{font-size:8px;gap:9px}.tile-info{bottom:25px;font-size:9px;max-height:36px;padding:3px 7px;max-width:calc(100% - 20px)}
 .action-panel{grid-column:1;grid-row:2;min-height:0;max-height:35dvh;margin:0 8px 7px;align-self:stretch;border-top-width:2px;border-radius:7px}
 .action-heading{padding:6px 10px;min-height:48px}.action-heading>div{display:flex;flex-direction:column;gap:2px;min-width:0}.action-heading h2{font-size:14px;margin:0}.action-heading .eyebrow{font-size:7px;letter-spacing:.7px}
 .fold-button{min-height:40px}.action-content{padding:8px 10px;flex:1}.status{font-size:10px;margin-bottom:7px}
 #actionBody{gap:8px;flex-direction:row;flex-wrap:wrap;align-items:center}#actionBody>.small-help,#actionBody>.action-section,#actionBody>.option-list,#actionBody>.action-context-summary{flex-basis:100%}
 #actionBody>.wide{width:auto;min-width:140px;flex:1}#actionBody>.plan-counter{min-width:72px}
 .bird-button{min-height:44px;font-size:10px}.option-button{min-height:44px;font-size:11px}.section-label{font-size:10px}.option-list{width:100%;flex-direction:row;flex-wrap:wrap}.option-list>.option-button{width:auto;flex:1}
 .confirm-action{position:sticky;bottom:-8px;width:100%;margin:0;padding-top:8px}.confirm-action .small-help{font-size:10px}.confirm-action button{min-height:44px}
 .bid-grid{display:flex;flex-wrap:wrap;gap:5px}.bid-grid button{min-width:40px;flex:1;font-size:18px}.battle-score{width:100%}.battle-score>div{flex-direction:row;gap:8px}
 .board-drawer{grid-column:1;grid-row:1;z-index:8;align-self:stretch;max-height:none;margin:6px 8px 8px;box-shadow:none}.drawer-open .board-scene{visibility:hidden;pointer-events:none}
 .drawer-header{padding:6px 9px;gap:8px}.drawer-header h2{font-size:12px}.drawer-content{padding:10px 8px;flex:1}
 .board-dock{padding:4px 8px calc(4px + env(safe-area-inset-bottom));min-height:58px;gap:0}.dock-switches{width:100%;gap:4px}.dock-switches button{min-width:0;flex:1;min-height:46px;font-size:11px;padding:7px;gap:5px}.dock-switches button>span{min-width:16px;font-size:16px}.dock-switches button:first-child>span{font-size:10px}
 .panels-heading{margin-bottom:8px;gap:5px}.panels-heading>.eyebrow{display:none}.panels-heading>span:last-child{font-size:9px}
 .player-mat{grid-template-columns:1fr 1fr;grid-template-areas:"core core" "day night";gap:5px}
 .mat-core{grid-area:core;padding:8px 10px;min-height:84px;display:grid;grid-template-columns:57px minmax(0,1fr) 80px;grid-template-rows:auto auto;gap:2px 8px;text-align:left}
 .mat-core::before{clip-path:polygon(3% 0,97% 0,100% 12%,100% 100%,0 100%,0 12%)}
 .mat-core-art{grid-row:1/3;grid-column:1;width:56px;height:64px}.mat-race-title{grid-column:2;grid-row:1;align-self:end}.mat-race-title h3{font-size:15px}.mat-side-label{font-size:7px}
 .mat-passive{grid-column:2;grid-row:2;font-size:9px;line-height:1.5;align-self:start}.mat-resources{grid-column:3;grid-row:1/3;margin:0;padding:0 0 0 5px;border:0;border-left:1px solid #bab89e88;flex-direction:column;gap:6px}.resource-stack{max-width:80px;gap:5px}.resource-amount{font-size:15px}.resource-tokens,.mat-footer{display:none}
 .day-wing{grid-area:day}.night-wing{grid-area:night}.mat-wing{padding:12px 10px 10px}.zone-title{min-height:35px;margin-bottom:8px;gap:3px}.zone-title>:first-child{font-size:14px}.zone-title>span:last-child{font-size:8px}
 .zone-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.compact{min-height:122px}.compact .card-heading{min-height:31px;font-size:10px}.compact .card-art{height:57px}.compact .card-upgrade{min-height:31px;padding-right:33px}.empty-slot{height:122px}
 .card-slot .detail-button{min-height:30px;min-width:30px;font-size:8px}#handTray{padding:9px 8px}.hand-tray-header{font-size:10px}.hand-cards .card-slot{flex-basis:100px}.hand-cards .compact .card-art{height:59px}
 #dockMat{display:flex;flex-direction:column}#handTray{order:-1;margin:0 0 12px}
 .opponent-drawer{top:calc(100% + 6px);right:8px;width:calc(100vw - 16px);padding:12px}.opponent-strip{display:block}.opponent-identity{flex-direction:row;align-items:baseline;justify-content:space-between;margin-bottom:10px}.opponent-orders{gap:10px}.public-order-chip{min-height:60px;font-size:9px}
 #market{grid-template-columns:1fr}.table-tools{display:block;padding:4px 2px 12px}.tool-buttons{margin-top:14px}.tool-buttons button{flex:1;white-space:nowrap}.drawer-intro{font-size:11px}
 .setup-intro h2{font-size:23px}.setup-art{height:100px;gap:12px;margin:13px 0}.setup-art img{height:95px;width:130px}
}
@media(max-width:380px){
 .scoreboard{grid-template-columns:1fr 66px 1fr;gap:5px}.score-name{font-size:10px}.score-points{font-size:21px}.score-resources{font-size:8px;gap:4px}.clock strong{font-size:16px}
 .dock-switches button{font-size:10px;padding-inline:4px}.dock-switches button>span{font-size:13px}.drawer-header h2{font-size:11px}
 .mat-core{grid-template-columns:44px minmax(0,1fr) 64px;gap:2px 6px}.mat-core-art{width:44px;height:56px}.mat-wing{padding-inline:8px}.zone-slots{gap:6px}.zone-title>:first-child{font-size:12px}
}
@media(min-width:761px) and (max-height:650px){
 #gameShell{padding:5px}.table-hud{min-height:60px;padding-block:5px}.board-dock{min-height:52px;padding-block:3px}
 /* A short window switches surfaces instead of crushing the live map. */
 .board-drawer,#boardTable[data-phase="planning"] .board-drawer{grid-row:1 / 3;max-height:none;margin:6px 12px;z-index:8}
 .drawer-open .board-scene{visibility:hidden;pointer-events:none}
 .drawer-header{padding-block:4px}.drawer-content{padding:8px}.scene-heading{top:7px}.board-scene .map-viewport{inset:50px 0 42px}.tile-info{bottom:24px}.scene-caption{bottom:6px}
}
@media(max-width:760px) and (max-height:500px) and (min-aspect-ratio:1/1){
 /* Landscape phones keep the decision rail beside, rather than below, the map. */
 .table-hud{min-height:58px;padding-block:4px}.score,.score.side-b{min-height:42px}.hud-button{min-height:44px}
 .board-workspace{grid-template-columns:minmax(0,1fr) min(38vw,248px);grid-template-rows:minmax(0,1fr)}
 .action-panel{grid-column:2;grid-row:1;max-height:none;margin:6px 6px 6px 0}
 .board-drawer{margin:6px}.scene-heading{top:5px}.scene-heading .eyebrow,.scene-caption{display:none}
 .scene-heading h1{font-size:11px}.board-scene .map-viewport{inset:51px 0 30px}.tile-info{bottom:4px;max-height:26px}
 .board-dock{min-height:52px;padding-block:3px;padding-bottom:calc(3px + env(safe-area-inset-bottom))}.dock-switches button{min-height:44px}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
