:root {
  /* Palette SNOOKER MASTER (identique à l'application) */
  --gold: #D4AF37;
  --gold-light: #F2D57E;
  --gold-dark: #9C7A1E;

  --table-green: #0B8A47;
  --table-green-dark: #06693A;
  --felt: #0E7A44;
  --felt-edge: #0A5A33;

  --bg: #17191C;
  --bg-2: #202327;
  --bg-3: #262A2E;
  --darker: #101214;
  --border: #2E3237;
  --border-light: rgba(255, 255, 255, 0.10);
  --text: #F2F4F8;
  --text-dim: #9AA3B2;

  --primary: #0B6E4F;
  --secondary: #33691E;
  --accent: #7CB342;
  --player1: #E53935;
  --player2: #1E88E5;
  --end-turn-blue: #1E6FE8;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--player2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ Pages de connexion ============ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at top left, rgba(212, 175, 55, 0.10), transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(11, 138, 71, 0.12), transparent 50%),
    var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card, var(--bg-2));
  background: linear-gradient(160deg, #202327 0%, #17191C 100%);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 38px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo { display: flex; justify-content: center; margin-bottom: 16px; }

.logo-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #20262E, #0D1115);
  color: var(--gold);
  font-weight: 900;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.35), inset 0 0 0 1px rgba(212, 175, 55, 0.25);
  overflow: hidden;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 5px;
}

.login-title { font-size: 24px; font-weight: 900; letter-spacing: 1px; }
.login-subtitle {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold);
  margin: 4px 0 20px;
}
.login-hint { margin-top: 16px; font-size: 12px; color: var(--text-dim); }

/* ============ Champs ============ */
.field-label {
  display: block;
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
  margin: 12px 0 6px;
  letter-spacing: 0.5px;
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}
select.field-input option { background: var(--bg-3); }

/* ============ Boutons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #14171c;
}
.btn-gold:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

.btn-green { background: var(--table-green-dark); color: #fff; border: 1px solid var(--table-green); }
.btn-green:hover { filter: brightness(1.15); }

.btn-red { background: #b71c1c; color: #fff; border: 1px solid var(--player1); }
.btn-red:hover { filter: brightness(1.15); }

.btn-blue { background: #0d47a1; color: #fff; border: 1px solid var(--player2); }
.btn-blue:hover { filter: brightness(1.15); }

.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }

/* ============ Layout applicatif (topbar + tuiles centrées) ============ */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--darker) 100%);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-brand .logo-circle { width: 46px; height: 46px; font-size: 16px; box-shadow: 0 0 18px rgba(212, 175, 55, 0.35); }
.brand-name { font-weight: 900; font-size: 16px; letter-spacing: 0.5px; white-space: nowrap; }
.brand-sub { font-size: 9px; letter-spacing: 2.5px; color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

/* -------- Navigation en tuiles (Concept 3) -------- */
.nav {
  display: flex;
  justify-content: center;
  padding: 16px 18px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner { width: 100%; max-width: 1120px; }
.modules-label {
  font-size: 11px;
  letter-spacing: 2.2px;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.nav-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 1120px;
  width: 100%;
}
.nav-tile {
  width: 170px;
  padding: 14px 14px 13px;
  border-radius: 19px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.nav-tile:hover { transform: translateY(-3px); border-color: var(--gold); }
.nav-tile.active {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.04));
  box-shadow: 0 0 0 1px var(--gold), 0 12px 26px rgba(0, 0, 0, 0.38);
}
.tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
}
.nav-tile.active .tile-icon {
  background: linear-gradient(145deg, var(--gold-light), var(--gold-dark));
  box-shadow: 0 5px 14px rgba(212, 175, 55, 0.35);
  color: #14171c;
}

/* Tuiles multicolores par module (Concept 3) */
.nav-tile.t1 .tile-icon { background: linear-gradient(145deg, #F2D57E, #C99B2F); box-shadow: 0 6px 14px rgba(242, 201, 76, 0.30); color: #14171c; }
.nav-tile.t2 .tile-icon { background: linear-gradient(145deg, #37B6F9, #2361CB); box-shadow: 0 6px 14px rgba(55, 182, 249, 0.30); }
.nav-tile.t3 .tile-icon { background: linear-gradient(145deg, #7CC25B, #2E7D32); box-shadow: 0 6px 14px rgba(124, 179, 66, 0.30); }
.nav-tile.t4 .tile-icon { background: linear-gradient(145deg, #B690F0, #6D4FC2); box-shadow: 0 6px 14px rgba(151, 112, 235, 0.30); }
.nav-tile.t5 .tile-icon { background: linear-gradient(145deg, #F06A5C, #C13B2F); box-shadow: 0 6px 14px rgba(240, 106, 92, 0.30); }
.nav-tile.t6 .tile-icon { background: linear-gradient(145deg, #38BDF8, #0E7490); box-shadow: 0 6px 14px rgba(56, 189, 248, 0.30); }
.nav-tile.t7 .tile-icon { background: linear-gradient(145deg, #F2A65C, #C7741F); box-shadow: 0 6px 14px rgba(242, 166, 92, 0.30); }
.nav-tile.t1 .tile-icon { filter: grayscale(.25) brightness(1.05); }
.nav-tile.active .tile-icon { filter: none; }
.tile-txt { display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: 13px; font-weight: 700; line-height: 1.15; }
.tile-sub { font-size: 11px; color: var(--text-dim); }

/* -------- Identité utilisateur (topbar) -------- */
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: #14171c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.user-avatar.img { overflow: hidden; }
.user-avatar.img img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 700; font-size: 13px; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--gold); white-space: nowrap; }

.main {
  flex: 1;
  padding: 22px 26px;
  background:
    radial-gradient(ellipse at top right, rgba(212, 175, 55, 0.05), transparent 50%),
    var(--bg);
}

/* ============ Entêtes ============ */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 14px; }
.page-title { font-size: 24px; font-weight: 900; }
.page-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* ============ Alertes ============ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
}
.alert-success { background: rgba(124, 179, 66, 0.12); border: 1px solid rgba(124, 179, 66, 0.4); color: var(--accent); }
.alert-error { background: rgba(229, 57, 53, 0.12); border: 1px solid rgba(229, 57, 53, 0.4); color: #ef9a9a; }
.alert-info { background: rgba(30, 136, 229, 0.12); border: 1px solid rgba(30, 136, 229, 0.4); color: #90caf9; }

/* ============ Cartes ============ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
.card-title {
  font-size: 13px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

/* ============ Statut de liaison App <-> Panel ============ */
.app-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  color: var(--text-dim);
}
.app-status-chip .app-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9aa4b0;
  flex: 0 0 auto;
}
.app-status-chip.connected { border-color: rgba(124, 179, 66, 0.5); color: #c8e6c9; }
.app-status-chip.connected .app-status-dot { background: var(--accent); box-shadow: 0 0 6px rgba(124, 179, 66, 0.8); }
.app-status-chip.disconnected { border-color: rgba(229, 57, 53, 0.4); color: #ef9a9a; }
.app-status-chip.disconnected .app-status-dot { background: var(--player1); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ============ Cartes statistiques ============ */
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.stat-value { font-size: 26px; font-weight: 900; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--text-dim); letter-spacing: 0.5px; }

/* ============ Match en direct ============ */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(229, 57, 53, 0.15);
  border: 1px solid var(--player1);
  border-radius: 20px;
  color: #ef9a9a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--player1); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); } 50% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); } }

/* Tableau vert façon billard */
.match-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 0;
  background: radial-gradient(ellipse at center, #0E7A44 0%, #0A5A33 100%);
  border: 1px solid #1a9c5a;
  border-radius: 20px;
  padding: 22px 16px;
}
.match-player { text-align: center; flex: 1; }
.match-player-name { font-size: 18px; font-weight: 800; color: #fff; }
.match-player-score { font-size: 54px; font-weight: 900; line-height: 1.1; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.match-score { font-size: 26px; font-weight: 900; margin: 6px 0 2px; color: #fff; }
.match-color-tag {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.match-score-pill {
  position: relative;
  text-align: center;
  min-width: 110px;
}
.match-score-pill .frames {
  font-size: 34px;
  font-weight: 900;
  color: #14171c;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.match-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.match-meta span { font-size: 12px; color: var(--text-dim); }
.match-meta b { color: var(--text); font-weight: 700; }

.player-card {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}
.player-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--gold-light), var(--gold-dark));
  color: #14171c;
  font-weight: 900;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.match-player .player-avatar { margin-bottom: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }

/* ============ Bandeau direct (live) ============ */
.live-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.live-banner .live-pill .live-dot { animation: blink 1s infinite; }
.live-banner .live-clock {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-light);
  padding: 6px 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
}
.live-updated { font-style: italic; }

/* Joueur dont c'est le tour : cadre doré animé */
.match-player { position: relative; transition: box-shadow 0.25s, border-color 0.25s; }
.match-player.turn-active {
  background: rgba(212, 175, 55, 0.09);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 16px;
  animation: pulse 1.6s infinite;
}
.match-player.turn-active .player-avatar { box-shadow: 0 0 0 3px var(--gold); }
.match-break {
  font-size: 12px;
  color: var(--text-dim);
  margin: 2px 0 4px;
  min-height: 18px;
}
.match-break b { color: var(--gold-light); font-weight: 800; }

/* Pastilles boules potées (tour en cours) */
.turn-balls {
  display: flex;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.turn-ball {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ============ Tables du club (une carte par application/table) ============ */
.section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}
.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.table-card {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.table-card.table-live {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.table-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-card-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.table-dot.online { background: var(--accent); box-shadow: 0 0 6px rgba(124, 179, 66, 0.6); }
.table-dot.offline { background: #f0593f; }
.table-rename { flex: 0 0 auto; }

.table-card-body { flex: 1; }
.tc-players {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: center;
  padding: 10px 8px;
  background: radial-gradient(ellipse at center, #0E7A44 0%, #0A5A33 100%);
  border: 1px solid #1a9c5a;
  border-radius: 14px;
}
.tc-player { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tc-right { order: 3; }
.tc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin: 0 auto;
  object-fit: cover;
}
.tc-name { font-size: 13px; font-weight: 800; color: #fff; }
.tc-break { font-size: 10px; color: rgba(255,255,255,0.65); }
.tc-score { font-size: 22px; font-weight: 900; color: #fff; }
.tc-vs { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tc-frames {
  font-size: 16px;
  font-weight: 900;
  color: #14171c;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  padding: 4px 12px;
}
.tc-ball {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.tc-turn { font-size: 10px; color: var(--gold-light); font-weight: 700; }
.tc-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 14px 8px;
}
.table-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ============ Tableaux ============ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.table tbody tr:hover { background: var(--border-light); }
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 12px;
  background: var(--border-light);
}
.rank-1 { background: rgba(212, 175, 55, 0.2); color: var(--gold); }
.rank-2 { background: rgba(200, 200, 210, 0.18); color: #d7dde6; }
.rank-3 { background: rgba(205, 127, 50, 0.22); color: #e0a066; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.badge-green { background: rgba(124, 179, 66, 0.15); color: var(--accent); }
.badge-red { background: rgba(229, 57, 53, 0.15); color: #ef9a9a; }
.badge-blue { background: rgba(30, 136, 229, 0.15); color: #90caf9; }
.badge-gold { background: rgba(212, 175, 55, 0.15); color: var(--gold); }

/* ============ Liste d'attente ============ */
.wait-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
}
.wait-item.next { border-color: var(--gold); background: rgba(212, 175, 55, 0.06); }
.wait-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: var(--border-light);
}
.wait-name { font-weight: 700; flex: 1; }
.wait-src { font-size: 11px; color: var(--text-dim); }
.wait-actions { display: flex; align-items: center; gap: 6px; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state .big { font-size: 40px; margin-bottom: 8px; }

/* ============ Liste d'attente — DESIGN MODERNE ============ */
.queue-card {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.queue-item:last-child { border-bottom: none; }
.queue-item:hover { background: var(--bg-3); }
.queue-item.next { background: rgba(212, 175, 55, 0.07); }
.queue-item.next:hover { background: rgba(212, 175, 55, 0.1); }

.queue-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--gold);
  flex-shrink: 0;
  transition: all 0.2s;
}
.queue-item.next .queue-rank {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #14171c;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.queue-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.queue-info { flex: 1; min-width: 0; }
.queue-name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}
.queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.queue-badge.table {
  background: rgba(30, 136, 229, 0.12);
  color: #90caf9;
  border: 1px solid rgba(30, 136, 229, 0.2);
}
.queue-badge.pts {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  border: 1px solid rgba(212, 175, 55, 0.18);
}
.queue-badge.gen {
  background: rgba(127, 127, 127, 0.12);
  color: var(--text-dim);
  border: 1px solid rgba(127, 127, 127, 0.2);
}
.queue-badge.src {
  background: rgba(124, 179, 66, 0.1);
  color: var(--accent);
  border: 1px solid rgba(124, 179, 66, 0.2);
}
.queue-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.queue-actions .btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.queue-actions .btn[disabled] { opacity: 0.35; pointer-events: none; }
.queue-move {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.queue-move:hover { border-color: var(--gold); color: var(--gold); }
.queue-move:disabled { opacity: 0.3; pointer-events: none; }
.queue-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.queue-remove:hover { border-color: var(--player1); color: #ef9a9a; background: rgba(229, 57, 53, 0.1); }

.queue-select-table {
  width: 84px;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  outline: none;
}
.queue-select-table:focus { border-color: var(--gold); }

/* Onglets modernes (TOUTES + tables) */
.table-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.tab-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
}
.tab-all:hover { border-color: var(--text-dim); color: var(--text); }
.tab-all.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-color: var(--gold);
  color: #14171c;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.tab-all .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
}
.tab-all.active .tab-count { background: rgba(0, 0, 0, 0.22); }

/* ============ STATISTIQUES — DESIGN MODERNE ============ */
.stats-section { margin-bottom: 22px; }
.stats-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stats-section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.podium-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  padding: 22px 10px 18px;
}
.podium-player {
  text-align: center;
  flex: 1;
  max-width: 160px;
}
.podium-medal { font-size: 40px; margin-bottom: 6px; }
.podium-name {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.podium-stats { font-size: 11px; color: var(--text-dim); }
.podium-bar {
  height: 40px;
  border-radius: 10px 10px 0 0;
  margin-top: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
}
.podium-player.gold .podium-medal { font-size: 52px; }
.podium-player.gold .podium-name { color: var(--gold); font-size: 16px; }
.podium-player.gold .podium-bar {
  height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.3);
}
.podium-player.silver .podium-name { color: #c0c0c0; }
.podium-player.silver .podium-bar {
  height: 48px;
  background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
  border: 1px solid rgba(200, 200, 200, 0.4);
}
.podium-player.bronze .podium-name { color: #cd7f32; }
.podium-player.bronze .podium-bar {
  height: 36px;
  background: linear-gradient(135deg, #cd7f32, #b8690e);
  border: 1px solid rgba(205, 127, 50, 0.4);
}

.stats-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-block {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-block .sb-icon { font-size: 24px; margin-bottom: 4px; }
.stat-block .sb-value { font-size: 28px; font-weight: 900; line-height: 1.1; }
.stat-block .sb-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 2px;
}
.stat-block.gold .sb-value { color: var(--gold); }
.stat-block.green .sb-value { color: var(--accent); }
.stat-block.blue .sb-value { color: var(--player2); }

/* Dernier match — carte résultat */
.match-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 22px 16px;
}
.match-result .mr-player { text-align: center; flex: 1; }
.match-result .mr-name {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-result .mr-name.winner { color: var(--gold); }
.match-result .mr-role { font-size: 11px; color: var(--text-dim); }
.match-result .mr-score { display: flex; align-items: center; gap: 10px; }
.match-result .mr-score .num { font-size: 38px; font-weight: 900; }
.match-result .mr-score .num.winner { color: var(--gold); }
.match-result .mr-score .sep { font-size: 18px; color: var(--text-dim); }
.match-result .mr-date {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding-bottom: 14px;
}

/* Performance par table */
.table-perf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
}
.table-perf-item {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.table-perf-item .tname { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.table-perf-item .tval { font-size: 24px; font-weight: 800; color: var(--player2); }
.table-perf-item .tlabel { font-size: 10px; color: var(--text-dim); }

/* ============ Avatars ============ */
.avatar-cell { width: 46px; }
.avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(212, 175, 55, 0.35);
}
.avatar-placeholder {
  background: radial-gradient(circle at 30% 25%, var(--gold-light), var(--gold-dark));
  color: #14171c;
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-file-input { display: none; }
.avatar-sm { width: 30px; height: 30px; font-size: 13px; }
.avatar-wait { width: 34px; height: 34px; font-size: 15px; flex-shrink: 0; }
.player-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* ============ Recherche & ajout rapide (liste d'attente) ============ */
.wsearch { box-sizing: border-box; }
.wquick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-add-item { margin: 0; }
.quick-add-item .btn {
  display: inline-flex;
  align-items: center;
  max-width: 210px;
}
.qav {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
}
.qav-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, var(--gold-light), var(--gold-dark));
  color: #14171c;
  font-weight: 900;
  font-size: 11px;
}

/* ============ Formulaire inline ============ */
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field-label { flex-basis: 100%; }

.form-card { max-width: 620px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .field-label { flex-basis: 100%; }
.form-row > div { flex: 1; min-width: 200px; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .nav-tile { width: 148px; }
}
@media (max-width: 900px) {
  .main { padding: 16px; }
  .match-player-score { font-size: 40px; }
}
@media (max-width: 820px) {
  .nav-tile { width: 128px; padding: 12px; }
  .nav-tiles { gap: 12px; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .topbar-right .user-chip div:last-child { display: none; }
  .nav { padding: 12px 0; }
  .nav-tiles {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 14px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tiles::-webkit-scrollbar { display: none; }
  .nav-tile {
    flex: 0 0 auto;
    width: auto;
    min-width: 124px;
    border-radius: 15px;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  .tile-icon { width: 40px; height: 40px; font-size: 19px; }
  .tile-sub { display: none; }
  .main { padding: 14px; }
}

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   THÈMES VISUELS DU PANEL
   Chaque thème ne redéfinit que des variables CSS (le layout ne bouge pas).
   Le thème "glass" ajoute en plus la matière vitreuse (transparence + blur).
   ===================================================================== */

/* ---- ROYAL : or sur ardoise profonde ---- */
body[data-theme="royal"] {
  --gold: #E6C15C;
  --gold-light: #F6E7A7;
  --gold-dark: #B8902E;
  --bg: #141216;
  --bg-2: #1D1A22;
  --bg-3: #262228;
  --darker: #0E0C10;
  --border: #312C37;
  --border-light: rgba(255, 255, 255, 0.10);
  --primary: #0B6E4F;
  --secondary: #5A4E12;
  --accent: #D4AF37;
  --player1: #F87171;
  --player2: #A5B4FC;
  --text: #F7F3E8;
  --text-dim: #B4A78F;
}

/* ---- EMERALD : vert billard / feutre ---- */
body[data-theme="emerald"] {
  --gold: #C7EFD4;
  --gold-light: #EAFBE9;
  --gold-dark: #7FD1A0;
  --bg: #0B2317;
  --bg-2: #10301F;
  --bg-3: #123A25;
  --darker: #07190F;
  --border: #1E4A30;
  --border-light: rgba(140, 255, 190, 0.10);
  --table-green: #1FBF6B;
  --table-green-dark: #0E9450;
  --felt: #17A05A;
  --felt-edge: #0C6B3B;
  --primary: #0E9450;
  --secondary: #2E7D32;
  --accent: #66BB6A;
  --player1: #FF7B6B;
  --player2: #66BBFF;
  --text: #EAF7EF;
  --text-dim: #A3C9B0;
}

/* ---- OCEAN : bleu profond / cyan ---- */
body[data-theme="ocean"] {
  --gold: #FFD98E;
  --gold-light: #FFE9B8;
  --gold-dark: #C9974A;
  --bg: #07141F;
  --bg-2: #0C2233;
  --bg-3: #102C40;
  --darker: #040C13;
  --border: #1C3F57;
  --border-light: rgba(120, 200, 255, 0.10);
  --primary: #0E7490;
  --secondary: #155E75;
  --accent: #22D3EE;
  --player1: #FB7185;
  --player2: #38BDF8;
  --text: #ECF7FE;
  --text-dim: #9CC3D6;
}

/* ---- CRIMSON : rouge moderne ---- */
body[data-theme="crimson"] {
  --gold: #FFC26B;
  --gold-light: #FFDDA8;
  --gold-dark: #C99041;
  --bg: #170B0D;
  --bg-2: #231014;
  --bg-3: #2C1318;
  --darker: #0F0507;
  --border: #3A1A20;
  --border-light: rgba(255, 140, 150, 0.10);
  --primary: #B71C1C;
  --secondary: #6D1F2E;
  --accent: #F25C54;
  --player1: #FF5D5D;
  --player2: #7EB8FF;
  --text: #FDF0F1;
  --text-dim: #D6A9AE;
}

body[data-theme="royal"] .nav-item.active,
body[data-theme="emerald"] .nav-item.active,
body[data-theme="ocean"] .nav-item.active,
body[data-theme="crimson"] .nav-item.active {
  background: rgba(255, 255, 255, 0.06);
}

/* ---- GLASS : verre dépoli (template demandé) ---- */
body[data-theme="glass"] {
  --gold: #F2E9C4;
  --gold-light: #FFF6DC;
  --gold-dark: #C9B458;
  --table-green: #8FE0B4;
  --table-green-dark: #57C98F;
  --felt: #5CB98C;
  --felt-edge: #3E8F68;
  --bg: transparent;
  --bg-2: rgba(255, 255, 255, 0.07);
  --bg-3: rgba(255, 255, 255, 0.11);
  --darker: rgba(5, 7, 15, 0.9);
  --border: rgba(255, 255, 255, 0.14);
  --border-light: rgba(255, 255, 255, 0.18);
  --text: #F4F6FB;
  --text-dim: #A9B4CC;
  --primary: #38BDF8;
  --secondary: #818CF8;
  --accent: #34D399;
  --player1: #FB7185;
  --player2: #60A5FA;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(1100px 800px at 90% 10%, rgba(129, 140, 248, 0.20), transparent 60%),
    radial-gradient(1400px 900px at 50% 115%, rgba(52, 211, 153, 0.16), transparent 60%),
    linear-gradient(135deg, #0B1023 0%, #141B3D 45%, #0D1226 100%);
  background-attachment: fixed;
}
body[data-theme="glass"].login-body {
  background:
    radial-gradient(1200px 800px at 15% 0%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(1100px 800px at 90% 10%, rgba(129, 140, 248, 0.24), transparent 60%),
    radial-gradient(1400px 900px at 50% 115%, rgba(52, 211, 153, 0.18), transparent 60%),
    linear-gradient(135deg, #0B1023 0%, #141B3D 45%, #0D1226 100%);
  background-attachment: fixed;
}
body[data-theme="glass"] .main { background: transparent; }
body[data-theme="glass"] .sidebar {
  background: rgba(10, 14, 30, 0.55);
  backdrop-filter: blur(24px) saturate(150%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
body[data-theme="glass"] .card,
body[data-theme="glass"] .stat-card,
body[data-theme="glass"] .player-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}
body[data-theme="glass"] .wait-item,
body[data-theme="glass"] .field-input,
body[data-theme="glass"] .app-status-chip {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px) saturate(140%);
}
body[data-theme="glass"] .wait-item.next {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.55);
}
body[data-theme="glass"] .login-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
body[data-theme="glass"] .nav-item:hover { background: rgba(255, 255, 255, 0.10); }
body[data-theme="glass"] .nav-item.active {
  background: rgba(242, 233, 196, 0.12);
  border-color: rgba(242, 233, 196, 0.35);
}
body[data-theme="glass"] .match-board {
  background: radial-gradient(ellipse at center, rgba(14, 122, 68, 0.9) 0%, rgba(10, 90, 51, 0.95) 100%);
}
body[data-theme="glass"] .table tbody tr:hover { background: rgba(255, 255, 255, 0.06); }

/* =====================================================================
   FACTURE (STATISTIQUES) — style moderne façon « fatoura »
   ===================================================================== */
.invoice {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.invoice-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 26px;
  border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}
.invoice-brand { display: flex; align-items: center; gap: 14px; }
.invoice-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
}
.invoice-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.invoice-meta { text-align: right; font-size: 12px; color: var(--text-dim); line-height: 1.7; }
.invoice-meta b { color: var(--text); }

.invoice-period { display: flex; gap: 8px; flex-wrap: wrap; padding: 18px 26px 0; }
.period-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-3);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}
.period-btn:hover { color: var(--text); border-color: var(--text-dim); }
.period-btn.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #14171c;
  border-color: transparent;
}

.invoice-table { width: 100%; border-collapse: collapse; }
.invoice-table th,
.invoice-table td { padding: 13px 26px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.invoice-table th {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
}
.invoice-table tbody tr:hover { background: var(--border-light); }
.invoice-table tfoot td {
  font-weight: 900;
  border-top: 2px solid var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.06);
}
.invoice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.invoice-stamp {
  border: 2px solid var(--gold);
  color: var(--gold);
  border-radius: 8px;
  padding: 5px 12px;
  font-weight: 900;
  letter-spacing: 3px;
  transform: rotate(-4deg);
  opacity: 0.9;
}
.invoice-empty { text-align: center; padding: 46px 20px; color: var(--text-dim); }
.invoice-empty .big { font-size: 42px; margin-bottom: 8px; }

/* ---- Cartes "liens" du hub statistiques ---- */
a.stat-card { text-decoration: none; transition: transform 0.15s, border-color 0.15s; }
a.stat-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.stat-card .stat-arrow { margin-left: auto; color: var(--gold); font-size: 18px; }

/* ---- Sélecteur de thème (paramètres) ---- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.theme-option { position: relative; cursor: pointer; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-preview {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 58px;
  border-radius: 11px;
  border: 2px solid var(--border);
  background: var(--bg-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  padding-bottom: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.theme-preview .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.theme-option input:checked + .theme-preview {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
  color: var(--text);
}
.theme-preview.pv-classic { background: linear-gradient(150deg, #202327 0%, #17191c 100%); }
.theme-preview.pv-glass   { background: linear-gradient(150deg, #1b2a5e 0%, #0b1023 60%, #141b3d 100%); }
.theme-preview.pv-royal   { background: linear-gradient(150deg, #1d1a22 0%, #0e0c10 100%); }
.theme-preview.pv-emerald { background: linear-gradient(150deg, #10301f 0%, #07190f 100%); }
.theme-preview.pv-ocean   { background: linear-gradient(150deg, #0c2233 0%, #040c13 100%); }
.theme-preview.pv-crimson { background: linear-gradient(150deg, #231014 0%, #0f0507 100%); }
.theme-preview.pv-glass .dot   { background: #7dd3fc; }
.theme-preview.pv-royal .dot   { background: #e6c15c; }
.theme-preview.pv-emerald .dot { background: #66bb6a; }
.theme-preview.pv-ocean .dot   { background: #22d3ee; }
.theme-preview.pv-crimson .dot { background: #f25c54; }

/* ---- Note importante (règle 24h/10h) ---- */
.alert-note {
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold);
}
.alert-note .note-tag {
  display: inline-block;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 2px 8px;
  margin-right: 8px;
}

/* ---- Recherche inline ---- */
.search-box { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.search-box .field-input { flex: 1; min-width: 220px; }
/* ---- Dossier Mois & jours (stats_monthly.php) ---- */
.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.day-folder {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 12px;
  text-decoration: none;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--border-light), transparent);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.day-folder:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.day-folder.has {
  background: linear-gradient(180deg, rgba(212,175,55,.14), rgba(212,175,55,.03));
  border-color: rgba(212,175,55,.45);
}
.day-folder.empty {
  opacity: .5;
}
.day-folder.today { border-color: var(--accent); }
.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.day-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.day-folder.has .day-num { color: var(--gold); }
.today-chip {
  font-size: 9px;
  font-weight: 900;
  color: #05140a;
  background: var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
  letter-spacing: 1px;
}
.day-week {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.day-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(212,175,55,.12);
  align-self: flex-start;
}
.day-count.muted { color: var(--text-dim); background: transparent; }
.win-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--border-light);
  margin-bottom: 8px;
}
@media (max-width: 640px) {
  .month-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .day-num { font-size: 20px; }
}

/* =====================================================================
   TABLEAU DE BORD — DESIGN "GLASS AURORA" (v1.2.3)
   Classes préfixées .dash- pour ne pas entrer en conflit avec l'existant.
   ===================================================================== */
.dash-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dash-title { font-size: 24px; font-weight: 900; }
.dash-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.dash-head-right { display: flex; align-items: center; gap: 10px; }

/* ---- Statistiques rapides ---- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.dash-stat {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.dash-stat:hover { transform: translateY(-3px); border-color: rgba(212, 175, 55, 0.5); }
.dash-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 130px at 100% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.ds-row { display: flex; align-items: flex-start; justify-content: space-between; }
.ds-ic {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--ibg);
  box-shadow: 0 8px 20px var(--ish);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.ds-v { font-size: 30px; font-weight: 900; color: var(--sc); line-height: 1.1; }
.ds-l { font-size: 12px; color: var(--text-dim); margin-top: 12px; font-weight: 700; letter-spacing: 0.4px; }
.ds-d { font-size: 11px; color: var(--text-dim); opacity: 0.7; margin-top: 3px; }

/* ---- Grid : match + liste d'attente (2 colonnes) ---- */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---- En-tête de carte moderne ---- */
.dash-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-card-title {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--gold);
  flex: 1;
}

/* ---- Barre live (chrono + infos match) ---- */
.dash-livebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dash-clock {
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  color: var(--gold-light);
  padding: 6px 13px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 20px;
}
.dash-turnchip {
  font-size: 12px; color: var(--text-dim);
  padding: 6px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 20px;
}
.dash-turnchip b { color: var(--text); }

/* ---- Tableau de match glass ---- */
.dash-board {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  background: radial-gradient(ellipse at center, #0e7a44 0%, #085431 90%);
  border: 1px solid #1a9c5a;
  border-radius: 20px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
.dash-player {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  transition: box-shadow 0.25s, border-color 0.25s, background 0.25s;
}
.dash-player-right { justify-content: flex-end; text-align: right; }
.dash-player.turn-on {
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3), 0 0 26px rgba(212, 175, 55, 0.12);
}
.dash-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 22px; color: #fff;
  object-fit: cover;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}
.dash-avatar-red { background: radial-gradient(circle at 30% 25%, #ef5350, #c62828); }
.dash-avatar-blue { background: radial-gradient(circle at 30% 25%, #42a5f5, #0d47a1); }
.dash-player.turn-on .dash-avatar { box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(212, 175, 55, 0.5); }
.dash-player-info { min-width: 0; }
.dash-player-name { font-size: 16px; font-weight: 800; color: #fff; }
.dash-player-break { font-size: 11px; color: rgba(255, 255, 255, 0.7); margin-top: 2px; min-height: 16px; }
.dash-player-break b { color: var(--gold-light); }
.dash-balls { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.dash-score { font-size: 34px; font-weight: 900; color: #fff; line-height: 1; margin-top: 5px; }
.dash-pts { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, 0.65); }
.dash-frames { font-size: 11px; color: #c8e6c9; margin-top: 2px; }

.dash-center { flex: 0 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dash-frames-pill {
  font-size: 30px; font-weight: 900; color: #14171c;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 16px; padding: 8px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.dash-vs { font-size: 10px; font-weight: 900; letter-spacing: 2px; color: rgba(255, 255, 255, 0.5); }

.dash-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.dash-meta span { font-size: 12px; color: var(--text-dim); }
.dash-meta b { color: var(--text); font-weight: 700; }

/* ---- Liste d'attente glasse ---- */
.dash-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px; height: 26px;
  padding: 0 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 800;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.15);
}
.dash-wrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 15px;
  margin-bottom: 9px;
  background: var(--bg-3);
  border: 1px solid var(--border-light);
}
.dash-wrow.next { background: rgba(212, 175, 55, 0.08); border-color: rgba(212, 175, 55, 0.4); }
.dash-wrank {
  width: 26px; height: 26px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 11px;
  background: var(--bg-2); color: var(--gold);
  border: 1px solid var(--border);
}
.dash-wrow.next .dash-wrank {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #14171c; border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}
.dash-wav {
  width: 34px; height: 34px; border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
}
.dash-wav-ph { background: radial-gradient(circle at 30% 25%, var(--gold-light), var(--gold-dark)); color: #14171c; }
.dash-wname { flex: 1; font-weight: 700; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-wsrc { font-size: 10px; color: var(--text-dim); background: var(--bg-2); padding: 3px 9px; border-radius: 8px; flex: 0 0 auto; }

/* ---- Sections ---- */
.dash-sect-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dash-sect-title { font-size: 17px; font-weight: 800; }

/* ---- Grille des tables ---- */
.dash-tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.dash-table {
  background: var(--bg-3);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.dash-table:hover { transform: translateY(-3px); }
.dash-table.tc-live {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2), 0 12px 30px rgba(0, 0, 0, 0.35);
}
.dt-head { display: flex; align-items: center; gap: 8px; }
.dt-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dt-dot.on { background: var(--accent); box-shadow: 0 0 7px rgba(124, 179, 66, 0.6); }
.dt-dot.off { background: #f0593f; }
.dt-name { font-weight: 800; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-rename { flex: 0 0 auto; }
.dt-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
}
.dt-tag.live { color: #ff8a80; background: rgba(229, 57, 53, 0.14); border: 1px solid rgba(229, 57, 53, 0.4); }
.dt-tag.free { color: #90caf9; background: rgba(30, 136, 229, 0.13); border: 1px solid rgba(30, 136, 229, 0.35); }
.dt-tag.off { color: var(--text-dim); background: rgba(127, 127, 127, 0.12); border: 1px solid var(--border); }
.dt-live-dot { width: 6px; height: 6px; border-radius: 50%; background: #ff5252; animation: blink 1s infinite; }

.dt-board {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, #0e7a44 0%, #085431 90%);
  border: 1px solid #1a9c5a;
}
.dt-player { flex: 1; display: flex; align-items: center; gap: 9px; }
.dt-player-r { justify-content: flex-end; }
.dt-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  flex: 0 0 auto; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff;
}
.dt-av-red { background: radial-gradient(circle at 30% 25%, #ef5350, #c62828); }
.dt-av-blue { background: radial-gradient(circle at 30% 25%, #42a5f5, #0d47a1); }
.dt-pinfo { min-width: 0; }
.dt-pname { font-size: 12px; font-weight: 800; color: #fff; }
.dt-pbreak { font-size: 9px; color: rgba(255, 255, 255, 0.6); }
.dt-pscore { font-size: 20px; font-weight: 900; color: #fff; line-height: 1.1; }
.dt-mid { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dt-frames {
  font-size: 15px; font-weight: 900; color: #14171c;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 10px; padding: 3px 11px; white-space: nowrap;
}
.dt-ball { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dt-turn { font-size: 9px; color: var(--gold-light); font-weight: 700; white-space: nowrap; }
.dt-empty { text-align: center; color: var(--text-dim); font-size: 12px; padding: 16px 8px; }

.dt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  font-size: 13px;
  color: var(--text-dim);
}
.dt-foot b { color: var(--gold); }
.dt-go {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 800;
  color: #90caf9;
  background: rgba(30, 136, 229, 0.12);
  border: 1px solid rgba(30, 136, 229, 0.3);
  padding: 6px 13px;
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.15s;
}
.dt-go:hover { filter: brightness(1.2); text-decoration: none; }

/* ---- Variante "glass" : cartes translucides + blur ---- */
body[data-theme="glass"] .dash-stat,
body[data-theme="glass"] .dash-match-card,
body[data-theme="glass"] .dash-wait-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px) saturate(150%);
}
body[data-theme="glass"] .dash-table { background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(14px) saturate(150%); }
body[data-theme="glass"] .dash-wrow { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.16); }
body[data-theme="glass"] .dash-wrow.next { background: rgba(212, 175, 55, 0.14); border-color: rgba(212, 175, 55, 0.45); }
body[data-theme="glass"] .dt-turnchip { background: rgba(255, 255, 255, 0.08); }
body[data-theme="glass"] .dash-board {
  background: radial-gradient(ellipse at center, rgba(14, 122, 68, 0.9) 0%, rgba(8, 84, 49, 0.95) 100%);
}
body[data-theme="glass"] .dash-sub { color: #a9b4cc; }

/* =====================================================================
   DESIGN OFFICIEL — MOCKUP "GLASS AURORA" (design2_glass.html)
   Reproduit fidèlement l'image choisie : cadre vitré centré, topbar,
   tuiles MES MODULES, stats, scoreboard, file d'attente, tables.
   ===================================================================== */

/* ---- Cadre application (le "verre") ---- */
body {
  padding: 0;
}
.app {
  width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #f2d57e, #9c7a1e);
  color: #14171c;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(242, 201, 76, 0.4);
  flex: 0 0 auto;
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: 0.4px; white-space: nowrap; }
.brand-sub { font-size: 9px; letter-spacing: 2.4px; color: #f2d57e; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px; font-weight: 700;
}
.chip .d { width: 8px; height: 8px; border-radius: 50%; background: #9aa4b0; }
.chip.connected { border-color: rgba(52, 211, 153, 0.4); color: #c8f5e2; }
.chip.connected .d { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.9); }
.chip.disconnected { border-color: rgba(244, 63, 94, 0.4); color: #ffb3b3; }
.chip.disconnected .d { background: #f43f5e; }

.user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.uav {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #f2d57e, #9c7a1e);
  color: #14171c;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px;
  overflow: hidden; flex: 0 0 auto;
}
.u-nm { font-size: 11px; font-weight: 700; white-space: nowrap; }
.u-rl { font-size: 9px; color: #f2d57e; white-space: nowrap; }

/* ---- NAV : tuiles MES MODULES (identiques à l'original 170px) ---- */
.nav-wrap { padding: 16px 26px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.modules-label {
  font-size: 11px;
  letter-spacing: 2.2px;
  color: #a9b4cc;
  margin-bottom: 12px;
  font-weight: 700;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
  background: transparent;
  padding: 0;
  border-bottom: none;
  max-width: none;
}
.nav-tile {
  width: 170px;
  padding: 14px 14px 13px;
  border-radius: 19px;
  cursor: pointer;
  text-decoration: none;
  color: #eef1f6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.nav-tile:hover { transform: translateY(-3px); border-color: rgba(242, 201, 76, 0.5); text-decoration: none; }
.nav-tile.active {
  border-color: rgba(242, 201, 76, 0.5);
  background: linear-gradient(160deg, rgba(242, 201, 76, 0.16), rgba(242, 201, 76, 0.04));
  box-shadow: 0 0 0 1px rgba(242, 201, 76, 0.4), 0 12px 26px rgba(0, 0, 0, 0.35);
}
.tile-icon {
  width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; font-size: 21px;
  background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(255, 255, 255, 0.12);
}
.tile-txt { display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: 13px; font-weight: 700; line-height: 1.15; }
.tile-sub { font-size: 11px; color: #a9b4cc; }

/* ---- CONTENU ---- */
.main {
  flex: 1;
  padding: 24px 26px;
  background: transparent;
}
.body { width: 100%; }
.page-title { font-size: 22px; font-weight: 900; }
.page-sub { font-size: 12px; color: #a9b4cc; margin-top: 3px; }

/* ---- STATS (4 cartes) ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.stat {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(12px);
}
.stat::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(220px 120px at 100% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.stat .row { display: flex; align-items: center; justify-content: space-between; }
.stat .ic {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--ibg);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  box-shadow: 0 8px 20px var(--ish);
}
.stat .v { font-size: 28px; font-weight: 900; color: var(--c); line-height: 1; }
.stat .l { font-size: 11px; color: #a9b4cc; margin-top: 12px; font-weight: 700; letter-spacing: 0.4px; }
.stat .d { font-size: 10px; color: #7d8aa8; margin-top: 3px; }

/* ---- GRID : match + attente ---- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; margin: 20px 0 0; align-items: start; }
.grid .card { margin-top: 0; }
.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: none;
}
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-t {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: #f2d57e; flex: 1;
}
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 1px; padding: 5px 13px; border-radius: 20px; }
.pill.live { color: #ff8a80; background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(244, 63, 94, 0.4); }
.pill.live .d { width: 7px; height: 7px; border-radius: 50%; background: #f43f5e; animation: blink 1s infinite; }
.clock {
  font-size: 11px; font-weight: 800; letter-spacing: 0.8px; color: #f2d57e;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(242, 201, 76, 0.12); border: 1px solid rgba(242, 201, 76, 0.3);
}

/* ---- SCOREBOARD ---- */
.board { border-radius: 18px; overflow: hidden; border: 1px solid rgba(143, 224, 180, 0.25); }
.b-top {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px;
  background: linear-gradient(90deg, rgba(10, 225, 139, 0.13), rgba(25, 195, 125, 0.20), rgba(10, 225, 139, 0.13));
  font-size: 10px; letter-spacing: 2px; color: #8fe0b4; font-weight: 800;
}
.b-mid { display: flex; align-items: stretch; background: linear-gradient(180deg, #0e7a44 0%, #0a5a33 100%); }
.pl { flex: 1; display: flex; align-items: center; gap: 14px; padding: 18px; }
.pl.left { justify-content: flex-start; }
.pl.right { justify-content: flex-end; flex-direction: row-reverse; }
.av {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; color: #fff;
  object-fit: cover; flex: 0 0 auto;
}
.pl.active .av { box-shadow: 0 0 0 3px #f2d57e, 0 0 22px rgba(242, 201, 76, 0.5); }
.pl .nm { font-size: 16px; font-weight: 800; color: #fff; }
.pl.right .nm, .pl.right .brk { text-align: right; }
.pl .brk { font-size: 11px; color: #b6c2d9; margin-top: 2px; }
.pl .brk b { color: #f2d57e; }
.pl .sc { font-size: 34px; font-weight: 900; margin-top: 2px; color: #fff; line-height: 1.1; }
.vs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; background: rgba(255, 255, 255, 0.06); flex: 0 0 auto; }
.vs .fr {
  font-size: 26px; font-weight: 900;
  background: linear-gradient(135deg, #f2d57e, #c9b458);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.vs .mn { font-size: 9px; color: #a9b4cc; letter-spacing: 1px; text-transform: uppercase; }
.b-balls { display: flex; gap: 4px; margin-top: 6px; justify-content: flex-end; flex-wrap: wrap; }
.ball { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.b-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  font-size: 11px; color: #a9b4cc;
  background: rgba(255, 255, 255, 0.03);
}
.b-meta b { color: #f2d57e; }

/* ---- FILE D'ATTENTE ---- */
.ct { font-size: 11px; font-weight: 800; color: #f2d57e; background: rgba(242, 201, 76, 0.14); padding: 3px 11px; border-radius: 16px; flex: 0 0 auto; }
.w { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 15px; margin-bottom: 9px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.09); }
.w.next { background: rgba(242, 201, 76, 0.10); border-color: rgba(242, 201, 76, 0.4); }
.w .rk {
  width: 25px; height: 25px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #f2d57e;
  flex: 0 0 auto;
}
.w.next .rk { background: linear-gradient(135deg, #f2d57e, #9c7a1e); color: #14171c; box-shadow: 0 0 10px rgba(242, 201, 76, 0.4); }
.w .av { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; object-fit: cover; }
.w .nm { flex: 1; font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w .src { font-size: 10px; color: #a9b4cc; background: rgba(255, 255, 255, 0.08); padding: 2px 8px; border-radius: 7px; flex: 0 0 auto; }

/* ---- SECTION TABLES ---- */
.sect { margin-top: 22px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sect-t { font-size: 16px; font-weight: 900; }
.sect .ct { font-size: 10px; font-weight: 800; color: #f2d57e; background: rgba(242, 201, 76, 0.14); padding: 3px 10px; border-radius: 20px; }
.tables { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tc {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 15px;
  transition: transform 0.15s, border-color 0.15s;
  backdrop-filter: blur(12px);
}
.tc:hover { transform: translateY(-3px); border-color: rgba(242, 201, 76, 0.4); }
.tc.live { border-color: rgba(242, 201, 76, 0.45); box-shadow: 0 0 0 1px rgba(242, 201, 76, 0.2); }
.tc-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tc-h .on { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.tc-h .on.g { background: #34d399; box-shadow: 0 0 7px #34d399; }
.tc-h .on.r { background: #f43f5e; }
.tc-nm { font-weight: 800; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 9px; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: 0.5px; flex: 0 0 auto; }
.tag.g { color: #34d399; background: rgba(52, 211, 153, 0.13); border: 1px solid rgba(52, 211, 153, 0.3); }
.tag.y { color: #ffd166; background: rgba(255, 209, 102, 0.13); border: 1px solid rgba(255, 209, 102, 0.3); }
.tag.r { color: #ff8a80; background: rgba(244, 63, 94, 0.13); border: 1px solid rgba(244, 63, 94, 0.3); }
.mb { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px; border-radius: 13px; background: linear-gradient(160deg, rgba(14, 122, 68, 0.85), rgba(8, 84, 49, 0.9)); }
.mb .pl2 { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.mb .pl2.r { justify-content: flex-end; }
.mb .av { width: 26px; height: 26px; border-radius: 50%; font-size: 11px; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; object-fit: cover; }
.mb .nm { font-size: 11px; font-weight: 700; color: #eafff3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb .sc { font-size: 15px; font-weight: 900; color: #fff; }
.mb .mid { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.mb .mid .frames { font-size: 11px; font-weight: 900; color: #f2d57e; white-space: nowrap; }
.tc-empty { text-align: center; color: #8b96b2; font-size: 11px; padding: 10px 6px; }
.tc-f { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; font-size: 11px; color: #a9b4cc; }
.tc-f b { color: #f2d57e; }
.tc-f .go { color: #8fb7f7; font-weight: 800; }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .tables { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .main { padding: 16px; }
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .nav-wrap { padding: 14px 16px 16px; }
  .body { padding: 0; }
}
@media (max-width: 640px) {
  body { padding: 0; }
  .app { min-height: 100vh; }
  .nav { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-tile { flex: 0 0 auto; width: auto; min-width: 124px; border-radius: 15px; padding: 12px 14px; flex-direction: row; align-items: center; gap: 10px; }
  .tile-sub { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .tables { grid-template-columns: 1fr; }
  .topbar-right .user div:last-child { display: none; }
  .pl { padding: 12px; }
  .pl .av { width: 44px; height: 44px; font-size: 16px; }
  .pl .sc { font-size: 26px; }
  .vs .fr { font-size: 20px; }
}
