.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 440px;
  max-width: 95vw;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; font-size: 20px; }
.modal p { color: var(--text-secondary); margin-bottom: 16px; font-size: 14px; }
.modal-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--text-muted);
  font-size: 28px; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-btn { cursor: pointer; }
.radio-btn:has(input:checked) {
  border-color: var(--accent-gold);
  background: rgba(245,158,11,0.15);
  color: var(--accent-gold);
}
hr { border: none; border-top: 1px solid var(--border); }

/* Le lobby s'étend sur toute la largeur (la grille de tables peut donc
   afficher beaucoup de colonnes); seuls l'entête et le bouton restent centrés. */
.main-menu { max-width: none; }
.menu-hero, .create-table-section { max-width: 900px; margin-left: auto; margin-right: auto; }

/* Grille de tables: cartes centrées horizontalement, colonnes adaptatives
   (minimum 2, pas de maximum: jusqu'à 8+ sur écran ultra large). */
.tables-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
}
.tables-grid .table-card {
  flex: 0 1 240px;
  min-width: 0;
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .tables-grid { gap: 10px; }
  .tables-grid .table-card { flex-basis: 160px; }
}

/* TABLE CARD */
.table-variant {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.table-variant.variant-classique { background: rgba(59,130,246,0.18); color: #93c5fd; }
.table-variant.variant-coinchee { background: rgba(168,85,247,0.18); color: #d8b4fe; }
.table-stakes .per-hand { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.badge-private { font-size: 11px; color: #c4b5fd; font-weight: 600; }
.badge-human { font-size: 11px; color: #6ee7b7; font-weight: 600; }
.stake-level { color: var(--accent-blue); font-weight: 700; font-size: 12px; margin-right: 5px; }

/* Tags de fonctionnalités d'une table */
.table-features { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
.filter-row-label {
  display: flex; align-items: center;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  margin-right: 4px; white-space: nowrap;
}
.tag {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  letter-spacing: .2px; white-space: nowrap;
}
/* Distinction sans couleur (daltonisme): ✔ plein vs ✘ bordure pointillée. */
.tag-on { background: rgba(16,185,129,0.16); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.45); }
.tag-off { background: rgba(148,163,184,0.14); color: #e2e8f0; border: 1px solid rgba(148,163,184,0.45); }

/* Paliers de mise (création de table) */
.preset-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.preset-btn {
  flex: 1 1 68px; cursor: pointer; text-align: center; line-height: 1.3;
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-primary); border-radius: 8px; padding: 6px 4px; font-size: 11px;
}
.preset-btn:hover { border-color: var(--accent-gold); }
.preset-btn.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }
.preset-label { font-weight: 700; }
.preset-blinds { font-weight: 400; opacity: .8; font-size: 10px; }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-icon { font-size: 42px; margin-bottom: 8px; }

/* LEADERBOARD bot rows */
.leaderboard-table tr.bot td { color: var(--text-muted); }

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000;
}
.toast {
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease;
}
.toast.error { border-color: var(--accent-red); color: #fca5a5; }
.toast.success { border-color: var(--accent-green); color: #6ee7b7; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
