/* Dedicated touch layout; the full desktop table remains available at wide widths. */
.mobileTableTools,.mobileDecisionSheet,.mobileMatchReadout{display:none}.mobilePreviewActions{position:sticky;bottom:0;background:#19261df5;padding:12px 0 0}.mobilePreviewActions p{font-size:12px;margin:0 0 9px}.mobilePreviewActions button{width:100%;min-height:48px;white-space:normal}.mobilePhaseSheet{width:min(520px,96vw)}.mobileSheetHead{display:flex;align-items:center;justify-content:space-between;gap:12px}.mobileSheetHead>button{min-height:44px;flex-shrink:0}.mobilePhaseSheet .turnRail{position:static;max-height:none;overflow:visible;border:0;padding:12px 0 0}.mobilePhaseSheet .inspect{display:none}
@media(max-width:700px),(max-width:950px) and (max-height:520px) and (pointer:coarse){
 body.mobileTable.inGame header{display:none}body.mobileTable.inGame main{padding:8px 8px calc(var(--dock-height) + 12px + env(safe-area-inset-bottom))}
 .mobileTable #table .tableHeader{position:sticky;top:0;margin:0 0 5px}.mobileTable #table .tableHeader .turn{padding:3px 9px;gap:7px;flex-wrap:nowrap;margin:0!important}.mobileTable #table .turnReadout{grid-template-columns:minmax(0,1fr);min-width:0;gap:3px}.mobileTable #table .turnIdentity{gap:7px;min-width:0}.mobileTable #table #turnMark{width:28px;height:28px;font-size:10px}.mobileTable #table #turnOwner{font-size:13px!important}.mobileTable #table .turnMeta,.mobileTable #table #phase{font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}.mobileTable #table .decisionBlock{display:none}.mobileTable #table .tableHeader .buttons{gap:5px}.mobileTable #table #gameHelpButton,.mobileTable #table #backLobby{min-width:44px;min-height:44px;font-size:11px;padding:7px}.mobileTable #table .gameGrid{display:block}.mobileTable #table .board{padding:4px}.mobileTable .mobileMatchReadout:not([hidden]){display:block;font-size:10px;line-height:12px;color:#efd69c;margin:0}
 .mobileTableTools{display:flex;gap:6px;margin:0 0 6px}.mobileTableTools>button{min-height:44px;padding:7px 11px;font-size:12px}.mobileTableTools>button:first-child{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}.mobileTableTools .needsDecision{border-color:#efd08b;color:#ffe1a7;background:#51432b}
 .mobileTable #table .battlefieldViewport{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 18px minmax(0,1fr);min-height:480px;height:max(480px,calc(100dvh - var(--board-top) - var(--dock-height) - var(--lower-table-height)));max-height:none;border-radius:10px;overflow:hidden}
 .mobileTable #table .battleRow{grid-template-columns:minmax(0,1fr) 111px;grid-template-rows:44px minmax(0,1fr);padding:0;min-height:0}.mobileTable #table .battleRow::before{display:none}.mobileTable #table .enemyRow{grid-column:1;grid-row:1;border-right:0;border-bottom:1px solid #a77d5566}.mobileTable #table .ownRow{grid-column:1;grid-row:3;border-top:1px solid #72906b66}.mobileTable #table .combat{grid-column:1;grid-row:2;height:18px;font-size:9px;line-height:12px;padding:3px 7px}
 .mobileTable #table .playerBar{grid-row:1;grid-column:1;min-height:44px;padding:3px 5px;gap:6px;overflow:hidden}.mobileTable #table .playerBar .name{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:0}.mobileTable #table .playerBar .name>strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.mobileTable #table .playerBar .seatLabel{font-size:8px;line-height:10px}.mobileTable #table .playerBar .name>small{display:block;font-size:9px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.mobileTable #table .playerBar .enemyHand{display:none}.mobileTable #table .playerBar .life{font-size:19px;min-width:48px;min-height:40px;padding:3px 6px;line-height:1.4}.mobileTable #table .playerBar .mana{flex-wrap:nowrap;overflow:auto;max-width:110px;margin-left:auto}.mobileTable #table .mana button{min-width:34px;min-height:36px;font-size:10px;padding:4px}
 .mobileTable #table .zoneRack{grid-row:1;grid-column:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;width:111px;padding:1px 3px;align-self:stretch;border:0}.mobileTable #table .zoneSlot{position:relative;display:block}.mobileTable #table .zoneLabel{position:absolute;top:2px;left:0;right:0;z-index:2;text-align:center;font-size:9px;pointer-events:none;margin:0}.mobileTable #table .zonePile{width:100%;height:42px;min-height:42px;background:#233329;border:1px solid #647e53;padding:0;border-radius:5px}.mobileTable #table .zonePile img,.mobileTable #table .zonePile .cardBack,.mobileTable #table .zonePile .pileEmpty,.mobileTable #table .zonePile>strong,.mobileTable #table .zoneSlot>small{display:none}.mobileTable #table .zonePile .pileCount{display:block;bottom:3px;left:0;right:0;background:none;color:#eeddbb;min-width:0;height:auto;font-size:13px;line-height:18px;border:0;padding:0}.mobileTable #table .zonePile:disabled{opacity:1}
 .mobileTable #table .field{grid-column:1/-1;grid-row:2;min-height:0;padding:2px 3px;overflow:hidden;gap:2px}.mobileTable #table .field .cardRow{flex-wrap:nowrap;justify-content:flex-start;align-items:center;align-content:center;overflow-x:auto;overflow-y:hidden;scrollbar-gutter:auto;scrollbar-width:thin;scroll-snap-type:x proximity;padding:13px 5px 2px;touch-action:auto;min-width:0}.mobileTable #table .field .cardRow:not(.landRow){flex:1 1 auto}.mobileTable #table .field .landRow{flex:0 0 55px;padding:11px 5px 2px}.mobileTable #table .field .cardRow .tile{scroll-snap-align:start;flex-shrink:0}.mobileTable #table .field .cardRow>.rowLabel{top:0;left:5px;font-size:8px}.mobileTable #table .field .cardRow[data-overflow=true]>.rowLabel:after{content:' · scorri →';color:#b9ceb5}.mobileTable #table .field .landRow .landName{font-size:10px;max-height:24px;padding:2px;white-space:normal}.mobileTable #table .field .landRow .card img{object-position:center 35%}.mobileTable #table .field .tile .stats{font-size:13px}.mobileTable #table .field .tile .zoom{width:32px;height:32px;font-size:18px}.mobileTable #table .field .landRow .zoom{width:28px;height:28px;font-size:16px}.mobileTable #table .emptyField{font-size:10px}
 .mobileTable #table .board>.sectionTitle{height:30px;margin:0;padding:2px 5px;gap:5px}.mobileTable #table .board>.sectionTitle h3{font-size:12px}.mobileTable #table .handSizeButton{font-size:11px;min-height:32px;padding:5px 9px}.mobileTable #table #hand,.mobileTable #table #hand.compactHand{padding:4px 5px;min-height:calc(var(--hand-card-height) + 8px);justify-content:flex-start;scroll-snap-type:x proximity;touch-action:auto;overscroll-behavior-x:contain}.mobileTable #table #hand .tile{scroll-snap-align:start}.mobileTable #table #hand .zoom,.mobileTable #table #hand.compactHand .zoom{width:32px;height:32px;font-size:18px}.mobileTable #table #hand .tile:hover{transform:none}
 .mobileTable #commandDock{z-index:30;left:0;right:0;bottom:0;width:100%;margin:0;border-radius:12px 12px 0 0;padding:7px 10px calc(7px + env(safe-area-inset-bottom));gap:5px;min-height:0}.mobileTable #commandDock .dockReadout{display:none}.mobileTable #commandDock #dockOwner,.mobileTable #commandDock #dockPhase,.mobileTable #commandDock .dockShortcut{display:none}.mobileTable #commandDock .commandSummary{width:auto;min-width:0;flex:1}.mobileTable #commandDock #commandState{font-size:12px}.mobileTable #commandDock #commandHint{display:none}.mobileTable #commandDock .controls{gap:6px;width:100%;max-width:none;flex-wrap:nowrap}.mobileTable #commandDock .controls>button,.mobileTable #advancedControls>summary{font-size:12px;min-height:44px;padding:8px 10px}.mobileTable #commandDock .controls>.gold{flex:1;min-width:0;white-space:normal;line-height:1.3}.mobileTable #commandDock #cancel{max-width:115px}.mobileTable #advancedControls{margin:0}.mobileTable #advancedControls>summary{display:flex;align-items:center}.mobileTable #advancedControls .advancedActions{max-height:65dvh;overflow:auto}.mobileTable #advancedControls .advancedActions button{min-height:44px;font-size:12px}.mobileTable #commandDock #pvpReadout{display:none}.mobileTable #soundToggle{position:absolute;right:10px;top:3px;width:34px;height:28px}.mobileTable #commandDock .commandSummary{position:relative;padding-right:40px}.mobileTable.inGame #status:not(:empty){bottom:calc(var(--dock-height) + 8px);font-size:12px}
 .mobileTable .mobileDecisionSheet:not([hidden]){display:block;position:fixed;bottom:calc(var(--dock-height) + 6px);left:6px;right:6px;z-index:28;border:1px solid #b0a16b;background:#192b21fa;border-radius:14px;max-height:48dvh;overflow:auto;padding:9px 12px 12px;box-shadow:0 -12px 40px #0008;overscroll-behavior:contain}.mobileTable .mobileDecisionSheet>.mobileSheetHead{position:sticky;top:-9px;background:#192b21;z-index:2;padding:5px 0;border-bottom:1px solid #688057;min-height:48px}.mobileTable .mobileDecisionSheet .gameAside{display:block;position:static;max-height:none;margin:0;padding:10px 0 0;border:0;background:none;overflow:visible;box-shadow:none}.mobileTable .mobileDecisionSheet button{min-height:44px;font-size:12px}.mobileTable .mobileDecisionSheet #targetOptions{grid-template-columns:repeat(2,minmax(0,1fr))}.mobileTable .mobileDecisionSheet .targetCandidate{min-width:0;padding:6px;font-size:12px}.mobileTable .mobileDecisionSheet .targetCandidate img{width:44px;height:62px}.mobileTable .mobileDecisionSheet #interactionBanner{position:static;margin:0 0 12px;max-height:none;overflow:visible}.mobileTable .mobileDecisionSheet .manaSourceChoices{max-height:120px;overflow:auto}.mobileTable .mobileDecisionSheet.hasMobileDecision .gameAside>h3,.mobileTable .mobileDecisionSheet.hasMobileDecision .gameAside>#stack,.mobileTable .mobileDecisionSheet.hasMobileDecision .gameAside>#stackFlow,.mobileTable .mobileDecisionSheet.hasMobileDecision .gameAside>#gameLog,.mobileTable .mobileDecisionSheet.hasMobileDecision .gameAside>p{display:none}
 .mobileTable .mobilePhaseSheet .turnRail{display:block;margin:0}.mobileTable .mobilePhaseSheet .phaseReadout,.mobileTable .mobilePhaseSheet #phaseTrack button,.mobileTable .mobilePhaseSheet select{min-height:44px;font-size:12px}.mobileTable #preview{max-height:88dvh;padding:14px;overflow:auto}.mobileTable #preview .previewGrid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:12px}.mobileTable #previewArt img{width:100%;max-height:270px;object-fit:contain}.mobileTable #previewName{font-size:20px}.mobileTable #previewText{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}.mobileTable #preview #chooseCardPrinting{font-size:11px;min-height:44px;padding:6px}.mobileTable #closePreview{min-height:44px}.mobileTable #spellOverlay .spellWindow{max-height:88dvh;overflow:auto}.mobileTable #spellOverlay button,.mobileTable #choice button,.mobileTable #sideboardDialog button{min-height:44px}.mobileTable #choice .choicePeek{min-height:32px}.mobileTable #choice{padding:8px}.mobileTable #choice>.panel{max-height:92dvh}
}
@media(max-width:950px) and (max-height:520px) and (pointer:coarse){
 .mobileTable #table .battlefieldViewport{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) 18px;min-height:250px;height:250px}.mobileTable #table .enemyRow{grid-column:1;grid-row:1;border-right:1px solid #a77d5566}.mobileTable #table .ownRow{grid-column:2;grid-row:1;border-top:0}.mobileTable #table .combat{grid-column:1/-1;grid-row:2}.mobileTable #table .tableHeader{margin-bottom:3px}.mobileTableTools{margin-bottom:4px}.mobileTable #table .tableHeader .turn{padding:2px 8px}.mobileTable #table #hand,.mobileTable #table #hand.compactHand{--hand-card-width:72px!important;--hand-card-height:100px!important}.mobileTable .mobileDecisionSheet:not([hidden]){max-height:60dvh}
}

html:has(body.mobileTable.inGame){scroll-padding-bottom:calc(var(--dock-height) + 12px)}
.mobileTable #hand{scroll-margin-bottom:calc(var(--dock-height) + 12px)}
