/* Room-specific game pages load this after their established table styles.
   The Kings Corner table keeps its own approved layout. */
body.isn-salon-classic:not(.kings-table),
body.isn-salon-friends,
body.isn-salon-tournament {
  --salon-cloth: url('/tabletop/salon-overhead.webp');
  --salon-room: url('/tabletop/salon-front.webp');
  --salon-brass: #c9a25e;
  --salon-ivory: #fff0c8;
}

body.isn-salon-classic:not(.kings-table) > header {
  padding: 5px 2.5%;
  align-items: center;
  gap: 6px;
}
body.isn-salon-classic:not(.kings-table) > header h1 {
  font-size: clamp(19px, 3.4dvh, 28px);
}
body.isn-salon-classic:not(.kings-table) > header small {
  font-size: 9px;
}
body.isn-salon-classic:not(.kings-table) main#game {
  width: min(100%, 1600px);
  padding: 4px 1%;
  margin-inline: auto;
}
body.isn-salon-classic:not(.kings-table) .scorebar {
  margin-bottom: 3px;
  padding: 3px 10px;
  font-size: 11px;
}
body.isn-salon-classic:not(.kings-table) main#game > .felt,
body.isn-salon-classic:not(.kings-table) main#game > .felt.has-seated-guests {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas:
    'seats seats'
    'status status'
    'board hand'
    'board moves'
    'board help';
  gap: clamp(3px, 1dvh, 10px) 3%;
  align-content: center;
  align-items: center;
  min-height: min(680px, calc(100dvh - 148px));
  width: 100%;
  margin: 0;
  padding: 5px 8% clamp(18px, 5dvh, 50px);
  border: 0;
  outline: 0;
  border-radius: 12px;
  box-shadow: none;
  filter: none;
  background: #123c2a var(--salon-cloth) center / 100% 100% no-repeat;
}
body.isn-salon-classic:not(.kings-table) main#game > .felt::after { display: none; }
body.isn-salon-classic:not(.kings-table) .felt > #opponents:not([hidden]) {
  position: relative;
  grid-area: seats;
  inset: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: space-evenly;
  align-items: end;
  gap: 8px;
  pointer-events: auto;
}
body.isn-salon-classic:not(.kings-table) #opponents > .opponent {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  max-width: 250px;
  min-width: 0;
  margin: 0;
  padding: 0;
  transform: none;
}
body.isn-salon-classic:not(.kings-table) #opponents .seated-figure {
  width: 100%;
  height: clamp(37px, 9dvh, 86px);
}
body.isn-salon-classic:not(.kings-table) #opponents .seated-figure > :is(img, svg) {
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  object-position: center bottom;
}
body.isn-salon-classic:not(.kings-table) #opponents .opponent > strong {
  margin: 0;
  padding: 1px 7px;
  font-size: clamp(10px, 1.9dvh, 15px);
  line-height: 1.1;
}
body.isn-salon-classic:not(.kings-table) #opponents .opponent > small {
  margin: 2px 0;
  font-size: clamp(10px, 1.6dvh, 13px);
  color: var(--salon-ivory);
}
body.isn-salon-classic:not(.kings-table) #opponents .opponent > p {
  max-height: none;
  margin: 1px 0;
  font: italic clamp(9px, 1.55dvh, 12px)/1.2 Georgia, serif;
  overflow: visible;
}
body.isn-salon-classic:not(.kings-table) #opponents .seated-reaction-button {
  top: auto;
  bottom: 17px;
  right: 0;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  font-size: 12px;
}
body.isn-salon-classic:not(.kings-table) #status {
  grid-area: status;
  min-height: 0;
  margin: 0;
  padding: 3px 8px;
  background: #103322d9;
  color: var(--salon-ivory);
  border: 0;
  border-radius: 4px;
  font: 600 clamp(14px, 2.3dvh, 19px)/1.2 Georgia, serif;
}
body.isn-salon-classic:not(.kings-table) #board {
  grid-area: board;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 2px 0;
  gap: clamp(4px, 1.2vw, 16px);
  color: var(--salon-ivory);
  text-shadow: 0 1px 2px #04190f;
}
body.isn-salon-classic:not(.kings-table) .your-hand {
  grid-area: hand;
  min-width: 0;
}
body.isn-salon-classic:not(.kings-table) .your-hand h2 {
  margin: 2px 0 6px;
  color: var(--salon-ivory);
  font-size: clamp(13px, 2.4dvh, 19px);
}
body.isn-salon-classic:not(.kings-table) #actions {
  grid-area: moves;
  min-height: 0;
  gap: 4px;
}
body.isn-salon-classic:not(.kings-table) #actions button {
  min-height: 32px;
  padding: 5px 9px;
  font: 600 clamp(11px, 1.85dvh, 15px)/1.2 Arial, sans-serif;
}
body.isn-salon-classic:not(.kings-table) #hint {
  grid-area: help;
  margin: 0;
  color: #f4e3c2;
  font-size: clamp(10px, 1.6dvh, 13px);
}
body.isn-salon-classic:not(.kings-table) .card {
  width: clamp(26px, 5.8dvh, 54px);
  height: clamp(36px, 8dvh, 76px);
  margin: 2px;
  font-size: clamp(13px, 2.45dvh, 21px);
}
body.isn-salon-classic:not(.kings-table) .pile {
  min-width: min(15%, 60px);
}
body.isn-salon-classic:not(.kings-table) .golf-grid {
  grid-template-columns: repeat(3, auto);
  gap: 1px;
}
body.isn-salon-classic:not(.kings-table) .suit-row .card {
  width: clamp(16px, 2.2vw, 34px);
  height: clamp(27px, 4.5dvh, 42px);
  font-size: clamp(10px, 1.7dvh, 14px);
}
body.isn-salon-classic:not(.kings-table) .pile small,
body.isn-salon-classic:not(.kings-table) .board-label {
  margin: 2px 0;
  color: #ffeac3;
  font-size: 11px;
}
body.isn-salon-classic:not(.kings-table) main#game > .felt:has(.solitaire-board) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas: 'status' 'board' 'moves' 'help';
}
body.isn-salon-classic:not(.kings-table) .felt:has(.solitaire-board) .your-hand { display: none; }
body.isn-salon-classic:not(.kings-table) .sol-top {
  align-items: start;
  gap: 4px;
  margin: 0 0 9px;
}
body.isn-salon-classic:not(.kings-table) .columns,
body.isn-salon-classic:not(.kings-table) .column { min-height: 0; }
body.isn-salon-classic:not(.kings-table) .column {
  --salon-card-height: clamp(35px, 8.5dvh, 78px);
  --salon-card-peek: clamp(11px, 2.4dvh, 20px);
}
body.isn-salon-classic:not(.kings-table) .column .card {
  width: min(96%, 64px);
  height: var(--salon-card-height);
  align-items: start;
  justify-content: start;
  font-size: clamp(12px, 2.1dvh, 16px);
  margin-inline: auto;
  padding: 1px 3px;
}
body.isn-salon-classic:not(.kings-table) .column .card + .card {
  margin-top: calc(var(--salon-card-peek) - var(--salon-card-height));
}
body.isn-salon-classic:not(.kings-table) .table-tools {
  margin: 3px 0;
  padding: 3px 8px;
  gap: 5px;
}
body.isn-salon-classic:not(.kings-table) .table-tools :is(button, select) {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 11px;
}
body.isn-salon-classic:not(.kings-table) main > details { padding: 4px 8px; }
body.isn-salon-classic:not(.kings-table) main > .fine { margin: 4px; }

/* Match the live friends' playing surface to the room while keeping all
   names, hidden cards, seat controls and server-returned choices intact. */
body.isn-salon-friends #table:has(> .table-seats) {
  background:
    linear-gradient(#06150d30, transparent 20%, #03160c28 75%, #06170dd4),
    #123c2a var(--salon-cloth) center / 100% 100% no-repeat;
  border: 1px solid var(--salon-brass);
  padding: 12px clamp(12px, 4%, 48px);
}
body.isn-salon-friends .table-seats {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-evenly;
  gap: 4px 8px;
  margin: 6px 0;
}
body.isn-salon-friends .table-seats .seat {
  flex: 1 1 62px;
  max-width: 170px;
  min-width: 0;
  padding: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 1px 3px #03160d;
}
body.isn-salon-friends .seat img {
  width: clamp(30px, 6dvh, 52px);
  height: clamp(30px, 6dvh, 52px);
  border: 2px solid var(--salon-brass);
}
body.isn-salon-friends .seat strong {
  width: fit-content;
  max-width: 100%;
  margin: 2px auto;
  padding: 1px 6px;
  color: var(--salon-ivory);
  border-bottom: 1px solid var(--salon-brass);
  background: #102016d9;
  font-size: clamp(11px, 2dvh, 16px);
}
body.isn-salon-friends .seat.turn strong { border-bottom: 3px solid #ffde88; }
body.isn-salon-friends .table-controls { gap: 5px; }
body.isn-salon-friends #table > .felt {
  min-height: 0;
  padding: 6px 2%;
  margin: 5px 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.isn-salon-friends #table > .felt::after { display: none; }
body.isn-salon-friends #table > .felt h3,
body.isn-salon-friends #table .turn-text,
body.isn-salon-friends #table .hand-title,
body.isn-salon-friends #table .score {
  margin: 5px 0;
  color: var(--salon-ivory);
}
body.isn-salon-friends #table .actions { margin: 7px 0; gap: 5px; }
body.isn-salon-friends #table .hand .card {
  width: clamp(27px, 5.8dvh, 49px);
  height: clamp(38px, 8dvh, 70px);
  margin: 1px;
}
body.isn-salon-friends #table .hand .card.selected { transform: translateY(-3px); }
body.isn-salon-friends #table > details { background: #101e15ec; }

/* A Hold'em championship reuses the same club card engine as its table.
   Retain the original photographed poker rail and all tournament actions. */
body.isn-salon-tournament #gameDialog,
body.isn-salon-tournament .club-tournament-review {
  background: linear-gradient(#0b180eb8, #0b180ed9), var(--salon-room) center / cover;
}
body.isn-salon-tournament #gameDialog .table-stage:has(.isn-seated-group) {
  background: var(--isn-table-art) center / 100% 100% no-repeat;
}
body.isn-salon-tournament #gameDialog .table-rail,
body.isn-salon-tournament #gameDialog .seated-controls {
  border-color: var(--salon-brass);
}
body.isn-salon-tournament #gameDialog .table-status {
  background: #122c1fed;
  color: var(--salon-ivory);
}

@media (max-width: 650px) {
  body.isn-salon-classic:not(.kings-table) main#game > .felt,
  body.isn-salon-classic:not(.kings-table) main#game > .felt.has-seated-guests {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: 'seats' 'status' 'board' 'hand' 'moves' 'help';
    padding: 4px 5% 18px;
    row-gap: 4px;
    min-height: min(560px, calc(100dvh - 124px));
  }
  body.isn-salon-classic:not(.kings-table) main#game > .felt:has(.solitaire-board) {
    grid-template-areas: 'status' 'board' 'moves' 'help';
  }
  body.isn-salon-classic:not(.kings-table) > header nav button {
    min-height: 30px;
    padding: 3px 5px;
  }
  body.isn-salon-classic:not(.kings-table) #opponents .opponent > p { font-size: 9px; }
  body.isn-salon-classic:not(.kings-table) .card {
    width: clamp(24px, 7.2vw, 39px);
    height: clamp(33px, 9.8vw, 53px);
    margin: 1px;
  }
  body.isn-salon-classic:not(.kings-table) #board { gap: 2px 5px; }
  body.isn-salon-classic:not(.kings-table) .result-hand .card {
    width: 21px;
    height: 28px;
    font-size: 11px;
  }
  body.isn-salon-friends .table-seats .seat { flex-basis: 43px; }
  body.isn-salon-friends #table:has(> .table-seats) { padding: 8px; }
}

@media (max-height: 470px) and (orientation: landscape) {
  body.isn-salon-classic:not(.kings-table) #opponents .seated-figure { height: 30px; }
  body.isn-salon-classic:not(.kings-table) main#game > .felt,
  body.isn-salon-classic:not(.kings-table) main#game > .felt.has-seated-guests {
    min-height: 0;
    padding: 1px 4% 8px;
    gap: 2px 2%;
  }
  body.isn-salon-classic:not(.kings-table) .card { width: 26px; height: 34px; font-size: 13px; }
  body.isn-salon-classic:not(.kings-table) .your-hand h2 { margin: 1px 0; font-size: 12px; }
  body.isn-salon-classic:not(.kings-table) #actions button { min-height: 24px; font-size: 10px; }
}
