/* Native game presentation inside the shared landscape stage. Select stable mode
   classes so a controller re-render never briefly restores the portrait layout. */
body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell:is(.mode-battleship, .mode-pokerduel, .mode-no) { height:100%; min-height:0; padding:8px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) :is(.worker-spectate-content, .worker-spectate-content-main) { height:100%; min-height:0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) :is(.native-game-main, .native-no-layout) {
  display:grid;
  grid-template-columns:minmax(0,1fr) clamp(210px,29vw,270px);
  grid-template-rows:minmax(0,1fr);
  height:100%; min-height:0; gap:8px;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) :is(.native-game-board-column, .worker-spectate-board-wrap, [data-native-board-slot], [data-native-panel-slot]) { height:100%; min-height:0; max-height:100%; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-board-column { display:grid; grid-template-rows:auto minmax(0,1fr); gap:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no).mode-pokerduel .native-game-board-column { grid-template-rows:minmax(0,1fr); }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-side {
  position:static; inset:auto; display:grid; grid-template-columns:minmax(0,1fr); grid-template-areas:none;
  grid-template-rows:auto minmax(0,1fr) auto; gap:4px;
  width:100%; height:100%; min-height:0; max-height:none; margin:0; padding:8px;
}
/* Match chat keeps the Home palette in the phone landscape workspace too. */
body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell .native-game-side[data-native-panel="chat"] {
  background: var(--rx-color-overlay-solid);
  background-image: var(--rx-background-page);
}
body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell .native-game-side[data-native-panel="chat"] .native-game-chat {
  background: transparent;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-tabs { grid-area:1 / 1; display:flex; min-height:0; margin:0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-tab { min-height:44px; flex:1; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-panel-body { grid-area:2 / 1; min-height:0; overflow:auto; padding:0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-panel-actions { grid-area:3 / 1; position:static; inset:auto; padding:4px 0 0; width:100%; min-width:0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(62px,1fr)); gap:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-game-actions .btn { min-width:0; min-height:44px; padding:4px; white-space:normal; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-practice-summary { padding:0; gap:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-practice-side .native-game-panel-body { grid-row:1 / 3; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-battleship, .mode-pokerduel, .mode-no) .native-practice-summary :is(.native-practice-kicker,[data-native-practice-mode],[data-native-practice-difficulty]) { display:none; }
/* A running game occupies the same content stage as Home. The board remains
   bounded; only secondary panel content can scroll. */
body.rx-landscape-shell.native-game-active > .layout { position: absolute; inset: 0 0 auto var(--rx-landscape-rail); width: auto; height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
body.rx-landscape-shell.native-game-active .layout > .sidebar { display: none; }
body.rx-landscape-shell.native-game-active .layout > .main,
body.rx-landscape-shell.native-game-active #homePage,
body.rx-landscape-shell.native-game-active .game-shell.home-game,
body.rx-landscape-shell.native-game-active .unity-container,
body.rx-landscape-shell.native-game-active #nativeWorkerGameRoot {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
body.rx-landscape-shell.native-game-active #homePage > :not(.home-game),
body.rx-landscape-shell.native-game-active .home-game > .game-header { display: none; }

body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell:is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) { height: 100%; padding: 8px max(8px, var(--rx-safe-right)) max(8px, var(--rx-safe-bottom)) 8px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) :is(.worker-spectate-content, .worker-spectate-content-main) { height: 100%; min-height: 0; overflow: visible; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell:is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) clamp(244px, 34vw, 310px);
  grid-template-rows: 53px minmax(0, 1fr);
  grid-template-areas: "player opponent controls" "board board controls";
  height: 100%;
  min-height: 0;
  gap: 4px 8px;
  overflow: visible;
  padding: 8px 0 0;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) :is(.native-game-board-column, .native-game-matchbar) { display: contents; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card:not(.local) { grid-area: opponent; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card.local { grid-area: player; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .worker-spectate-board-wrap { grid-area: board; width: 100%; height: 100%; min-height: 0; max-height: 100%; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) [data-native-board-slot] { height: 100%; max-height: 100%; }
/* The panel owns its tabs, scrollable body and actions. Keep status above the
   board without moving live nodes or sharing padded subgrid tracks. */
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) [data-native-panel-slot] { grid-area: controls; display: block; min-height: 0; min-width: 0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-status-stack { grid-column: 1 / 3; grid-row: 1; align-self: end; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; min-height: 16px; padding: 0; position: relative; z-index: 1; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe):has([data-native-turn-status]:not(:empty)) .native-game-player-card { height: 32px; align-self: start; margin-top: 4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-status-stack [data-native-live-slot] { display: none; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe).practice .native-game-status-stack:not(.practice-hidden) { display: flex; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-practice-status { display: none; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-status-stack.practice-hidden { display: none; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-side { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; grid-template-rows: 44px minmax(0, 1fr) auto; height: 100%; min-height: 0; max-height: none; border: 1px solid var(--rx-color-border); border-radius: 10px; background: var(--rx-color-surface); padding: 8px; gap: 4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-practice-summary :is(.native-practice-kicker, [data-native-practice-mode], [data-native-practice-difficulty]) { display: none; }

/* The original game buttons occupy the side panel directly. History scrolls
   independently; actions keep their touch targets and existing handlers. */
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-panel-actions {
  display: block;
  grid-area: 3 / 1;
  position: static;
  inset: auto;
  width: 100%;
  flex: 0 0 auto;
  padding: 6px 0 0;
  border: 0;
  border-top: 1px solid var(--rx-color-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 4px;
  width: 100%;
  overflow: visible;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-actions .btn {
  min-width: 0;
  min-height: 44px;
  padding: 4px 8px;
  white-space: normal;
}
/* Desktop-style player strip: both identities and clocks sit above the board.
   Keep the existing live clock/profile nodes. */
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card {
  display: grid;
  grid-template-columns: 28px minmax(0, max-content) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 0 5px;
  min-height: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  text-align: left;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card :is(.native-game-player-meta, .native-game-name-row) { display: contents; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card > :is(.worker-spectate-avatar, .native-game-avatar-button) { grid-column: 1; grid-row: 1; width: clamp(20px, 8dvh, 28px); height: clamp(20px, 8dvh, 28px); }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-name-row > :is(strong, .native-game-player-name) { grid-column: 2; grid-row: 1; text-align: left; justify-self: start; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-clock { grid-column: 3; grid-row: 1; min-width: max-content; justify-self: start; font-size: clamp(18px, 2.5vw, 21px); line-height: 1; font-variant-numeric: tabular-nums; padding: 0; background: transparent; border: 0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-name { justify-content: flex-start; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card:not(.local) { grid-template-columns: auto minmax(0, max-content) 28px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card:not(.local) > :is(.worker-spectate-avatar, .native-game-avatar-button) { grid-column: 3; justify-self: end; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card:not(.local) .native-game-name-row > :is(strong, .native-game-player-name) { text-align: right; justify-content: flex-end; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-card:not(.local) .native-game-clock { grid-column: 1; justify-self: end; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) :is(.native-game-clan, .native-game-player-badges) { display: none; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-panel-body { grid-area: 2 / 1; padding: 0; min-height: 0; min-width: 0; overflow: auto; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-practice-summary { padding: 0; gap: 4px; border: 0; background: transparent; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-practice-status { padding: 4px 0; border: 0; border-radius: 0; background: transparent; }

body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-avatar-button .worker-spectate-avatar { width: 100%; height: 100%; }

/* Match chat shares the same side-panel slot as the game log. The game
   actions and live status stay available on either tab. */
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-side[data-native-panel="chat"] {
  position: static;
  inset: auto;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  box-shadow: none;
}
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-tabs { grid-area: 1 / 1; display: flex; flex: 0 0 auto; gap: 4px; margin: 0; padding: 0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-tabs .native-game-tab { flex: 1; min-width: 0; min-height: 44px; border-radius: 5px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-chat { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; gap: 4px; padding: 0; border: 0; background: transparent; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-chat-header { display: none; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-chat-list { min-height: 0; height: auto; overflow: auto; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-chat-form { min-width: 0; margin: 0; padding: 0; gap: 4px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-chat-form .chat-input-shell { min-width: 0; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-system-prefix { color: var(--rx-color-text-muted); }
/* While writing, the visible viewport becomes the shared board/chat stage.
   Identities return when the keyboard closes; no game or chat nodes are moved. */
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-practice-side .native-game-panel-body { grid-row: 1 / 3; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-side[data-native-has-log="false"] .native-game-panel-body { grid-row: 1 / 3; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-name-row > :is(strong, .native-game-player-name) { font-size: 12px; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-player-name strong { font-size: inherit; text-align: inherit; }
body.rx-landscape-shell #nativeWorkerGameRoot :is(.mode-rookx, .mode-classical, .mode-checkers, .mode-fourwins, .mode-tictactoe) .native-game-status-stack .worker-spectate-turn { font-size: 11px; }

  /* Poker keeps real readable controls in short landscape. The previous
     transform scale made the table look smaller without making its layout fit,
     so its lower hand continued behind the footer. */
  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-game-board-column, .worker-spectate-board-wrap, [data-native-board-slot]) {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-board {
    --native-poker-card-width: 44px;
    --native-poker-dealer-rise: 44px;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    grid-template-rows: 30px minmax(108px, 1fr) 44px minmax(108px, 1fr);
    align-content: stretch;
    gap: 3px;
    padding: 2px 6px 4px;
    overflow: auto;
    transform: none;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-game-board-column {
    container-type: inline-size;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-score {
    min-height: 30px;
    height: 30px;
    padding-bottom: 2px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-score-player > span:first-child {
    font-size: .68rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-score-player > strong {
    font-size: .9rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-round-label strong {
    padding: 2px 6px;
    font-size: .72rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-round-label span {
    display: none;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-row {
    grid-template-rows: 24px minmax(0, 1fr);
    min-height: 0;
    gap: 2px;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-row-head {
    min-height: 24px;
    height: 24px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-poker-player-avatar, .native-poker-profile-button.avatar) {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-poker-row-title > strong, .native-poker-profile-button.name > strong) {
    font-size: .76rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-row-title > span,
  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-player-clan {
    display: none;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-row-status {
    max-width: 48%;
    padding: 2px 5px;
    font-size: .68rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-poker-hand-wrap, .native-poker-hand) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-hand {
    grid-template-columns: repeat(5, 44px);
    justify-content: center;
    gap: 6px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-card {
    width: 44px;
    gap: 2px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-card-command {
    min-height: 18px;
    padding: 1px 2px;
    font-size: .72rem;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-poker-table-center, .native-poker-dealer-row) {
    height: 44px;
    min-height: 44px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-dealer-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 4px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-dealer-circle {
    width: 40px;
    height: 40px;
    padding: 2px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel :is(.native-poker-table-line, .native-poker-center-label) { display:none; }
  body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-deck-stack { width:12px; }
  body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-timer { font-size:10px; line-height:12px; }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel :is(.native-poker-center-console, .native-poker-center-console.result-mode) {
    min-height: 44px;
    height: 44px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    padding: 0;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-center-console .btn { min-height:44px; padding:4px 6px; }
  body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-center-console .native-poker-control-copy :is(span,small) { display:none; }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-center-console .native-poker-phase-copy span {
    display: none;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-shared-slot,
  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-pokerduel .native-poker-card.poker-shared-card {
    width: 32px;
    min-width: 32px;
  }

  /* Two complete five-card hands need 520px including their gutters. When the
     table has that width, use it instead of clipping the opponent's cards. */
  @container (min-width: 520px) {
    body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-board {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      grid-template-rows: 30px minmax(108px, 1fr) 44px;
      column-gap: 8px;
    }
    body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-score { grid-area: 1 / 1 / 2 / -1; }
    body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-row.opponent { grid-area: 2 / 1; }
    body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-row.own { grid-area: 2 / 2; }
    body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-pokerduel .native-poker-table-center { grid-area: 3 / 1 / 4 / -1; }
  }

  /* 2-1 divides the same bounded stage between its announcements, table, and
     hand. No row keeps a viewport-specific fixed height, so the hand cannot be
     pushed underneath the shared footer. */
  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-no :is(.native-no-layout, .native-no-game) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-no .native-no-game {
    grid-template-rows: 24px minmax(118px, 1fr) minmax(88px, .72fr);
    gap: 3px;
    padding: 2px 6px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-no :is(.native-no-table, .native-no-hand-area) {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-no .native-no-hand {
    height: calc(100% - 20px);
    min-height: 0;
    padding: 4px 8px 6px;
  }

  body.rx-landscape-shell #nativeWorkerGameRoot
    .native-game-shell.mode-no .native-no-hand .native-no-card {
    width: 44px;
    flex-basis: 44px;
    transform: translateY(calc(var(--no-fan-lift, 0px) - 4px)) rotate(var(--no-fan-rotate, 0deg));
  }


/* One usable Ocean grid on short screens. The controller still owns fleet,
   shots and disabled states; this owner only chooses which grid is visible. */
body.rx-landscape-shell #nativeWorkerGameRoot .native-game-shell.mode-battleship { --rx-ocean-grid:min(calc(100dvh - 116px),calc(100vw - 340px)); --native-battleship-mobile-grid-size:var(--rx-ocean-grid); }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board.practice-challenge { --battle-practice-grid-size:var(--rx-ocean-grid); gap:4px; padding:6px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board :is(.native-battleship-boards,.native-battleship-grid-panel) { padding:0; gap:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board .native-battleship-grid { width:var(--rx-ocean-grid); height:var(--rx-ocean-grid); max-width:100%; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-shot-budget { min-height:0; margin:0; padding:2px; font-size:var(--rx-font-size-sm); }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board:not(.practice-challenge) { grid-template-rows:auto minmax(0,1fr); gap:4px; padding:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board:not(.practice-challenge) .native-battleship-boards { display:grid; grid-template-columns:minmax(0,1fr); width:100%; height:auto; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board:not(.practice-challenge) .native-battleship-grid-panel { position:relative; inset:auto; width:100%; height:auto; transform:none; opacity:1; pointer-events:auto; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board:not(.practice-challenge) .native-battleship-grid-panel.own,
body.rx-landscape-shell #nativeWorkerGameRoot [data-rx-fleet-view="own"] .native-battleship-board .native-battleship-grid-panel.enemy { display:none; }
body.rx-landscape-shell #nativeWorkerGameRoot [data-rx-fleet-view="own"] .native-battleship-board .native-battleship-grid-panel.own { display:grid; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board-status { min-height:0; padding:4px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-board-status:has(strong:empty) { display:none; }
.rx-ocean-view-switch { display:flex; gap:4px; margin-bottom:6px; }
.rx-ocean-view-switch .btn { flex:1; min-height:44px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-setup-board { grid-template-columns:minmax(0,1fr) minmax(160px,38%); padding:4px; gap:8px; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-setup-grid { width:min(100%,calc(100dvh - 72px)); align-self:start; }
body.rx-landscape-shell #nativeWorkerGameRoot .native-battleship-setup-panel { max-height:calc(100dvh - 64px); min-height:0; overflow:auto; }
/* Typing is a focused conversation with the existing live player clocks.
   The board is revealed again on blur without replacing it or the session. */
html[data-rx-keyboard-open] body.rx-landscape-shell.native-game-active:has([data-native-chat-input]:focus) > .layout { top:var(--rx-visual-top); height:var(--rx-visual-height); }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot .native-game-main { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:32px minmax(0,1fr); grid-template-areas:"player opponent" "controls controls"; padding:0; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot :is(.native-game-board-column,.native-game-matchbar) { display:contents; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot :is(.worker-spectate-board-wrap,.native-game-tabs,.native-game-panel-actions,.native-game-status-stack) { display:none; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot [data-native-panel-slot] { grid-area:controls; display:block; min-height:0; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot .native-game-side { display:grid; grid-template-rows:minmax(0,1fr); padding:2px 4px; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot .native-game-panel-body { grid-area:1 / 1; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot .native-game-chat { display:grid; grid-template-rows:minmax(0,1fr) auto; min-height:0; height:100%; padding:0; }
html[data-rx-keyboard-open] body.rx-landscape-shell:has([data-native-chat-input]:focus) #nativeWorkerGameRoot .native-game-chat-header { display:none; }
