/* Table geometry v2. One DOM for practice, network and teaching; platform differences
   live here. Legacy layouts remain available only to the isolated 3D renderer. */
.workspace:has(.friendlier-table) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding-top: 16px;
  align-items: start;
}
.workspace:has(.friendlier-table) > .play-area {
  display: contents;
}
.workspace:has(.friendlier-table) > .sidebar {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 12px;
}
.workspace:has(.friendlier-table) .table-toolbar {
  grid-column: 1 / -1;
  margin: 0;
}
.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;
}
.friendlier-table .player-dock {
  display: contents;
}
.friendlier-table .hand-zone {
  position: absolute;
  left: 20px;
  right: 336px;
  bottom: 18px;
  z-index: 4;
  padding: 0;
  background: none;
  box-shadow: none;
  border: 0;
  margin: 0;
  min-width: 0;
}
.friendlier-table .hand-topline {
  position: absolute;
  bottom: 132px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
}
.friendlier-table .you-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--club-ink);
  font-size: 12px;
}
.friendlier-table .table-turn-bar {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 10px;
  background: var(--club-paper);
  color: var(--club-ink);
  border: 1px solid var(--club-line);
  border-left: 5px solid var(--club-teal);
  border-radius: 6px;
  padding: 14px;
  margin: 0;
  position: relative;
  z-index: 5;
  min-height: 0;
  height: auto;
  width: auto;
}
.friendlier-table:has([data-claim-preview]) .table-turn-bar {
  border-left-color: var(--club-red);
}
.friendlier-table .table-turn-bar .turn-status {
  min-width: 0;
  max-width: none;
}
.friendlier-table .table-turn-bar .turn-status strong {
  color: var(--club-teal);
  font:
    400 22px/1.2 'DM Serif Display',
    'Noto Sans SC',
    serif;
}
.friendlier-table .table-turn-bar .turn-status p {
  display: block;
  color: var(--club-help);
  font: 600 13px/1.5 var(--club-body-font);
  margin: 6px 0 0;
  white-space: normal;
}
.friendlier-table .move-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin: 0;
}
.friendlier-table .move-actions > button {
  flex: 1 1 88px;
  min-height: 48px;
  width: auto;
  padding: 10px;
  border: 1px solid var(--club-line);
  border-radius: 6px;
  background: var(--club-paper);
  color: var(--club-ink);
  font: 800 14px/1.3 var(--club-body-font);
}
.friendlier-table .move-actions > button.primary,
.friendlier-table .move-actions > button[data-confirm-discard],
.friendlier-table .move-actions > button[data-command='discard'] {
  background: var(--club-red);
  color: var(--club-paper);
  border-color: var(--club-red);
  flex-basis: 100%;
}
.friendlier-table .move-actions .claim-set {
  display: flex;
  justify-content: center;
  gap: 0;
}
.friendlier-table .move-actions .claim-set .tile {
  width: 26px;
  height: 35px;
  --tile-w: 26px;
  --tile-h: 35px;
}
.friendlier-table .mobile-hand-tools {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  gap: 6px;
  min-height: 44px;
}
.friendlier-table .mobile-hand-tools button {
  min-height: 44px;
  color: var(--club-teal);
  background: var(--club-paper);
  border: 1px solid var(--club-line);
  flex: 1;
}
.friendlier-table .mobile-hand-tools > span {
  display: none;
}
.friendlier-table .own-tiles {
  display: flex;
  align-items: end;
  justify-content: center;
  flex-wrap: nowrap;
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 0;
  padding: 18px 0 0;
  margin: 0;
  overflow: visible;
  min-height: 0;
}
/* The rack fills its row: 14 tiles at 60px sit inside the 864px desktop zone with the drawn gap. */
.friendlier-table .own-tiles > .tile {
  --tile-w: 60px;
  --tile-h: 80px;
  width: min(60px, calc((100% - 14px) / var(--rack-count)));
  flex: 0 1 60px;
  min-width: 0;
  min-height: 0;
  max-width: 60px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  transform: none;
  transition:
    width 0.16s,
    transform 0.16s;
}
.friendlier-table .own-tiles > .tile.drawn {
  margin-left: 14px !important;
  outline: 2px solid var(--club-red);
  transform: translateY(-8px);
}
.friendlier-table .own-tiles > .tile.drawn::after {
  content: 'new';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: auto;
  width: auto;
  border: 0;
  background: none;
  color: var(--club-red);
  font: 800 10px/1 var(--club-body-font);
  box-shadow: none;
}
html[lang^='zh'] .friendlier-table .own-tiles > .tile.drawn::after {
  content: '新';
}
.friendlier-table .own-tiles > .tile.selected {
  transform: translateY(-12px);
  outline: 2px solid var(--club-red);
}
.friendlier-table .own-tiles > .tile.selected::before {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 6px);
  padding: 3px 5px;
  border-radius: 3px;
  background: var(--club-paper);
  color: var(--club-ink);
  font: 800 11px/1.2 var(--club-body-font);
  white-space: nowrap;
  z-index: 5;
}
.friendlier-table .own-tiles > .tile.selected.drawn::after {
  display: none;
}
.friendlier-table .own-melds {
  display: flex;
  flex: 0 1 auto;
  align-items: end;
  padding: 0;
  margin: 0;
  gap: 2px;
  overflow: visible;
}
.friendlier-table .own-melds .tile {
  width: clamp(12px, 2.2vw, 26px);
  height: auto;
  aspect-ratio: 3/4;
}
.friendlier-table .rack-families {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 6px;
}
.friendlier-table .rack-families button {
  min-height: 44px;
  border-top: 2px solid #1f6f6644;
  padding: 5px 10px;
  border-radius: 0;
  background: none;
  color: var(--club-muted);
  font: 700 11px/1.1 var(--club-body-font);
}
.friendlier-table .rack-families button[aria-pressed='true'] {
  border-color: var(--club-teal);
  color: var(--club-teal);
}
.friendlier-table .compass-seat {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  transform: none;
  color: var(--club-ink);
  /* The side seats reach over the hand topline on wide tables; clicks fall through the
     transparent section to the dealer and seat markers and the tai badge beneath it. */
  pointer-events: none;
}
.friendlier-table .compass-seat :is(button, a, [tabindex]) {
  pointer-events: auto;
}
.friendlier-table .compass-top {
  top: 20px;
  left: 100px;
  right: 100px;
}
.friendlier-table .compass-left {
  left: 20px;
  top: 102px;
  bottom: 170px;
  width: 92px;
}
.friendlier-table .compass-right {
  right: 20px;
  top: 102px;
  bottom: 170px;
  width: 92px;
}
.friendlier-table .compass-seat .opponent-rack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  transform: none;
}
.friendlier-table .compass-seat .rack-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.friendlier-table .compass-seat .backs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin: 0;
  padding: 0;
}
.friendlier-table .compass-seat .back {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 30px;
  background: var(--club-paper);
  border: 1px solid var(--club-back-edge);
  border-bottom: 4px solid var(--club-lattice);
  border-radius: 2px;
  box-shadow: none;
  transform: none;
}
.friendlier-table .compass-seat .back::after {
  display: none;
}
.friendlier-table .compass-seat .player-badge {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 3px;
  background: none;
  border: 0;
  border-radius: 4px;
  transform: none;
}
.friendlier-table .compass-seat.active .player-badge {
  background: #e2b65444;
  outline: 2px solid var(--club-mustard);
}
.friendlier-table .compass-seat .player-name {
  min-width: 0;
  text-align: center;
}
.friendlier-table .compass-seat .player-name strong {
  color: var(--club-ink);
  font: 800 12px/1.2 var(--club-body-font);
  overflow-wrap: anywhere;
}
.friendlier-table .compass-seat .player-name small {
  display: none;
}
.friendlier-table .compass-seat .rack-front {
  order: 3;
}
.friendlier-table .compass-seat .player-badge {
  order: -1;
}
.friendlier-table .compass-top .player-badge {
  order: 0;
}
.friendlier-table :is(.compass-left, .compass-right) .rack-line {
  flex-direction: row;
  align-items: start;
}
.friendlier-table .compass-left .rack-line {
  flex-direction: row-reverse;
}
.friendlier-table :is(.compass-left, .compass-right) .backs {
  flex-direction: column;
}
.friendlier-table :is(.compass-left, .compass-right) .back {
  width: 30px;
  height: 14px;
  border-bottom: 1px solid var(--club-back-edge);
  border-right: 4px solid var(--club-lattice);
}
.friendlier-table :is(.compass-left, .compass-right) .player-badge {
  flex-direction: column;
}
.friendlier-table .compass-seat .melds {
  display: flex;
  gap: 3px;
}
.friendlier-table :is(.compass-left, .compass-right) .melds {
  flex-direction: column;
}
.friendlier-table .compass-seat .exposed-meld {
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
}
.friendlier-table .compass-seat .tile.tiny {
  width: 20px;
  height: 27px;
  --tile-w: 20px;
  --tile-h: 27px;
}
.friendlier-table :is(.compass-left, .compass-right) .meld {
  display: flex;
  flex-direction: column;
}
.friendlier-table .compass-seat .rack-front {
  display: flex;
  justify-content: center;
  gap: 3px;
}
.friendlier-table .compass-seat .tai-anchor {
  display: none;
}
.friendlier-table .bonus-row {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 0;
}
.friendlier-table .bonus-piece {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  background: none;
  border: 0;
}
.friendlier-table .bonus-piece .tile {
  width: 22px;
  height: 29px;
  --tile-w: 22px;
  --tile-h: 29px;
}
.friendlier-table .compass-seat .bonus-piece .tile {
  width: 14px;
  height: 19px;
}
.friendlier-table .bonus-value {
  display: none;
}
.friendlier-table .rack-front {
  display: flex;
  align-items: center;
  gap: 5px;
}
.friendlier-table .tai-badge {
  display: block;
  min-height: 28px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: var(--club-tai);
  color: var(--club-tai-text);
  transform: none;
}
.friendlier-table .tai-count {
  font: 800 12px/1.2 var(--club-body-font);
}
.friendlier-table .tai-meter,
.friendlier-table .tai-caption {
  display: none;
}
.friendlier-table .table-center {
  position: absolute;
  inset: 110px 120px 174px;
  padding: 0;
  margin: 0;
  width: auto;
  height: auto;
  transform: none;
  container-type: normal;
}
.friendlier-table .discard-stage {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  grid-template-rows: 70px minmax(120px, 1fr) 70px;
  height: 100%;
  min-height: 0;
  gap: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
}
.friendlier-table .discard-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  max-height: none;
  background: none;
  border: 0;
}
.friendlier-table .discard-top {
  grid-area: 1 / 2;
  flex-direction: column-reverse;
}
.friendlier-table .discard-bottom {
  grid-area: 3 / 2;
}
.friendlier-table .discard-left {
  grid-area: 1 / 1 / 4;
}
.friendlier-table .discard-right {
  grid-area: 1 / 3 / 4;
}
.friendlier-table .discard-pile {
  display: grid;
  gap: 0;
  grid-auto-rows: 35px;
  grid-auto-columns: 26px;
  padding: 0;
  margin: 0;
  transform: none;
}
.friendlier-table :is(.discard-left, .discard-right) .discard-pile {
  grid-auto-rows: 26px;
  grid-auto-columns: 35px;
}
.friendlier-table .scattered-discard {
  display: block;
  min-height: 0;
  min-width: 0;
  width: 26px;
  height: 35px;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  transform: none;
}
.friendlier-table :is(.discard-left, .discard-right) .scattered-discard {
  width: 35px;
  height: 26px;
  display: grid;
  place-items: center;
}
.friendlier-table .scattered-discard .tile {
  --tile-w: 26px;
  --tile-h: 35px;
  width: 26px;
  height: 35px;
  transform: none;
}
.friendlier-table .discard-top .tile {
  transform: rotate(180deg);
}
.friendlier-table .discard-left .tile {
  transform: rotate(90deg);
}
.friendlier-table .discard-right .tile {
  transform: rotate(-90deg);
}
.friendlier-table .desktop-focus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-area: 2 / 2;
  gap: 3px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  color: var(--club-felt-text);
  background: none;
  border: 0;
}
.friendlier-table .focus-caption {
  color: var(--club-felt-text);
  font: 800 10px/1.2 var(--club-body-font);
  letter-spacing: 0.08em;
}
.friendlier-table .focus-name {
  color: var(--club-ink);
  font:
    400 19px/1.2 'DM Serif Display',
    'Noto Sans SC',
    serif;
}
.friendlier-table .focus-player {
  color: var(--club-felt-text);
  font: 700 12px/1.2 var(--club-body-font);
}
.friendlier-table .focus-tile {
  min-height: 0;
  border: 0;
  background: none;
  padding: 3px;
}
.friendlier-table .focus-tile .tile {
  width: 60px;
  height: 80px;
  --tile-w: 60px;
  --tile-h: 80px;
}
.friendlier-table .focus-wall {
  background: var(--club-paper);
  color: var(--club-teal);
  border: 1px solid var(--club-line);
  padding: 6px 8px;
  min-height: 32px;
  border-radius: 4px;
  font: 700 11px var(--club-body-font);
}
.friendlier-table .focus-wind {
  font:
    700 30px 'Noto Sans SC',
    serif;
  color: var(--club-teal);
}
.friendlier-table .win-status {
  position: absolute;
  bottom: 164px;
  left: 100px;
  right: 100px;
  color: var(--club-teal);
  background: var(--club-paper);
}
.friendlier-table .tile-marker {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: var(--club-paper) !important;
  color: var(--club-teal);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.friendlier-table .tile-marker img {
  display: none;
}
.friendlier-table .tile-marker .marker-glyph {
  position: static;
  color: var(--club-paper);
  font:
    700 15px 'Noto Sans SC',
    serif;
  transform: none;
}
.friendlier-table .dealer-marker {
  background: var(--club-red) !important;
}
.friendlier-table .seat-wind::after {
  content: attr(data-wind-glyph);
  color: var(--club-teal);
  font:
    700 15px 'Noto Sans SC',
    serif;
}
.friendlier-table .hand-topline .seat-wind {
  background: var(--club-teal) !important;
}
.friendlier-table .hand-topline .seat-wind::after {
  color: var(--club-paper);
}
@media (max-width: 1000px) {
  .workspace:has(.friendlier-table) {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .friendlier-table .hand-zone {
    right: 296px;
  }
  .friendlier-table .table-center {
    inset: 105px 80px 172px;
  }
  .friendlier-table .compass-left,
  .friendlier-table .compass-right {
    width: 54px;
  }
  .friendlier-table .discard-stage {
    grid-template-columns: 35px minmax(0, 1fr) 35px;
  }
}
@media (max-width: 800px) {
  .workspace:has(.friendlier-table) {
    display: block;
    padding: 8px 0 0;
  }
  .workspace:has(.friendlier-table) > .play-area {
    display: block;
  }
  .workspace:has(.friendlier-table) > .sidebar {
    display: none;
  }
  .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);
  }
  .friendlier-table .table-turn-bar {
    order: 1;
    padding: 10px 12px;
    width: 100%;
    gap: 8px;
  }
  .friendlier-table .table-turn-bar .turn-status strong {
    font-size: 17px;
  }
  .friendlier-table .table-turn-bar .turn-status p {
    font-size: 13px;
    line-height: 1.4;
  }
  .friendlier-table .move-actions > button {
    font-size: 14px;
  }
  .friendlier-table .mobile-hand-tools {
    min-height: 44px;
  }
  .friendlier-table .hand-zone {
    position: relative;
    inset: auto;
    order: 2;
    padding: 0 0 4px;
    min-height: 104px;
    width: 100%;
    margin: 0;
    background: none;
  }
  /* 44px tap targets: the topline top stays at the discard stage's bottom edge (54px). */
  .friendlier-table .hand-topline {
    bottom: 10px;
    left: 12px;
    right: 12px;
    min-height: 28px;
  }
  .friendlier-table .hand-topline .tai-badge {
    min-height: 44px;
  }
  .friendlier-table .own-tiles {
    padding: 36px 0 0;
    justify-content: center;
    min-height: 72px;
    overflow: visible;
  }
  /* Tiles grow to use the phone's width; a focused family still stands out when space is tight. */
  .friendlier-table .own-tiles > .tile {
    --tile-w: 23px;
    --tile-h: 31px;
    width: 23px;
    max-width: 36px;
    flex: 1 1 23px;
    min-width: 0;
  }
  .friendlier-table[data-rack-focus='characters'] .own-tiles > [data-suit='characters'],
  .friendlier-table[data-rack-focus='bamboo'] .own-tiles > [data-suit='bamboo'],
  .friendlier-table[data-rack-focus='dots'] .own-tiles > [data-suit='dots'],
  .friendlier-table[data-rack-focus='honours'] .own-tiles > [data-suit='honours'],
  .friendlier-table .own-tiles > .tile.drawn {
    flex-basis: 36px;
    width: 36px;
    --tile-w: 36px;
    --tile-h: 48px;
  }
  .friendlier-table .own-tiles > .tile.drawn {
    margin-left: 4px !important;
  }
  .friendlier-table .own-melds {
    max-width: 36%;
  }
  .friendlier-table .own-melds .tile {
    width: 16px;
    height: auto;
  }
  .friendlier-table .rack-families {
    margin-top: 4px;
  }
  .friendlier-table .rack-families button {
    font-size: 10px;
    padding: 5px 8px;
    min-height: 44px;
  }
  .friendlier-table .compass-top {
    top: 12px;
    left: 62px;
    right: 62px;
  }
  .friendlier-table .compass-left {
    left: 10px;
    top: 72px;
    bottom: 56px;
    width: 48px;
  }
  .friendlier-table .compass-right {
    right: 10px;
    top: 72px;
    bottom: 56px;
    width: 48px;
  }
  .friendlier-table .compass-seat .opponent-rack {
    gap: 4px;
  }
  .friendlier-table .compass-seat .rack-line {
    gap: 3px;
  }
  .friendlier-table .compass-seat .back {
    width: 13px;
    height: 17px;
    border-bottom-width: 3px;
  }
  .friendlier-table :is(.compass-left, .compass-right) .back {
    width: 17px;
    height: 10px;
    border-bottom-width: 1px;
    border-right-width: 3px;
  }
  .friendlier-table .compass-seat .player-name strong {
    font-size: 11px;
  }
  .friendlier-table .compass-seat .tile.tiny {
    width: 16px;
    height: 21px;
    --tile-w: 16px;
    --tile-h: 21px;
  }
  .friendlier-table .compass-seat .bonus-piece .tile {
    width: 10px;
    height: 14px;
  }
  .friendlier-table .table-center {
    inset: 84px 60px 54px;
  }
  .friendlier-table .discard-stage {
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    grid-template-rows: 48px minmax(140px, 1fr) 48px;
    gap: 2px;
  }
  .friendlier-table .discard-pile {
    grid-auto-rows: 24px;
    grid-auto-columns: 18px;
  }
  .friendlier-table :is(.discard-left, .discard-right) .discard-pile {
    grid-auto-rows: 18px;
    grid-auto-columns: 24px;
  }
  .friendlier-table .scattered-discard {
    width: 18px;
    height: 24px;
  }
  .friendlier-table :is(.discard-left, .discard-right) .scattered-discard {
    width: 24px;
    height: 18px;
  }
  .friendlier-table .scattered-discard .tile {
    width: 18px;
    height: 24px;
    --tile-w: 18px;
    --tile-h: 24px;
  }
  .friendlier-table .focus-tile .tile {
    width: 58px;
    height: 77px;
    --tile-w: 58px;
    --tile-h: 77px;
  }
  .friendlier-table .focus-wall {
    min-height: 44px;
    padding: 4px 7px;
  }
  .friendlier-table .win-status {
    bottom: 50px;
    left: 60px;
    right: 60px;
  }
  .friendlier-table .table-felt:has(.winning-concealed) {
    min-height: 430px;
  }
  .table-toolbar {
    margin: 0 0 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .friendlier-table * {
    transition: none !important;
  }
}
/* The action/points rail is part of the board, so mode wrappers cannot move it. */
.workspace:has(.friendlier-table) {
  display: block;
}
/* The lesson host never locks its workspace to the viewport height (the landscape phone rules
   do for live tables): the follow-up section must sit below the table, not over its topline. */
.lesson-table .workspace:has(.friendlier-table) {
  height: auto;
  max-height: none;
}
.workspace:has(.friendlier-table) > .play-area {
  display: block;
}
.workspace:has(.friendlier-table) > .sidebar {
  display: none;
}
.board.friendlier-table {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.friendlier-table .table-side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.friendlier-table .table-points {
  padding: 18px;
  border: 1px solid var(--club-line);
  border-radius: 6px;
  background: var(--club-paper);
}
.friendlier-table .table-points h2 {
  font: var(--club-section-heading);
  margin: 0 0 16px;
}
.friendlier-table .table-points > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--club-line);
  font-size: 13px;
}
.friendlier-table .table-points > div > span:not(.seat-markers) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.friendlier-table .table-points > p {
  font-size: 12px;
  color: var(--club-muted);
  margin-top: 16px;
}
@media (max-width: 1000px) and (min-width: 801px) {
  .board.friendlier-table {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
}
@media (max-width: 800px) {
  .friendlier-table .table-side-panel {
    display: contents;
  }
  .friendlier-table .table-points {
    display: none;
  }
}
.friendlier-table .table-turn-bar .turn-status {
  display: block;
  text-align: left;
  width: 100%;
}
.friendlier-table .compass-seat .player-name {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
}
.friendlier-table .compass-seat .player-name strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}
/* Side seats: the name sits below the wind marker, centred when it fits the column and otherwise
   anchored at the felt edge and running inward, never breaking into lines or crossing the frame. */
.friendlier-table :is(.compass-left, .compass-right) .player-badge {
  align-self: stretch;
  padding-bottom: 22px;
}
.friendlier-table :is(.compass-left, .compass-right) .player-name {
  position: absolute;
  top: 32px;
  width: max-content;
  min-width: calc(100% - 6px);
  max-width: 108px;
  text-align: center;
}
.friendlier-table .compass-left .player-name {
  left: 3px;
}
.friendlier-table .compass-right .player-name {
  right: 3px;
}
.friendlier-table .tai-count b,
.friendlier-table .tai-count > span {
  color: var(--club-tai-text);
}
.friendlier-table .focus-wall b {
  color: var(--club-teal);
}
@media (max-width: 800px) {
  .friendlier-table .own-tiles {
    padding-inline: 4px;
  }
}
.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;
  }
}
/* 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;
  }
}
/* A real, noninteractive table preview; this scale is only for landing artwork.
   Vertical budget on the 500px felt: top seat 20–104, centre 112–354 (35px discard rows
   around a 172px focus cell), side seats 100–354, topline 360–396, own rack from 414. */
.landing-preview .board.friendlier-table {
  display: block;
  pointer-events: none;
}
.landing-preview .friendlier-table .table-felt {
  min-height: 500px;
  height: 500px;
}
.landing-preview .friendlier-table .table-side-panel,
.landing-preview .rack-families {
  display: none;
}
.landing-preview .friendlier-table .hand-zone {
  left: 20px;
  right: 20px;
  bottom: 20px;
}
.landing-preview .friendlier-table .hand-topline {
  bottom: 104px;
}
.landing-preview .friendlier-table .table-center {
  inset: 112px 96px 146px;
}
.landing-preview .friendlier-table .compass-top {
  left: 90px;
  right: 90px;
}
.landing-preview .friendlier-table .compass-left,
.landing-preview .friendlier-table .compass-right {
  width: 76px;
  top: 100px;
  bottom: 146px;
}
.landing-preview .friendlier-table .compass-top .back {
  width: 16px;
  height: 22px;
}
.landing-preview .friendlier-table :is(.compass-left, .compass-right) .back {
  width: 26px;
  height: 12px;
}
.landing-preview .friendlier-table .discard-stage {
  grid-template-columns: 26px 1fr 26px;
  grid-template-rows: 35px minmax(120px, 1fr) 35px;
}
.landing-preview .friendlier-table .desktop-focus {
  gap: 2px;
}
/* The preview lives inside #account-panel, whose tap-target rule in interface.css would inflate
   every inert button here (bonus tiles, the featured tile, the wall count and the tai badge). */
#account-panel .landing-preview .friendlier-table button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 0;
}
#account-panel .landing-preview .friendlier-table .focus-tile {
  display: grid;
  place-items: center;
  padding: 2px;
}
.landing-preview .friendlier-table .focus-tile .tile {
  width: 45px;
  height: 60px;
  --tile-w: 45px;
  --tile-h: 60px;
}
.landing-preview .friendlier-table .focus-name {
  font-size: 16px;
}
.landing-preview .friendlier-table .focus-player {
  font-size: 11px;
}
#account-panel .landing-preview .friendlier-table .focus-wall {
  min-height: 26px;
  padding: 3px 6px;
  font: 700 10px/1.2 var(--club-body-font);
}
#account-panel .landing-preview .friendlier-table .tai-badge {
  min-height: 28px;
  padding: 4px 8px;
  line-height: 1.2;
}
.landing-preview .friendlier-table .own-tiles > .tile {
  flex-basis: 40px;
  max-width: 40px;
}
.friendlier-table .move-actions > [data-action-type='win'] {
  order: -1;
  flex-basis: 100%;
  background: var(--club-red);
  color: var(--club-paper);
}
.friendlier-table .move-actions > [data-action-type='pass'] {
  background: var(--club-page);
}
.friendlier-table .table-recent {
  background: var(--club-paper);
  border: 1px solid var(--club-line);
  border-radius: 6px;
  padding: 18px;
}
.friendlier-table .table-recent h2 {
  font: var(--club-section-heading);
  margin-bottom: 12px;
}
.friendlier-table .table-recent ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.friendlier-table .table-recent li {
  color: var(--club-help);
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid var(--club-line);
}
@media (max-width: 800px) {
  .friendlier-table .table-recent {
    display: none;
  }
}
.friendlier-table .table-bottom-tools {
  display: flex;
  grid-column: 1;
  justify-content: space-around;
  margin: 0;
  padding: 0;
  gap: 4px;
  order: 3;
}
.friendlier-table .table-bottom-tools button {
  min-width: 44px;
  min-height: 48px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--club-muted);
  font: 800 13px/1.2 var(--club-body-font);
}
.friendlier-table:has(.table-bottom-tools) .hand-zone {
  bottom: 82px;
}
.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;
}
.app-shell:has(.friendlier-table) .table-view-switch {
  color: var(--club-muted);
}
.app-shell:has(.friendlier-table) .table-view-switch button {
  background: var(--club-paper);
  color: var(--club-teal);
  border-color: var(--club-line);
}
.app-shell:has(.friendlier-table) .table-view-switch button[aria-pressed='true'] {
  background: var(--club-selection);
}
.app-shell:has(.friendlier-table) .table-view-switch small {
  color: var(--club-muted);
}
@media (max-width: 800px) {
  .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;
  }
  .app-shell:has(.friendlier-table) .table-view-switch {
    display: none;
  }
  .friendlier-table:has(.table-bottom-tools) .hand-zone {
    bottom: auto;
  }
}
.friendlier-table .own-tiles > .tile.selected::before {
  max-width: 110px;
  white-space: normal;
  width: max-content;
  text-align: center;
}
.friendlier-table .own-tiles > .tile:nth-child(-n + 4).selected::before {
  left: 0;
  transform: none;
}
.friendlier-table .own-tiles > .tile:nth-last-child(-n + 4).selected::before {
  left: auto;
  right: 0;
  transform: none;
}

.friendlier-table .table-turn-bar > .turn-status {
  order: 0;
}
.friendlier-table .table-turn-bar > .move-actions {
  order: 1;
}
.friendlier-table .table-turn-bar > .mobile-hand-tools {
  order: 2;
}
.workspace:has(.friendlier-table) .hand-controls {
  display: none;
}
.friendlier-table .table-recent ol {
  max-height: 120px;
  overflow: auto;
}
.landing-preview .friendlier-table .hand-zone {
  width: auto;
}
.landing-preview .friendlier-table .own-tiles > .tile {
  min-width: 0;
  flex: 0 1 40px;
  width: calc(100% / var(--rack-count));
}

@media (min-width: 801px) {
  .friendlier-table .table-felt {
    height: 620px;
    min-height: 620px;
    align-self: start;
  }
  .friendlier-table .table-side-panel {
    max-height: 620px;
    overflow: auto;
  }
  .friendlier-table .table-side-panel > * {
    flex-shrink: 0;
  }
  .friendlier-table .hand-zone,
  .friendlier-table:has(.table-bottom-tools) .hand-zone {
    top: 452px;
    bottom: auto;
  }
  /* The selected tile's name label rises 25px above the raised tile; keep the topline clear of it. */
  .friendlier-table .hand-topline {
    bottom: 172px;
  }
  /* Tiles never shrink below the phone's 36px. A window too narrow for the rack scrolls it
     instead, and the drawn or selected tile snaps into view. */
  .friendlier-table .own-tiles {
    padding-top: 38px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }
  .friendlier-table .own-tiles > .tile {
    min-width: 36px;
  }
  .friendlier-table .own-tiles > .tile:is(.drawn, .selected) {
    scroll-snap-align: end;
  }
  .landing-preview .friendlier-table .hand-zone {
    top: auto;
    bottom: 20px;
  }
  .landing-preview .friendlier-table .own-tiles {
    padding-top: 18px;
  }
}
.board.friendlier-table .table-turn-bar.your-turn .turn-status strong {
  font:
    400 22px/1.2 'DM Serif Display',
    'Noto Sans SC',
    serif;
  color: var(--club-teal);
}
@media (max-width: 800px) {
  .board.friendlier-table .table-turn-bar.your-turn .turn-status strong {
    font-size: 17px;
  }
}

.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;
}
.friendlier-table .player-dock {
  overflow: visible;
}

/* 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;
}
.friendlier-table .winning-concealed {
  gap: 0;
}
.friendlier-table .own-tiles > .winning-concealed {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: center;
}
.friendlier-table .own-tiles > .winning-concealed .winning-set {
  flex: 0 1 auto;
  min-width: 0;
}
.friendlier-table .own-tiles > .winning-concealed .winning-piece {
  flex: 1 1 0;
  min-width: 0;
  max-width: 54px;
}
.friendlier-table .own-tiles > .winning-concealed .tile {
  width: 100%;
  max-width: 54px;
  height: auto;
  aspect-ratio: 3 / 4;
}
.friendlier-table .own-tiles > .winning-concealed .winning-tile .tile {
  transform: translateY(-8px);
}
.friendlier-table .win-label {
  color: var(--club-red);
  margin-left: 6px;
}
.friendlier-table .compass-top .winning-concealed {
  flex: 0 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 3px;
}
/* Side seats stack each set as a short row; a winner's declared sets follow beneath. */
.friendlier-table :is(.compass-left, .compass-right) .winning-concealed {
  flex-direction: column;
  align-items: center;
}
.friendlier-table :is(.compass-left, .compass-right) .winning-set + .winning-set {
  margin: 4px 0 0;
}
.friendlier-table :is(.compass-left, .compass-right).winner .rack-line {
  flex-direction: column;
  gap: 4px;
}
.friendlier-table :is(.compass-left, .compass-right).winner .melds,
.friendlier-table :is(.compass-left, .compass-right).winner .meld {
  flex-direction: row;
}
@media (max-width: 800px) {
  .winning-set + .winning-set {
    margin-left: 4px;
  }
  .friendlier-table :is(.compass-left, .compass-right) .winning-concealed .tile.tiny {
    width: 14px;
    height: 19px;
    --tile-w: 14px;
    --tile-h: 19px;
  }
}
