/* Layout for the table view + shared game-surface styles.
   Per-game boards style themselves in their own modules via these hooks. */

.waiting-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: var(--su-gap-4);
  align-items: start;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  min-height: 0;
}
.game-chat {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--su-edge);
  min-height: 0;
  padding: 10px;
}

.game-surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--su-gap-3);
  padding: var(--su-gap-4);
  min-height: 320px;
}

.hand-fan { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.hand-fan .pcard { margin-left: -12px; }
.hand-fan .pcard:first-child { margin-left: 0; }

.table-oval {
  position: relative;
  width: min(760px, 96%);
  aspect-ratio: 16 / 9;
  max-height: 52vh;
}

.seat-anchor { position: absolute; transform: translate(-50%, -50%); }

/* Chess board */
.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(72vmin, 560px);
  aspect-ratio: 1;
  border: 6px solid var(--su-rim);
  border-radius: var(--su-radius);
  box-shadow: var(--su-shadow-md);
  user-select: none;
}
.chess-sq {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 6vmin, 44px);
  line-height: 1;
  cursor: pointer;
  position: relative;
  padding: 0;
  border: none;
}
.chess-sq.light { background: #e9dcc3; color: #241a10; }
.chess-sq.dark { background: #7a5a3c; color: #241a10; }
.chess-sq.sel { outline: 3px solid var(--su-gold); outline-offset: -3px; z-index: 1; }
.chess-sq.hint::after {
  content: "";
  position: absolute;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(243, 193, 75, 0.65);
}
.chess-sq.cap::after {
  width: 82%;
  background: none;
  border: 3px solid rgba(243, 193, 75, 0.8);
}
.chess-sq.last { box-shadow: inset 0 0 0 3px rgba(243, 193, 75, 0.45); }
.chess-piece-w { color: #f7f3e8; text-shadow: 0 1px 2px rgba(0,0,0,.65); }
.chess-piece-b { color: #17120c; text-shadow: 0 1px 2px rgba(255,255,255,.15); }

/* Solitaire */
.sol-row { display: flex; gap: 8px; justify-content: center; width: 100%; flex-wrap: nowrap; }
.sol-pile { position: relative; width: 44px; min-height: 62px; }
.sol-pile .pcard, .sol-pile .felt-slot { position: absolute; left: 0; }
.sol-tableau { align-items: flex-start; }

/* Race progress board */
.race-board { display: flex; flex-direction: column; gap: 6px; width: min(420px, 92%); }

@media (max-width: 900px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-chat { display: none; }
}
@media (max-width: 719px) {
  .waiting-grid { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
  .game-surface { padding: var(--su-gap-2); }
}
