/* «Столы» — the multiplayer lobby (tables-design.md §E; mock СТОЛ 3435–3531).

   Geometry follows the mock's inline pixels where the block exists here:
   header 15/20 pad radius 18 violet .26 border; cards radius 16 border
   rgba(violet,.18) over var(--panel); seats grid radius 14 cells; gold CTA
   with the mock's own gradient. The vote column is the static «во что
   играем» card and the chat column is the poll-driven feed (views/table.js
   explains both repurposings). */

.tbl-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

/* ── Create form ─────────────────────────────────────────────────────── */

.tbl-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.tbl-create-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tbl-create-title {
  font-family: Unbounded, sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}
.tbl-what {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tbl-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 15px;
  border-radius: 16px;
  border: 1px solid rgba(var(--t-violet), 0.18);
  background: var(--panel);
  min-width: 0;
}
.tbl-sec {
  font-family: Unbounded, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tbl-game-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(var(--t-violet), 0.16);
  background: rgba(26, 17, 48, 0.5);
}
.tbl-game-row.is-live {
  border-color: rgba(241, 193, 82, 0.42);
  background: rgba(241, 193, 82, 0.08);
}
.tbl-game-row.is-off {
  opacity: 0.55;
}
.tbl-game-icon {
  font-size: 17px;
}
img.tbl-game-icon { width: 20px; height: 20px; object-fit: contain; display: block; }
.tbl-game-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tbl-game-name {
  font-size: 12px;
  font-weight: 800;
}
.tbl-game-fit {
  font-size: 10px;
  color: var(--text-soft);
}
.tbl-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tbl-chip {
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid rgba(var(--t-violet), 0.22);
  background: rgba(26, 17, 48, 0.5);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  transition: 0.16s;
}
@media (hover: hover) {
  .tbl-chip:hover {
    border-color: rgba(var(--t-violet), 0.5);
  }
}
.tbl-chip.is-on {
  border-color: rgba(241, 193, 82, 0.5);
  background: rgba(241, 193, 82, 0.1);
  color: var(--gold);
}
.tbl-choice-hint {
  font-size: 10px;
  color: var(--text-soft);
}
.tbl-lifetime {
  margin: 0;
  padding: 11px 12px;
  border-radius: 11px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(var(--t-violet), 0.24);
  font-size: 10px;
  color: var(--text-soft);
  line-height: 1.5;
}
.tbl-cta {
  padding: 12px 24px;
  border-radius: 11px;
  background: var(--gold-grad);
  color: var(--gold-ink);
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(241, 193, 82, 0.3);
  transition: 0.18s;
}
@media (hover: hover) {
  .tbl-cta:hover {
    transform: translateY(-2px);
  }
}
.tbl-cta:disabled {
  opacity: 0.6;
  transform: none;
}

/* ── Seat view header (mock 3437–3458) ───────────────────────────────── */

.tbl-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px 20px;
  border-radius: 18px;
  border: 1px solid rgba(var(--t-violet), 0.26);
  background: linear-gradient(115deg, rgba(40, 24, 74, 0.78), rgba(18, 12, 34, 0.6));
}
.tbl-head-icon {
  font-size: 32px;
}
img.tbl-head-icon { width: 34px; height: 34px; object-fit: contain; display: block; }
.tbl-head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: auto;
  min-width: 0;
}
.tbl-head-title {
  font-family: Unbounded, sans-serif;
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tbl-head-sub {
  font-size: 11px;
  color: var(--text-soft);
}
.tbl-code-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 11px;
  background: rgba(10, 7, 20, 0.6);
  border: 1px solid rgba(var(--t-violet), 0.24);
}
.tbl-code-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tbl-code-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.tbl-throw {
  white-space: nowrap;
  padding: 12px 20px;
  border-radius: 11px;
  border: 1px solid rgba(var(--t-violet), 0.34);
  background: rgba(24, 16, 44, 0.66);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  transition: 0.18s;
}
@media (hover: hover) {
  .tbl-throw:hover {
    border-color: rgba(var(--t-violet), 0.7);
    transform: translateY(-2px);
  }
}
.tbl-start {
  white-space: nowrap;
  padding: 12px 24px;
  border-radius: 11px;
  background: var(--gold-grad);
  color: var(--gold-ink);
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(241, 193, 82, 0.3);
  transition: 0.18s;
}
@media (hover: hover) {
  .tbl-start:hover {
    transform: translateY(-2px);
  }
}
/* mock 3453–3458: the dashed gold busy-lock, one per busy player */
.tbl-busy-lock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 18px;
  border-radius: 11px;
  border: 1px dashed rgba(241, 193, 82, 0.4);
  background: rgba(241, 193, 82, 0.07);
  transition: 0.18s;
}
@media (hover: hover) {
  .tbl-busy-lock:hover {
    background: rgba(241, 193, 82, 0.14);
    border-color: rgba(241, 193, 82, 0.7);
  }
}
.tbl-busy-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
}
.tbl-busy-sub {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
}
.tbl-ready-toggle {
  white-space: nowrap;
  padding: 12px 20px;
  border-radius: 11px;
  border: 1px solid rgba(53, 199, 131, 0.4);
  background: rgba(53, 199, 131, 0.1);
  font-size: 12px;
  font-weight: 800;
  color: var(--ok);
  transition: 0.18s;
}
.tbl-ready-toggle.is-on {
  border-color: rgba(var(--t-violet), 0.34);
  background: rgba(24, 16, 44, 0.66);
  color: var(--text-dim);
}
.tbl-leave {
  white-space: nowrap;
  padding: 12px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 93, 108, 0.3);
  background: rgba(255, 93, 108, 0.07);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: 0.18s;
}
@media (hover: hover) {
  .tbl-leave:hover {
    border-color: rgba(255, 93, 108, 0.6);
  }
}

/* ── The three columns (mock 3460: grid, seats/vote/chat) ────────────── */

.tbl-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .tbl-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
.tbl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tbl-count {
  font-size: 11px;
  color: var(--text-faint);
}
.tbl-seats {
  min-width: 0;
}
.tbl-seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 11px;
}
/* mock 10446–10452: filled/host/empty seat cells */
.tbl-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 9px;
  border-radius: 14px;
  border: 1px solid rgba(var(--t-violet), 0.2);
  background: rgba(26, 17, 48, 0.55);
  min-width: 0;
}
.tbl-seat.is-host {
  border-color: rgba(241, 193, 82, 0.45);
  background: rgba(241, 193, 82, 0.07);
}
.tbl-seat.is-empty {
  border-style: dashed;
  border-color: rgba(var(--t-violet), 0.28);
  background: rgba(16, 11, 30, 0.34);
}
.tbl-seat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: linear-gradient(135deg, #7c3aed, #241638);
  border: 1px solid rgba(var(--t-violet), 0.24);
}
.tbl-seat.is-empty .tbl-seat-avatar {
  background: rgba(var(--t-violet), 0.07);
  color: var(--text-faint);
  font-size: 20px;
}
.tbl-seat-name {
  font-size: 11px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl-seat.is-empty .tbl-seat-name {
  color: var(--text-faint);
}
.tbl-seat-meta {
  font-size: 9px;
  color: var(--text-faint);
  text-align: center;
}
.tbl-seat-pill {
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(var(--t-violet), 0.1);
  color: var(--text-faint);
}
.tbl-seat-pill.is-ready {
  background: rgba(53, 199, 131, 0.16);
  color: var(--ok);
}
.tbl-seat-pill.is-host {
  background: rgba(241, 193, 82, 0.16);
  color: var(--gold);
}
.tbl-game {
  min-width: 0;
}

/* ── The system feed (v1: polls, no chat backend) ────────────────────── */

.tbl-feed {
  min-width: 0;
}
.tbl-feed-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 300px;
  overflow-y: auto;
}
.tbl-feed-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(var(--t-violet), 0.07);
}
.tbl-feed-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: var(--text-faint);
  flex: 0 0 auto;
}
.tbl-feed-text {
  font-size: 11px;
  line-height: 1.42;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.tbl-feed-empty {
  font-size: 11px;
  color: var(--text-soft);
}
.tbl-feed-note {
  font-size: 10px;
  color: var(--text-faint);
}

/* ── Closed states (the table_dissolved sheet grammar) ───────────────── */

.tbl-gone,
.tbl-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 28px 20px;
  border-radius: 18px;
  border: 1px solid rgba(241, 193, 82, 0.3);
  background: linear-gradient(115deg, rgba(50, 33, 12, 0.5), rgba(14, 9, 26, 0.9));
  max-width: 480px;
  margin: 24px auto 0;
  width: 100%;
}
.tbl-sheet {
  margin: 0;
  background: linear-gradient(115deg, rgba(50, 33, 12, 0.92), rgba(14, 9, 26, 0.98));
}
.tbl-gone-icon {
  font-size: 34px;
}
img.tbl-gone-icon { width: 40px; height: 40px; object-fit: contain; display: block; }
.tbl-gone-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.tbl-gone-title {
  font-family: Unbounded, sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.tbl-gone-body {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tbl-gone-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}
.tbl-gone-note {
  font-size: 10px;
  color: var(--text-faint);
}
.tbl-started,
.tbl-notfound {
  padding: 32px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── The durak capsule door (ui/game-hub.js) ─────────────────────────── */

.tbl-hub {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tbl-hub-door {
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(241, 193, 82, 0.42);
  background: rgba(241, 193, 82, 0.08);
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  transition: 0.16s;
}
@media (hover: hover) {
  .tbl-hub-door:hover {
    border-color: rgba(241, 193, 82, 0.7);
    background: rgba(241, 193, 82, 0.14);
  }
}
.tbl-hub-sub {
  font-size: 10px;
  color: var(--text-soft);
  line-height: 1.45;
}
