/* A viewport-sized play surface, with independently scrollable crowded rows. */
.mobile-details-toggle { display: none; }
/* Keep the count inside the space reserved for the opponent's hand. */
.mini-hand { flex-shrink: 0; }
.mini-hand span { position: absolute; right: 0; bottom: 0; margin: 0; min-width: 18px; text-align: center; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  body:has(.tactile-layout) { height: 100dvh; overflow: hidden; }
  body:has(.tactile-layout) header { height: 88px; min-height: 88px; padding: 5px 12px; gap: 2px; flex-direction: column; flex-wrap: nowrap; }
  body:has(.tactile-layout) .brand { font-size: 1rem; }
  body:has(.tactile-layout) .brand small { display: none; }
  body:has(.tactile-layout) .studio-mark { width: 26px; height: 26px; }
  body:has(.tactile-layout) header nav { margin: 0; gap: 8px; flex-wrap: nowrap; }
  body:has(.tactile-layout) header nav button { min-height: 44px; padding: 8px 14px; font-size: .875rem; }
  .game-layout.tactile-layout { height: calc(100dvh - 88px); min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) 44px; padding-bottom: env(safe-area-inset-bottom); position: relative; }
  .tactile-layout .table { --gear-peek: 12px; width: 100%; min-height: 0; margin: 0 auto; padding: 6px 10px 0; display: flex; flex-direction: column; gap: 4px; overflow: auto; }
  .tactile-layout .opponents { flex: 1 0 140px; min-height: 140px; max-height: 190px; gap: 5px; overflow: auto; }
  .tactile-layout .seat { min-height: 0; padding: 5px; border-radius: 10px; overflow: auto; }
  .tactile-layout .seat-head { min-height: 24px; margin-bottom: 2px; gap: 2px; }
  .tactile-layout .mini-hand { flex: 0 0 34px; width: 34px; height: 30px; transform: none; }
  .tactile-layout .mini-hand i { width: 16px; height: 23px; }
  .tactile-layout .mini-hand i:nth-child(2) { left: 6px; }
  .tactile-layout .mini-hand i:nth-child(3) { left: 12px; }
  .tactile-layout .seat-name { font-size: .75rem; }
  .tactile-layout .characters { gap: 8px; padding: 5px 4px 8px; align-items: flex-start; }
  .tactile-layout .seat .character-wrap, .tactile-layout .seat .chest { flex: 0 0 48px; min-width: 48px; max-width: 48px; }
  .tactile-layout .character-name, .tactile-layout .chest>span { font-size: .75rem; line-height: 1.15; margin-top: 3px; }
  .tactile-layout .tactile-center { flex: none; min-height: 0; padding: 8px 4px; gap: 14px; }
  .tactile-center .pile { width: 64px; }
  .tactile-center .table-message { width: auto; min-width: 0; flex: 1; }
  .deck-button, .discard-button { width: 44px; height: 62px; margin-inline: auto; }
  .pile .subtle { margin-top: 5px; font-size: .75rem; white-space: nowrap; }
  .card-back small { display: none; }
  .tactile-center .table-message h2 { font-size: 1rem; }
  .tactile-center .table-message p { font-size: .75rem; margin-bottom: 3px; }
  .pending-slot { min-height: 0; }
  .pending-face { width: 36px!important; }
  .pending-face .card-art { height: 50px; }
  .tactile-layout .human-seat { --player-card: clamp(64px,11dvh,84px); flex: none; min-height: 0; padding: 0; }
  .tactile-layout .human-board { min-height: 0; max-height: clamp(88px,19dvh,160px); overflow: auto; padding: 2px 0; }
  .tactile-layout .human-board.posse-threat { padding: 2px 0; }
  .tactile-layout .human-board .seat-head { margin: 0; min-height: 18px; }
  .tactile-layout .human-board .characters { gap: 12px; }
  .tactile-layout .human-seat .character-wrap, .tactile-layout .human-seat .chest { flex: 0 0 52px; min-width: 52px; max-width: 52px; width: 52px; }
  .tactile-layout .human-seat>.action-bar { margin: 0; min-height: 44px; }
  .action-bar button { min-height: 44px; padding: 6px 14px; font-size: .875rem; }
  .tactile-layout .human-seat .hand { min-height: 0; height: calc(var(--player-card)*1.4 + 38px); flex-shrink: 0; padding: 14px 8px 8px; }
  .tactile-layout .human-seat .hand-card { touch-action: pan-x; transform: none; }
  .tactile-layout .human-seat .hand-card+.hand-card { margin-left: -16px; }
  .tactile-layout .human-seat .hand-card.selected, .tactile-layout .human-seat .hand-card:focus-visible { transform: translateY(-8px); }
  .tactile-layout .human-seat .hand-card .card-caption { font-size: .75rem; white-space: normal; margin-top: 3px; }
  .tactile-layout .sidebar { min-height: 0; width: 100%; padding: 0 12px; border: 0; }
  .mobile-details-toggle { display: block; padding: 4px 12px; font-size: .75rem; min-height: 44px; }
  .tactile-layout .sidebar:has(.mobile-details-toggle):not(.mobile-details-open) .selection { display: none; }
  .history summary { padding: 12px 0; font-size: .75rem; min-height: 44px; }
  .history[open], .tactile-layout .sidebar .selection { position: absolute; z-index: 80; left: 8px; right: 8px; bottom: 32px; max-height: 48dvh; overflow: auto; padding: 12px; background: #173c35; border: 1px solid #789782; border-radius: 14px; box-shadow: 0 -8px 30px #0006; }
  .card-details { grid-template-columns: minmax(0,90px) minmax(0,1fr); gap: 12px; }
  .card-details-copy { padding: 34px 0 0; }
  .card-details-copy p { font-size: .875rem; }
  .card-details-close { width: 44px; height: 44px; }
  .tactile-layout .table-notices { display: grid; flex: none; gap: 8px; margin: 8px 0; }
  .tactile-layout .table-notices .threat-banner, .tactile-layout .table-notices .outcome[role="status"] { position: static; width: 100%; min-width: 0; margin: 0; padding: 8px 12px; gap: 8px; }
  .tactile-layout .outcome[role="status"] { flex-wrap: wrap; text-align: left; }
  .tactile-layout .threat-banner>div:first-child { min-width: 0; }
  .tactile-layout .threat-banner p { margin: 3px 0 0; }
  .tactile-layout .threat-clock { flex: none; display: flex; align-items: center; gap: 8px; }
  .tactile-layout .threat-clock span { margin: 0; font-size: 22px; }
  .threat-banner strong { font-size: 1rem; }
  .threat-banner p { font-size: .875rem; }
  .threat-clock button { min-height: 44px; margin: 0; }
  .choice-panel { position: absolute; z-index: 70; left: 8px; right: 8px; bottom: calc(var(--player-card)*1.4 + 114px); max-height: 35dvh; overflow: auto; margin: 0; background: #173c35; }
  .choice-options { max-height: none; }
}
@media (max-width: 760px) and (max-height: 740px) and (orientation: portrait) {
  body:has(.tactile-layout) header { height: 52px; min-height: 52px; flex-direction: row; padding: 4px 8px; }
  body:has(.tactile-layout) .brand>span { display: none; }
  body:has(.tactile-layout) header nav { gap: 4px; }
  body:has(.tactile-layout) header nav button { padding: 6px 9px; white-space: nowrap; font-size: .75rem; }
  .game-layout.tactile-layout { height: calc(100dvh - 52px); }
  .tactile-layout .human-seat { --player-card: 64px; }
  .tactile-layout .human-board { max-height: 100px; }
  .tactile-layout .human-board { display: flex; gap: 4px; align-items: center; }
  .tactile-layout .human-board .seat-head { min-width: 64px; }
  .tactile-layout .human-board .characters { min-width: 0; flex: 1; }
  .tactile-layout .human-seat .character-wrap, .tactile-layout .human-seat .chest { flex-basis: 44px; width: 44px; min-width: 44px; max-width: 44px; }
  .tactile-layout .tactile-center { padding: 4px; }
}
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  body:has(.tactile-layout) header { height: 48px; min-height: 48px; flex-direction: row; }
  .game-layout.tactile-layout { height: calc(100dvh - 48px); }
  .tactile-layout .table { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: minmax(140px,1fr) auto auto; grid-template-areas: "opponents human" "notice human" "center human"; gap: 4px 12px; }
  .tactile-layout .human-seat { grid-area: human; --player-card: 64px; }
  .tactile-layout .human-board { flex: 1; min-height: 0; max-height: none; }
  .tactile-layout .opponents { grid-area: opponents; }
  .tactile-layout .table-notices { grid-area: notice; }
  .tactile-layout .tactile-center { grid-area: center; padding: 4px; }
  .tactile-layout .seat .character-wrap { flex-basis: 44px; min-width: 44px; max-width: 44px; }
  .tactile-layout .sidebar .selection, .history[open] { max-height: 75dvh; }
}

