/* Every game board is a .classic-table (design/table-classic.css). The one .friendlier-table
   left is the online lobby's waiting table (renderWaitingTable in table-renderer.js); this file
   also keeps the 3D view's header and a few rules shared by the table pages. */
.board.friendlier-table {
  --tile-w: 26px;
  --tile-h: 35px;
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  height: auto;
  min-height: 0;
  overflow: visible;
  position: relative;
  color: var(--club-ink);
}
.friendlier-table::before,
.friendlier-table::after {
  display: none;
}
.friendlier-table .table-felt {
  position: relative;
  grid-column: 1;
  min-height: 620px;
  border-radius: 10px;
  background: var(--club-felt);
  box-shadow:
    inset 0 0 0 6px var(--club-mustard),
    inset 0 0 0 9px var(--club-lattice);
  padding: 20px;
  overflow: hidden;
}
@media (max-width: 800px) {
  .board.friendlier-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    width: 100%;
    margin: 0;
    min-height: 0;
    height: auto;
    border: 0;
  }
  .friendlier-table .table-felt {
    min-height: 390px;
    height: clamp(390px, 52dvh, 520px);
    flex: 0 0 auto;
    padding: 10px 8px 6px;
    box-shadow:
      inset 0 0 0 4px var(--club-mustard),
      inset 0 0 0 6px var(--club-lattice);
  }
  .table-toolbar {
    margin: 0 0 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .friendlier-table * {
    transition: none !important;
  }
}
.board.friendlier-table {
  grid-template-columns: minmax(0, 1fr) 300px;
}
@media (max-width: 1000px) and (min-width: 801px) {
  .board.friendlier-table {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}
.board.waiting-table {
  display: block;
  margin: 20px 0;
}
.waiting-table .table-felt {
  min-height: 460px;
}
.waiting-seat {
  position: absolute;
  width: 140px;
  text-align: center;
  color: var(--club-ink);
}
.waiting-top {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}
.waiting-bottom {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}
.waiting-left {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.waiting-right {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.waiting-seat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: auto;
  border-radius: 50%;
  background: var(--club-paper);
  color: var(--club-teal);
  font-size: 22px;
}
.waiting-seat h3 {
  font: 800 14px/1.3 var(--club-body-font);
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.waiting-seat p,
.waiting-seat .seat-readiness {
  font: 700 11px/1.3 var(--club-body-font);
  color: var(--club-felt-text);
  margin: 0;
}
.waiting-centre {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.waiting-centre h2 {
  font: var(--club-section-heading);
  margin: 6px 0;
}
.waiting-centre p {
  font-size: 12px;
  line-height: 1.4;
  color: var(--club-felt-text);
}
@media (max-width: 600px) {
  .waiting-table .table-felt {
    min-height: 410px;
  }
  .waiting-seat {
    width: 82px;
  }
  .waiting-left {
    left: 10px;
  }
  .waiting-right {
    right: 10px;
  }
  .waiting-centre {
    width: 130px;
  }
  .waiting-centre h2 {
    font-size: 23px;
  }
}
/* From 801 to 1000px the chat column beside the lobby leaves the felt 350–490px wide, and 140px
   side seats ran into the centre's text. At 801px: side seats 10–106 and 244–340, centre box
   100–250 (its centred text clears both). */
@media (max-width: 1000px) and (min-width: 801px) {
  .waiting-left,
  .waiting-right {
    width: 96px;
  }
  .waiting-left {
    left: 10px;
  }
  .waiting-right {
    right: 10px;
  }
  .waiting-centre {
    width: 150px;
  }
}
/* On a 320px phone the felt is 271px wide: side seats 6–82 and 189–265, centre 88–184. The
   narrower centre wraps to more lines, so the felt grows to keep it clear of the top and bottom seats. */
@media (max-width: 360px) {
  .waiting-table .table-felt {
    min-height: 520px;
  }
  .waiting-seat {
    width: 76px;
  }
  .waiting-left {
    left: 6px;
  }
  .waiting-right {
    right: 6px;
  }
  .waiting-centre {
    width: 96px;
  }
}
.inspection-river {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 16px;
}
.app-shell:not(:has(.classic-table)) > .topbar {
  min-height: 64px;
  height: auto;
  margin-bottom: 16px;
  padding: 8px 0;
  gap: 12px;
}
.app-shell:not(:has(.classic-table)) > .topbar button {
  background: var(--club-paper);
  color: var(--club-teal);
  border: 1px solid var(--club-line);
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
}
@media (max-width: 800px) {
  /* 3D has an extra 2D switch: it needs one flowing row, not the 2D
     three-cell grid (whose unassigned switch used to spill over the felt). */
  .app-shell.has-live-table:not(:has(.classic-table)) > .topbar {
    display: flex;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    height: auto;
    min-height: 56px;
    align-items: center;
  }
  .app-shell.has-live-table:not(:has(.classic-table)) > .topbar .brand {
    flex: 1;
  }
  .app-shell.has-live-table:not(:has(.classic-table)) > .topbar .live-classic-switch {
    flex-shrink: 0;
  }
  .app-shell.has-live-table:not(:has(.classic-table)) > .topbar .mobile-header-actions {
    display: flex;
  }
  .app-shell.has-live-table:not(:has(.classic-table)) > .topbar .mobile-round {
    font-size: 13px;
  }
  .app-shell:not(:has(.classic-table)) > .topbar {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 60px;
    padding: 6px;
    gap: 6px;
    height: auto;
    min-height: 56px;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .brand {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    text-align: center;
    min-width: 0;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .desktop-brand-subtitle,
  .app-shell:not(:has(.classic-table)) > .topbar > .sound-toggle,
  .app-shell:not(:has(.classic-table)) > .topbar .nav,
  .app-shell:not(:has(.classic-table)) > .topbar .landscape-controls {
    display: none;
  }
  /* The page keeps its h1 for assistive technology; the round label is the visible title. */
  .app-shell:not(:has(.classic-table)) > .topbar .table-wordmark {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .mobile-round {
    display: block;
    font:
      400 16px/1.3 'DM Serif Display',
      'Noto Sans SC',
      serif;
    color: var(--club-ink);
    letter-spacing: 0;
    text-transform: none;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .mobile-round .header-wall-count {
    font: 700 11px/1.3 var(--club-body-font);
    color: var(--club-muted);
  }
  .app-shell:not(:has(.classic-table)) > .topbar .mobile-header-actions {
    display: contents;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .mobile-header-actions > button {
    grid-column: 1;
    grid-row: 1;
  }
  .app-shell:not(:has(.classic-table)) > .topbar .mobile-header-actions > .score-button {
    grid-column: 3;
  }
}

@media (min-width: 801px) {
  .friendlier-table .table-felt {
    height: 620px;
    min-height: 620px;
    align-self: start;
  }
  /* The lobby map holds four seats, not a hand: keep it short so Deal stays nearer. */
  .friendlier-table.waiting-table .table-felt {
    height: auto;
    min-height: 460px;
  }
}

.app-shell:has(.board),
#learn:has(.lesson-table) {
  max-width: var(--table-page-width);
  padding-left: max(var(--table-page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--table-page-gutter), env(safe-area-inset-right, 0px));
}

.online-app.playing #online-root {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* A completed hand lies as sets, the pair last, with the winning tile marked inside its set. */
.winning-set {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: 0;
}
.winning-set + .winning-set {
  margin-left: 6px;
}
.winning-set .winning-tile {
  margin: 0;
}
@media (max-width: 800px) {
  .winning-set + .winning-set {
    margin-left: 4px;
  }
}
/* Text the final review still measured under 4.5:1 on the practice page. */
.app-shell > .topbar .desktop-brand-subtitle {
  color: var(--club-muted);
}
.app-shell .table-toolbar .icon-btn {
  color: var(--club-teal);
}
.app-shell > .footer,
.app-shell > .footer span {
  color: var(--club-muted);
}
.app-shell > .footer button {
  color: var(--club-teal);
}
