/* Scale within a readable range, not indefinitely with the TV resolution.
   Controls and reference panels stop at 24px base type; the extra area belongs
   to the table. BOTH dimensions matter for short/ultrawide windows. */
@media screen and (min-width: 1440px) and (min-height: 810px) {
  html:has(body.is-playing) { font-size: clamp(1rem, min(1.05vw, 1.8dvh), 1.5rem); }

  .is-playing .game-toolbar { min-height: 3rem; }
  .is-playing .game-toolbar-actions > button,
  .is-playing .game-tools-menu > summary,
  .is-playing .flyout-bar button { min-height: 2.5rem; border-radius: .375rem; }
  .is-playing .game-tools-menu > div { min-width: 15rem; }
  .is-playing .board-stage { padding: .3rem .75rem 0; }
  .is-playing .game-phase-track { top: .5rem; }
  .is-playing .mahjong-table {
    grid-template-columns: minmax(0, min(15rem, 22%)) minmax(0, 1fr) minmax(0, min(15rem, 22%));
    gap: .75rem;
    padding: 4.25rem 2.125rem 2.1rem;
    border-width: .4375rem;
    border-radius: 1.5rem;
    background-size: auto, 22.5rem 22.5rem, auto, auto;
  }
  .is-playing .mahjong-table::before { inset: 2.8rem; }
  .is-playing .wall-north { top: 2.75rem; }
  .is-playing .wall-south { bottom: .625rem; }
  .is-playing .wall-east { right: .5625rem; }
  .is-playing .wall-west { left: .5625rem; }
  .is-playing :is(.wall-north, .wall-south) .wall-stack { height: 1rem; }
  .is-playing :is(.wall-east, .wall-west) .wall-stack { width: 1rem; }
  .is-playing .wall-stack:is(.is-next, .is-open)::after { top: -1.125rem; }
  .is-playing .table-compass { width: 2.5rem; height: 2.5rem; top: .5rem; }
  .is-playing .table-compass::before { top: 1rem; bottom: 1rem; }
  .is-playing .table-compass::after { left: 1rem; right: 1rem; }
  .is-playing .compass-top { top: .3125rem; }
  .is-playing .compass-bottom { bottom: .3125rem; }
  .is-playing .compass-left { left: .3125rem; }
  .is-playing .compass-right { right: .3125rem; }

  .is-playing .table-player { border-radius: .5rem; }
  .is-playing .player-north { width: 15rem; }
  .is-playing .player-south { min-width: min(15rem, 100%); gap: 0 .5rem; }
  .is-playing .mini-player-rack { gap: .125rem; }
  .is-playing .mini-player-rack .mini-tile-back { width: .625rem; height: 1.0625rem; flex-basis: .625rem; }
  .is-playing .mini-player-rack .mini-game-tile { width: 1.75rem; height: 2.5375rem; flex-basis: 1.75rem; }
  .is-playing .table-player .mini-exposures { max-height: 9rem; gap: .3125rem; padding: .25rem .125rem .4rem; }
  .is-playing .table-player:is(.player-east, .player-west) .mini-exposures { max-height: none; }
  .is-playing .table-player .mini-exposure { gap: .2rem; padding: .25rem .3rem .4rem; }
  .is-playing .mini-exposure-tiles { gap: .125rem; }
  .is-playing .mini-exposure .mini-game-tile { width: 2rem; height: 2.9rem; flex-basis: 2rem; }
  .is-playing .table-player .tile-corner { font-size: .65rem; top: .15rem; left: .15rem; }
  .is-playing .table-center .latest-discard { border-radius: .625rem; }
  .is-playing .latest-discard .latest-discard-tile { width: clamp(44px, 2.75rem, 58px); height: auto; aspect-ratio: 1 / 1.45; flex-basis: clamp(44px, 2.75rem, 58px); }
  .is-playing .latest-discard strong { max-width: 140px; font-size: clamp(16px, .9rem, 20px); }
  .is-playing .latest-discard .tile-corner { font-size: 14px; top: 4px; left: 4px; }
  /* Discard rows use their own capped scale and measured, complete-row viewport. */

  /* Reference tiles scale with their panels; the human rack deliberately keeps
     the compact desktop dimensions defined in game-focus.css. */
  .is-playing .game-tile { width: 3.625rem; height: 5.25rem; flex-basis: 3.625rem; border-radius: .375rem; padding: 0 .1875rem .3125rem 0; }
  .is-playing .game-tile .tile-corner { top: .25rem; left: .25rem; padding: .0625rem .125rem; }
  .is-playing .game-tile.is-drawn { margin-left: .875rem; }
  .is-playing .game-tile.is-drawn::before { top: -1rem; }
  .is-playing .rack-heading-tools select { max-width: 17rem; min-height: 2.25rem; }
  .is-playing .rack-help-disclosure summary { min-height: 2.25rem; }
  .is-playing .rack-help-disclosure p { width: 18rem; }
  .is-playing .game-button { min-height: 2.5rem; }
  .is-playing .quick-coach-button { min-height: 2.75rem; }
  .is-playing .quick-coach-button > span { width: 1.1875rem; height: 1.1875rem; }
  .is-playing .turn-secondary-actions .game-button { min-height: 2.5rem; }
  /* Public sets beside the human rack retain compact, fixed tile dimensions. */
  .is-playing .exposed-set .tile-preview { width: 3rem; height: 4.375rem; flex-basis: 3rem; }

  .is-playing .preplay-stage { grid-template-columns: 1fr minmax(14.375rem, .65fr); }
  .is-playing .preplay-copy { grid-template-columns: 1.875rem 1fr; }
  .is-playing .preplay-step-number { width: 1.75rem; height: 1.75rem; }
  .is-playing .wall-die { width: 2rem; height: 2rem; }
  .is-playing .charleston-workspace { grid-template-columns: minmax(0,1fr) minmax(14.375rem,.42fr); }
  .is-playing .pass-zone .mini-game-tile,
  .is-playing .pass-zone .mini-tile-back { width: 2rem; height: 2.9rem; flex-basis: 2rem; }
  .is-playing .pass-direction { min-width: 4.6875rem; }
  .is-playing .blind-buttons button { min-height: 2.5rem; }

  /* Reference panels scale with their text and still stop above the measured dock. */
  .is-playing .play-flyout { top: 3.875rem; right: .75rem; bottom: calc(var(--dock-height) + .75rem); width: min(38.75rem, calc(100vw - 1.5rem)); }
  .is-playing .coach-column.play-flyout { width: min(28.75rem, calc(100vw - 1.5rem)); height: calc(100dvh - var(--dock-height) - 4.625rem); }
  .is-playing .game-card-panel.play-flyout { left: 1rem; right: 1rem; width: auto; }
  .is-playing .call-decision { top: 4.125rem; left: 1rem; bottom: calc(var(--dock-height) + .75rem); width: min(35rem, calc(100vw - 2rem)); }
  .is-playing .call-decision-heading .mini-game-tile { width: 2.25rem; height: 3.25rem; flex-basis: 2.25rem; }
  .is-playing .hand-result { top: 4.125rem; width: min(56.25rem, calc(100vw - 2rem)); max-height: calc(100dvh - var(--dock-height) - 4.875rem); }
  .is-playing .result-finale { min-height: 9.25rem; padding: 1.125rem 2rem; }
  .is-playing .result-finale-loss .finale-copy { max-width: 22rem; }
  .is-playing .joker-dancer { width: 7.875rem; height: 8.25rem; flex-basis: 7.875rem; }
  .is-playing .finale-flower { width: 6rem; height: 8.75rem; }
  .is-playing .finale-burst { width: 9.375rem; height: 9.375rem; }
  .is-playing .game-history li::before { width: 1.75rem; height: 1.75rem; }
  .is-playing .candidate-slots { gap: .125rem; }
  .is-playing .candidate-slots i { height: .375rem; }
  .is-playing .player-detail .mini-game-tile,
  .is-playing .player-detail .mini-tile-back { width: 1.875rem; height: 2.6875rem; flex-basis: 1.875rem; }
  .is-playing .discard-closeup { grid-template-columns: 6.5rem minmax(0,1fr); gap: 1rem; width: min(19rem, calc(100vw - 1rem)); padding: 1.5625rem 1rem 1.125rem; }
  .is-playing .discard-closeup [data-discard-closeup-tile] .game-tile { width: 6.5rem; height: 9.375rem; }
  .is-playing .discard-closeup-close { width: 2.75rem; height: 2.75rem; }
}
