body[data-ink-ui].screen-game { height:100dvh;overflow:hidden;min-height:0 }
body[data-ink-ui].screen-game .app { max-width:none;width:100%;height:100dvh;min-height:0;padding:8px 18px;display:flex;flex-direction:column;gap:5px;overflow:hidden }
body[data-ink-ui].screen-game .app-nav,body[data-ink-ui].screen-game .topbar { display:none }
body[data-ink-ui].screen-game .lobby-announcement { flex:none;position:relative;top:auto;height:25px;padding:3px 0;border-radius:0;font-size:11px }
body[data-ink-ui].screen-game .lobby-disclaimer { flex:none;order:5;margin:0;padding:4px 0;border:0;font-size:10px;line-height:1.45 }
body[data-ink-ui].screen-game .game-screen { flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;gap:6px;overflow:hidden }
body[data-ink-ui].screen-game .game-layout,body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout,body[data-ink-ui].screen-game .game-screen.tools-collapsed .game-layout { flex:1;min-height:0;height:auto;grid-template-columns:minmax(0,var(--ink-field-width,60%)) minmax(310px,1fr);grid-template-rows:minmax(0,1fr);gap:24px;justify-content:start;overflow:hidden;align-items:stretch }
body[data-ink-ui].screen-game .field-column { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;grid-row:1;grid-column:1;width:100%;height:100%;min-height:0;max-width:none;max-height:none;overflow:auto;padding:0 5px 0 0 }
body[data-ink-ui].screen-game .field-column>.player-zone { width:100%;flex:none }
body[data-ink-ui].screen-game .field-column>.hand-column,body[data-ink-ui].screen-game .field-column>.opponent-hand-tray { width:100%;flex:none }
body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.player-zone,body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.hand-column,body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.opponent-hand-tray { width:100% }
body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column { justify-content:flex-start }
body[data-ink-ui].screen-game .playmat { width:100%;height:auto;max-height:none;aspect-ratio:600/350;flex:none }
body[data-ink-ui].screen-game .zone-head { margin:0 0 5px;height:20px;min-height:20px;line-height:20px }
body[data-ink-ui].screen-game .zone-head h2 { font-size:12px;font-weight:500 }
body[data-ink-ui].screen-game .zone-head span { font-size:11px;color:#717171 }
body[data-ink-ui].screen-game .zone-head h2::before { content:'我';display:inline-grid;place-items:center;width:19px;height:19px;border-radius:50%;background:#292929;color:#f9f9f9;font:13px 'SimSun',serif;margin-right:7px }
body[data-ink-ui].screen-game .opponent .zone-head h2::before { content:'敌';background:transparent;color:#555;border:1px solid #bbb }
body[data-ink-ui].screen-game .player-zone.self { margin-top:4px }
body[data-ink-ui].screen-game .hand-column,body[data-ink-ui].screen-game .hand-column .hand-panel,body[data-ink-ui].screen-game .opponent-hand-tray { min-height:0;height:auto;max-height:none;background:none;border:0;border-radius:0;padding:0;margin:0;overflow:visible }
body[data-ink-ui].screen-game .hand-panel,body[data-ink-ui].screen-game .opponent-hand-tray { display:grid!important;grid-template-columns:66px minmax(0,1fr) 60px;align-items:center;gap:6px }
body[data-ink-ui].screen-game .hand-panel>.panel-head,body[data-ink-ui].screen-game .opponent-hand-tray>.panel-head { display:contents }
body[data-ink-ui].screen-game .hand-panel>.panel-head h2,body[data-ink-ui].screen-game .opponent-hand-tray>.panel-head h2 { grid-row:1;grid-column:1;margin:0;align-self:center;font-size:11px;font-weight:400 }
body[data-ink-ui].screen-game #handCount,body[data-ink-ui].screen-game .ink-enemy-count { display:none }
body[data-ink-ui].screen-game .hand-panel .hand-help { display:none }
.ink-all-hand { min-height:32px;font-size:10px;padding:3px 0;border:0;border-bottom:1px solid #c6c6c6;border-radius:0;background:none;color:#333;grid-column:3;grid-row:1;white-space:nowrap }
body[data-ink-ui].screen-game #hand,body[data-ink-ui].screen-game #opponentHand { grid-column:2;grid-row:1;display:flex;flex-flow:row nowrap;align-items:start;gap:5px;height:57px;min-height:0;max-height:none;width:100%;padding:4px 2px 8px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#8e8e88 #d8d8d5;overscroll-behavior-x:contain;scroll-behavior:auto }
#hand::-webkit-scrollbar,#opponentHand::-webkit-scrollbar { height:5px }#hand::-webkit-scrollbar-track,#opponentHand::-webkit-scrollbar-track { background:#d8d8d5 }#hand::-webkit-scrollbar-thumb,#opponentHand::-webkit-scrollbar-thumb { background:#8e8e88;border-radius:5px }
body[data-ink-ui].screen-game #hand>.hand-card,body[data-ink-ui].screen-game #opponentHand>.hand-card { flex:0 0 62px;width:62px;min-width:62px;max-width:62px;height:42px;min-height:0;max-height:none;margin:0;padding:0;display:block;overflow:hidden;border:0;border-radius:2px;background:none;aspect-ratio:auto;box-shadow:0 1px 2px #0003 }
body[data-ink-ui].screen-game #hand .public-card-face,body[data-ink-ui].screen-game #opponentHand .public-card-face { width:62px;height:87px;max-width:none;max-height:none;position:relative;inset:auto;aspect-ratio:62/87 }
body[data-ink-ui].screen-game #opponentHand>.hand-card>.card-art { width:62px;height:87px;object-fit:contain;position:absolute;left:0;top:50%;transform:translateY(-50%) }
body[data-ink-ui].screen-game #hand .hand-index { display:none }
body[data-ink-ui].screen-game #hand .hand-card.is-selected,body[data-ink-ui].screen-game #opponentHand .hand-card.is-selected { outline:2px solid #222!important;outline-offset:0 }
.character-card.concealed-owned .card-face::after { content:'';position:absolute;inset:0;background:rgba(248,248,246,.48);border-radius:3px;pointer-events:none;z-index:1 }
.character-card.concealed-owned .character-state { background:#f2f2ed!important;color:#454640!important;border:1px solid #b9bab3;box-shadow:0 1px 3px #00000012 }
body[data-ink-ui].screen-game .side-column { grid-row:1;grid-column:2;display:flex;flex-direction:column;gap:15px;height:100%;max-height:none;min-height:0;overflow:auto;border-left:1px solid #d1d1d1;padding:0 0 0 22px;scrollbar-width:thin;background:none }
body[data-ink-ui].screen-game .side-column>.tool-rail { display:none!important }
body[data-ink-ui].screen-game .side-column>.battle-controls { display:flex!important;position:sticky;top:0;z-index:8;background:var(--bg);padding:3px 0 5px;gap:5px;flex:none }
body[data-ink-ui].screen-game .battle-controls button { font-size:11px;min-height:32px;border:1px solid #ccc;background:#f6f6f6;border-radius:2px;color:#252525 }
body[data-ink-ui].screen-game #toggleTableTools { display:none }
.ink-battle-header { display:none }
.ink-battle-notices { flex:none;min-height:0;max-height:58px;overflow-y:auto;font-size:12px;line-height:1.5;display:flex;flex-wrap:wrap;column-gap:15px }
.ink-battle-notices:has(>.record-error:empty):not(:has(>:not([hidden]):not(.record-error))) { display:none }
body[data-ink-ui].screen-game .ink-battle-notices .room-presence { padding:2px 0;margin:0;min-width:0;white-space:normal;font-size:12px;flex:1 }
body[data-ink-ui].screen-game .ink-battle-notices .series-score { padding:2px 0;margin:0;background:none;border:0;font-size:12px }
body[data-ink-ui].screen-game .ink-battle-notices .record-error { position:static;flex:1 0 100%;margin:0;padding:3px 8px;font-size:12px }
.ink-turn-context { position:relative;flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;border-bottom:1px solid #cecece;padding:4px 0 18px }
body[data-ink-ui].screen-game .ink-turn-context #statusLine { display:block;grid-column:1;grid-row:1;font-size:11px;line-height:1.6;color:#717171;white-space:normal;margin:0 }
.ink-turn-context>div:not(.match-clock) { grid-column:1/-1;grid-row:2;display:block;min-width:0 }
.ink-turn-context .label { display:none }
body[data-ink-ui].screen-game #phaseValue { font:400 25px/1.3 'Songti SC','SimSun',serif;letter-spacing:2px;color:#252525;white-space:normal }
body[data-ink-ui].screen-game .ink-turn-context .match-clock { grid-column:2;grid-row:1;margin:0;padding:0;background:none;border:0;font-size:11px;line-height:1.6;max-width:none;white-space:normal;text-align:right }
body[data-ink-ui].screen-game #actionsPanel { flex:none;order:0;background:none;border:0;border-radius:0;overflow:visible;padding:0;max-height:none }
body[data-ink-ui].screen-game #actionsPanel>summary { padding:0 0 12px;min-height:28px;font-size:13px;font-weight:500 }
body[data-ink-ui].screen-game #actionsPanel>.panel-content { padding:0 }
body[data-ink-ui].screen-game #actionsPanel .panel-head { background:#e4e4e4;border-left:2px solid #333;padding:12px 14px;margin-bottom:12px }
body[data-ink-ui].screen-game #actionHint { font-size:13px;line-height:1.7;color:#252525 }
body[data-ink-ui].screen-game #actions .action-button { min-height:38px;padding:9px 12px;font-size:13px;border-radius:2px }
body[data-ink-ui].screen-game .table-status { order:2;border-block:1px solid #ccc;padding:10px 0;background:none;flex:none }
body[data-ink-ui].screen-game .table-status .info-strip { gap:8px;display:grid }
body[data-ink-ui].screen-game .table-status .info-strip>div { background:none;border:0;padding:0;font-size:11px }
body[data-ink-ui].screen-game .table-status .label,body[data-ink-ui].screen-game .table-status strong { font-size:11px;font-weight:400 }
body[data-ink-ui].screen-game .process-cards { min-height:0 }
body[data-ink-ui].screen-game #logPanel { order:3;border:0;border-radius:0;background:none;min-height:200px;flex:1 0 200px;max-height:none }
body[data-ink-ui].screen-game #logPanel>summary { padding:0;height:30px;font-size:13px }
body[data-ink-ui].screen-game #logPanel>.panel-content { top:30px;padding:0 }
body[data-ink-ui].screen-game #logPanel .log-list { font-size:11px;line-height:1.65 }
body[data-ink-ui].screen-game #logPanel .panel-head { margin-bottom:8px }
body[data-ink-ui].screen-game #logPanel .panel-head button { font-size:10px;padding:2px 4px;min-height:26px;background:none;border-color:#ccc;border-radius:2px }
.ink-settings-panel { order:4;border-top:1px solid #ccc;flex:none;padding-top:8px }.ink-settings-panel>summary { font-size:12px;padding:5px 0 }.ink-settings-panel .action-settings { display:flex;gap:13px;padding:12px 0 }.ink-settings-panel .test-panel { border:0;border-top:1px solid #ccc;background:none;padding:12px 0;margin:0 }
.ink-hand-sheet { width:min(680px,calc(100vw - 24px));height:min(700px,calc(100dvh - 36px));max-width:none;max-height:calc(100dvh - 36px);padding:20px;background:#f2f2f2;color:#252525;border:1px solid #aaa;border-radius:8px;overflow:hidden }
.ink-hand-sheet[open] { display:flex;flex-direction:column;gap:12px }.ink-hand-sheet::backdrop { background:#15151570;backdrop-filter:blur(3px) }
.ink-hand-sheet>header { display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none }.ink-hand-sheet h2 { font:400 24px 'Songti SC','SimSun',serif;margin:0 }.ink-hand-sheet header button { min-height:36px;font-size:12px }
.ink-hand-hint { flex:none;margin:0;font-size:12px;line-height:1.7;color:#666;max-height:75px;overflow:auto }.ink-hand-body { flex:1;min-height:0;overflow:hidden }
body[data-ink-ui].screen-game .ink-hand-sheet #hand,body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;height:100%;max-height:none;width:100%;gap:14px 12px;padding:5px 5px 16px;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin }
body[data-ink-ui].screen-game .ink-hand-sheet #hand>.hand-card,body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand>.hand-card { width:100%;min-width:0;max-width:none;height:auto;aspect-ratio:62/87;overflow:visible;box-shadow:none }
body[data-ink-ui].screen-game .ink-hand-sheet #hand .public-card-face,body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand .public-card-face { width:100%;height:100%;aspect-ratio:62/87 }
body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand>.hand-card>.card-art { position:static;transform:none;width:100%;height:100% }
.ink-hand-actions { flex:none;max-height:30%;overflow:auto;padding-top:12px;border-top:1px solid #ccc }.ink-hand-actions #actions { display:flex;flex-wrap:wrap;gap:6px }.ink-hand-actions #actions>.empty { display:none }.ink-hand-actions #actions>section { flex-basis:100% }
body[data-ink-ui].screen-game .play-confirmation:not([hidden]) { position:fixed;z-index:5300;right:auto;bottom:auto;width:min(380px,calc(100vw - 16px));overflow-y:auto;box-sizing:border-box;padding:18px;margin:0;background:#f7f7f7;border:1px solid #aaa;border-radius:5px;box-shadow:0 16px 60px #0003;font-size:14px }
body[data-ink-ui] .character-tooltip { z-index:5200;max-height:90dvh;overflow:auto;width:250px;background:#f5f5f5;border-color:#aaa }
/* Inline-size containment cannot infer a card's width from its absolute image. */
body[data-ink-ui] .character-tooltip>.public-card-face { width:214px;max-width:100%;height:auto;aspect-ratio:62/87;margin:0 auto 8px }
@media(max-width:900px),(max-width:1180px) and (max-height:600px) {
  body[data-ink-ui].screen-game .app { padding:max(3px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));gap:3px }
  body[data-ink-ui].screen-game .lobby-announcement { height:21px;font-size:10px;padding:2px 0 }
  body[data-ink-ui].screen-game .lobby-disclaimer { font-size:9px;line-height:1.25;padding:1px 0 }
  body[data-ink-ui].screen-game .game-screen { gap:4px }
  .ink-battle-header { display:flex;align-items:center;gap:4px;flex:none;min-height:29px }.ink-table-brand { display:flex;align-items:center;gap:6px;margin-right:auto;font:13px 'SimSun',serif;letter-spacing:1px }.ink-table-brand img { width:23px;height:23px;object-fit:contain }
  .ink-battle-header button { font-size:10px;padding:4px 6px;min-height:27px;border-radius:2px }
  .ink-battle-notices { max-height:32px;column-gap:8px;line-height:1.3 }
  body[data-ink-ui].screen-game .ink-battle-notices .room-presence,body[data-ink-ui].screen-game .ink-battle-notices .series-score { font-size:10px;line-height:1.3 }
  body[data-ink-ui].screen-game .game-layout,body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout,body[data-ink-ui].screen-game .game-screen.tools-collapsed .game-layout { grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto auto auto;gap:4px;overflow:hidden }
  body[data-ink-ui].screen-game .field-column { grid-row:1;grid-column:1;width:100%;height:100%;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:6px;padding:0;overflow:hidden;align-items:stretch }
  body[data-ink-ui].screen-game .field-column>.player-zone { width:100%;display:grid;grid-template-rows:20px minmax(0,1fr);gap:2px;overflow:hidden;padding:5px 7px;background:linear-gradient(130deg,#fbfbfb,#ececec);border:1px solid #d0d0d0;border-radius:5px;margin:0 }
  body[data-ink-ui].screen-game .field-column>.player-zone.self { border-color:#9b9b9b }
  body[data-ink-ui].screen-game .zone-head { height:20px;min-height:0;margin:0 }.screen-game .zone-head h2::before { width:17px;height:17px;font-size:11px }
  body[data-ink-ui].screen-game .zone-head h2 { font-size:11px }.screen-game .zone-head span.mobile-player-meta { font-size:10px }
  body[data-ink-ui].screen-game .playmat { height:100%;min-height:0;max-height:none;aspect-ratio:auto;grid-template-columns:minmax(0,1fr) 65px 60px 58px;grid-template-rows:22px minmax(0,1fr) 23px;gap:2px;overflow:hidden;background:none }
  body[data-ink-ui].screen-game .playmat[data-aux=empty] { grid-template-rows:22px minmax(0,1fr) }
  body[data-ink-ui].screen-game .playmat .mat-art { display:none }
  body[data-ink-ui].screen-game .commander-card,body[data-ink-ui].screen-game .camp-stack,body[data-ink-ui].screen-game .mat-hp .hp-track { height:22px }
  body[data-ink-ui].screen-game .mobile-card-label,body[data-ink-ui].screen-game .hp-track .hp-value,body[data-ink-ui].screen-game .camp-stack .pile-count,body[data-ink-ui].screen-game .mat-rest .pile-count { font-size:10px;padding:1px 2px;background:none }
  body[data-ink-ui].screen-game .commander-card .mobile-card-label::before { content:'主帅 · ';font-weight:400 }
  body[data-ink-ui].screen-game .mat-rest { background:none }
  body[data-ink-ui].screen-game .battlefield { padding:3px 1px 12px;gap:5px;grid-auto-columns:calc((100% - 20px)/5) }
  body[data-ink-ui].screen-game .character-card .character-state { font-size:9px;line-height:12px;bottom:-10px;background:#f5f5f5;color:#333;border:1px solid #ddd;max-width:125% }
  body[data-ink-ui].screen-game .mobile-lane { color:#999;border:1px dashed #c5c5c5;background:#ffffff10;text-shadow:none;font-size:10px }
  body[data-ink-ui].screen-game .mat-equipment .equipment-pile,body[data-ink-ui].screen-game .mat-judgment .pile { height:23px }
  body[data-ink-ui].screen-game .mat-equipment .equipment-card { height:21px;font-size:9px;min-width:35px;padding:1px 2px }
  body[data-ink-ui].screen-game .hand-column { grid-column:1;grid-row:2;height:auto;padding:0 }
  body[data-ink-ui].screen-game .hand-panel { display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:1px;min-height:0 }
  body[data-ink-ui].screen-game .hand-panel>.panel-head h2 { grid-column:1;grid-row:1;height:20px;line-height:20px;font-size:11px }
  body[data-ink-ui].screen-game .hand-panel .ink-all-hand { grid-column:2;grid-row:1;min-height:22px;font-size:10px }
  body[data-ink-ui].screen-game .mobile-hand-toggle { display:none }
  body[data-ink-ui].screen-game .hand-column #hand { grid-column:1/-1;grid-row:2;gap:5px;height:clamp(70px,12dvh,100px);padding:3px 2px 7px }
  body[data-ink-ui].screen-game .hand-column #hand>.hand-card { flex:0 0 auto;height:100%;width:auto;min-width:0;max-width:none;aspect-ratio:62/87;margin:0;overflow:visible }
  body[data-ink-ui].screen-game .hand-column #hand .public-card-face { width:100%;height:100%;aspect-ratio:62/87 }
  body[data-ink-ui].screen-game .opponent-hand-tray { display:none!important }
  body[data-ink-ui].screen-game .side-column { display:contents!important;padding:0;border:0 }
  body[data-ink-ui].screen-game .side-column>.battle-controls,body[data-ink-ui].screen-game .ink-settings-panel { display:none!important }
  body[data-ink-ui].screen-game .ink-turn-context { grid-column:1;grid-row:3;min-height:0;max-height:72px;overflow:auto;gap:3px;background:#292929;color:#f4f4f4;border:0;border-radius:4px 4px 0 0;padding:6px 9px;margin-bottom:-4px }
  body[data-ink-ui].screen-game .ink-turn-context #statusLine { color:#d1d1d1;font-size:10px;line-height:1.4;max-height:28px;overflow:auto }
  body[data-ink-ui].screen-game #phaseValue { color:#f4f4f4;font:500 13px/1.35 var(--font-ui);letter-spacing:0 }
  body[data-ink-ui].screen-game .ink-turn-context .match-clock { color:#e4e4e4;font-size:10px;max-width:108px;line-height:1.4 }
  body[data-ink-ui].screen-game .side-column>#actionsPanel { grid-column:1;grid-row:4;background:#f9f9f9;border:1px solid #bbb;border-top:0;border-radius:0 0 4px 4px;padding:5px 8px;min-height:0 }
  body[data-ink-ui].screen-game #actionsPanel>summary { min-height:20px;height:20px;padding:0;font-size:10px;line-height:18px }
  body[data-ink-ui].screen-game #actionsPanel .fold-label::after { font-size:10px }
  body[data-ink-ui].screen-game #actionsPanel .panel-head { padding:0;margin:0 0 4px;border:0;background:none }
  body[data-ink-ui].screen-game #actionHint { font-size:11px;line-height:15px;max-height:30px }
  body[data-ink-ui].screen-game #actionsPanel #actions { min-height:30px;max-height:39px;gap:5px;padding:1px }
  body[data-ink-ui].screen-game #actions .action-button { min-height:30px;font-size:11px;padding:5px 9px }
  body[data-ink-ui].screen-game .mobile-toolbar { position:static;order:3;width:100%;height:auto;min-height:30px;gap:4px;flex-wrap:nowrap;overflow-x:auto }
  body[data-ink-ui].screen-game .mobile-toolbar button { flex:1 0 auto;font-size:11px;min-height:30px;min-width:0;padding:3px 5px;border-radius:2px }
  body[data-ink-ui].screen-game #mobileRoomButton { display:none }
  body[data-ink-ui].screen-game .side-column>.mobile-sheet-open { order:0;bottom:40px;left:8px;right:8px;max-height:calc(100dvh - 65px);padding:14px;background:#f5f5f5;border:1px solid #bbb }
  body[data-ink-ui].screen-game .side-column>#logPanel.mobile-sheet-open { height:min(620px,80dvh);min-height:0;max-height:calc(100dvh - 65px);flex:none;border:1px solid #bbb;padding:12px;background:#f5f5f5 }
  body[data-ink-ui].screen-game #logPanel.mobile-sheet-open>summary { height:26px;flex:none }
  body[data-ink-ui].screen-game #logPanel.mobile-sheet-open>.panel-content { inset:84px 12px 12px;padding:0 }
  body[data-ink-ui].screen-game #logPanel.mobile-sheet-open .log-list { font-size:12px }
  body[data-ink-ui].screen-game #actionsPanel.is-expanded { position:fixed;left:8px;right:8px;bottom:40px;z-index:180;max-height:78dvh;border:1px solid #aaa;padding:12px }
  body[data-ink-ui].screen-game #actionsPanel.is-expanded #actions { max-height:60dvh;flex-wrap:wrap;min-height:34px }
  .ink-hand-sheet { padding:14px;height:min(740px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);border-radius:10px }
  .ink-hand-sheet h2 { font-size:20px }.ink-hand-sheet[open] { gap:10px }
  body[data-ink-ui].screen-game .ink-hand-sheet #hand,body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand { grid-template-columns:repeat(4,minmax(0,1fr));gap:16px 8px }
  body[data-ink-ui].screen-game .play-confirmation:not([hidden]) { right:auto;bottom:auto;padding:12px;font-size:13px }
  body[data-ink-ui].screen-game.replaying .game-layout { grid-template-rows:minmax(0,1fr) auto auto }
  body[data-ink-ui].screen-game.replaying .ink-turn-context { grid-row:3 }
  body[data-ink-ui].screen-game.replaying .replay-controls { order:2;flex:none }
}
@media(max-width:1180px) and (max-height:600px) and (orientation:landscape) {
  body[data-ink-ui].screen-game .app { gap:2px }.ink-battle-header { min-height:26px }.ink-battle-header button { min-height:24px;padding:2px 5px }.ink-table-brand img { width:20px;height:20px }
  body[data-ink-ui].screen-game .game-screen { gap:3px }
  body[data-ink-ui].screen-game .game-layout,body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout,body[data-ink-ui].screen-game .game-screen.tools-collapsed .game-layout { grid-template-columns:minmax(0,1.5fr) minmax(220px,1fr);grid-template-rows:minmax(0,1fr) auto auto;gap:3px 8px }
  body[data-ink-ui].screen-game .field-column { grid-column:1/-1;grid-row:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:8px }
  body[data-ink-ui].screen-game .field-column>.player-zone { padding:2px 5px;grid-template-rows:18px minmax(0,1fr) }.screen-game .zone-head { height:18px }
  body[data-ink-ui].screen-game .hand-column { grid-column:1;grid-row:2/4 }
  body[data-ink-ui].screen-game .hand-column #hand { height:clamp(61px,18dvh,86px) }
  body[data-ink-ui].screen-game .ink-turn-context { grid-column:2;grid-row:2;max-height:40px;padding:4px 8px;gap:1px }
  body[data-ink-ui].screen-game .ink-turn-context #statusLine { max-height:14px;font-size:9px }
  body[data-ink-ui].screen-game #phaseValue { font-size:11px;line-height:13px }
  body[data-ink-ui].screen-game .side-column>#actionsPanel { grid-column:2;grid-row:3;padding:3px 6px }
  body[data-ink-ui].screen-game #actionsPanel>summary { display:none }
  body[data-ink-ui].screen-game #actionsPanel .panel-head { margin:0 0 2px }
  body[data-ink-ui].screen-game #actionHint { font-size:10px;line-height:13px;max-height:13px }
  body[data-ink-ui].screen-game #actionsPanel #actions { min-height:26px;max-height:28px;flex-wrap:nowrap }
  body[data-ink-ui].screen-game #actions .action-button { min-height:25px;padding:3px 7px;font-size:10px }
  body[data-ink-ui].screen-game .mobile-toolbar { min-height:25px }.screen-game .mobile-toolbar button { min-height:25px }
  body[data-ink-ui].screen-game .lobby-disclaimer { font-size:9px;white-space:nowrap;overflow-x:auto }
  body[data-ink-ui].screen-game #actionsPanel.is-expanded { left:auto;width:min(520px,65vw);right:8px;bottom:8px;padding:12px }
  body[data-ink-ui].screen-game #actionsPanel.is-expanded>summary { display:block }
  body[data-ink-ui].screen-game #actionsPanel.is-expanded #actionHint { max-height:none }
  body[data-ink-ui].screen-game .ink-hand-sheet #hand,body[data-ink-ui].screen-game .ink-hand-sheet #opponentHand { grid-template-columns:repeat(8,minmax(0,1fr)) }
  body[data-ink-ui].screen-game.replaying .game-layout { grid-template-columns:minmax(0,1.5fr) minmax(220px,1fr);grid-template-rows:minmax(0,1fr) auto }
  body[data-ink-ui].screen-game.replaying .hand-column { grid-row:2 }.screen-game.replaying .ink-turn-context { grid-row:2;grid-column:2 }
}

@media(min-width:901px) and (min-height:601px), (min-width:1181px) {
  body[data-ink-ui].screen-game .field-column { align-items:flex-start;justify-content:flex-start }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout { grid-template-columns:minmax(0,1fr) minmax(310px,32%) }
  body[data-ink-ui].screen-game .opponent .battlefield,body[data-ink-ui].screen-game .opponent .equipment-pile,body[data-ink-ui].screen-game .opponent .mat-judgment>.pile { transform:rotate(180deg) }
  body[data-ink-ui].screen-game .opponent .commander-card,body[data-ink-ui].screen-game .opponent .camp-stack,body[data-ink-ui].screen-game .opponent .rest-stack { rotate:180deg }
  body[data-ink-ui].screen-game .opponent .mat-zone>h3,body[data-ink-ui].screen-game .opponent .mat-rest>.zone-label,body[data-ink-ui].screen-game .opponent .mat-rest>.pile-count { rotate:180deg }
  body[data-ink-ui].screen-game .opponent .hp-value { rotate:180deg }
}

@media(min-width:901px) and (min-height:601px), (min-width:1181px) {
  body[data-ink-ui].screen-game .side-column { max-width:600px }
  body[data-ink-ui].screen-game .field-column { overflow-x:hidden }
}
@media(prefers-reduced-motion:reduce) {body[data-ink-ui] .lobby-announcement { height:auto;max-height:64px;overflow:auto }}

/* The live player panels surround the original, full-colour playmats. */
.ink-identity-rail { display:none }
.ink-match-info { width:min(520px,calc(100vw - 24px));max-height:80dvh;overflow:auto;padding:20px;background:#f4f4f4;border:1px solid #aaa;border-radius:6px;color:#292929 }
.ink-match-info::backdrop { background:#18181870 }
.ink-match-info header { display:flex;align-items:center;justify-content:space-between;gap:16px }
.ink-match-info h2 { font:400 22px 'SimSun',serif;margin:0 }
.ink-match-info-body { font-size:13px;line-height:1.8 }
body[data-ink-ui].screen-game .ink-match-info .lobby-disclaimer { font-size:12px;white-space:normal;text-align:left;padding-top:14px;border-top:1px solid #ccc;overflow:visible }
@media(min-width:901px) and (min-height:601px), (min-width:1181px) {
  body[data-ink-ui].screen-game .app { padding:0;gap:0 }
  body[data-ink-ui].screen-game .game-screen { gap:0;padding:0 }
  body[data-ink-ui].screen-game .game-layout,
  body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout,
  body[data-ink-ui].screen-game .game-screen.tools-collapsed .game-layout { grid-template-columns:minmax(200px,1fr) minmax(0,var(--ink-field-width,60%)) minmax(240px,1fr);gap:0;align-items:start }
  body[data-ink-ui].screen-game .ink-battle-header { display:none }
  body[data-ink-ui].screen-game .ink-identity-rail { grid-column:1;grid-row:1;display:flex;flex-direction:column;width:100%;max-width:300px;justify-self:end;height:100%;min-height:0;overflow-y:auto;padding:25px 22px 18px;background:radial-gradient(ellipse at 0 60%,#dedede33,transparent 70%) }
  .ink-rail-brand img { display:block;width:74px;height:74px;object-fit:contain;margin-bottom:15px;filter:none }
  .ink-rail-brand strong { display:block;font:400 22px 'Songti SC','SimSun',serif;letter-spacing:4px }
  body[data-ink-ui].screen-game .ink-rail-announcement .lobby-announcement { margin-top:10px;height:27px;font-size:10px;border:0;background:none;box-shadow:none;backdrop-filter:none }
  .ink-rail-match { margin-top:22px;padding-top:16px;border-top:1px solid #d0d0d0;font-size:12px;line-height:1.7 }
  .ink-rail-match small { display:block;font-size:11px;color:#777;margin-top:4px }
  .ink-rail-player { margin-top:24px }
  .ink-rail-player>small { display:block;font-size:11px;color:#777;overflow-wrap:anywhere }
  .ink-rail-identity { display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:7px }
  .ink-rail-identity strong { font:400 22px 'Songti SC','SimSun',serif }
  .ink-rail-identity span { font-size:13px;white-space:nowrap;font-variant-numeric:tabular-nums }
  .ink-rail-player p { font-size:11px;line-height:1.7;color:#777;margin:8px 0 3px }
  .ink-rail-hand { min-height:32px;font-size:11px;padding:3px 0;background:none;color:#292929;border:0;border-bottom:1px solid #ccc;border-radius:0;text-align:left }
  .ink-rail-divider { display:flex;align-items:center;gap:12px;color:#999;font:24px 'SimSun',serif;margin-top:18px }
  .ink-rail-divider::after { content:'';flex:1;height:1px;background:#d4d4d4 }
  .ink-rail-notices { border-top:1px solid #d0d0d0;margin-top:auto;padding-top:14px }
  body[data-ink-ui].screen-game .ink-rail-notices .ink-battle-notices { max-height:160px;display:block;overflow:auto }
  body[data-ink-ui].screen-game .ink-rail-notices .room-presence,
  body[data-ink-ui].screen-game .ink-rail-notices .series-score { font-size:11px;line-height:1.7 }
  .ink-rail-footer { margin-top:18px }
  body[data-ink-ui].screen-game .ink-rail-footer .lobby-disclaimer { font-size:10px;line-height:1.8;text-align:left;padding:0;color:#818181 }
  body[data-ink-ui].screen-game .field-column { position:relative;grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:0;align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden;height:auto;max-height:100%;border-radius:0 0 9px 9px }
  body[data-ink-ui].screen-game .field-column>.player-zone { margin:0;padding:0;border:0;border-radius:0;background:none }
  body[data-ink-ui].screen-game .field-column .zone-head { display:none }
  body[data-ink-ui].screen-game .field-column .playmat { border:0;border-radius:0;box-shadow:none;aspect-ratio:600/350 }
  body[data-ink-ui].screen-game .field-column>.player-zone.self { border-top:1px solid #ffffff80 }
  body[data-ink-ui].screen-game .field-column>.hand-column,
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.hand-column { position:absolute;z-index:12;bottom:0;left:22%;width:min(66%,397px);height:50px;overflow:hidden }
  body[data-ink-ui].screen-game .field-column>.opponent-hand-tray,
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.opponent-hand-tray { position:absolute;z-index:12;top:0;left:16%;width:min(66%,397px);height:50px;overflow:hidden }
  body[data-ink-ui].screen-game .field-column .hand-panel,
  body[data-ink-ui].screen-game .field-column>.opponent-hand-tray { display:block!important }
  body[data-ink-ui].screen-game .field-column .hand-panel>.panel-head,
  body[data-ink-ui].screen-game .field-column>.opponent-hand-tray>.panel-head { display:none }
  body[data-ink-ui].screen-game .field-column #hand,
  body[data-ink-ui].screen-game .field-column #opponentHand { width:100%;height:50px;padding:0 0 8px;gap:5px;scroll-snap-type:none }
  body[data-ink-ui].screen-game .field-column #hand>.hand-card,
  body[data-ink-ui].screen-game .field-column #opponentHand>.hand-card { scroll-snap-align:start;height:42px }
  body[data-ink-ui].screen-game .self .mat-equipment { top:65%;height:23% }
  body[data-ink-ui].screen-game .opponent .mat-equipment { top:65%;height:23% }
  body[data-ink-ui].screen-game .side-column { grid-column:3;grid-row:1;width:100%;max-width:410px;min-width:0;height:100%;padding:20px 22px 14px;border:0;gap:17px;overflow-y:auto }
  body[data-ink-ui].screen-game .side-column .battle-controls { order:-2;padding:0;margin:0;flex-wrap:wrap;gap:5px }
  body[data-ink-ui].screen-game .battle-controls button { min-height:30px;font-size:11px;padding:5px 8px }
  body[data-ink-ui].screen-game .ink-turn-context { order:-1;padding:4px 0 16px;gap:8px }
  body[data-ink-ui].screen-game #actionsPanel .panel-head { padding:12px;margin-bottom:10px }
  body[data-ink-ui].screen-game #logPanel { min-height:150px;flex:1 0 150px }
  body[data-ink-ui].screen-game .game-screen.tools-collapsed .side-column { display:flex }
  body[data-ink-ui].screen-game .game-screen.tools-collapsed .side-column>:not(.tool-rail) { display:block!important }
  body[data-ink-ui].screen-game .game-screen.tools-collapsed .side-column>.battle-controls { display:flex!important }
  body[data-ink-ui].screen-game .game-screen.tools-collapsed .side-column>.ink-turn-context { display:grid!important }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .game-layout { grid-template-columns:minmax(200px,1fr) minmax(0,calc(100% - 480px)) minmax(240px,1fr) }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column { height:100%;overflow-y:auto }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.opponent-hand-tray { position:sticky;margin-bottom:-50px;flex:none }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.hand-column { position:sticky;margin-top:-50px;flex:none }
}

/* One physical card size. Landscape cards swap the same long and short edges. */
body[data-ink-ui].screen-game .game-screen {
  --battle-card-width:10.25cqw;
  --battle-card-height:calc(var(--battle-card-width) * 87 / 62);
  --battle-hand-height:calc(var(--battle-card-height) / 2);
}
body[data-ink-ui].screen-game .field-column { container-type:inline-size }
body[data-ink-ui].screen-game .playmat .battlefield { display:flex;align-items:center;gap:5px }
body[data-ink-ui].screen-game .playmat .battlefield>.character-card {
  flex:none;width:var(--battle-card-width);height:var(--battle-card-height);min-width:0;min-height:0;max-height:none;aspect-ratio:62/87;
}
body[data-ink-ui].screen-game .playmat .battlefield>.character-card.tapped { width:var(--battle-card-height);aspect-ratio:1 }
body[data-ink-ui].screen-game .playmat .character-card.tapped>.card-face {
  position:absolute;left:calc((var(--battle-card-height) - var(--battle-card-width)) / 2);top:0;
  width:var(--battle-card-width);height:var(--battle-card-height);transform:rotate(90deg);
}
body[data-ink-ui].screen-game .playmat .mat-commander { width:var(--battle-card-width);height:var(--battle-card-height) }
body[data-ink-ui].screen-game .playmat .commander-card {
  display:block;width:100%;height:100%;padding:0;translate:calc(var(--hp-covered,0) * var(--battle-card-height)) 0;
}
body[data-ink-ui].screen-game .playmat .commander-card>.card-art { display:block }
body[data-ink-ui].screen-game .playmat .commander-card>.mobile-card-label { display:none }
body[data-ink-ui].screen-game .playmat .mat-hp { width:var(--battle-card-height);height:var(--battle-card-width) }
body[data-ink-ui].screen-game .playmat .mat-hp .hp-track { display:block;width:100%;height:100%;padding:0 }
body[data-ink-ui].screen-game .playmat .hp-track>.card-art {
  display:block;width:100%;height:100%;clip-path:inset(0 0 0 calc(var(--hp-covered,0) * 100%));
}
body[data-ink-ui].screen-game .playmat .hp-track .hp-value {
  position:absolute;left:0;right:0;top:100%;bottom:auto;width:100%;padding:1px 2px;line-height:1.2;font-size:10px;text-align:center;
}
body[data-ink-ui].screen-game .playmat .hp-track .hp-value::before { content:none }
body[data-ink-ui].screen-game .playmat .mat-judgment .mini-card {
  position:relative;display:block;flex:none;width:var(--battle-card-height);height:var(--battle-card-width);
  min-width:0;max-width:none;min-height:0;padding:0;aspect-ratio:87/62;
}
body[data-ink-ui].screen-game .playmat .mat-judgment .mini-card>.public-card-face {
  position:absolute;inset:0 auto auto 0;width:var(--battle-card-width);height:var(--battle-card-height);
  transform-origin:top left;transform:translateX(var(--battle-card-height)) rotate(90deg);
}
body[data-ink-ui].screen-game .field-column #hand>.hand-card,
body[data-ink-ui].screen-game .field-column #opponentHand>.hand-card,
body[data-ink-ui].screen-game .hand-column #hand>.hand-card {
  flex:0 0 var(--battle-card-width);width:var(--battle-card-width);height:var(--battle-hand-height);
  min-width:0;max-width:none;min-height:0;max-height:none;aspect-ratio:auto;overflow:hidden;
}
body[data-ink-ui].screen-game .field-column #hand .public-card-face,
body[data-ink-ui].screen-game .field-column #opponentHand .public-card-face,
body[data-ink-ui].screen-game .hand-column #hand .public-card-face,
body[data-ink-ui].screen-game .field-column #opponentHand>.hand-card>.card-art {
  position:relative;inset:auto;width:var(--battle-card-width);height:var(--battle-card-height);max-width:none;max-height:none;transform:none;
}
@media(min-width:901px) and (min-height:601px), (min-width:1181px) {
  body[data-ink-ui].screen-game .playmat .mat-hp { top:calc(69.5% + (var(--battle-card-height) - var(--battle-card-width)) / 2) }
  body[data-ink-ui].screen-game .field-column>.hand-column,
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.hand-column { left:30%;width:52%;height:calc(var(--battle-hand-height) + 8px) }
  body[data-ink-ui].screen-game .field-column>.opponent-hand-tray,
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.opponent-hand-tray { left:16%;width:52%;height:calc(var(--battle-hand-height) + 8px) }
  body[data-ink-ui].screen-game .field-column #hand,
  body[data-ink-ui].screen-game .field-column #opponentHand { height:calc(var(--battle-hand-height) + 8px) }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.opponent-hand-tray { margin-bottom:calc(-1 * (var(--battle-hand-height) + 8px)) }
  body[data-ink-ui].screen-game .game-screen.table-enlarged .field-column>.hand-column { margin-top:calc(-1 * (var(--battle-hand-height) + 8px)) }
}
@media(max-width:900px),(max-width:1180px) and (max-height:600px) {
  body[data-ink-ui].screen-game .game-screen { --battle-card-width:var(--mobile-card-width,40px) }
  body[data-ink-ui].screen-game .playmat {
    grid-template-columns:var(--battle-card-width) var(--battle-card-height) minmax(35px,1fr) minmax(35px,1fr);
    grid-template-rows:var(--battle-card-height) calc(var(--battle-card-height) + 14px) calc(var(--battle-card-width) + 3px);align-content:start;
  }
  body[data-ink-ui].screen-game .playmat[data-aux=empty] { grid-template-rows:var(--battle-card-height) calc(var(--battle-card-height) + 14px) }
  body[data-ink-ui].screen-game .playmat .mat-commander { overflow:visible }
  body[data-ink-ui].screen-game .playmat .commander-card.inverted { transform:rotate(180deg) }
  body[data-ink-ui].screen-game .playmat .mat-hp { align-self:center;overflow:visible }
  body[data-ink-ui].screen-game .playmat .mat-hp .hp-track { position:relative }
  body[data-ink-ui].screen-game .playmat .mat-camp,body[data-ink-ui].screen-game .playmat .mat-rest { align-self:start;height:24px }
  body[data-ink-ui].screen-game .playmat .battlefield { padding:1px 1px 13px;align-items:start }
  body[data-ink-ui].screen-game .playmat .mobile-lane { flex:0 0 var(--battle-card-width);height:var(--battle-card-height) }
  body[data-ink-ui].screen-game .playmat .mat-judgment .pile { height:calc(var(--battle-card-width) + 3px);align-items:start;justify-content:flex-start }
  body[data-ink-ui].screen-game .hand-column #hand { height:calc(var(--battle-hand-height) + 10px) }
}

/* Card selection stays on the board. Native scrollbars remain draggable;
   snapping is disabled because rebuilding selected cards must not re-snap. */
body[data-ink-ui].screen-game #hand,body[data-ink-ui].screen-game #opponentHand {
  scroll-snap-type:none!important;overflow-anchor:none;scrollbar-width:auto;scrollbar-color:#777 #ddd;
  overscroll-behavior-x:contain;scroll-behavior:auto!important;touch-action:pan-x pan-y;
}
body[data-ink-ui].screen-game #hand::-webkit-scrollbar,body[data-ink-ui].screen-game #opponentHand::-webkit-scrollbar{height:10px}
body[data-ink-ui].screen-game #hand::-webkit-scrollbar-thumb:hover,body[data-ink-ui].screen-game #opponentHand::-webkit-scrollbar-thumb:hover{background:#444}
body[data-ink-ui].screen-game .pending-card-grid{max-height:min(42dvh,340px);overflow:auto;overscroll-behavior:contain;scrollbar-width:auto}
@media(max-width:900px),(max-width:1180px) and (max-height:600px){
  body[data-ink-ui].screen-game .player-zone.opponent{position:relative}
  body[data-ink-ui].screen-game .player-zone.opponent:has(>.opponent-hand-tray[data-selecting="true"]){grid-template-rows:20px auto minmax(0,1fr)}
  body[data-ink-ui].screen-game .player-zone.opponent>.opponent-hand-tray[data-selecting="true"] {
    display:block!important;position:static;flex:none;width:100%;height:calc(var(--battle-hand-height) + 10px);
    padding:0;background:#f3f3efdd;border-radius:3px;overflow:hidden;
  }
  body[data-ink-ui].screen-game .opponent-hand-tray>.panel-head{display:none}
  body[data-ink-ui].screen-game .player-zone.opponent>.opponent-hand-tray[data-selecting="true"]>.mobile-drawer-close{display:none}
  body[data-ink-ui].screen-game .opponent-hand-tray #opponentHand{height:calc(var(--battle-hand-height) + 10px);padding:0 0 10px}
}
