
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #243044;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --felt-green: #0d6b3e;
  --felt-dark: #095230;
  --felt-light: #0f834d;
  --border: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(17,24,39,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-logo { height: 32px; width: auto; }
.top-title { font-weight: 700; font-size: 16px; color: #126ca3; }
.game-title-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: .2s; }
.back-link:hover { color: var(--text-primary); }
.balance-display { font-weight: 600; color: var(--accent-gold); font-size: 15px; }
.hand-info { color: var(--text-muted); font-size: 11px; }
.stakes-info { color: var(--accent-blue); font-weight: 600; font-size: 14px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .3s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245,158,11,0.4);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all .3s;
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all .3s;
}
.btn-danger:hover { background: #dc2626; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }
/* AUTH PAGE */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #111827 0%, #0a0e17 70%);
}
.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 420px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { height: 64px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 24px; color: var(--accent-gold); }
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all .3s;
}
.auth-tab.active { background: var(--accent-gold); color: #000; }
.auth-tab:hover:not(.active) { color: var(--text-primary); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-blue);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.auth-link:hover { color: var(--accent-gold); }
.form-success { color: var(--accent-green); font-size: 13px; margin-top: 8px; min-height: 20px; }
/* MAIN MENU */
.main-menu-page {
  background: radial-gradient(ellipse at 50% 0%, #1a2332 0%, #0a0e17 70%);
  padding-top: 56px;
}
.main-menu {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}
.menu-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-logo { height: 160px; margin-bottom: 16px; }
.menu-hero h1 { font-size: 36px; color: #126ca3; margin-bottom: 8px; }
.menu-hero p { color: var(--text-secondary); font-size: 18px; }
.leaderboard {
  flex: 0 0 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: left;
}
.leaderboard-title { font-size: 16px; font-weight: 700; color: var(--accent-gold); margin-bottom: 12px; text-align: center; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard-table td { padding: 6px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.leaderboard-table td.ldb-balance { text-align: right; white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; }
.leaderboard-table td.ldb-name { white-space: nowrap; width: 1%; }
.leaderboard-table td.ldb-rank { white-space: nowrap; width: 1%; }
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr.me td { color: var(--accent-gold); font-weight: 700; }
.leaderboard-table tr.leaderboard-ellipsis td { text-align: center; color: var(--text-muted); font-weight: 700; letter-spacing: 2px; }
.menu-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: all .3s;
  position: relative;
}
.menu-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.menu-card-icon { font-size: 48px; margin-bottom: 16px; }
.menu-card h2 { font-size: 20px; margin-bottom: 8px; }
.menu-card p { color: var(--text-secondary); font-size: 14px; }
.menu-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}
/* TABLES */
.tables-section { margin-top: 24px; }
.tables-section h2 { font-size: 22px; margin-bottom: 16px; text-align: center; }
.table-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.filter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 84px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 6px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  line-height: 1.1;
  text-align: center;
}
.filter-btn .filter-label { font-weight: 600; white-space: nowrap; }
.filter-btn .filter-blinds { font-size: 10px; opacity: .85; white-space: nowrap; }
.filter-btn.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }
.filter-btn:hover:not(.active) { border-color: var(--text-muted); }
.tables-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  transition: all .3s;
  cursor: pointer;
}
.table-card:hover { border-color: var(--accent-gold); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.table-card h3 { font-size: 16px; margin-bottom: 8px; }
.table-card .table-stakes { color: var(--accent-gold); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.table-card .table-detail { color: var(--text-muted); font-size: 13px; }
.table-card .table-players { color: var(--accent-green); font-size: 13px; font-weight: 500; margin-top: 8px; }
.table-card .table-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-top: 8px; }
.table-status-waiting { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.table-status-active { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.create-table-section { text-align: center; }
/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border .2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent-gold); }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.form-error { color: var(--accent-red); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* Symboles de couleur de carte : rouge pour cœur/carreau, noir pour pique/trèfle.
   Un léger halo clair garde le noir lisible sur les fonds sombres. */
.suit-red { color: #ef4444; font-weight: 700; }
.suit-black { color: #0f172a; font-weight: 700; text-shadow: 0 0 1px #fff, 0 0 3px rgba(255,255,255,0.85); }
