/* Only retained, human-only tables. Playing and initial waiting layouts are untouched. */
#tableWaitingPanel[hidden] { display:none !important; }
#gameScreen.waiting-at-table { display:flex !important; flex-direction:column !important; gap:8px !important; }
#gameScreen.waiting-at-table :is(.istaka-container,.discard-rail,.table-center,#tableMelds101,.discard-box,.player-tile-count,.pod-score-mini) { display:none !important; }
#gameScreen.waiting-at-table .table-arena {
  position:relative !important; display:grid !important; flex:1 !important; min-height:0 !important;
  grid-template-columns:minmax(90px,1fr) minmax(0,4fr) minmax(90px,1fr) !important;
  grid-template-rows:auto minmax(0,1fr) auto !important;
  padding:12px !important; gap:10px !important; overflow:auto !important;
}
#gameScreen.waiting-at-table .table-zone { position:static !important; display:flex !important; align-items:center !important; justify-content:center !important; min-width:0 !important; transform:none !important; padding:0 !important; }
#gameScreen.waiting-at-table .zone-top { grid-area:1 / 2 !important; }
#gameScreen.waiting-at-table .zone-left { grid-area:2 / 1 !important; }
#gameScreen.waiting-at-table .zone-right { grid-area:2 / 3 !important; }
#gameScreen.waiting-at-table .zone-bottom { grid-area:3 / 2 !important; }
#gameScreen.waiting-at-table #tableWaitingPanel {
  grid-area:2 / 2 !important; align-self:center; justify-self:center; width:100%; max-width:600px;
  min-width:0; padding:14px; border:1px solid #84d1ad40; border-radius:16px;
  background:#0b241be8; color:#eef8f1; text-align:center; box-sizing:border-box;
}
#tableWaitingPanel h2 { margin:0 0 8px; color:#81dbad; font-size:clamp(16px,2.4vw,22px); }
#tableWaitingPanel p { margin:6px 0; font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
#tableWaitingListing { color:#b1c5b8; }
#tableWaitingStatus { color:#f0cf80; }
.table-waiting-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:7px; margin-top:12px; }
.table-waiting-actions button { min-height:40px; padding:8px 12px; white-space:normal; font-size:13px; touch-action:manipulation; }
.table-waiting-actions button[hidden] { display:none !important; }
.table-waiting-actions button:disabled { opacity:.5; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) {
  position:static !important; transform:none !important; display:flex !important; flex-direction:column !important;
  align-items:center !important; flex:0 1 auto !important; min-width:0 !important; max-width:100% !important; width:max-content !important;
  min-height:0 !important; height:auto !important; box-sizing:border-box !important;
  padding:7px !important; border:1px solid var(--meld-owner,#81dbad) !important; border-radius:16px !important;
}
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft).hidden-seat { display:none !important; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-avatar { display:flex !important; align-items:center; justify-content:center; width:40px !important; height:40px !important; font-size:28px; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-avatar .avatar-img { width:100% !important; height:100% !important; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-details { display:block !important; text-align:center !important; min-width:0; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-name { display:block !important; max-width:130px !important; font-size:13px !important; }
#gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-score { display:block !important; font-size:11px !important; white-space:normal !important; }
#gameScreen.waiting-at-table .waiting-empty-seat { border-style:dashed !important; color:#a9cdb9; cursor:default !important; }
#gameScreen.waiting-at-table.two-player-table :is(.zone-left,.zone-right) { display:none !important; }
#gameScreen.waiting-at-table.two-player-table .table-arena { grid-template-columns:minmax(0,1fr) !important; }
#gameScreen.waiting-at-table.two-player-table :is(.zone-top,.zone-bottom) { grid-column:1 !important; }
#gameScreen.waiting-at-table.two-player-table #tableWaitingPanel { grid-column:1 !important; }
@media (max-width:600px) and (orientation:portrait) {
  #gameScreen.waiting-at-table .table-arena { grid-template-columns:1fr 1fr !important; grid-template-rows:auto minmax(min-content,1fr) auto auto !important; padding:8px !important; gap:8px !important; }
  #gameScreen.waiting-at-table .zone-top { grid-area:1 / 1 / auto / -1 !important; }
  #gameScreen.waiting-at-table #tableWaitingPanel { grid-area:2 / 1 / auto / -1 !important; padding:10px; }
  #gameScreen.waiting-at-table .zone-left { grid-area:3 / 1 !important; }
  #gameScreen.waiting-at-table .zone-right { grid-area:3 / 2 !important; }
  #gameScreen.waiting-at-table .zone-bottom { grid-area:4 / 1 / auto / -1 !important; }
  #gameScreen.waiting-at-table.two-player-table .zone-bottom { grid-row:3 !important; }
  #gameScreen.waiting-at-table.two-player-table .table-arena { grid-template-rows:auto minmax(min-content,1fr) auto !important; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) { flex-direction:row !important; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-name { max-width:95px !important; }
}
@media (max-width:320px) and (orientation:portrait) {
  #gameScreen.waiting-at-table :is(#podRight,#podLeft) { flex-direction:column !important; }
  #gameScreen.waiting-at-table :is(#podRight,#podLeft) .player-pod-name { max-width:78px !important; }
}
@media (orientation:landscape) and (max-height:540px) {
  #gameScreen.waiting-at-table { gap:3px !important; }
  #gameScreen.waiting-at-table .table-arena { padding:5px !important; gap:4px !important; grid-template-rows:auto minmax(min-content,1fr) auto !important; }
  #gameScreen.waiting-at-table #tableWaitingPanel { padding:6px 10px; }
  #tableWaitingPanel h2 { font-size:15px; margin-bottom:3px; }
  #tableWaitingPanel p { font-size:11px; margin:3px 0; line-height:1.3; }
  .table-waiting-actions { margin-top:5px; gap:4px; }
  .table-waiting-actions button { min-height:34px; padding:5px 8px; font-size:12px; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) { flex-direction:row !important; padding:3px 6px !important; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-avatar { width:28px !important; height:28px !important; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-name { max-width:88px !important; font-size:11px !important; }
  #gameScreen.waiting-at-table :is(#podBottom,#podRight,#podTop,#podLeft) .player-pod-score { font-size:9px !important; }
  #gameScreen.waiting-at-table.two-player-table .table-arena { grid-template-columns:1fr minmax(0,4fr) 1fr !important; grid-template-rows:minmax(min-content,1fr) !important; }
  #gameScreen.waiting-at-table.two-player-table .zone-top { grid-area:1 / 3 !important; }
  #gameScreen.waiting-at-table.two-player-table .zone-bottom { grid-area:1 / 1 !important; }
  #gameScreen.waiting-at-table.two-player-table #tableWaitingPanel { grid-area:1 / 2 !important; }
}
