/* Shared table presentation: catalog artwork, seats, setup, invites and results.
   Playing boards retain their own geometry and controls. */
:root[data-social-game] { --table-color: #63436f; }
:root[data-social-game="poker"] { --table-color: #1f5845; }
:root[data-social-game="durak"] { --table-color: #7d3d2c; }
:root[data-social-game="mahjong"] { --table-color: #24594e; }
:root[data-social-game="catan"] { --table-color: #8c4529; }
:root[data-social-game="codenames"] { --table-color: #2b5879; }
:root[data-social-game="coup"] { --table-color: #69432e; }
:root[data-social-game="wavelength"] { --table-color: #91405d; }
:root[data-social-game="mental-math"] { --table-color: #64478c; }

:root[data-social-game] .table-feature {
  display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center;
  gap: 24px; position: relative; isolation: isolate; overflow: hidden;
  min-height: 230px; margin: 0 0 24px; padding: 30px 38px;
  border: 1px solid color-mix(in srgb, var(--table-color), white 18%);
  border-radius: 24px; color: #fffaf0; background: var(--table-color);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--table-color) 12%, transparent);
}
.table-feature::after {
  content: ""; position: absolute; z-index: -1; width: 380px; height: 380px;
  right: -30px; top: -110px; border: 1px solid #fff3d329; border-radius: 50%;
  box-shadow: 0 0 0 32px #fff3d309, 0 0 0 65px #fff3d306;
  pointer-events: none;
}
.table-feature-copy { min-width: 0; }
:root[data-social-game] .table-feature-label {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
  color: #fff7e6; font-size: 12px; line-height: 1.4; font-weight: 600;
}
.table-feature-label img { width: 28px; height: 28px; object-fit: contain; }
:root[data-social-game] .table-feature h1 {
  margin: 0; color: inherit; font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.05; letter-spacing: -.045em; overflow-wrap: anywhere;
}
:root[data-social-game] .table-feature-description {
  max-width: 550px; margin: 12px 0 0; color: #fff5e3; font-size: 16px; line-height: 1.5;
}
.table-feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
:root[data-social-game] .table-feature-actions .button {
  min-height: 44px; padding: 10px 16px; color: #fffaf0;
  background: #ffffff12; border: 1px solid #ffffff66; border-radius: 10px; box-shadow: none;
}
:root[data-social-game] .table-feature-actions .button:hover { background: #ffffff25; }
.table-lobby-connection { display: inline-flex; }
.table-game-art { position: relative; width: 100%; aspect-ratio: 1; }
.table-game-art img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  border-radius: 18px; transform: rotate(-7deg);
  filter: drop-shadow(0 13px 7px #08191130);
}
.table-game-art--feature { width: 194px; justify-self: center; }
.table-game-art--empty { width: 100px; margin: 0 auto 24px; opacity: .85; }
.table-game-art--result { width: 112px; margin: 0 auto 22px; }
:root[data-social-game] .table-directory { gap: 24px; }
:root[data-social-game] .table-directory .panel,
:root[data-social-game] .table-lobby .panel,
:root[data-social-game] .join-card,
:root[data-social-game] .table-result {
  border: 1px solid var(--ui-line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--table-color) 5%, transparent);
}
:root[data-social-game] .table-directory .panel-body { padding: 28px; }
:root[data-social-game] .table-directory .create-panel { position: static; border-top: 4px solid var(--ui-accent); }
:root[data-social-game] .table-directory .button,
:root[data-social-game] .table-lobby .button,
:root[data-social-game] .table-result .button,
:root[data-social-game] .join-card .button { min-height: 44px; border-radius: 10px; }
:root[data-social-game] .table-directory :is(input, select),
:root[data-social-game] .table-lobby select,
:root[data-social-game] .join-card input { border-radius: 10px; }
:root[data-social-game] .table-directory .directory-heading { padding: 24px; align-items: start; }
:root[data-social-game] .table-directory .directory-tabs { padding: 4px; background: var(--ui-soft); border-radius: 12px; }
:root[data-social-game] .table-directory .directory-tabs button { min-width: 44px; min-height: 44px; border-radius: 8px; }
:root[data-social-game] .table-directory .directory-tabs button[aria-selected="true"] { background: var(--ui-surface); box-shadow: 0 2px 4px #0000000b; }
:root[data-social-game] .table-directory-empty { min-height: 310px; border: 0; box-shadow: none; }
:root[data-social-game] .table-directory .room-card { border-radius: 14px; border-left: 3px solid var(--ui-accent); }

:root[data-social-game] .table-lobby { gap: 0; }
:root[data-social-game] .table-lobby .lobby-table {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); align-items: start; gap: 24px;
}
:root[data-social-game] .table-lobby .panel-body { padding: 26px; }
.table-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
:root[data-social-game] .table-lobby .panel-title { font-size: 24px; line-height: 1.15; }
.table-seat-count { flex: none; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-seat-count span { color: var(--ui-muted); font-size: 12px; font-weight: 500; }
:root[data-social-game] .table-seating {
  background: linear-gradient(160deg, var(--ui-accent-soft), var(--ui-surface) 65%);
}
:root[data-social-game] .table-lobby .seat-grid { margin-top: 24px; gap: 12px; }
:root[data-social-game] .table-lobby .lobby-seat {
  position: relative; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto;
  gap: 4px 12px; min-height: 112px; padding: 18px 46px 15px 16px;
  border-radius: 16px; background: var(--ui-surface);
  border: 1px solid var(--ui-line); box-shadow: 0 3px 0 color-mix(in srgb, var(--seat-color, var(--ui-line)) 13%, transparent);
}
:root[data-social-game] .table-lobby .lobby-seat.is-you { border-color: color-mix(in srgb, var(--ui-accent) 40%, var(--ui-line)); }
:root[data-social-game] .table-lobby .avatar {
  grid-row: 1 / 3; width: 42px; height: 42px; align-self: center; border-radius: 50%;
  background: var(--seat-color); border: 3px solid var(--ui-surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--seat-color) 45%, var(--ui-surface));
}
:root[data-social-game] .table-lobby .lobby-seat.is-ready .avatar { box-shadow: 0 0 0 2px var(--ui-success); }
.table-seat-person { min-width: 0; align-self: end; }
:root[data-social-game] .table-lobby .lobby-seat strong { font-size: 14px; line-height: 1.4; }
:root[data-social-game] .table-lobby .lobby-seat small { font-size: 11px; line-height: 1.4; margin-top: 1px; }
.table-seat-status { display: flex; align-items: center; gap: 5px; color: var(--ui-muted); font-size: 10px; line-height: 18px; white-space: nowrap; }
.table-seat-status.is-ready { color: var(--ui-success); }
.table-seat-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.table-seat-status svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; }
:root[data-social-game] .table-lobby .table-remove-seat {
  position: absolute; right: 3px; top: 4px; width: 44px; height: 44px; padding: 0;
  border: 0; background: transparent; color: var(--ui-muted); box-shadow: none; font-size: 24px; font-weight: 400;
}
:root[data-social-game] .table-lobby .table-remove-seat:hover { background: var(--ui-soft); color: var(--ui-danger); }
:root[data-social-game] .table-lobby .lobby-seat.empty {
  grid-template-rows: 1fr; border-style: dashed; box-shadow: none; text-align: left; justify-items: start;
  padding-right: 16px; background: transparent; min-height: 112px;
}
.table-empty-avatar { display: grid; place-items: center; width: 42px; height: 42px; border: 1px dashed var(--ui-strong); border-radius: 50%; color: var(--ui-muted); }
.table-empty-avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.table-ready-summary { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 26px; font-size: 12px; font-weight: 650; }
.table-ready-dots { display: flex; gap: 4px; }
.table-ready-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-line); }
.table-ready-dots .is-ready { background: var(--ui-success); }
.table-lobby-status { min-height: 36px; margin: 7px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--ui-muted); }
:root[data-social-game] .table-lobby .lobby-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
:root[data-social-game] .table-lobby .lobby-controls:has(> :only-child) { grid-template-columns: 1fr; }
:root[data-social-game] .table-lobby .lobby-controls .button { min-height: 50px; font-size: 14px; padding: 10px; }
:root[data-social-game] .table-lobby .lobby-controls .button:disabled { opacity: 1; color: var(--ui-muted); background: var(--ui-soft); border-color: var(--ui-line); box-shadow: none; }
.table-lobby-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
:root[data-social-game] .table-lobby .table-quiet-button { color: var(--ui-muted); border-color: transparent; background: transparent; padding-inline: 0; box-shadow: none; font-size: 12px; }
:root[data-social-game] .table-lobby .table-add-bot { font-size: 12px; }
.table-setup-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ui-accent-soft); color: var(--ui-accent); }
.table-setup-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
:root[data-social-game] .table-lobby .invite-code { margin: 24px 0; padding: 14px; border: 1px dashed color-mix(in srgb, var(--ui-accent) 50%, var(--ui-line)); border-radius: 14px; background: var(--ui-accent-soft); }
:root[data-social-game] .table-lobby .invite-code-copy { display: grid; gap: 3px; }
:root[data-social-game] .table-lobby .invite-code small { color: var(--ui-muted); font-size: 11px; }
:root[data-social-game] .table-lobby .invite-code code { color: var(--ui-accent); font-size: 22px; line-height: 1.2; }
:root[data-social-game] .table-lobby .invite-code .button { width: 44px; padding: 10px; }
:root[data-social-game] .table-lobby .host-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
:root[data-social-game] .table-lobby .settings-line { grid-template-columns: minmax(0, 1fr); align-content: start; align-items: start; gap: 8px; min-width: 0; padding: 0; border: 0; font-size: 12px; }
:root[data-social-game] .table-lobby .settings-line :is(span, strong) { font-size: 12px; }
:root[data-social-game] .table-lobby .settings-line small { font-size: 10px; }
:root[data-social-game] .table-lobby .settings-line select { width: 100%; min-width: 0; min-height: 44px; font-size: 14px; background-color: var(--ui-soft); }
:root[data-social-game] .table-lobby .host-settings > .panel-sub { grid-column: 1 / -1; font-size: 11px; margin: 0; line-height: 1.5; }
.table-expiry { margin: 22px 0 0; color: var(--ui-muted); font-size: 11px; }
.table-expiry strong { font-variant-numeric: tabular-nums; }
:root[data-social-game] .join-card .table-feature { border: 0; border-radius: 0; margin: 0; padding: 26px; grid-template-columns: minmax(0, 1fr) 140px; }
:root[data-social-game] .join-card .table-game-art { width: 130px; }
:root[data-social-game] .join-card .table-feature h1 { font-size: 34px; }
:root[data-social-game] .table-result { padding: 32px; border-top: 4px solid var(--ui-accent); }
:root[data-social-game] .table-result h2 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; }
.table-result .result-row { border: 1px solid transparent; }
.table-result .result-row.is-winner { border-color: color-mix(in srgb, var(--ui-accent) 40%, var(--ui-line)); background: var(--ui-accent-soft); }
.table-result .result-score small { display: block; font-size: 10px; font-weight: 500; color: var(--ui-muted); }
:root[data-social-game] .table-result .result-actions { flex-wrap: wrap; }
:root[data-theme="dark"] .table-feature { background: color-mix(in srgb, var(--table-color) 70%, #101923); border-color: #ffffff20; }
@media (max-width: 1000px) {
  :root[data-social-game] .table-lobby .lobby-table { grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
  :root[data-social-game] .table-lobby .seat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root[data-social-game] .table-feature { grid-template-columns: minmax(0, 1fr) 140px; gap: 14px; min-height: 190px; padding: 24px; border-radius: 20px; margin-bottom: 18px; }
  .table-game-art--feature { width: 128px; }
  :root[data-social-game] .table-feature h1 { font-size: 36px; }
  :root[data-social-game] .table-feature-description { font-size: 13px; }
  :root[data-social-game] .table-feature-label { font-size: 10px; gap: 6px; }
  :root[data-social-game] .table-lobby .lobby-table { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  :root[data-social-game] .table-lobby .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-social-game] .table-directory .panel-body,
  :root[data-social-game] .table-lobby .panel-body { padding: 22px; }
  :root[data-social-game] .table-result { padding: 24px 18px; }
}
@media (max-width: 460px) {
  :root[data-social-game] .table-feature { padding: 20px; grid-template-columns: minmax(0, 1fr) 85px; gap: 14px; min-height: 184px; }
  .table-game-art--feature { width: 84px; }
  :root[data-social-game] .table-feature h1 { font-size: clamp(26px, 8vw, 32px); }
  :root[data-social-game] .table-feature-label img { display: none; }
  :root[data-social-game] .table-feature-actions { margin-top: 16px; gap: 8px; }
  :root[data-social-game] .table-feature-actions .button { padding: 8px 10px; font-size: 12px; }
  .table-lobby-connection { display: none; }
  :root[data-social-game] .table-lobby .panel-body { padding: 18px; }
  :root[data-social-game] .table-lobby .seat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; gap: 10px; }
  :root[data-social-game] .table-lobby .lobby-seat { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; min-height: 144px; padding: 14px 12px; gap: 6px; }
  :root[data-social-game] .table-lobby .avatar { grid-row: auto; }
  :root[data-social-game] .table-lobby .lobby-seat.empty { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; }
  :root[data-social-game] .table-lobby .table-panel-heading { gap: 10px; }
  :root[data-social-game] .table-lobby .panel-title { font-size: 22px; }
  :root[data-social-game] .table-directory .directory-heading { padding: 20px; flex-wrap: wrap; gap: 12px; }
  :root[data-social-game] .table-directory-empty { padding: 24px 16px; }
  :root[data-social-game] .join-card .table-feature { grid-template-columns: minmax(0, 1fr) 85px; padding: 22px; }
  :root[data-social-game] .join-card .table-game-art { width: 84px; }
  :root[data-social-game] .join-card .table-feature h1 { font-size: 28px; }
  :root[data-social-game] .table-result .result-actions { display: grid; grid-template-columns: 1fr; }
}
