/* Command Table: tactical desktop, shared-table identity, focused mobile.
   Scoped after the compatibility sheets; engine/card interaction classes stay intact. */
body.game-active #game.command-table {
  --ct-card: 116px;
  --ct-opponent-card: 86px;
  --ct-hand: 178px;
  --ct-hand-extra: 0px;
  --ct-rail: 284px;
  --v3-rail: 0px;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) var(--ct-rail) !important;
  grid-template-rows: 60px 26px minmax(170px, .85fr) auto minmax(200px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) !important;
  grid-template-areas: 'topbar topbar' 'ticker decision' 'opps decision' 'center decision' 'mine decision' 'hand decision' !important;
  width: 100%; height: calc(100 * var(--dvhu)) !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; gap: 0 !important; overflow: hidden !important;
  color: var(--ds-text);
}
body.game-active #game.command-table.empty-hand { --ct-hand: 52px; }
body.game-active #game.command-table[data-hand-size='large']:not(.empty-hand) { --ct-hand-extra: 20px; }
body.game-active #game.command-table::before { display: none !important; }
body.game-active #game.command-table .arenaheader {
  padding: 6px 16px !important; gap: 12px; box-shadow: none !important;
  min-height: 0; background: var(--ds-table) !important;
}
#game.command-table .phasewrap { gap: 16px; }
#game.command-table .phase { gap: 6px; font-size: 13px; }
#game.command-table .phase b { font-size: 21px; }
#game.command-table .arenaheader .stepper { flex: 0 1 auto; }
#game.command-table .stepper .step { padding: 5px; font-size: 9px; }
#game.command-table .hudaction { min-height: 44px !important; padding: 7px 9px !important; font-size: 10px; letter-spacing: .04em; }
#game.command-table .ct-view-switch { display: flex; gap: 2px; margin-left: auto; flex: 0 0 auto; }
#game.command-table .ct-view-button { min-height: 40px; font: 600 13px var(--ds-font-body); padding: 6px 12px; }
#game.command-table .ct-view-button[aria-pressed='true'] { border-color: var(--ds-accent); color: var(--ds-accent-bright); background: rgba(var(--ds-accent-rgb), .10); }
#game.command-table .ticker { grid-area: ticker; min-width: 0; padding: 4px 14px !important; font-size: 11px !important; color: var(--ds-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#game.command-table .ct-seat-ribbon { display: none; grid-area: seats; }
#game.command-table .ct-portrait { display: block; width: 42px; height: 48px; flex: 0 0 auto; object-fit: cover; object-position: 50% 24%; border-radius: 6px; }
#game.command-table .ct-icon { display: inline-flex; align-items: center; }
#game.command-table .ct-icon .gameicon { width: 18px; height: 18px; }

/* Quiet playmats: artwork only belongs to battlefield backgrounds, never cards or controls. */
[data-playmat='felt'] { --playmat-art: repeating-linear-gradient(0deg, #28364833 0 1px, transparent 1px 4px), radial-gradient(ellipse at 85% 15%, #638aa9, transparent 65%), linear-gradient(125deg, #233944, #111e2c); }
[data-playmat='grove'] { --playmat-art: url('../assets/backgrounds/moonlit-grove.svg'); }
[data-playmat='astral'] { --playmat-art: url('../assets/backgrounds/astral-sanctum.svg'); }
[data-playmat='ember'] { --playmat-art: url('../assets/backgrounds/molten-forge.svg'); }
[data-playmat='none'] { --playmat-art: none; }
body.game-active #game.command-table[data-playmat] :is(.opprow, .opprow.activeai, .myboard),
#game .playmatpreview {
  background-color: var(--ds-panel) !important;
  background-image: linear-gradient(rgba(var(--ds-panel-rgb), var(--playmat-cover, .8)), rgba(var(--ds-panel-rgb), var(--playmat-cover, .8))), var(--playmat-art) !important;
  background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important;
}
body.game-active.high-contrast #game.command-table[data-playmat] :is(.opprow, .opprow.activeai, .myboard),
body.high-contrast #game .playmatpreview { background-image: none !important; }
#game .playmatart { background-image: var(--playmat-art); background-color: var(--ds-panel-raised); }
#game .playmatpreview { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px; padding: 18px; border: 1px solid var(--ds-line); border-radius: 10px; }
#game .playmatpreviewlabel { flex: 0 0 100%; color: var(--ds-muted); font: 600 10px var(--ds-font-body); letter-spacing: .12em; }
#game .playmatpreviewcard { display: grid; gap: 6px; justify-items: center; padding: 20px; background: var(--ds-panel); border: 1px solid var(--ds-line); border-radius: 8px; }
#game .playmatpreviewcard > .gameicon { width: 28px; height: 28px; color: var(--ds-accent-bright); }
#game .playmatpreviewcard small, #game .playmathint { color: var(--ds-muted); font: 12px/1.6 var(--ds-font-body); }
#game .playmatpreviewzones { display: flex; flex-direction: column; gap: 6px; }
#game .playmatpreviewzones > span { display: flex; gap: 8px; align-items: center; padding: 7px 10px; background: var(--ds-panel); border: 1px solid var(--ds-line-soft); border-radius: 5px; font-size: 11px; }
#game .playmatpreviewzones b { margin-left: auto; }
#game .playmatpreviewzones .gameicon { width: 18px; height: 18px; }

/* The same public battlefield is shown in both layouts. */
body.game-active #game.command-table .oppsouter { grid-area: opps; padding: 5px 10px 8px !important; min-height: 0; min-width: 0; }
body.game-active #game.command-table .oppswrap,
body.game-active #game.command-table .oppswrap.active-ai-turn {
  display: grid !important; grid-template-columns: repeat(var(--ct-opponent-columns, 3), minmax(0, 1fr)) !important;
  height: 100% !important; min-height: 0 !important; gap: 8px !important; overflow: hidden;
}
/* Counts size the table view without overriding the single-column focus view. */
body.game-active #game.command-table .oppswrap[data-opponent-count='2'] { --ct-opponent-columns: 2; }
body.game-active #game.command-table .oppswrap[data-opponent-count='1'] { --ct-opponent-columns: 1; }
body.game-active #game.command-table .opprow,
body.game-active #game.command-table .opprow.activeai {
  display: flex !important; flex-direction: column; min-height: 0; min-width: 0;
  background: rgba(var(--ds-panel-rgb), .88) !important; border: 1px solid var(--ds-line-soft) !important;
  border-top: 2px solid var(--seat-accent) !important; border-radius: 8px !important; box-shadow: none !important;
}
body.game-active #game.command-table .opphead {
  display: grid !important; grid-template-columns: 42px minmax(0, 1fr) auto 28px !important;
  grid-template-areas: 'portrait name life info' 'portrait meta meta meta' !important;
  gap: 4px 7px !important; min-height: 66px !important; flex: 0 0 auto; padding: 7px 8px !important;
  background: transparent !important; border-bottom: 1px solid var(--ds-line-soft);
}
#game.command-table .opphead > .ct-portrait { grid-area: portrait; }
#game.command-table .opphead .chev,
#game.command-table .opphead .seatindex,
#game.command-table .opphead .personachip,
#game.command-table .activeaitag { display: none !important; }
#game.command-table .opphead .oppname { grid-area: name; min-width: 0; font-size: 13px; line-height: 1.3; }
#game.command-table .oppname .oppidentityicon { display: none; }
#game.command-table .ct-commander-name { display: block; color: var(--ds-muted); font: 500 10px/1.35 var(--ds-font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game.command-table .opphead .playerlifetotals { grid-area: life; }
#game.command-table .opphead .opplife { font: 700 25px/1 var(--ds-font-mono); }
#game.command-table .opphead .oppmeta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; justify-self: stretch; gap: 4px 6px; font-size: 10px; min-width: 0; }
#game.command-table .opphead .oppmeta > .gameicon { flex-shrink: 0; }
#game.command-table .opphead .oppmeta > .zbtn { min-width: 0; max-width: 100% !important; }
#game.command-table .opphead .oppcmd { font-size: 9px; margin: 0 0 0 auto; max-width: 100%; white-space: normal; }
#game.command-table .opphead .tbtn.small { grid-area: info; width: 28px; height: 32px; min-height: 32px; padding: 4px; }
#game.command-table .turntimeline { display: none; }
body.game-active #game.command-table .oppstrip {
  display: flex !important; flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 6px; padding: 7px 8px !important; min-height: 0; flex: 1; overflow: auto !important;
}
body.game-active #game.command-table .oppboardmain { display: flex; flex: 1 0 auto; gap: 6px; min-height: 0; align-items: stretch; }
body.game-active #game.command-table .boardlane { display: flex; flex-direction: column; gap: 4px; padding: 0 !important; min-height: 0; min-width: 0; background: transparent !important; border: 0 !important; }
body.game-active #game.command-table .creaturelane { flex: 2 1 0; }
body.game-active #game.command-table .supportlane { flex: 1 1 0; }
body.game-active #game.command-table .boardlanecards {
  display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; justify-content: flex-start;
  gap: 7px; padding: 3px !important; min-height: 0; max-height: none; overflow: visible; zoom: 1 !important;
}
body.game-active #game.command-table .boardlanelabel { position: static; flex: 0 0 auto; font: 600 10px/1.3 var(--ds-font-body); color: var(--ds-muted); letter-spacing: .06em; }
body.game-active #game.command-table .mini { width: var(--ct-card) !important; height: calc(var(--ct-card) * 1.48) !important; flex: 0 0 auto; margin: 0 0 5px; border-radius: 6px; transform-origin: center; }
body.game-active #game.command-table .mini.sm { width: calc(var(--ct-opponent-card) * var(--ct-opponent-scale, 1)) !important; height: calc(var(--ct-opponent-card) * var(--ct-opponent-scale, 1) * 1.48) !important; }
body.game-active #game.command-table .permanentpile { width: var(--ct-card) !important; flex: 0 0 auto; }
body.game-active #game.command-table .permanentpile.sm { width: calc(var(--ct-opponent-card) * var(--ct-opponent-scale, 1)) !important; }
body.game-active #game.command-table .mini > img { width: 100%; height: calc(100% - 12px) !important; object-fit: contain; object-position: top; border-radius: 6px; }
body.game-active #game.command-table .mini .mname { bottom: 0; font: 600 10px/1.2 var(--ds-font-body); background: var(--ds-panel); padding: 3px; max-height: 29px; }
body.game-active #game.command-table .oppswrap .mini.sm .mname { font-size: 10px; max-height: 29px; }
body.game-active #game.command-table .mini .pt { top: auto !important; bottom: 25px; right: 2px; font-size: 12px; }
#game.command-table .mini.ct-spell-target { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
#game.command-table .mini .damagebadge { bottom: 42px; }
body.game-active #game.command-table .oppresourcelane { display: flex; flex-direction: column; align-items: stretch; gap: 5px; width: 100%; max-width: none; padding: 4px 0 0; min-height: 0; flex: 0 0 auto; background: transparent; border: 0; border-top: 1px solid var(--ds-line-soft); }
body.game-active #game.command-table .oppresourcecards { display: flex; flex-wrap: nowrap; gap: 6px; align-items: flex-start; overflow-x: auto; }
#game.command-table .oppLands { display: flex; align-items: center; gap: 5px; min-height: 38px; width: auto; padding: 7px; white-space: nowrap; font-size: 11px; }
body.game-active #game.command-table .oppresourcecards .mini.sm { width: 56px !important; height: 79px !important; }
body.game-active #game.command-table .center { grid-area: center; min-height: 0; max-height: 116px; overflow: auto; padding: 0 10px !important; }
#game.command-table .center:empty { display: none; }
#game.command-table .ct-inline-stack { display: none !important; }
#game.command-table .combatmap { padding: 6px; margin: 0; }
#game.command-table .combatunit img { height: 45px; width: 32px; }

/* Human battlefield and hand stay separate from the decision rail. */
body.game-active #game.command-table .myboard {
  grid-area: mine; display: flex !important; flex-direction: column; justify-content: flex-start;
  min-height: 0; min-width: 0; overflow: auto !important; gap: 8px;
  padding: 8px 10px !important; margin: 0 10px 6px !important;
  background: rgba(var(--ds-panel-rgb), .75) !important; border: 1px solid var(--ds-line-soft); border-radius: 8px !important;
}
#game.command-table .myboard::before { display: none !important; }
#game.command-table .ct-player-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 0 auto; }
#game.command-table .ct-inspect-commander { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--ds-line); border-radius: 6px; background: transparent; flex: 0 0 auto; }
#game.command-table .ct-player-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#game.command-table .ct-player-name small { font-size: 10px; color: var(--ds-accent-bright); }
#game.command-table .ct-player-name b { font: 650 17px/1.2 var(--ds-font-display); }
#game.command-table .ct-player-head .meinfo { margin-left: auto; flex: 0 0 auto; background: transparent !important; padding: 0 !important; border: 0; gap: 6px; }
#game.command-table .ct-player-head .seatyou { display: none !important; }
#game.command-table .ct-player-name .manapool:empty { display: none; }
#game.command-table .ct-player-name .manapool { margin: 0; }
#game.command-table .ct-player-head .melife { font-size: 27px !important; }
#game.command-table .ct-player-head .zbtn { min-width: 34px; min-height: 34px; }
body.game-active #game.command-table .mybattlefieldmain { display: flex !important; gap: 12px; min-height: 0 !important; flex: 1 0 auto; padding: 0 !important; }
#game.command-table .landrow { display: flex; flex: 0 0 auto; min-height: 0 !important; padding: 0 !important; }
#game.command-table .landstack { min-width: 64px; height: auto; min-height: 48px; padding: 5px; }
#game.command-table .landstack .lname { font-size: 10px; }
#game.command-table .landstack .lcount { font-size: 11px; }
#game.command-table .playerrail:empty { display: none; }
#game.command-table .resourcezone { border: 0; background: transparent; padding: 5px 0; display: flex; flex-wrap: wrap; gap: 6px; }
body.game-active #game.command-table .resourcezone > .boardlanelabel { flex: 0 0 100%; order: -2; }
#game.command-table .resourcezone .landstrip { flex: 0 1 auto; }
#game.command-table .manaartifactstrip { flex-wrap: nowrap !important; overflow: auto; }
body.game-active #game.command-table .manaartifactstrip .mini.sm { width: 64px !important; height: 90px !important; }
#game.command-table .czrow { margin: 0; flex: 0 0 auto; }
#game.command-table .czcard { min-height: 48px; padding: 5px 8px; }
#game.command-table .czcard img { height: 42px; width: 30px; object-fit: contain; }
#game.command-table .czname { font-size: 13px !important; }
body.game-active #game.command-table .handwrap { grid-area: hand; display: flex !important; min-height: 0; padding: 7px 10px !important; align-items: flex-start; gap: 7px; background: rgba(var(--ds-panel-rgb), .96); border-top: 1px solid var(--ds-line); overflow: hidden; }
body.game-active #game.command-table .hand { display: flex; flex: 1; align-items: flex-start; justify-content: safe center; min-height: 0 !important; height: 100% !important; padding: 2px 3px !important; gap: 8px !important; overflow: auto; }
body.game-active #game.command-table .hcard { width: calc((var(--ct-hand) + var(--ct-hand-extra) - 23px) / 1.4) !important; height: calc(var(--ct-hand) + var(--ct-hand-extra) - 23px) !important; flex: 0 0 auto; margin: 0 !important; transform: none; }
body.game-active #game.command-table .hcard:hover { transform: translateY(-2px); }
#game.command-table .handtools { align-self: stretch; flex-basis: 90px; width: 90px; min-width: 0; padding: 2px 0; font-size: 11px; }
#game.command-table .handtools select { width: 100%; min-height: 34px; }
#game.command-table .handwrap > .exiletray,
#game.command-table .handwrap > .suspendtray { max-width: 185px; max-height: 100%; overflow: auto; flex: 0 0 auto; }
/* Exile states share a bounded dock; only actual hand cards enter the hand scroller. */
#game .handzones { display: flex; flex-direction: column; flex: 0 0 220px; width: 220px; min-width: 0; max-width: 35%; height: 100%; min-height: 0; gap: 6px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#game .handzones > :is(.exiletray, .suspendtray) { display: flex; flex-direction: column; flex: 0 0 auto; align-items: stretch; width: 100%; min-width: 0; max-width: none; height: auto; margin: 0; padding: 3px; gap: 3px; box-sizing: border-box; }
#game .handzones :is(.exiletraylist, .suspendtraylist) { display: flex; flex-direction: column; overflow: visible; gap: 4px; }
#game .handzones :is(.exiletraycard, .suspendtraycard) { flex: 0 0 auto; min-width: 0; width: 100%; min-height: 44px; padding: 3px; box-sizing: border-box; grid-template-columns: 24px minmax(0, 1fr); }
#game .handzones .suspendtraycard { grid-template-columns: 24px minmax(0, 1fr) 28px; }
#game .handzones :is(.exiletraycard, .suspendtraycard) img { width: 24px; height: 34px; object-fit: cover; }
#game .handzones .suspendtraycard > span small { display: none; }
#game .handzones .exiletraytitle { font-size: 9px; letter-spacing: .08em; }
#game .handzones .exiletraycard { padding-right: 38px; }
#game .handzones .exiletraycard span { min-width: 0; }
#game .handzones .exiletraycard b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game .handzones .suspendtrayhead small { white-space: normal; }
body.game-active #game.command-table .hand > :first-child { margin-left: 0; }
body.game-active #game.command-table .hand > :last-child { margin-right: 0; }
#game.command-table .handwrap.is-empty .hand { min-height: 38px !important; height: 38px !important; }

/* Preparation belongs to the permanent; each prepared copy has its own action. */
#game .mini .preparedtag { position: absolute; top: 3px; left: 3px; right: 3px; z-index: 4; padding: 3px 2px; border: 1px solid #9b8bc4; border-radius: 3px; background: #272036f2; color: #eee5ff; font: 700 8px/1.2 var(--ds-font-body); text-align: center; pointer-events: none; }
#game .mini .preparedtag.ready { border-color: #a6d6a1; background: #1b3425f2; color: #d8ffd3; }
#game .mini.prepared-castable { outline: 2px solid #91c88c; outline-offset: 1px; }
#game .preparedspell { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #8d7eaa; border-radius: 8px; background: #282237; }
#game .preparedspellhead { display: grid; gap: 5px; }
#game .preparedspellhead > b { color: #cdbde9; font-size: 10px; letter-spacing: .1em; }
#game .preparedspellhead > strong { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 16px; }
#game .preparedspellrules { font-size: 13px; line-height: 1.45; }
#game .preparedspellhint { margin: 0; color: var(--ds-muted); font-size: 11px; line-height: 1.4; }
#game .sheet.preparedsheet { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px; width: min(680px, calc(100 * var(--vwu) - 24px)); max-height: calc(100 * var(--dvhu) - 32px); overflow: hidden; }
#game .preparedsheet > .sheetimg { width: 100%; max-height: min(220px, calc(30 * var(--dvhu))); object-fit: contain; align-self: start; }
#game .preparedsheet .sheetinfo { min-width: 0; min-height: 0; max-height: calc(28 * var(--dvhu)); overflow-y: auto; }
#game .preparedsheet .sheetacts { grid-column: 1 / -1; min-height: 0; max-height: calc(54 * var(--dvhu)); overflow-y: auto; gap: 8px; }
#game .preparedsheet .sheetacts .pbtn { flex-shrink: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  #game .sheet.preparedsheet { grid-template-columns: minmax(0, 88px) minmax(0, 1fr); }
}

/* Preserve hard reviews and their real callbacks while docking their presentation. */
#game.command-table .ct-decision-rail { grid-area: decision; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--ds-panel); border-left: 1px solid var(--ds-line); overflow: hidden; }
#game.command-table .ct-decision-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid var(--ds-line-soft); flex: 0 0 auto; }
#game.command-table .ct-decision-heading h2 { font: 650 18px var(--ds-font-display); color: var(--ds-accent-bright); margin: 0; }
#game.command-table .ct-phase-label { font-size: 11px; color: var(--ds-muted); }
#game.command-table .ct-decision-content { flex: 1 1 0; overflow: auto; min-height: 0; }
#game.command-table .ct-decision-hint { font: 400 14px/1.65 var(--ds-font-body); color: var(--ds-muted); margin: 6px 0; }
#game.command-table .ct-activity { padding: 0 0 0 18px; margin: 8px 0; font: 400 12px/1.6 var(--ds-font-body); color: var(--ds-copy); }
#game.command-table .ct-activity li { padding: 0 0 12px 3px; }
#game.command-table .ct-stack-title { font: 650 14px var(--ds-font-display); }
body.game-active #game.command-table .ct-decision-rail .promptbar { display: block; flex: 0 1 auto; min-height: 0; max-height: 58%; overflow: auto; width: auto !important; margin: 0 !important; padding: 10px 0 !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
#game.command-table .ct-decision-rail .promptbar[hidden] { display: none !important; }
#game.command-table .ct-decision-rail.has-targets .ct-decision-content { display: none; }
body.game-active #game.command-table .ct-decision-rail.has-targets .targetprompt { display: flex; flex: 1 1 auto; max-height: none; overflow: hidden; gap: 10px; }
#game.command-table .targetprompthead { flex: 0 0 auto; align-items: flex-start; }
#game.command-table .targetpromptbody { flex: 1 1 auto; }
#game.command-table .targetpromptactions { flex: 0 0 auto; margin: 0; padding-top: 6px; border-top: 1px solid var(--ds-line-soft); }
#game.command-table .targetprompt .targetpickchips { flex-wrap: wrap; overflow: visible; }
#game.command-table .targetprompt .targetpickchip { max-width: 100%; }
#game.command-table .targetprompt .targetpickchip b { white-space: normal; overflow-wrap: anywhere; }
#game.command-table .targetprompt .targetclear { min-height: 30px; padding: 4px 8px; font-size: 11px; }
#game.command-table .zbtn.targetzone { flex-wrap: wrap; gap: 3px; }
#game.command-table .zbtn.targetzone .targetzonebadge { flex-basis: 100%; }
#game.command-table .ct-zone-link.targetzone { display: inline-flex; gap: 5px; align-items: center; }
#game.command-table .promptbar .ptext { font: 500 13px/1.55 var(--ds-font-body) !important; }
#game.command-table .promptbar .btnrow { display: flex; flex-direction: column; gap: 6px; }
#game.command-table .pbtn { min-height: 42px; font-size: 12px; letter-spacing: .025em; text-transform: none; padding: 10px 12px; white-space: normal; }
#game.command-table .pbtn.primary { background: var(--ds-accent) !important; color: var(--ds-accent-ink); box-shadow: none !important; }
#game.command-table .ct-decision-rail .actionstagewrap { position: static !important; inset: auto !important; transform: none !important; display: flex; width: 100%; height: 100%; padding: 0 !important; background: transparent !important; pointer-events: auto; }
#game.command-table .ct-decision-rail .actionstage { position: static !important; display: flex !important; flex-direction: column; width: 100% !important; height: 100%; max-width: none; max-height: none !important; padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; gap: 10px; overflow: hidden; }
#game.command-table .ct-review-body { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
#game.command-table .actionstageart { flex: 0 0 auto; height: 216px; width: 100%; padding: 0; background: transparent; }
#game.command-table .actionstageart img { display: block; width: auto; max-width: 100%; height: 100%; max-height: 216px; object-fit: contain; margin: auto; }
#game.command-table .actionstageinfo { flex: 0 0 auto; min-height: 0; justify-content: flex-start; padding: 0 !important; }
#game.command-table .ct-response-summary { display: none; }
#game.command-table .ct-decision-rail .stacktargetflow { flex-direction: column; }
#game.command-table .ct-decision-rail .stackflowsource { width: 100%; }
#game.command-table .ct-decision-rail .stackflowarrow { align-self: center; height: 24px; }
#game.command-table .ct-decision-rail .stackflowtargets { flex-wrap: wrap; overflow: visible; }
#game.command-table .ct-decision-rail .stackflowtarget { min-width: 0; max-width: none; flex: 1 1 100%; }
#game.command-table .actionstagename { font-size: 19px !important; }
#game.command-table .actionstageeyebrow { font-size: 10px; }
#game.command-table .actionstagetype, #game.command-table .actionstageoracle { font-size: 12px !important; line-height: 1.5; }
#game.command-table .actionstagebuttons { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-top: 8px; flex: 0 0 auto; }
#game.command-table .ct-decision-rail .stackpop { position: static !important; width: 100% !important; max-height: none !important; transform: none !important; padding: 0; border: 0; background: transparent; }
#game.command-table .ct-decision-rail .utilityrail { position: static !important; display: flex !important; flex-direction: row; width: 100%; padding: 8px 0 0; gap: 6px; border: 0; border-top: 1px solid var(--ds-line-soft); flex: 0 0 auto; background: transparent; backdrop-filter: none; }
#game.command-table .utilitybutton { flex: 1; min-height: 46px; width: auto; padding: 5px; }
#game.command-table .utilitylabel { font-size: 10px !important; letter-spacing: .03em !important; }
#game.command-table .sidebar { z-index: 80 !important; width: min(400px, calc(100 * var(--vwu) - 20px)) !important; }
#game.command-table .systemstatus { position: absolute; z-index: 90; top: 62px; left: 12px; right: 12px; }
#game.command-table > .overlay { z-index: 140; }

@media (min-width: 901px) {
  body.game-active #game.command-table[data-table-view='focus'] { grid-template-rows: 60px 64px minmax(170px, .85fr) auto minmax(200px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) !important; grid-template-areas: 'topbar topbar' 'seats decision' 'opps decision' 'center decision' 'mine decision' 'hand decision' !important; }
  #game.command-table[data-table-view='focus'] .ticker { display: none; }
  #game.command-table[data-table-view='focus'] .ct-seat-ribbon { display: flex; padding: 5px 10px; gap: 8px; }
  #game.command-table[data-table-view='focus']:not(.ct-show-all) .oppswrap { grid-template-columns: minmax(0, 1fr) !important; }
  #game.command-table[data-table-view='focus']:not(.ct-show-all) .opprow:not(.ct-focused) { display: none !important; }
  #game.command-table[data-table-view='focus'] { --ct-opponent-card: 104px; }
}
#game.command-table .ct-seat { display: flex; gap: 7px; align-items: center; flex: 1; min-width: 0; border: 1px solid var(--ds-line); border-radius: 6px; color: var(--ds-text); background: var(--ds-panel); padding: 5px 7px; text-align: left; }
#game.command-table .ct-seat.selected { border-color: var(--ds-accent); }
#game.command-table .ct-seat.active { box-shadow: inset 0 -3px var(--ds-accent); }
#game.command-table .ct-seat.active .ct-seat-copy b::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--ds-accent-bright); }
#game.command-table .ct-turn-badge { display: inline-block; margin-left: 8px; color: var(--ds-accent-bright); font: 650 10px/1.3 var(--ds-font-body); white-space: nowrap; }
#game.command-table .ct-seat .ct-portrait { width: 36px; height: 40px; }
#game.command-table .ct-seat-copy { display: flex; flex-direction: column; min-width: 0; }
#game.command-table .ct-seat-copy b { font: 650 12px/1.35 var(--ds-font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game.command-table .ct-seat-life { font: 650 16px var(--ds-font-mono); }
#game.command-table .ct-seat-copy small { color: var(--ds-danger); font-size: 10px; }
#game.command-table .ct-public-deals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
#game.command-table .ct-public-deal { min-height: 44px; padding: 8px; border: 1px solid var(--ds-line); border-radius: 6px; text-align: left; background: var(--ds-panel-raised); color: var(--ds-copy); font: 500 12px/1.5 var(--ds-font-body); }
#game.command-table .ct-public-deal b { display: block; color: var(--ds-accent-bright); }
@media (max-width: 1250px) {
  #game.command-table .arenaheader .stepper { display: none; }
  #game.command-table .politicsstatus { display: none; }
  body.game-active #game.command-table { --ct-rail: 258px; --ct-card: 102px; --ct-opponent-card: 76px; }
}
@media (min-width: 901px) and (max-height: 760px) {
  body.game-active #game.command-table { --ct-hand: 130px; --ct-card: 87px; --ct-opponent-card: 68px; grid-template-rows: 54px 20px minmax(132px, .8fr) auto minmax(155px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) !important; }
  body.game-active #game.command-table[data-table-view='focus'] { grid-template-rows: 54px 54px minmax(120px, .8fr) auto minmax(145px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) !important; }
  #game.command-table .actionstageart { height: 150px; }
  #game.command-table .actionstageart img { max-height: 150px; }
}

/* Phone/tablet: stable seat summaries, one focused board, bottom navigation. */
@media (max-width: 900px) {
  body.game-active #game.command-table {
    --ct-card: 90px; --ct-opponent-card: 82px; --ct-hand: 144px;
    --ct-tabs: calc(54px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 52px 60px minmax(0, 1fr) auto calc(var(--ct-hand) + var(--ct-hand-extra)) var(--ct-tabs) !important;
    grid-template-areas: 'topbar' 'seats' 'mine' 'decision' 'hand' 'tabs' !important;
  }
  /* Every mobile height uses one readable board. A seat opens that opponent;
     Mine restores your board, and Table keeps all opponents in a scrollable list. */
  body.game-active #game.command-table[data-mobile-view='mine'][data-mobile-board='mine'] .oppsouter { display: none !important; }
  body.game-active #game.command-table[data-mobile-view='mine'][data-mobile-board='opponent'] { grid-template-areas: 'topbar' 'seats' 'opps' 'decision' 'hand' 'tabs' !important; }
  body.game-active #game.command-table[data-mobile-view='mine'][data-mobile-board='opponent'] .myboard { display: none !important; }
  body.game-active #game.command-table .arenaheader { padding: 4px 8px !important; gap: 4px; min-height: 0 !important; height: 100%; flex-wrap: nowrap; }
  body.game-active #game.command-table .arenaheader .phasewrap { min-width: 0; width: auto; flex: 1 1 0; flex-wrap: nowrap; }
  body.game-active #game.command-table .arenaheader .phase { display: flex; flex: 1 1 0; gap: 5px; font-size: 10px; flex-wrap: wrap; }
  #game.command-table .phase b { font-size: 17px; }
  #game.command-table .phase > span { display: none; }
  #game.command-table .phase em::before { display: none; }
  #game.command-table .ct-view-switch, #game.command-table .ticker, #game.command-table .arenaheader .monarchstatus, #game.command-table .arenaheader .stepper { display: none !important; }
  body.game-active #game.command-table .arenaheader .topbtns { position: static; flex: 0 0 auto; gap: 3px !important; }
  #game.command-table .hudaction { width: 44px !important; min-width: 44px; height: 44px; min-height: 44px !important; flex: 0 0 44px; flex-direction: column; gap: 3px; padding: 4px !important; }
  #game.command-table .hudaction > span:not([aria-hidden]) { font: 650 8px/1 var(--ds-font-body); letter-spacing: .03em; }
  #game.command-table .arenaheader .hudaction > .gameicon { width: 18px; height: 18px; }
  #game.command-table .commandbutton > span[aria-hidden] { font: 24px/18px var(--ds-font-body); }
  #game.command-table .hudaction kbd { display: none; }
  #game.command-table .ct-seat-ribbon { display: flex; padding: 4px 8px; gap: 5px; }
  #game.command-table .ct-seat { padding: 4px; gap: 4px; }
  #game.command-table .ct-seat .ct-portrait { width: 28px; height: 38px; }
  #game.command-table .ct-seat-copy b { font-size: 10px; }
  #game.command-table .ct-seat-life { font-size: 13px; }
  body.game-active #game.command-table .oppsouter { display: block !important; padding: 2px 8px 5px !important; overflow: hidden; }
  body.game-active #game.command-table .oppswrap,
  body.game-active #game.command-table .oppswrap.active-ai-turn { grid-template-columns: minmax(0, 1fr) !important; }
  body.game-active #game.command-table:not(.ct-show-all):not([data-mobile-view='table']) .opprow:not(.ct-focused) { display: none !important; }
  body.game-active #game.command-table .opphead { min-height: 44px !important; grid-template-columns: minmax(0, 1fr) 44px !important; grid-template-areas: 'name info' !important; gap: 2px 5px !important; padding: 0 8px !important; }
  body.game-active #game.command-table .opphead .tbtn.small { width: 44px; height: 44px; min-height: 44px; }
  #game.command-table .opphead .playerlifetotals,
  #game.command-table .opphead .oppmeta,
  #game.command-table .opphead .oppcmd { display: none !important; }
  #game.command-table .opphead .ct-portrait, #game.command-table .opphead .ct-commander-name { display: none; }
  #game.command-table .opphead .opplife { font-size: 18px; }
  #game.command-table .opphead .oppmeta { font-size: 9px; }
  body.game-active #game.command-table .oppstrip { padding: 4px 6px !important; }
  body.game-active #game.command-table .myboard { margin: 0 8px 4px !important; padding: 5px 7px !important; gap: 5px; }
  #game.command-table .ct-player-head { gap: 5px; flex-wrap: nowrap; }
  #game.command-table .ct-player-head .ct-portrait { width: 28px; height: 36px; }
  #game.command-table .ct-player-name b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #game.command-table .ct-player-name small { font-size: 9px; }
  #game.command-table .ct-player-name .manapool { white-space: nowrap; overflow-x: auto; max-width: 100%; }
  #game.command-table .ct-player-head .melife { font-size: 21px !important; }
  #game.command-table .ct-player-head .meinfo { gap: 2px; }
  #game.command-table .ct-player-head .melife small { display: none; }
  #game.command-table .ct-player-head .zbtn { min-width: 30px; min-height: 32px; padding: 3px; gap: 2px; font-size: 9px; }
  #game.command-table .ct-player-head .zbtn b { font-size: 10px; }
  #game.command-table .mybattlefieldmain { gap: 6px !important; }
  #game.command-table .boardlanecards { gap: 5px !important; }
  /* One horizontal row per battlefield keeps dense boards readable and leaves
     vertical scrolling for resources. Each board retains its own position. */
  body.game-active #game.command-table .oppboardmain,
  body.game-active #game.command-table .mybattlefieldmain { flex: 0 0 auto; gap: 12px !important; overflow-x: auto; overflow-y: hidden; }
  body.game-active #game.command-table .oppboardmain > .boardlane,
  body.game-active #game.command-table .mybattlefieldmain > .boardlane { flex: 0 0 auto; }
  body.game-active #game.command-table .boardlanecards { flex-wrap: nowrap; padding: 5px !important; }
  #game.command-table :is(.oppboardmain, .mybattlefieldmain, .hand) { overscroll-behavior-x: contain; scrollbar-width: thin; }
  #game.command-table :is(.oppstrip, .oppswrap, .myboard) { overscroll-behavior-y: contain; scrollbar-width: thin; }
  #game.command-table .ct-decision-rail { gap: 4px; padding: 6px 9px; max-height: 160px; border: 0; border-top: 1px solid var(--ds-line); border-bottom: 1px solid var(--ds-line); }
  #game.command-table .ct-decision-heading { padding: 0; border: 0; }
  #game.command-table .ct-decision-heading h2 { font-size: 14px; }
  #game.command-table .ct-phase-label { font-size: 10px; }
  #game.command-table .ct-decision-content { display: none; }
  #game.command-table .ct-decision-rail.has-review .ct-decision-content { display: block; flex: 1 1 0; overflow: hidden; }
  #game.command-table .ct-decision-rail.has-targets { height: min(340px, 46vh); max-height: min(340px, 46vh); }
  body.game-active #game.command-table .ct-decision-rail.has-targets .targetprompt { max-height: none; flex: 1 1 auto; gap: 6px; }
  #game.command-table .targetinstruction { padding: 7px 9px; }
  #game.command-table .targetinstructiontext { font-size: 14px; line-height: 1.45; }
  #game.command-table .targetprompthead strong { padding: 4px 6px; font-size: 10px; }
  #game.command-table .targetprompt .targetprompthint { font-size: 11px; }
  #game.command-table .targetzonelinks .pbtn { min-height: 44px; padding: 6px 8px; }
  #game.command-table .targetprompt .targetpromptactions { display: flex; flex-wrap: nowrap; }
  #game.command-table .targetprompt .targetpromptactions > .pbtn { flex: 1 1 0; min-width: 0; padding: 7px; font-size: 11px; letter-spacing: 0; }
  #game.command-table .ct-decision-rail.has-review {
    position: absolute; grid-area: auto; z-index: 85; left: 8px; right: 8px; bottom: calc(var(--ct-tabs) + 4px);
    height: min(640px, calc(100 * var(--dvhu) - 178px)); max-height: none;
    padding: 10px; gap: 8px; border: 1px solid var(--ds-line); border-radius: 10px;
    background: var(--ds-dialog); box-shadow: 0 -12px 40px rgba(var(--ds-table-rgb), .7);
  }
  body.game-active #game.command-table .ct-decision-rail .promptbar { padding: 0 !important; max-height: 130px; flex: 0 0 auto; }
  #game.command-table .promptbar .ptext { font-size: 12px !important; line-height: 1.4 !important; }
  #game.command-table .promptbar .btnrow { flex-direction: row; flex-wrap: wrap; }
  #game.command-table .promptbar .btnrow > .pbtn { flex: 1 1 auto; min-height: 44px; }
  #game.command-table .actionstageart { display: block; height: clamp(190px, calc(38 * var(--dvhu)), 320px); }
  #game.command-table .actionstageart img { max-height: none; }
  #game.command-table .actionstageinfo { overflow: visible; }
  #game.command-table .actionstagename { font-size: 15px !important; }
  #game.command-table .actionstagebuttons { flex-direction: row; padding: 0; gap: 5px; }
  #game.command-table .actionstagebuttons > .pbtn { flex: 1; min-height: 44px; padding: 8px; }
  #game.command-table .ct-decision-rail .utilityrail { display: none !important; }
  body.game-active #game.command-table .handwrap { padding: 5px 8px !important; gap: 4px; }
  #game.command-table .handtools { flex-basis: 72px; width: 72px; font-size: 10px; gap: 6px; }
  #game.command-table .handtools select { min-height: 44px; font-size: 10px; padding-inline: 2px; }
  #game.command-table .handzones { flex: 0 1 112px; width: 112px; max-width: 30%; }
  #game.command-table .handzones .exiletraycard { padding-right: 3px; }
  #game.command-table .handzones .exiletraycard .exgo { position: static; grid-column: 2; transform: none; }
  body.game-active #game.command-table .hand { justify-content: flex-start; gap: 6px !important; }
  #game.command-table .mobileviewtabs { grid-area: tabs; display: flex !important; position: static !important; width: 100%; margin: 0; padding: 3px 6px max(3px, env(safe-area-inset-bottom)); background: var(--ds-table); border-top: 1px solid var(--ds-line); }
  #game.command-table .mobileviewtab { display: inline-flex; align-items: center; justify-content: center; flex: 1; min-height: 44px; flex-direction: column; padding: 4px; gap: 3px; font: 650 10px/1 var(--ds-font-body); color: var(--ds-muted); background: transparent; border: 0; border-bottom: 2px solid transparent; }
  #game.command-table .mobileviewtab.on { color: var(--ds-accent-bright); border-bottom-color: var(--ds-accent); }
  #game.command-table .mobileviewtab .gameicon { width: 18px; height: 18px; margin: 0; }
  #game.command-table .center { display: none !important; }
  body.game-active #game.command-table[data-mobile-view='table'] { grid-template-rows: 52px 60px minmax(0, 1fr) auto var(--ct-tabs) !important; grid-template-areas: 'topbar' 'seats' 'opps' 'decision' 'tabs' !important; }
  body.game-active #game.command-table[data-mobile-view='table'] .myboard,
  body.game-active #game.command-table[data-mobile-view='table'] .handwrap { display: none !important; }
  body.game-active #game.command-table:is([data-mobile-view='table'], .ct-show-all) .oppswrap { display: flex !important; flex-direction: column; overflow: auto; }
  body.game-active #game.command-table:is([data-mobile-view='table'], .ct-show-all) .opprow { min-height: 190px; flex: 0 0 auto; }
  body.game-active #game.command-table:is([data-mobile-view='table'], .ct-show-all) .oppstrip { flex: 0 0 auto; overflow: visible !important; }
  body.game-active #game.command-table[data-mobile-view='stack'] { grid-template-rows: 52px 60px minmax(0, 1fr) auto var(--ct-tabs) !important; grid-template-areas: 'topbar' 'seats' 'center' 'decision' 'tabs' !important; }
  body.game-active #game.command-table[data-mobile-view='stack'] .oppsouter,
  body.game-active #game.command-table[data-mobile-view='stack'] .myboard,
  body.game-active #game.command-table[data-mobile-view='stack'] .handwrap { display: none !important; }
  body.game-active #game.command-table[data-mobile-view='stack'] .sidebar { grid-area: center; position: static !important; width: 100% !important; height: 100%; max-height: none; min-height: 0; margin: 0; transform: none !important; }
}
@media (max-width: 900px) and (max-height: 720px) {
  body.game-active #game.command-table { --ct-card: 74px; --ct-opponent-card: 70px; --ct-hand: 116px; --ct-tabs: calc(48px + env(safe-area-inset-bottom, 0px)); grid-template-rows: 48px 52px minmax(0, 1fr) auto calc(var(--ct-hand) + var(--ct-hand-extra)) var(--ct-tabs) !important; }
  #game.command-table .ct-seat-ribbon { padding-block: 2px; }
  body.game-active #game.command-table .arenaheader { padding-block: 2px !important; }
  #game.command-table .mobileviewtabs { padding-block: 1px; }
  #game.command-table .ct-seat .ct-portrait { height: 32px; }
  #game.command-table .ct-decision-rail { max-height: 130px; }
  #game.command-table .ct-decision-rail.has-review { height: calc(100 * var(--dvhu) - 160px); max-height: 640px; }
  body.game-active #game.command-table .ct-decision-rail .promptbar { max-height: 100px; flex-shrink: 1; }
  body.game-active #game.command-table[data-mobile-view='table'],
  body.game-active #game.command-table[data-mobile-view='stack'] { grid-template-rows: 48px 52px minmax(0, 1fr) auto var(--ct-tabs) !important; }
}

@media (min-width: 600px) and (max-width: 900px) and (max-height: 500px) {
  /* Landscape phones put the hand beside the board so neither is squeezed
     between the navigation and the current action. */
  body.game-active #game.command-table[data-mobile-view='mine'] {
    grid-template-columns: 104px minmax(0, 1fr) 210px !important;
    grid-template-rows: 48px minmax(0, 1fr) auto var(--ct-tabs) !important;
    grid-template-areas: 'topbar topbar topbar' 'seats mine hand' 'decision decision decision' 'tabs tabs tabs' !important;
  }
  body.game-active #game.command-table[data-mobile-view='mine'][data-mobile-board='opponent'] { grid-template-areas: 'topbar topbar topbar' 'seats opps hand' 'decision decision decision' 'tabs tabs tabs' !important; }
  #game.command-table[data-mobile-view='mine'] .ct-seat-ribbon { flex-direction: column; padding: 4px; }
  #game.command-table[data-mobile-view='mine'] .ct-seat { min-height: 44px; }
  #game.command-table[data-mobile-view='mine'] .ct-seat .ct-portrait { display: none; }
  body.game-active #game.command-table[data-mobile-view='mine'] .handwrap { flex-direction: column; }
  #game.command-table[data-mobile-view='mine'] .handzones { flex: 0 0 auto; width: 100%; max-width: none; height: auto; max-height: 48px; }
  #game.command-table[data-mobile-view='mine'] .handwrap:has(.handzones) .handsortlabel > span { display: none; }
  body.game-active #game.command-table[data-mobile-view='mine'] .handwrap:has(.handzones) { overflow-y: auto; }
  body.game-active #game.command-table[data-mobile-view='mine'] .handzones + .hand { min-height: calc(var(--ct-hand) + var(--ct-hand-extra) - 19px) !important; flex-shrink: 0; }
  #game.command-table[data-mobile-view='mine'] .handtools { flex: 0 0 auto; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 5px; }
  #game.command-table[data-mobile-view='mine'] .handsortlabel { width: 90px; }
  body.game-active #game.command-table[data-mobile-view='mine'] .hand { width: 100%; flex: 1 1 0; }
  #game.command-table[data-mobile-view='mine'] .ct-decision-rail:not(.has-review) .ct-decision-heading { display: none; }
}

/* Public zone counters use the same symbols, labels and numerals at every seat. */
#game.command-table .opprow { container-type: inline-size; }
#game.command-table .ct-player-zones { display: flex; align-items: center; gap: 4px; padding: 5px 7px; background: var(--ds-panel); border-bottom: 1px solid var(--ds-line-soft); flex: 0 0 auto; }
#game .zonecounter { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 34px; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--ds-line-soft); border-radius: 5px; background: var(--ds-panel); color: var(--ds-copy); font: 500 11px/1.2 var(--ds-font-body); white-space: nowrap; }
#game .zonecounter .gameicon { display: block; flex: 0 0 18px; width: 18px; height: 18px; margin: 0; stroke-width: 1.8; }
#game .zonecounter b { font: 650 14px/1 var(--ds-font-mono); color: var(--ds-text); font-variant-numeric: tabular-nums; }
#game .zone-hand .gameicon { color: #b8d1e7; }
#game .zone-library .gameicon { color: #d4cba7; }
#game .zone-graveyard .gameicon { color: #c2becb; }
#game .zone-exile .gameicon { color: #c3acf0; }
#game .zone-command .gameicon { color: var(--ds-accent-bright); }
#game button.zonecounter { cursor: pointer; }
#game button.zonecounter:hover { background: var(--ds-panel-raised); border-color: var(--ds-accent); }
#game .zonecounter.targetzone { padding-bottom: 16px !important; min-height: 46px !important; }
#game .zonecounter > .targetzonebadge { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); font-size: 7px; }
#game :is(.zonecounter, .ct-focus-board, .playeroverviewclose):focus-visible { outline: 2px solid var(--ds-accent-bright); outline-offset: 2px; }
#game .ct-player-zones > .zonecounter { flex: 1 1 0; padding-inline: 4px; gap: 4px; }
#game .ct-player-zones .zonecounterlabel { font-size: 9px; }
#game .ct-focus-board { display: grid; place-items: center; flex: 0 0 30px; min-height: 34px; padding: 4px; background: var(--ds-panel-raised); color: var(--ds-copy); border: 1px solid var(--ds-line-soft); border-radius: 5px; cursor: pointer; }
#game .ct-focus-board:hover { color: var(--ds-accent-bright); border-color: var(--ds-accent); }
body.game-active #game.command-table .opphead { background: var(--ds-panel) !important; }
#game.command-table .opphead .oppmeta { gap: 4px; }
#game.command-table .opphead .oppcmd { margin-left: 0; line-height: 1.4; }
#game.command-table .opphead .oppcmd .gameicon { width: 13px; height: 13px; }
#game.command-table .opplife { display: inline-flex; gap: 5px; align-items: center; }
#game.command-table .opplife > .gameicon { width: 16px; height: 16px; margin: 0; color: #d49b9d; }
#game.command-table .opplife > b { font: inherit; }
#game.command-table .ct-player-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: 'portrait name life' 'zones zones zones'; gap: 7px 10px; }
#game.command-table .ct-player-head > :is(.ct-inspect-commander, .ct-portrait) { grid-area: portrait; }
#game.command-table .ct-player-head .ct-player-name { grid-area: name; }
#game.command-table .ct-player-head .meinfo { display: contents !important; }
#game.command-table .ct-player-head .meinfo > .playerlifetotals { grid-area: life; }
#game.command-table .ct-player-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
#game.command-table .ct-player-status > * { flex: 0 1 auto; min-width: 0; max-width: 100%; }
#game.command-table .ct-player-status .memonarch { flex-shrink: 0; gap: 6px; padding: 6px 8px; white-space: nowrap; }
#game.command-table .ct-player-status .memonarch > span { display: flex; flex: 0 0 auto; }
#game.command-table .ct-player-status .memonarch b { font: 700 11px/1.2 var(--ds-font-body); letter-spacing: .06em; }
#game.command-table .ct-player-head .zbtns { grid-area: zones; display: flex; gap: 5px; flex-wrap: wrap; margin: 0; }
#game.command-table .ct-player-head .zbtn { min-height: 34px; gap: 5px; }
#game.command-table .handtoolstitle { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
#game.command-table .handtoolstitle .gameicon { width: 18px; height: 18px; }
#game.command-table .handtoolstitle b { font-family: var(--ds-font-mono); color: var(--ds-text); }
#game.command-table .exiletraytitle .gameicon { width: 15px; height: 15px; }
@container (max-width: 345px) {
  #game .ct-player-zones .zonecounterlabel { display: none; }
}
@media (min-width: 901px) {
  body.game-active #game.command-table[data-table-view='focus'] { --ct-opponent-card: 104px; }
  body.game-active #game.command-table[data-table-view='focus'] .opphead { grid-template-columns: 42px minmax(0, 1fr) auto auto 28px !important; grid-template-areas: 'portrait name meta life info' !important; min-height: 56px !important; }
  #game.command-table[data-table-view='focus'] .opphead .oppmeta { max-width: 280px; }
  #game.command-table[data-table-view='focus'] .ct-player-zones { justify-content: flex-start; }
  #game.command-table[data-table-view='focus'] .ct-player-zones > .zonecounter { flex: 0 1 auto; padding-inline: 12px; }
  #game.command-table[data-table-view='focus'] .ct-player-zones .zonecounterlabel { font-size: 11px; }
  #game.command-table[data-table-view='focus'] .ct-focus-board { margin-left: auto; }
}
@media (min-width: 901px) and (max-height: 760px) {
  body.game-active #game.command-table[data-table-view='focus'] { --ct-opponent-card: 86px; grid-template-rows: 54px 54px minmax(245px, 1.1fr) auto minmax(155px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) !important; }
}

/* Desktop Table: four equal quadrants, clockwise from your lower-left seat.
   Flatten only the layout wrappers so the existing card/target handlers and
   public-zone semantics are shared by Solo, Live, Table and Focus. */
@media (min-width: 901px) {
  body.game-active #game.command-table.ct-grid-view {
    --ct-card: clamp(56px, calc((50 * var(--dvhu) - 308px) / 1.48), 92px);
    --ct-opponent-card: var(--ct-card);
    --ct-table-header: 60px;
    --ct-table-ticker: 26px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--ct-rail) !important;
    grid-template-rows: var(--ct-table-header) var(--ct-table-ticker) repeat(2, minmax(0, 1fr)) auto calc(var(--ct-hand) + var(--ct-hand-extra)) !important;
    grid-template-areas: 'topbar topbar topbar' 'ticker ticker decision' 'opponent-one opponent-two decision' 'mine opponent-three decision' 'center center decision' 'hand hand decision' !important;
  }
  body.game-active #game.command-table.ct-grid-view:not(.empty-hand) { --ct-hand: 150px; }
  #game.command-table.ct-grid-view .ct-seat-ribbon { display: none; }
  #game.command-table.ct-grid-view .ticker { display: block; }
  body.game-active #game.command-table.ct-grid-view :is(.oppsouter, .oppswrap, .oppswrap.active-ai-turn) { display: contents !important; }
  body.game-active #game.command-table.ct-grid-view .opprow {
    margin: 4px 5px !important;
    height: auto !important;
    overflow: hidden;
  }
  #game.command-table.ct-grid-view .opprow:nth-child(1) { grid-area: opponent-one; }
  #game.command-table.ct-grid-view .opprow:nth-child(2) { grid-area: opponent-two; }
  #game.command-table.ct-grid-view .opprow:nth-child(3) { grid-area: opponent-three; }
  body.game-active #game.command-table.ct-grid-view .myboard {
    margin: 4px 5px !important;
    padding: 0 !important;
    gap: 0;
    border-top: 2px solid var(--ds-accent);
    scrollbar-width: thin;
  }
  #game.command-table.ct-grid-view .ct-player-head {
    position: sticky; top: 0; z-index: 6;
    padding: 7px 8px;
    background: var(--ds-panel);
    border-bottom: 1px solid var(--ds-line-soft);
  }
  #game.command-table.ct-grid-view .ct-player-name b { font-size: 14px; }
  #game.command-table.ct-grid-view .ct-player-head .zbtns { flex-wrap: nowrap; }
  #game.command-table.ct-grid-view .ct-player-head .zonecounter { flex: 1 1 0; padding-inline: 4px; }
  #game.command-table.ct-grid-view .ct-player-head .zonecounterlabel { font-size: 9px; }
  body.game-active #game.command-table.ct-grid-view :is(.mybattlefieldmain, .landrow) { padding: 7px 8px !important; gap: 6px; }
  #game.command-table.ct-grid-view .czrow { padding: 0 8px 7px; }
  body.game-active #game.command-table.ct-grid-view .opphead {
    grid-template-columns: 42px minmax(0, 1fr) auto 28px !important;
    grid-template-areas: 'portrait name life info' 'portrait meta meta meta' !important;
    min-height: 66px !important;
  }
  #game.command-table.ct-grid-view .ct-player-zones > .zonecounter { flex: 1 1 0; padding-inline: 4px; }
  #game.command-table.ct-grid-view .ct-player-zones .zonecounterlabel { font-size: 9px; }
  #game.command-table.ct-grid-view .oppstrip { overscroll-behavior-y: contain; scrollbar-width: thin; }

  /* Smaller pods reclaim empty seats without changing their relative order. */
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count='2']) {
    grid-template-areas: 'topbar topbar topbar' 'ticker ticker decision' 'opponent-one opponent-two decision' 'mine mine decision' 'center center decision' 'hand hand decision' !important;
  }
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count='1']) {
    grid-template-areas: 'topbar topbar topbar' 'ticker ticker decision' 'opponent-one opponent-one decision' 'mine mine decision' 'center center decision' 'hand hand decision' !important;
  }
  body.game-active #game.command-table.ct-grid-view.ct-no-opponents {
    grid-template-areas: 'topbar topbar topbar' 'ticker ticker decision' 'mine mine decision' 'mine mine decision' 'center center decision' 'hand hand decision' !important;
  }
}
@media (min-width: 901px) and (max-height: 760px) {
  body.game-active #game.command-table.ct-grid-view {
    --ct-card: clamp(44px, calc((50 * var(--dvhu) - 280px) / 1.48), 78px);
    --ct-opponent-card: var(--ct-card);
    --ct-table-header: 54px; --ct-table-ticker: 20px;
  }
  body.game-active #game.command-table.ct-grid-view:not(.empty-hand) { --ct-hand: 126px; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  #game.command-table.ct-grid-view .ct-player-head .zonecounterlabel { display: none; }
}

/* Public lands stay in view on desktop, below each independently scrolling
   battlefield. Phones keep their original land counters and scrolling. */
@media (min-width: 901px) {
  body.game-active #game.command-table.ct-desktop-lands .myboard { overflow: hidden !important; }
  body.game-active #game.command-table.ct-desktop-lands .mybattlefieldmain {
    flex: 1 1 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock {
    flex: 0 0 auto; min-width: 0; width: auto; max-width: 100%;
    margin: 0; padding: 3px 7px !important;
    border: 0; border-top: 1px solid var(--ds-line-soft);
    background: var(--ds-panel);
  }
  #game.command-table.ct-desktop-lands .resourcezone {
    flex: 1 1 0; min-width: 0; padding: 0; gap: 3px;
  }
  body.game-active #game.command-table.ct-desktop-lands :is(.landstrip, .oppresourcecards) {
    display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 5px;
    flex: 1 1 auto; width: 100%; min-width: 0; max-height: 72px;
    padding: 3px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .mini.sm {
    width: 40px !important; height: 56px !important; margin-bottom: 2px;
  }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .permanentpile.sm { width: 40px !important; }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .boardlanelabel { font-size: 8px; line-height: 1.2; }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .mini .mname { font-size: 9px; }
  #game.command-table.ct-desktop-lands .ct-land-state {
    position: absolute; top: 3px; left: 2px; right: 2px; z-index: 3;
    border-radius: 3px; padding: 2px; background: #16191fee; color: #f3c689;
    font: 700 8px/1.3 var(--ds-font-body); text-align: center; text-transform: uppercase;
    pointer-events: none;
  }
  #game.command-table.ct-desktop-lands .landrow { align-items: stretch; gap: 8px; }
  #game.command-table.ct-desktop-lands .landrow > .playerrail:empty { display: none; }
}
@media (min-width: 901px) and (max-height: 760px) {
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .mini.sm { width: 36px !important; height: 50px !important; }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .permanentpile.sm { width: 36px !important; }
  body.game-active #game.command-table.ct-desktop-lands :is(.landstrip, .oppresourcecards) { max-height: 66px; }
}

/* Desktop counters sit between identity and life; cards own the saved height. */
@media (min-width: 901px) {
  body.game-active #game.command-table.ct-desktop-lands .opphead {
    grid-template-columns: 32px minmax(0, 1fr) auto auto 24px !important;
    grid-template-areas: 'portrait name zones life info' !important;
    min-height: 54px !important; padding: 5px 7px !important; gap: 4px 6px !important;
  }
  #game.command-table.ct-desktop-lands .ct-player-head {
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    grid-template-areas: 'portrait name zones life';
    min-height: 54px; padding: 5px 7px; gap: 4px 6px;
  }
  #game.command-table.ct-desktop-lands :is(.opphead, .ct-player-head) .ct-portrait { width: 32px; height: 40px; }
  #game.command-table.ct-desktop-lands .ct-inspect-commander { min-width: 32px; min-height: 40px; }
  #game.command-table.ct-desktop-lands .opphead .oppname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  #game.command-table.ct-desktop-lands .opphead .oppcmd { display: inline-flex; float: none; margin-left: 5px; white-space: nowrap; }
  #game.command-table.ct-desktop-lands .opphead .oppmeta { margin-top: 2px; flex-wrap: nowrap; }
  #game.command-table.ct-desktop-lands .opphead .oppmeta:empty { display: none; }
  #game.command-table.ct-desktop-lands .opphead .oppmeta > .zbtn { min-height: 18px; padding: 2px 4px; font-size: 9px; line-height: 1.2; }
  #game.command-table.ct-desktop-lands .opphead > .tbtn.small { display: none; }
  #game.command-table.ct-desktop-lands .opphead .ct-turn-badge { margin-left: 4px; font-size: 0; }
  #game.command-table.ct-desktop-lands .opphead .ct-turn-badge::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ds-accent-bright); vertical-align: middle; }
  #game.command-table.ct-desktop-lands .ct-player-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  #game.command-table.ct-desktop-lands :is(.ct-player-zones, .ct-player-head .zbtns) {
    grid-area: zones; display: flex; flex-wrap: nowrap; align-items: center;
    gap: 3px; margin: 0; padding: 0; border: 0; background: transparent;
  }
  #game.command-table.ct-desktop-lands :is(.ct-player-zones, .ct-player-head) .zonecounter {
    flex: 0 0 auto; min-width: 32px; min-height: 30px; padding: 4px; gap: 3px;
    background: transparent; border-color: transparent;
  }
  #game.command-table.ct-desktop-lands :is(.ct-player-zones, .ct-player-head) .zonecounterlabel { display: none; }
  #game.command-table.ct-desktop-lands :is(.ct-player-zones, .ct-player-head) .zonecounter .gameicon { width: 14px; height: 14px; flex-basis: 14px; }
  #game.command-table.ct-desktop-lands :is(.ct-player-zones, .ct-player-head) .zonecounter b { font-size: 12px; }
  #game.command-table.ct-desktop-lands .ct-focus-board { grid-area: info; width: 24px; min-height: 28px; margin: 0; padding: 3px; }
  #game.command-table.ct-desktop-lands .ct-focus-board .gameicon { width: 14px; height: 14px; }

  body.game-active #game.command-table.ct-hand-command.empty-hand { --ct-hand: 86px; }
  #game.command-table.ct-hand-command .handtools { order: -3; flex: 0 0 188px; width: 188px; gap: 2px; padding: 0; }
  #game.command-table.ct-hand-command .handtoolstitle { font-size: 10px; line-height: 16px; }
  #game.command-table.ct-hand-command .handtoolstitle .gameicon { width: 14px; height: 14px; }
  #game.command-table.ct-hand-command .handsortlabel { margin: 0; }
  #game.command-table.ct-hand-command .handsortlabel > span { display: none; }
  #game.command-table.ct-hand-command .handtools select { min-height: 24px; height: 24px; padding: 1px 5px; font-size: 10px; }
  body.game-active #game.command-table.ct-partner-command.empty-hand { --ct-hand: 110px; }
  #game.command-table.ct-hand-command.empty-hand .handsortlabel { display: none; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone {
    order: 0; flex: 1 1 auto; min-height: 0; min-width: 0; width: 100%; max-width: none; align-self: stretch;
    display: flex; flex-direction: column !important; flex-wrap: nowrap !important; gap: 3px; overflow: auto;
    margin: 0; padding: 0; border: 0; scrollbar-width: thin;
  }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czcard { box-sizing: border-box; flex: 0 0 auto; width: 100%; min-width: 0; max-width: 100%; min-height: 32px; padding: 1px 4px; gap: 5px; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czcard > img { width: 20px; height: 27px; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czinfo { min-width: 0; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czlabel { display: none; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czname { font-size: 10px !important; line-height: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czcost { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 9px; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czcard .msym { width: 11px; height: 11px; min-width: 11px; font-size: 8px; }
  #game.command-table.ct-desktop-lands .ct-hand-command-zone .czgo { padding: 3px; font-size: 8px; }
}

/* Cards wrap inside the scrolling field. A clipped lane used to hide later rows
   before they could contribute to the field's scroll height. */
@media (min-width: 901px) {
  body.game-active #game.command-table.ct-desktop-lands :is(.mybattlefieldmain, .oppboardmain) { align-items: flex-start; }
  body.game-active #game.command-table.ct-desktop-lands .oppboardmain { flex: 0 0 auto; }
  body.game-active #game.command-table.ct-desktop-lands .boardlane { overflow: visible !important; height: auto; align-self: flex-start; }
  body.game-active #game.command-table.ct-desktop-lands .boardlanecards { flex: 0 0 auto; overflow: visible !important; }
  body.game-active #game.command-table.ct-desktop-lands :is(.mybattlefieldmain, .oppstrip) {
    overflow-y: auto !important; scrollbar-gutter: stable; scrollbar-color: #66777e #111a20;
    padding: 5px 6px !important; outline-offset: -2px;
  }
  body.game-active #game.command-table.ct-desktop-lands :is(.oppresourcelane, .resourcezone) { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 3px; }
  body.game-active #game.command-table.ct-desktop-lands .ct-resource-dock .boardlanelabel { flex: 0 0 32px; width: 32px; white-space: normal; font-size: 7px; }
  body.game-active #game.command-table.ct-desktop-lands :is(.landstrip, .oppresourcecards) { width: 0; flex: 1 1 0; }
  #game.command-table.ct-desktop-lands .ct-partner-name { display: flex; flex-direction: column; gap: 1px; white-space: normal; }
  #game.command-table.ct-desktop-lands .ct-partner-name .ct-commander-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 12px; }
  #game.command-table.ct-desktop-lands .ct-player-name b.ct-partner-name { font-size: 11px; }
}
@media (min-width: 901px) and (max-height: 760px) {
  body.game-active #game.command-table.ct-grid-view { --ct-card: 64px; --ct-opponent-card: var(--ct-card); }
}

/* One combat workspace: defender routes and a creature roster, with actions
   outside the scroll panes. The same visual language continues in the rail. */
#game.command-table > .ct-combat-overlay { z-index: 139; padding: 18px; background: #05090dde; backdrop-filter: blur(5px); }
#game.command-table .modal.ct-combat-workspace {
  --combat-line: #34434b; --combat-muted: #a7b7c0; --combat-select: #eab181;
  display: flex !important; flex-direction: column; gap: 0;
  width: min(1200px, 100%) !important; max-width: 1200px !important;
  height: min(800px, calc(100 * var(--dvhu) - 36px)); max-height: calc(100 * var(--dvhu) - 36px) !important;
  min-height: 0; margin: 0 !important; padding: 0 !important; overflow: hidden !important;
  border: 1px solid var(--combat-line); border-radius: 14px;
  background: #10181e !important; color: #edf3f5; box-shadow: 0 24px 90px #0008;
  font: 13px/1.4 var(--ds-font-body);
}
#game.command-table .ct-combat-head { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px 10px; }
#game.command-table .ct-combat-heading { min-width: 0; }
#game.command-table .ct-combat-heading > small { font-size: 10px; letter-spacing: .17em; font-weight: 700; color: var(--combat-select); }
#game.command-table .ct-combat-heading h2 { margin: 2px 0 4px; font: 650 24px/1.15 var(--ds-font-display); color: #f6f1ea; }
#game.command-table .ct-combat-heading p { margin: 0; color: var(--combat-muted); font-size: 12px; }
#game.command-table .ct-combat-stats { flex: 0 0 auto; max-width: 36%; margin: 0; padding: 8px 12px; border: 1px solid var(--combat-line); border-radius: 8px; background: #19232a; font-size: 11px; text-align: right; }
#game.command-table .attackallocscore.ct-combat-stats { display: grid; grid-template-columns: auto auto; gap: 0 7px; align-items: center; text-align: left; }
#game.command-table .attackallocscore.ct-combat-stats :is(strong, b) { font: 650 24px var(--ds-font-mono); color: #f6f1ea; }
#game.command-table .ct-combat-stats strong { font: 650 19px var(--ds-font-mono); }
#game.command-table .ct-combat-steps { display: flex; flex: 0 0 auto; list-style: none; gap: 0; margin: 0; padding: 0 24px; border-bottom: 1px solid var(--combat-line, var(--ds-line)); }
#game.command-table .ct-combat-steps li { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; padding: 9px 0 11px; color: #7f929e; border-bottom: 2px solid transparent; font-size: 11px; }
#game.command-table .ct-combat-steps li > span { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #34434b; border-radius: 50%; font: 10px var(--ds-font-mono); }
#game.command-table .ct-combat-steps .done { color: #9fbfac; }
#game.command-table .ct-combat-steps .current { color: #f0b58a; border-bottom-color: #f0b58a; }
#game.command-table .ct-combat-steps .current > span { color: #152027; background: #f0b58a; border-color: #f0b58a; }
#game.command-table .ct-combat-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); flex: 1 1 0; min-height: 0; overflow: hidden; }
#game.command-table .ct-combat-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 0 14px 12px 20px; }
#game.command-table .ct-combat-roster { padding: 0 20px 12px 14px; background: #141f26; border-left: 1px solid var(--combat-line); }
#game.command-table .ct-combat-panel-head { flex: 0 0 auto; padding: 10px 0 8px; }
#game.command-table .ct-combat-panel-head h3 { margin: 0 0 3px; font-size: 13px; color: #f3f5f6; }
#game.command-table .ct-combat-panel-head p { margin: 0; color: var(--combat-muted); font-size: 11px; }
#game.command-table .ct-combat-workspace .ct-combat-scroll { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; min-height: 0; max-height: none; margin: 0; padding: 3px 6px 6px 2px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #5c737f #17222a; }
#game.command-table .ct-combat-workspace .ct-combat-route { position: relative; flex: 0 0 auto; min-width: 0; margin: 0; padding: 0; border: 1px solid #34434b; border-radius: 9px; overflow: hidden; background: #18232b; }
#game.command-table .ct-combat-route.selected { border-color: var(--combat-select); box-shadow: 0 0 0 1px var(--combat-select); background: #25292a; }
#game.command-table .ct-combat-workspace .attackalloclane { display: block; width: 100%; min-height: 0; padding: 10px 12px; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; color: inherit; }
#game.command-table .ct-combat-workspace .attacklanehead { display: flex; gap: 10px; align-items: center; }
#game.command-table .ct-combat-workspace .attacklanehead > span { flex: 1; min-width: 0; }
#game.command-table .ct-combat-workspace .attacklanehead :is(small, b, i) { display: block; font-style: normal; }
#game.command-table .ct-combat-workspace .attacklanehead small { color: #a7b7c0; font-size: 8px; letter-spacing: .09em; }
#game.command-table .ct-combat-workspace .attacklanehead b { margin: 1px 0; font-size: 14px; }
#game.command-table .ct-combat-workspace .attacklanehead i { color: #a7b7c0; font-size: 10px; }
#game.command-table .ct-combat-workspace .attacklanehead em { display: grid; place-items: center; width: 28px; height: 28px; margin: 0; border-radius: 50%; background: #30424c; color: #f0f4f6; font: 600 14px var(--ds-font-mono); }
#game.command-table .ct-combat-workspace .attacklaneassigned { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; padding: 0 10px 10px; }
#game.command-table .ct-combat-workspace .attackdropempty { width: 100%; padding: 8px; border: 1px dashed #46545b; border-radius: 5px; color: #99aeb9; font: 11px var(--ds-font-body); text-align: left; }
#game.command-table .ct-combat-workspace .attackassignedchip { display: flex; align-items: center; gap: 6px; flex: 1 1 170px; max-width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid #54675e; border-radius: 6px; background: #23352c; color: #edf5f0; text-align: left; }
#game.command-table .ct-combat-workspace .attackassignedchip > img { width: 27px; height: 38px; object-fit: cover; }
#game.command-table .ct-combat-workspace .attackassignedchip > span { min-width: 0; flex: 1; }
#game.command-table .ct-combat-workspace .attackassignedchip b { display: block; font-size: 11px; overflow-wrap: anywhere; }
#game.command-table .ct-combat-workspace .attackassignedchip small { display: block; font-size: 11px; }
#game.command-table .ct-combat-workspace .attackassignedchip i { font: 20px var(--ds-font-body); }
#game.command-table .ct-combat-workspace .ct-combat-roster .ct-combat-scroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; align-content: start; }
#game.command-table .ct-combat-choice { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid #3a4b55; border-radius: 8px; overflow: hidden; background: #0d171e; }
#game.command-table .ct-combat-choice:has([aria-pressed='true']) { border-color: #eab181; box-shadow: 0 0 0 1px #eab181; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; flex: 1; min-height: 0; min-width: 0; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: #eef3f5; text-align: left; opacity: 1; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) > img { display: block; width: 100%; height: clamp(145px, calc(100 * var(--dvhu) - 550px), 200px); padding-top: 7px; border-radius: 0; object-fit: contain; object-position: center; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) > span { display: flex; flex-wrap: wrap; flex: 1; align-content: flex-start; gap: 4px 7px; padding: 9px; min-width: 0; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) b { display: block; flex: 1 1 100%; font-size: 12px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) strong { font: 600 16px var(--ds-font-mono); color: #fff0df; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) small { display: block; font-size: 10px; color: #bacbd5; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) i { display: block; flex: 1 1 100%; font-size: 10px; font-style: normal; color: #f5c59f; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand)[aria-pressed='true'] { background: #323029; }
#game.command-table .ct-combat-workspace :is(.attackpoolcard.cantfocus, .blockcand.cant) { opacity: .48; }
#game.command-table .ct-combat-workspace .attackpoolcard > em { position: absolute; top: 5px; left: 5px; padding: 3px 5px; border-radius: 3px; background: #16232eeb; color: #ffd2a9; font: 700 8px var(--ds-font-body); }
#game.command-table .ct-combat-inspect { flex: 0 0 auto; padding: 5px 8px; min-height: 27px; border: 0; border-top: 1px solid #34434b; border-radius: 0; background: transparent; color: #a7bdca; font: 10px var(--ds-font-body); text-align: center; }
#game.command-table .ct-combat-inspect:hover { color: white; background: #263943; }
#game.command-table .ct-combat-workspace .ct-combat-footer { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 12px 20px; border-top: 1px solid #34434b; background: #0c141a; }
#game.command-table .ct-combat-footer :is(.attackallocnote, .combatreviewnote, .ct-combat-notices) { flex: 1; max-width: 52%; margin: 0; padding: 0; border: 0; background: transparent; color: #a7b7c0; font-size: 11px; line-height: 1.5; }
#game.command-table .ct-combat-notices p { margin: 0; }
#game.command-table .ct-combat-footer .btnrow { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: flex-end; width: auto; margin: 0; padding: 0; border: 0; }
#game.command-table .ct-combat-footer .pbtn { flex: 0 0 auto; min-width: 0; min-height: 42px; width: auto; padding: 9px 13px; font-size: 12px; }
#game.command-table .ct-combat-footer .primary { background: #eab181; color: #1f1b16; border-color: #eab181; }
#game.command-table .ct-combat-workspace .blockmenacewarn { margin: 0; padding: 0; border: 0; color: #f3b297; background: transparent; font-size: 11px; }
#game.command-table .ct-combat-workspace .ct-combat-duel { display: grid; grid-template-columns: minmax(110px, .8fr) 45px minmax(0, 1.2fr); padding: 9px; gap: 6px; }
#game.command-table .ct-combat-route-label { grid-column: 1 / -1; color: #a9bbc4; font-size: 10px; }
#game.command-table .ct-combat-attacker { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; background: transparent; color: #eef3f5; text-align: left; }
#game.command-table .ct-combat-card-art { display: block; flex: 0 0 auto; }
#game.command-table .ct-combat-card-art > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
#game.command-table .ct-combat-attacker .ct-combat-card-art { width: 100%; height: 128px; }
#game.command-table .ct-combat-attacker .ct-combat-card-art > img { object-fit: contain; }
#game.command-table .ct-combat-attacker .ct-combat-unit-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
#game.command-table .ct-combat-attacker .ct-combat-unit-copy strong { font-size: 14px; }
#game.command-table .ct-combat-attacker .ct-combat-unit-copy small { grid-column: 1 / -1; }
#game.command-table .ct-combat-attacker .ct-combat-unit-copy small:empty { display: none; }
#game.command-table .ct-combat-unit-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#game.command-table .ct-combat-unit-copy b { font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
#game.command-table .ct-combat-unit-copy strong { font: 600 18px var(--ds-font-mono); }
#game.command-table .ct-combat-unit-copy small { color: #a7b7c0; font-size: 10px; }
#game.command-table .ct-combat-blockers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; min-width: 0; }
#game.command-table .ct-combat-blocker { position: relative; display: flex; flex-direction: column; align-items: stretch; width: 96px; max-width: 100%; gap: 5px; padding: 5px; border: 1px solid #526e62; border-radius: 5px; background: #24382f; color: #eef6f1; text-align: left; }
#game.command-table .ct-combat-blocker .ct-combat-card-art { width: 100%; height: 112px; }
#game.command-table .ct-combat-blocker .ct-combat-card-art > img { object-fit: contain; }
#game.command-table .ct-combat-blocker .ct-combat-unit-copy { flex: 1; }
#game.command-table .ct-combat-blocker .ct-combat-unit-copy b { font-size: 9px; }
#game.command-table .ct-combat-blocker i { position: absolute; top: 2px; right: 2px; width: 19px; height: 19px; border-radius: 50%; background: #182b23; text-align: center; font: 17px var(--ds-font-body); }
#game.command-table .ct-combat-link { display: flex; flex-direction: column; justify-content: center; gap: 4px; text-align: center; color: #c4a187; font: 600 7px var(--ds-font-body); letter-spacing: .03em; }
#game.command-table .ct-combat-link::after { content: '⟶'; display: block; font: 26px/1 var(--ds-font-body); color: #ad8c74; }
#game.command-table .ct-combat-open { padding: 15px 7px; border: 1px dashed #4b5a63; border-radius: 5px; color: #a7b7c0; text-align: center; font-size: 10px; }
#game.command-table .ct-combat-workspace .blockoutcome { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; grid-column: 1 / 3; margin: 0; padding-top: 6px; border-top: 1px solid #34434b; }
#game.command-table .ct-combat-preview-label { font-size: 9px; color: #a7b7c0; margin-right: 4px; }
#game.command-table .ct-combat-workspace .blockoutcome .bo { padding: 2px 4px; font-size: 9px; line-height: 1.5; }
#game.command-table .ct-combat-duel > .ct-combat-inspect { grid-column: 3; border-top: 1px solid #34434b; min-height: 22px; padding: 1px; text-align: right; }
#game.command-table .ct-combat-review .ct-combat-body { grid-template-columns: minmax(0, 1fr); }
#game.command-table .ct-combat-review .ct-combat-panel { padding-right: 20px; }
#game.command-table .ct-combat-workspace .combatreviewlane { display: grid; grid-template-columns: minmax(0, 1fr) 80px 180px; align-items: center; gap: 10px; padding: 14px; }
#game.command-table .ct-combat-workspace .combatreviewcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 160px)); justify-content: center; gap: 10px; overflow: visible; }
#game.command-table .ct-combat-workspace .combatreviewcard { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; padding: 0 0 8px; border: 1px solid #465762; border-radius: 7px; overflow: hidden; background: #101a21; color: #edf3f5; text-align: left; }
#game.command-table .ct-combat-workspace .combatreviewcard > img { width: 100%; height: 176px; padding-top: 6px; object-fit: contain; object-position: center; border-radius: 0; }
#game.command-table .ct-combat-workspace .combatreviewcard > span { padding: 0 9px; }
#game.command-table .ct-combat-workspace .combatreviewcard b { font-size: 12px; white-space: normal; }
#game.command-table .ct-combat-workspace .combatreviewcard strong { display: block; margin-top: 4px; font: 600 19px var(--ds-font-mono); }
#game.command-table .ct-combat-workspace .combatreviewcard small { color: #a7b7c0; font-size: 10px; }
#game.command-table .ct-combat-review-arrow { color: #d0a380; text-align: center; font-size: 9px; }
#game.command-table .ct-combat-review-arrow::after { content: '⟶'; display: block; font: 40px/1 var(--ds-font-body); }
#game.command-table .ct-combat-workspace .combatreviewtarget { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; margin: 0; padding: 8px; border: 0; }
#game.command-table .ct-combat-workspace .combatreviewtarget b { font-size: 18px; }
#game.command-table .ct-combat-workspace .combatreviewtarget small { display: block; color: #a7b7c0; font-size: 10px; }
#game.command-table .ct-combat-workspace .combatestimate { text-align: left; color: #edc4a4; }
#game.command-table .ct-combat-workspace .combatestimate strong { font: 650 25px var(--ds-font-mono); }
#game.command-table .ct-combat-workspace .combatestimate span { display: block; font-size: 10px; }
#game.command-table .ct-combat-workspace button:focus-visible { outline: 2px solid #ffe0ae; outline-offset: -3px; }
#game.command-table .ct-combat-scroll:focus-visible { outline: 1px solid #5c737f; outline-offset: -1px; }
#game.command-table .ct-combat-ledger { margin-bottom: 14px; }
#game.command-table .ct-combat-ledger h3 { margin: 0 0 6px; font-size: 14px; color: var(--ds-accent-bright); }
#game.command-table .ct-combat-ledger .ct-combat-steps { padding: 0; }
#game.command-table .ct-combat-ledger .ct-combat-steps li { gap: 3px; font-size: 8px; }
#game.command-table .ct-combat-ledger .ct-combat-steps li > span { width: 14px; height: 14px; font-size: 8px; }
#game.command-table .ct-combat-ledger-lane { display: flex; flex-direction: column; gap: 5px; padding: 10px 0; border-bottom: 1px solid var(--ds-line); }
#game.command-table .ct-combat-ledger-target { font-size: 11px; color: #ddc7b8; }
#game.command-table .ct-combat-ledger-card { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; padding: 4px; border: 1px solid var(--ds-line); border-radius: 5px; background: var(--ds-panel); color: var(--ds-text); text-align: left; }
#game.command-table .ct-combat-ledger-card .ct-combat-card-art { width: 30px; height: 42px; }
#game.command-table .ct-combat-ledger-block { color: #c6aa91; }
@media (max-width: 900px) {
  #game.command-table > .ct-combat-overlay { padding: 8px; }
  #game.command-table .modal.ct-combat-workspace { height: calc(100 * var(--dvhu) - 16px); max-height: calc(100 * var(--dvhu) - 16px) !important; border-radius: 9px; }
  #game.command-table .ct-combat-head { padding: 12px; gap: 8px; }
  #game.command-table .ct-combat-heading h2 { font-size: 23px; }
  #game.command-table .ct-combat-heading p { font-size: 10px; }
  #game.command-table .ct-combat-stats { max-width: 34%; padding: 6px; font-size: 10px; }
  #game.command-table .ct-combat-steps { padding: 0 12px; }
  #game.command-table .ct-combat-workspace .ct-combat-footer { padding: 8px 12px; flex-wrap: wrap; gap: 5px; }
  #game.command-table .ct-combat-footer :is(.attackallocnote, .combatreviewnote, .ct-combat-notices) { flex: 1 1 100%; max-width: none; font-size: 10px; }
  #game.command-table .ct-combat-footer .btnrow { flex: 1; }
  #game.command-table .ct-combat-footer .pbtn { padding: 8px 10px; min-height: 42px; font-size: 11px; }
}
@media (max-width: 650px) {
  #game.command-table .ct-combat-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  #game.command-table .ct-combat-panel, #game.command-table .ct-combat-review .ct-combat-panel { padding: 0 10px 6px; }
  #game.command-table .ct-combat-roster { border-left: 0; border-top: 1px solid #34434b; }
  #game.command-table .ct-combat-panel-head { padding: 7px 0 5px; }
  #game.command-table .ct-combat-panel-head h3 { font-size: 12px; }
  #game.command-table .ct-combat-panel-head p { font-size: 10px; }
  #game.command-table .ct-combat-workspace .ct-combat-roster .ct-combat-scroll { display: flex; flex-direction: row; align-items: stretch; }
  #game.command-table .ct-combat-choice { flex: 0 0 145px; }
  #game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) > img { height: 100px; padding-top: 3px; }
  #game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) > span { padding: 6px; gap: 2px 5px; }
  #game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) b { font-size: 11px; }
  #game.command-table .ct-combat-workspace :is(.attackpoolcard, .blockcand) small { font-size: 9px; }
  #game.command-table .ct-combat-inspect { min-height: 28px; padding: 4px; }
  #game.command-table .ct-combat-review .ct-combat-body { grid-template-rows: minmax(0, 1fr); }
  #game.command-table .ct-combat-workspace .combatreviewlane { grid-template-columns: minmax(0, 1fr) 28px 95px; padding: 8px; gap: 5px; }
  #game.command-table .ct-combat-workspace .combatreviewcards { grid-template-columns: minmax(0, 1fr); }
  #game.command-table .ct-combat-workspace .combatreviewcard > img { height: 150px; }
  #game.command-table .ct-combat-workspace .combatreviewtarget { padding: 0; }
  #game.command-table .ct-combat-workspace .combatreviewtarget b { font-size: 13px; }
  #game.command-table .ct-combat-review-arrow { font-size: 0; }
  #game.command-table .ct-combat-review-arrow::after { font-size: 26px; }
  #game.command-table .ct-combat-attacker .ct-combat-card-art { height: 112px; }
}
@media (max-width: 900px) {
  #game.command-table .ct-player-zones { padding: 3px 5px; gap: 3px; }
  #game.command-table .ct-player-zones :is(.zonecounter, .ct-focus-board) { min-height: 38px; }
  #game.command-table .ct-player-head { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 6px; }
  #game.command-table .ct-player-head .zbtns { gap: 3px; flex-wrap: nowrap; }
  #game.command-table .ct-player-head .zonecounter { flex: 1 1 0; padding: 5px 3px; font-size: 9px; gap: 3px; }
  #game.command-table .ct-player-head .zonecounter b { font-size: 12px; }
  #game.command-table .ct-player-head .zonecounter .gameicon { width: 16px; height: 16px; flex-basis: 16px; }
  #game.command-table .ct-focus-board { flex-basis: 38px; }
  #game.command-table .opphead .ct-turn-badge { font-size: 9px; }
  #game.command-table .opphead .oppmeta:has(.zbtn, .playereffectsbadge) { display: flex !important; grid-column: 1 / -1; grid-row: 2; padding-bottom: 4px; }
}
@media (max-width: 360px) {
  #game.command-table .ct-player-head .zonecounterlabel { display: none; }
}

/* A player overview is a readable public board, with damage relative to your seat. */
#game .sheet.playeroverview { display: flex; flex-direction: column; gap: 16px; width: min(980px, calc(100 * var(--vwu) - 32px)); padding: 22px; background: var(--ds-dialog); overflow-y: auto; }
#game .playeroverviewhead { display: flex; align-items: center; gap: 16px; }
#game .playeroverviewhead > div:first-child { flex: 1; min-width: 0; }
#game .playeroverviewhead small { color: var(--ds-accent-bright); font: 650 10px/1.5 var(--ds-font-body); letter-spacing: .07em; }
#game .playeroverviewhead .mtitle { margin: 3px 0; font: 650 26px/1.2 var(--ds-font-display); }
#game .playeroverviewhead p { color: var(--ds-muted); margin: 4px 0 0; font-size: 13px; }
#game .playeroverviewlife { display: flex; align-items: center; gap: 7px; }
#game .playeroverviewlife .gameicon { width: 22px; height: 22px; color: #d49b9d; }
#game .playeroverviewlife b { font: 650 32px var(--ds-font-mono); }
#game .playeroverviewclose { display: grid; place-items: center; align-self: flex-start; width: 44px; height: 44px; border: 1px solid var(--ds-line); border-radius: 6px; background: var(--ds-panel); color: var(--ds-copy); font-size: 26px; flex: 0 0 44px; }
#game .playeroverviewnav { display: flex; gap: 5px; overflow-x: auto; flex: 0 0 auto; }
#game .playeroverviewnav .pbtn { flex: 1 0 auto; min-height: 38px; padding: 7px 12px; font-size: 11px; }
#game .playeroverviewnav [aria-pressed='true'] { border-color: var(--ds-accent); color: var(--ds-accent-bright); }
#game .playeroverviewzones { display: flex; flex-wrap: wrap; gap: 6px; }
#game .playeroverviewzones > .zonecounter { flex: 1 1 auto; min-height: 42px; }
#game .playeroverviewcounters { display: flex; gap: 6px; flex-wrap: wrap; }
#game .playeroverviewfocus { align-self: flex-start; min-height: 42px; }
#game .playeroverviewfocus .gameicon { width: 16px; height: 16px; }
#game .playeroverviewdamage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#game .playeroverviewdamage > div { padding: 12px; display: grid; gap: 6px; background: var(--ds-panel); border: 1px solid var(--ds-line-soft); border-radius: 7px; font-size: 12px; }
#game .playeroverviewdamage small { font: 600 9px var(--ds-font-body); color: var(--ds-muted); letter-spacing: .04em; }
#game .playeroverviewdamage b { color: var(--ds-text); font-family: var(--ds-font-mono); white-space: nowrap; }
#game .playeroverview :is(.cmdhint, .cmddmg) { margin: 0; flex: 0 0 auto; }
#game .playeroverviewbattlefield { display: grid; gap: 16px; flex: 0 0 auto; }
#game .playeroverviewbattlefield h3 { margin: 0; font: 600 16px var(--ds-font-display); }
body.game-active #game.command-table .playeroverviewbattlefield .boardlanecards { flex-wrap: wrap; overflow: visible; }
#game .playeroverviewbattlefield .boardlanelabel { margin-bottom: 5px; }
#game .playeroverview .playerstatuspanel { flex: 0 0 auto; }
@media (max-width: 600px) {
  #game .sheet.playeroverview { width: calc(100 * var(--vwu) - 20px); padding: 14px; gap: 12px; }
  #game .playeroverviewhead { gap: 8px; }
  #game .playeroverviewhead .mtitle { font-size: 21px; }
  #game .playeroverviewlife { gap: 4px; }
  #game .playeroverviewlife b { font-size: 25px; }
  #game .playeroverviewlife small { display: none; }
  #game .playeroverviewzones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #game .playeroverviewzones > .zonecounter { gap: 4px; font-size: 9px; padding-inline: 5px; }
  #game .playeroverviewdamage { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  #game .playeroverviewzones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Review celebrates the four seats while preserving the existing setup flow. */
#setup[data-setup-stage='review'] .setupgrid { display: block !important; max-width: 1380px; padding: 0 32px 24px !important; margin: auto !important; }
#setup[data-setup-stage='review'] .setupright { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
#setup[data-setup-stage='review'] .reviewstage { padding: 0 !important; }
#setup[data-setup-stage='review'] .menuhead { padding-bottom: 24px !important; }
#setup[data-setup-stage='review'] .reviewhead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#setup[data-setup-stage='review'] .reviewdeck { display: none; }
#setup .ct-review-seats { display: grid; grid-template-columns: repeat(var(--ct-seats, 4), minmax(0, 1fr)); gap: 14px; }
#setup .ct-review-seat { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ds-line); border-radius: 8px; overflow: hidden; background: var(--ds-panel); }
#setup .ct-review-seat.is-human { border-color: var(--ds-accent); }
#setup .ct-review-art { display: block; width: 100%; height: clamp(170px, calc(25 * var(--dvhu)), 280px); object-fit: cover; object-position: center 25%; }
#setup .ct-review-number { position: absolute; top: 12px; left: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ds-line); border-radius: 50%; background: var(--ds-table); color: var(--ds-copy); font: 600 12px var(--ds-font-mono); }
#setup .ct-review-copy { display: flex; flex-direction: column; gap: 7px; padding: 18px; flex: 1; }
#setup .ct-review-copy > small { font-size: 12px; color: var(--ds-accent-bright); }
#setup .ct-review-copy > b { font: 600 24px/1.15 var(--ds-font-display); }
#setup .ct-review-copy > span { font: 400 14px/1.4 var(--ds-font-body); color: var(--ds-muted); }
#setup .ct-review-colors { display: flex; gap: 5px; min-height: 20px; }
#setup .ct-review-colors img { width: 19px; height: 19px; }
#setup .ct-review-seat .reviewstyle { padding: 0; margin: 4px 0; justify-content: flex-start; min-height: 26px; background: transparent; }
#setup .ct-review-seat .reviewstyle img { width: 22px; height: 22px; object-fit: cover; }
#setup .ct-review-change { min-height: 44px; padding: 12px; border: 0; border-top: 1px solid var(--ds-line-soft); color: var(--ds-accent-bright); background: transparent; font: 600 13px var(--ds-font-body); }
#setup .ct-review-random { display: grid; place-content: center; gap: 12px; text-align: center; color: var(--ds-muted); background: var(--ds-panel-raised); }
#setup .ct-review-random .gameicon { width: 44px; height: 44px; margin: auto; }
#setup .reviewrules { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 14px 0; margin: 22px 0; border-block: 1px solid var(--ds-line); gap: 0; }
#setup .reviewrules > div { border: 0; border-right: 1px solid var(--ds-line-soft); padding: 4px 14px; border-radius: 0; background: transparent; }
#setup .reviewrules > div:last-child { border-right: 0; }
#setup .reviewrules dt { font-size: 11px; line-height: 1.3; }
#setup .reviewrules dd { font-size: 12px; line-height: 1.5; }
#setup .reviewactions { position: sticky; bottom: 0; z-index: 8; display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; background: var(--ds-table); border-top: 1px solid var(--ds-line-soft); }
#setup .reviewactions .pbtn { min-height: 48px; min-width: 180px; }
#setup .reviewactions .reviewstart { margin-left: auto; width: auto; flex: 0 0 230px; background: var(--ds-accent); }
#setup .savepodform { margin-top: 14px; }
@media (min-width: 901px) and (max-height: 800px) {
  #setup[data-setup-stage='review'] .menuhead { padding-top: 22px !important; padding-bottom: 18px !important; }
  #setup[data-setup-stage='review'] .menuhead h1 { font-size: 38px !important; }
  #setup .ct-review-copy { padding: 12px 15px; gap: 5px; }
  #setup .ct-review-copy > b { font-size: 21px; }
  #setup .reviewrules { margin: 14px 0; }
}
@media (max-width: 900px) {
  #setup[data-setup-stage='review'] .setupgrid { padding: 0 16px 16px !important; }
  #setup .ct-review-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #setup .ct-review-art { height: 190px; }
  #setup .ct-review-copy { padding: 12px; }
  #setup .ct-review-copy > b { font-size: 19px; }
  #setup .reviewrules { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; }
  #setup .reviewactions .pbtn { min-width: 0; flex: 1 1 auto; width: 100%; }
}
@media (max-width: 450px) {
  #setup .ct-review-art { height: 156px; }
  #setup .ct-review-copy > b { font-size: 17px; }
  #setup .ct-review-copy > span { font-size: 12px; }
  #setup .ct-review-copy .reviewstyle b { font-size: 10px; }
}
@media (max-width: 600px) {
  /* Keep the whole pod scannable before committing to a game on a phone. */
  #setup[data-setup-stage='review'] .setupgrid { padding: 0 12px 16px !important; }
  #setup .ct-review-seats { grid-template-columns: minmax(0, 1fr); }
  #setup .ct-review-seat { display: grid; grid-template-columns: 80px minmax(0, 1fr) 62px; min-height: 124px; }
  #setup .ct-review-art { width: 80px; height: 100%; min-height: 124px; }
  #setup .ct-review-number { top: 6px; left: 6px; width: 26px; height: 26px; font-size: 10px; }
  #setup .ct-review-copy { min-width: 0; padding: 12px; gap: 5px; justify-content: center; }
  #setup .ct-review-copy > b { font-size: 18px; overflow-wrap: anywhere; }
  #setup .ct-review-copy > span { font-size: 12px; overflow-wrap: anywhere; }
  #setup .ct-review-colors:empty { display: none; }
  #setup .ct-review-change { padding: 8px; border-top: 0; border-left: 1px solid var(--ds-line-soft); font-size: 12px; }
  #setup .ct-review-random > span { display: none; }
  #setup .ct-review-random .gameicon { width: 30px; height: 30px; }
  #setup .ct-review-seat .reviewstyle { margin: 0; min-height: 22px; }
  #setup .ct-review-copy .reviewstyle b { font-size: 11px; }
  #setup .reviewactions { flex-direction: row; gap: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  #setup .reviewactions .pbtn { flex: 1 1 0; padding: 10px; font-size: 13px; }
  #setup .reviewrules > div:nth-child(even) { border-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #game.command-table *, #setup .ct-review-seat { animation: none !important; transition: none !important; }
}

/* Shared Live Arena transport status stays readable without covering decisions. */
#game .live-arena-status { position: fixed; top: 4px; left: 50%; transform: translateX(-50%); max-width: min(90%, 700px); padding: 8px 14px; border: 1px solid var(--ds-accent); border-radius: 8px; background: var(--ds-dialog); color: var(--ds-text); font: 12px var(--ds-font-body); z-index: 3000; }
#game .live-arena-status[hidden] { display: none; }
.mutatetag { position: absolute; top: 28px; left: 3px; z-index: 3; max-width: calc(100% - 6px); padding: 2px 4px; border: 1px solid #8cbaa3; border-radius: 3px; background: #122e25e8; color: #e1ffef; font-size: 8px; line-height: 1.2; font-weight: 700; letter-spacing: .03em; }

/* Mutate remains one interactive permanent, with its physical cards underneath. */
#game .mini.mutated {
  --mutate-peek: 18px;
  isolation: isolate;
  overflow: visible;
  margin-bottom: calc(5px + var(--mutate-peek-count) * var(--mutate-peek));
}
body.game-active #game.command-table .mini.mutated {
  margin-bottom: calc(5px + var(--mutate-peek-count) * var(--mutate-peek));
}
#game .mini.mutated::before { border-radius: inherit; }
#game .mini.mutated > .mutate-underlay {
  position: absolute;
  inset: -2px;
  z-index: calc(-1 * var(--mutate-layer));
  transform: translate(calc(var(--mutate-layer) * 2px), calc(var(--mutate-layer) * var(--mutate-peek)));
  overflow: hidden;
  border: 1px solid #709e89;
  border-radius: 6px;
  background: #183027;
  box-shadow: 0 2px 4px #0009;
  cursor: inherit;
}
#game .mini .mutate-underlay > img { inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
#game .mini .mutate-underlay > span {
  position: absolute; inset: auto 0 0; height: 16px;
  padding: 3px 2px 2px; background: #10271ff2; color: #e1ffef;
  font: 600 8px/11px var(--ds-font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mutate-kicker { color: #abd6c1; font: 700 10px/1.4 var(--ds-font-body); letter-spacing: .09em; }
.mutate-explanation, .mutate-components > p { margin: 8px 0 16px; color: var(--ds-muted, #abb6b1); font-size: 13px; line-height: 1.5; }
#game .mutate-order-modal { max-width: 620px; }
.mutate-order .mtitle { margin: 5px 0 0; }
.mutate-order-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mutate-order-choice {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  min-width: 0; padding: 16px 12px; border: 1px solid #527262; border-radius: 12px;
  background: #14201b; color: #edf5f0; font: inherit; text-align: center; cursor: pointer;
}
.mutate-order-choice:hover { border-color: #b0e5cd; background: #1d3027; }
.mutate-order-choice:focus-visible { outline: 3px solid #b0e5cd; outline-offset: 3px; }
.mutate-choice-title { font-size: 16px; font-weight: 700; }
.mutate-choice-result { margin-top: auto; color: #afc4b9; font-size: 12px; line-height: 1.4; }
.mutate-choice-result strong { display: block; color: #edf5f0; }
.mutate-order-foot { margin: 14px 0 0; color: #afc4b9; font-size: 11px; line-height: 1.5; }
.mutate-stack {
  --mutate-offset: 27px;
  display: grid; width: min(100%, 210px); box-sizing: border-box;
  padding: 0 calc((var(--mutate-count) - 1) * 2px) calc((var(--mutate-count) - 1) * var(--mutate-offset)) 0;
  isolation: isolate;
}
.mutate-layer {
  grid-area: 1 / 1; position: relative; align-self: start; width: 100%; aspect-ratio: 5 / 7;
  transform: translate(calc(var(--mutate-layer) * 2px), calc(var(--mutate-layer) * var(--mutate-offset)));
  z-index: calc(var(--mutate-count) - var(--mutate-layer));
  overflow: hidden; border: 1px solid #6b8275; border-radius: 8px;
  background: #17251f; box-shadow: 0 3px 9px #0009;
}
.mutate-layer.incoming { border-color: #adf2cc; box-shadow: 0 0 0 2px #adf2cc, 0 3px 9px #0009; }
.mutate-layer > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mutate-layer-name {
  position: absolute; inset: auto 0 0; padding: 6px 4px;
  background: #10271ff5; color: #eefbf4; font: 600 10px/14px var(--ds-font-body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mutate-omitted { padding: 20px 8px; color: #afc4b9; font-size: 12px; }
.mutate-layer.hidden-card, .mutate-underlay.hidden-card, .mutate-component-body.hidden-card { background: repeating-linear-gradient(135deg, #203328 0 8px, #17271f 8px 16px); }

/* Battlefield-first play: a shared table, quiet chrome and a small action dock. */
#game.command-table .ct-combat-prompt { display: flex !important; align-items: center; gap: 16px; }
#game.command-table .ct-combat-instruction { flex: 1; min-width: 0; }
#game.command-table .ct-combat-copy { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
#game.command-table .ct-combat-copy b { font: 650 14px/1.4 var(--ds-font-body); color: var(--ds-text); white-space: nowrap; }
#game.command-table .ct-combat-copy > span { color: var(--ds-muted); font: 500 12px/1.4 var(--ds-font-body); }
#game.command-table .ct-combat-actions { flex: 0 0 auto; align-items: center; }
#game.command-table .ct-defender-choices { display: flex; gap: 6px; margin-top: 6px; padding: 1px 1px 3px; overflow: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
#game.command-table .ct-defender-choice { flex: 1 0 112px; min-width: 0; max-width: 180px; min-height: 58px; display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 7px 9px; border: 1px solid var(--ds-line); border-radius: 7px; background: #171e25; color: var(--ds-text); font: 500 11px/1.3 var(--ds-font-body); letter-spacing: 0; text-align: left; text-transform: none; white-space: normal; scroll-snap-align: start; }
#game.command-table .ct-defender-identity { min-width: 0; display: grid; gap: 2px; }
#game.command-table .ct-defender-identity b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 650 12px/1.25 var(--ds-font-body); letter-spacing: 0; }
#game.command-table .ct-defender-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b1c0cb; font: 500 10px/1.2 var(--ds-font-body); letter-spacing: 0; }
#game.command-table .ct-defender-allocation { font: 600 10px/1.2 var(--ds-font-body); color: var(--ds-muted); letter-spacing: 0; }
#game.command-table .ct-defender-choice.has-attackers { border-color: #9a704a; background: #2c241e; }
#game.command-table .ct-defender-choice.has-attackers .ct-defender-allocation { color: #f4c394; }
#game.command-table .ct-defender-walker .ct-defender-identity small { color: #c9ace6; }
#game.command-table .ct-defender-choice:disabled { opacity: .48; cursor: not-allowed; }
#game.command-table .ct-defender-choice:focus-visible { outline: 2px solid #96d6ee; outline-offset: -2px; }
#game.command-table .ct-defender-choice[aria-pressed='true'] { border-color: var(--ds-accent); background: rgba(var(--ds-accent-rgb), .14); color: var(--ds-accent-bright); }
#game.command-table .ct-quiet-action { background: transparent; border-color: transparent; box-shadow: none; color: var(--ds-muted); }
#game.command-table .ct-quiet-action:hover { color: var(--ds-text); border-color: var(--ds-line); }
#game.command-table .ct-combat-pick { cursor: pointer; }
#game.command-table .ct-combat-pick:focus-visible { outline: 2px solid #96d6ee; outline-offset: 3px; }
#game.command-table .mini.eligible { box-shadow: 0 0 0 1px #75b2c1, 0 0 12px #75b2c122 !important; animation: none !important; }
#game.command-table .mini.ct-combat-selected { border-color: #eeaa70 !important; box-shadow: 0 0 0 2px #eeaa70, 0 0 18px #ed9b4c30 !important; }
#game.command-table .mini.ct-attack-pending { border-color: #9ae5f1 !important; box-shadow: 0 0 0 2px #9ae5f1, 0 0 18px #79d5e930 !important; }
#game.command-table .mini.ct-attack-pending .atkchip { background: #153b46f5; color: #cdf6ff; }
#game.command-table .mini.ct-block-pending { box-shadow: 0 0 0 2px #9ae5f1, 0 0 18px #79d5e930 !important; }
#game.command-table .ct-block-unavailable { opacity: .5; }
#game.command-table .opphead.ct-combat-pick { box-shadow: inset 0 -2px #72909b; }
#game.command-table .opphead.ct-combat-selected { box-shadow: inset 0 -2px #eeaa70; background: #3a2a1e; }
#game.command-table .mini .atkchip { background: #402916f2; color: #ffdbb5; font-size: 9px; letter-spacing: 0; }
#game.command-table .ct-combat-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; overflow: hidden; color: #efb477; }
#game.command-table .ct-combat-lines path { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .68; }
#game.command-table .ct-combat-lines circle { fill: currentColor; }
#game.command-table[data-combat-step='blockers'] .ct-combat-lines { color: #8ccfdc; }
#game.command-table .ct-battle-line { display: flex; align-items: center; min-width: 0; padding: 6px 12px; gap: 16px; border-block: 1px solid #b8834433; background: #111519ed; }
#game.command-table .ct-battle-line-label { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; }
#game.command-table .ct-battle-line-label b { font-size: 12px; color: #e9bc92; }
#game.command-table .ct-battle-line-label small { font-size: 10px; color: var(--ds-muted); }
#game.command-table .ct-battle-line-cards { display: flex; align-items: flex-start; gap: 12px; overflow: auto; min-width: 0; scrollbar-width: thin; }
#game.command-table .ct-battle-pair { flex: 0 0 160px; min-width: 0; }
#game.command-table .ct-battle-attacker { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px; min-height: 56px; background: #1a2027; border: 1px solid #5c4740; border-radius: 5px; letter-spacing: 0; text-align: left; }
#game.command-table .ct-battle-attacker.ct-combat-selected { border-color: #9ae5f1; background: #1c3038; }
#game.command-table .ct-battle-art { flex: 0 0 34px; width: 34px; height: 48px; overflow: hidden; border-radius: 3px; }
#game.command-table .ct-battle-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
#game.command-table .ct-battle-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.2; }
#game.command-table .ct-battle-copy b { font-size: 10px; line-height: 1.25; }
#game.command-table .ct-battle-copy strong { font: 650 12px var(--ds-font-mono); }
#game.command-table .ct-battle-copy small { font-size: 9px; line-height: 1.2; color: var(--ds-muted); }
#game.command-table .ct-battle-attacker, #game.command-table .ct-battle-attacker :is(b, strong, small), #game.command-table .ct-block-link { letter-spacing: 0 !important; text-transform: none; }
#game.command-table .ct-battle-blocks { display: flex; flex-wrap: wrap; gap: 2px; padding-top: 3px; max-height: 48px; overflow: auto; }
#game.command-table .ct-block-link { min-height: 22px; padding: 2px 4px; font: 500 9px/1.2 var(--ds-font-body); letter-spacing: 0; background: #172b30; color: #bce3e8; border-color: #527c8555; }
body.game-active #game.command-table .ct-battle-blocks .ct-block-link { min-height: 22px !important; padding: 3px 4px !important; line-height: 1.2; letter-spacing: 0 !important; }
#game.command-table .ct-unblocked { padding: 2px 4px; color: #c1a393; font-size: 9px; }

@media (min-width: 901px) {
  body.game-active #game.command-table.ct-grid-view,
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count]),
  body.game-active #game.command-table.ct-grid-view.ct-no-opponents {
    --ct-card: 122px; --ct-opponent-card: 94px; --ct-hand: 150px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 48px 20px minmax(190px, 1fr) auto minmax(200px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) auto !important;
    grid-template-areas: 'topbar topbar topbar' 'ticker ticker ticker' 'opponent-one opponent-two opponent-three' 'center center center' 'mine mine mine' 'hand hand hand' 'decision decision decision' !important;
  }
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count='2']) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; grid-template-areas: 'topbar topbar' 'ticker ticker' 'opponent-one opponent-two' 'center center' 'mine mine' 'hand hand' 'decision decision' !important; }
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count='1']) { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: 'topbar' 'ticker' 'opponent-one' 'center' 'mine' 'hand' 'decision' !important; }
  body.game-active #game.command-table.ct-grid-view.ct-no-opponents { grid-template-areas: 'topbar topbar topbar' 'ticker ticker ticker' 'mine mine mine' 'mine mine mine' 'center center center' 'hand hand hand' 'decision decision decision' !important; }
  body.game-active #game.command-table[data-table-view='focus']:not(.ct-grid-view) {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 48px 52px minmax(170px, 1fr) auto minmax(180px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) auto !important;
    grid-template-areas: 'topbar' 'seats' 'opps' 'center' 'mine' 'hand' 'decision' !important;
  }
  body.game-active #game.command-table.ct-grid-view .opprow { border-radius: 6px; border-top: 1px solid #9b8c7044; background: linear-gradient(180deg, #151b21dc, #12171e9c) !important; }
  body.game-active #game.command-table.ct-grid-view .myboard { border-top: 1px solid #b7835366; background: linear-gradient(180deg, #151b21a8, #151b21de) !important; }
  body.game-active #game.command-table.ct-grid-view .mybattlefieldmain { justify-content: center; }
  body.game-active #game.command-table.ct-grid-view .creaturelane .boardlanecards { justify-content: center; }
  body.game-active #game.command-table .arenaheader { padding: 4px 12px !important; }
  #game.command-table .phase b { font-size: 18px; }
  #game.command-table .phase { font-size: 11px; }
  #game.command-table .hudaction, #game.command-table .ct-view-button { min-height: 32px !important; padding: 5px 9px !important; font-size: 10px; }
  #game.command-table .pbtn { min-height: 34px; padding: 6px 12px; border-radius: 5px; font: 600 12px/1.35 var(--ds-font-body); letter-spacing: 0; }
  #game.command-table .pbtn.primary { min-width: 116px; max-width: 180px; background: #c68b59 !important; color: #101214; border-color: #edc18d; }
  #game.command-table .ct-decision-rail { flex-direction: row; align-items: center; gap: 14px; min-height: 58px; max-height: 150px; padding: 8px 14px; border: 0; border-top: 1px solid var(--ds-line); background: #0d1116f5; z-index: 20; }
  #game.command-table .ct-decision-heading, #game.command-table .ct-decision-content { display: none; }
  body.game-active #game.command-table .ct-decision-rail .promptbar { display: flex; flex-direction: row; align-items: center; gap: 14px; flex: 1; max-height: 132px; min-width: 0; padding: 0 !important; }
  #game.command-table .promptbar .ptext { flex: 1; margin: 0; font-size: 12px !important; }
  #game.command-table .promptbar .btnrow { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
  #game.command-table .promptbar .btnrow:not(.offzone):not(.priorityabilities):not(.faceupactions) { margin-left: auto; flex: 0 0 auto; }
  #game.command-table .ct-decision-rail .utilityrail { width: auto; gap: 4px; border: 0; border-left: 1px solid var(--ds-line); padding: 0 0 0 10px; order: -1; }
  #game.command-table .utilitybutton { flex: 0 0 36px; min-height: 36px; padding: 6px; }
  #game.command-table .utilitylabel { display: none; }
  #game.command-table .utilityicon .gameicon { width: 17px; height: 17px; }
  #game.command-table .ct-expanded-decision { overflow: visible; }
  #game.command-table.ct-expanded-decision .ct-decision-rail {
    position: absolute; grid-area: auto; right: 10px; top: 58px; bottom: 12px; width: 278px; max-height: 660px;
    flex-direction: column; align-items: stretch; padding: 12px; border: 1px solid var(--ds-line); border-radius: 8px;
    background: #11171df5; box-shadow: 0 8px 32px #0008; z-index: 30;
  }
  #game.command-table.ct-expanded-decision .ct-decision-heading { display: flex; }
  body.game-active #game.command-table.ct-expanded-decision { padding-right: 300px !important; }
  #game.command-table.ct-expanded-decision .ct-decision-content { display: block; }
  body.game-active #game.command-table.ct-expanded-decision .ct-decision-rail .promptbar { display: block; flex: 0 1 auto; max-height: 230px; }
  #game.command-table.ct-expanded-decision .promptbar .btnrow { flex-wrap: wrap; }
  #game.command-table.ct-expanded-decision .ct-decision-rail .utilityrail { order: 0; border: 0; padding: 0; }
  #game.command-table.ct-expanded-decision .ct-decision-rail.has-targets .ct-decision-content { display: none; }
  body.game-active #game.command-table.ct-expanded-decision .ct-decision-rail.has-targets .targetprompt { display: flex; flex-direction: column; flex: 1; max-height: none; }
  #game.command-table .actionstagebuttons { flex-direction: row; flex-wrap: wrap; }
  #game.command-table .actionstagebuttons .pbtn { flex: 1; min-width: 0; }
  #game.command-table .ct-combat-dock .ct-decision-heading, #game.command-table .ct-combat-dock .ct-decision-content { display: none; }
  body.game-active #game.command-table.ct-battlefield-combat .center { padding: 0 !important; min-height: 0; }
  body.game-active #game.command-table.ct-battlefield-combat[data-combat-step='attackers'] .center { display: none !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-combat-step='blockers'] { --ct-card: 104px; }
  #game.command-table .ct-battle-attacker, #game.command-table .ct-block-link { letter-spacing: 0 !important; }
  #game.command-table .ct-combat-keywords { color: #e2bd8f; }
}
@media (min-width: 901px) and (max-height: 800px) {
  body.game-active #game.command-table.ct-grid-view,
  body.game-active #game.command-table.ct-grid-view:has(.oppswrap[data-opponent-count]) {
    --ct-card: 82px; --ct-opponent-card: 70px; --ct-hand: 116px;
    grid-template-rows: 44px 18px minmax(144px, 1fr) auto minmax(156px, 1fr) calc(var(--ct-hand) + var(--ct-hand-extra)) auto !important;
  }
  body.game-active #game.command-table.ct-grid-view:not(.empty-hand) { --ct-hand: 116px; }
  #game.command-table .ct-battle-line { padding-block: 4px; }
  #game.command-table .ct-battle-line-label { display: none; }
  body.game-active #game.command-table.ct-grid-view .opphead { min-height: 44px !important; padding-block: 3px !important; }
  #game.command-table.ct-grid-view .ct-player-head { padding-block: 3px; }
  #game.command-table.ct-grid-view :is(.ct-player-head, .opphead) .ct-portrait { height: 34px; width: 30px; }
  body.game-active #game.command-table.ct-battlefield-combat.ct-grid-view,
  body.game-active #game.command-table.ct-battlefield-combat.ct-grid-view:has(.oppswrap[data-opponent-count]) {
    --ct-card: 82px; --ct-opponent-card: 76px;
    grid-template-rows: 44px 18px minmax(190px, 1fr) auto minmax(190px, 1fr) 0 auto !important;
  }
  body.game-active #game.command-table.ct-battlefield-combat .handwrap { display: none !important; }
  body.game-active #game.command-table.ct-battlefield-combat .ct-player-head { min-height: 40px; height: 40px; padding: 2px 7px; }
  #game.command-table.ct-battlefield-combat .ct-player-name { display: flex; flex-direction: row; align-items: center; gap: 8px; }
  #game.command-table.ct-battlefield-combat .ct-player-name > small { display: none; }
  #game.command-table.ct-battlefield-combat .ct-player-name .manapool { margin: 0; }
  body.game-active #game.command-table.ct-battlefield-combat .ct-resource-dock .mini.sm { width: 30px !important; height: 40px !important; }
  body.game-active #game.command-table.ct-battlefield-combat .ct-resource-dock .permanentpile.sm { width: 30px !important; }
  body.game-active #game.command-table.ct-battlefield-combat .ct-resource-dock { padding: 1px 7px !important; }
  body.game-active #game.command-table.ct-battlefield-combat .ct-resource-dock .landstrip { padding-block: 1px; }
}
@media (max-width: 900px) {
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 48px 52px auto minmax(0, 1fr) auto var(--ct-tabs) !important;
    grid-template-areas: 'topbar' 'seats' 'center' 'mine' 'decision' 'tabs' !important;
  }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .myboard { display: flex !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .oppsouter,
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .handwrap { display: none !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .ct-seat-ribbon { display: flex !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .center { display: block !important; padding: 0 !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'][data-combat-step='attackers'] .center { display: none !important; }
  #game.command-table .ct-battle-line { gap: 8px; padding: 5px 8px; }
  #game.command-table .ct-battle-line-label { display: none; }
  #game.command-table .ct-battle-pair { flex-basis: 142px; }
  #game.command-table .ct-battle-blocks { max-height: 44px; }
  #game.command-table .ct-block-link { min-height: 32px; }
  #game.command-table .ct-combat-lines { display: none; }
  body.game-active #game.command-table .ct-combat-dock { max-height: 184px; padding: 8px; gap: 0; }
  #game.command-table .ct-combat-dock .ct-decision-heading,
  #game.command-table .ct-combat-dock .ct-decision-content { display: none; }
  body.game-active #game.command-table .ct-combat-dock .ct-combat-prompt { flex-direction: column; align-items: stretch; gap: 7px; max-height: none; overflow: hidden; }
  #game.command-table .ct-combat-copy { flex-wrap: wrap; gap: 2px 8px; }
  #game.command-table .ct-combat-copy b { font-size: 12px; }
  #game.command-table .ct-combat-copy > span { font-size: 11px; }
  #game.command-table .ct-defender-choice { min-height: 64px; padding: 7px 8px; }
  #game.command-table .ct-combat-actions { flex-wrap: nowrap; gap: 4px; }
  body.game-active #game.command-table .ct-combat-prompt .btnrow > .pbtn { flex: 0 0 auto; min-height: 44px; width: auto; padding: 6px 9px; font-size: 11px; letter-spacing: 0; }
  body.game-active #game.command-table .ct-combat-prompt .btnrow > .primary { margin-left: auto; min-width: 108px; max-width: 160px; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'][data-mobile-board='opponent'] { grid-template-areas: 'topbar' 'seats' 'center' 'opps' 'decision' 'tabs' !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'][data-mobile-board='opponent'] .oppsouter { display: block !important; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'][data-mobile-board='opponent'] .myboard { display: none !important; }
}
body.game-active #game.command-table .ct-decision-rail .pbtn { letter-spacing: 0 !important; }
body.game-active #game.command-table .ct-decision-rail .pbtn.primary { background: #c68b59 !important; color: #101214; }
@media (min-width: 600px) and (max-width: 900px) and (max-height: 500px) {
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] {
    --ct-card: 66px;
    grid-template-rows: 40px auto minmax(90px, 1fr) auto 44px !important;
    grid-template-areas: 'topbar' 'center' 'mine' 'decision' 'tabs' !important;
  }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .ct-seat-ribbon,
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .ct-player-head,
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'] .landrow { display: none !important; }
  body.game-active #game.command-table .ct-combat-dock .ct-combat-prompt { flex-direction: row; align-items: center; }
  #game.command-table .ct-combat-copy > span { font-size: 10px; }
  #game.command-table .ct-combat-actions { flex: 0 0 auto; }
  #game.command-table .ct-battle-blocks { max-height: 24px; }
  #game.command-table .ct-block-link { min-height: 24px; }
  body.game-active #game.command-table.ct-battlefield-combat[data-mobile-view='mine'][data-mobile-board='opponent'] { grid-template-areas: 'topbar' 'center' 'opps' 'decision' 'tabs' !important; }
}
.mutate-sheet-visual { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 4px 4px; }
.mutate-sheet-visual .mutate-stack { width: min(100%, 230px); }
#game .faceupsheet .mutate-sheet-visual { min-height: 0; overflow-y: auto; padding-inline: 0; }
.mutate-components { margin-top: 16px; }
.mutate-components h3 { margin: 0; font-size: 15px; }
.mutate-component { margin: 6px 0; border: 1px solid #354e41; border-radius: 8px; background: #111e18; }
.mutate-component > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px; cursor: pointer; }
.mutate-component > summary::after { content: '+'; margin-left: auto; color: #abd6c1; }
.mutate-component[open] > summary::after { content: '−'; }
.mutate-component > summary strong { font-size: 12px; }
.mutate-component > summary small { color: #afc4b9; font-size: 10px; }
.mutate-component-position { flex: 0 0 auto; color: #abd6c1; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.mutate-component-body { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 0 10px 12px; }
.mutate-component-body > img { width: 100%; height: auto; border-radius: 6px; }
.mutate-component-body > p { margin: 0; color: #c5d2ca; font-size: 12px; line-height: 1.5; }
@media (max-width: 480px) {
  .mutate-order-choices { gap: 10px; }
  .mutate-order-choice { padding: 12px 8px; gap: 12px; }
  .mutate-choice-title { font-size: 14px; }
  .mutate-layer-name { font-size: 9px; }
  .mutate-component-body { grid-template-columns: 90px minmax(0, 1fr); gap: 8px; }
}
