:root {
  --bg: #0b0f0d;
  --bg-elevated: #121815;
  --bg-card: #161d19;
  --bg-row-alt: #12211a;
  --border: #26302b;
  --text: #eef2ef;
  --text-dim: #9aa79f;
  --text-faint: #6b7871;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.12);
  --accent2: #818cf8;
  --accent2-soft: rgba(129, 140, 248, 0.12);
  --amber: #f59e0b;
  --red: #f87171;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --frozen-widths: 64px 84px 176px 68px 56px 76px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }

/* ---------- top bar ---------- */
header.board-top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-elevated);
  position: sticky; top: 0; z-index: 30;
}
header.board-top .left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
header.board-top .title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.badge-beta { background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--accent); }
.data-date { color: var(--text-dim); font-size: 0.8rem; }
header.board-top .right { display: flex; align-items: center; gap: 16px; font-size: 0.82rem; }
header.board-top .right a { color: var(--text-dim); }
.private-note { color: var(--amber); font-weight: 600; }

/* ---------- controls ---------- */
.controls { padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.pos-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pos-tab {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.pos-tab.active { background: var(--accent); border-color: var(--accent); color: #06210f; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row select, .filter-row input[type="text"] {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
  padding: 7px 10px; border-radius: 6px; font-size: 0.82rem;
}
.filter-row label { font-size: 0.75rem; color: var(--text-faint); margin-right: 4px; }
.filter-group { display: flex; align-items: center; }
.filter-summary { margin-left: auto; font-size: 0.8rem; color: var(--text-dim); }
.reset-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.8rem; text-decoration: underline; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 0.82rem; color: var(--text-dim); flex-wrap: wrap; }
.pagination button { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination select { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text); padding: 5px 8px; border-radius: 6px; }

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; overflow-y: visible; border-bottom: 1px solid var(--border); }
table.board { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 0.82rem; }
table.board th, table.board td {
  padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border);
}
table.board thead th {
  position: sticky; top: 0; z-index: 5; background: var(--bg-elevated);
  color: var(--text-faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
  cursor: pointer; user-select: none; font-weight: 700;
}
table.board thead th:hover { color: var(--text); }
table.board thead th .arrow { margin-left: 4px; opacity: 0.6; }
table.board tbody tr:nth-child(even) { background: var(--bg-row-alt); }
table.board tbody tr:hover { background: var(--accent-soft); cursor: pointer; }

/* colonnes figees (Rang, Mouvement, Joueur, Equipe, Pos., Role) */
table.board th.frozen, table.board td.frozen {
  position: sticky; z-index: 4; background: var(--bg-elevated);
}
table.board tbody td.frozen { background: var(--bg); }
table.board tbody tr:nth-child(even) td.frozen { background: var(--bg-row-alt); }
table.board tbody tr:hover td.frozen { background: #1c2a20; }
table.board td.frozen, table.board th.frozen { box-shadow: 2px 0 0 var(--border); }

.joueur-cell { font-weight: 600; }
.mvt-up { color: var(--accent); font-weight: 700; }
.mvt-down { color: var(--red); font-weight: 700; }
.mvt-flat, .mvt-new { color: var(--text-faint); font-weight: 700; }
.mvt-new { color: #60a5fa; }

.grade-Ap, .grade-A { color: var(--accent); font-weight: 700; }
.grade-Bp, .grade-B { color: #86efac; font-weight: 700; }
.grade-Cp, .grade-C { color: var(--amber); font-weight: 700; }
.grade-D { color: var(--red); font-weight: 700; }
.grade-E { color: #dc2626; font-weight: 700; }
.delta-pos { color: var(--accent); font-weight: 600; }
.delta-neg { color: var(--red); font-weight: 600; }
.delta-flat { color: var(--text-faint); }
.cal-fav { color: var(--accent); font-weight: 600; }
.cal-dif { color: var(--red); font-weight: 600; }
.cal-neu { color: var(--text-faint); }
.buzz-Positif { color: var(--accent); font-weight: 600; }
.buzz-Negatif { color: var(--red); font-weight: 600; }
.buzz-Asurveiller { color: var(--amber); font-weight: 600; }
.buzz-Discret { color: var(--text-faint); }

td.lecture-cell { white-space: normal; max-width: 340px; color: var(--text-dim); border-left: 2px solid var(--accent2-soft); }

/* ---------- modal fiche joueur ---------- */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 50;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; max-width: 640px; width: 100%; padding: 28px; }
.modal h2 { font-family: var(--font-display); margin: 0 0 4px; }
.modal .sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 18px; }
.modal .close { float: right; background: none; border: none; color: var(--text-faint); font-size: 1.3rem; cursor: pointer; }
.modal .grades { display: flex; gap: 24px; margin-bottom: 18px; }
.modal .grades div { font-size: 0.85rem; color: var(--text-dim); }
.modal .grades span { font-size: 1.1rem; font-weight: 700; }
.modal-section { margin-bottom: 16px; }
.modal-section h4 { font-family: var(--font-display); font-size: 0.85rem; margin: 0 0 6px; color: var(--accent2); }
.modal-section p { margin: 0; color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; }

/* ---------- gate ---------- */
.gate-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 40px; max-width: 520px; width: 100%; }
.gate-card h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.gate-card .sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 24px; }
.gate-card .terms-box { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 16px; max-height: 220px; overflow-y: auto; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 20px; }
.gate-card label.accept { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--text); margin-bottom: 20px; cursor: pointer; }
.gate-card input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.gate-card button.access {
  width: 100%; background: var(--accent); color: #06210f; font-weight: 700; border: none;
  padding: 12px; border-radius: 8px; font-size: 0.95rem; cursor: pointer;
}
.gate-card button.access:disabled { opacity: 0.35; cursor: not-allowed; }
.gate-card .beta-note { margin-top: 18px; font-size: 0.78rem; color: var(--text-faint); }

@media (max-width: 720px) {
  header.board-top .right { display: none; }
  .filter-summary { margin-left: 0; width: 100%; }
}

/* ---------- conditions.html (contenu partage avec le site public) ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
header.site { position: sticky; top: 0; z-index: 20; background: rgba(11,15,13,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
header.site .bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; max-width: 760px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
nav.site-nav { display: flex; gap: 20px; }
nav.site-nav a { color: var(--text-dim); font-size: 0.88rem; }
.doc { padding: 56px 0 96px; }
.doc h1 { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 4px; }
.doc .meta { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 32px; }
.doc .callout { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; padding: 16px 18px; margin: 24px 0; font-size: 0.92rem; }
.doc h2 { font-family: var(--font-display); font-size: 1.1rem; margin-top: 34px; }
.doc ul { color: var(--text-dim); }
.doc li { margin-bottom: 8px; }
.doc p { color: var(--text-dim); }
footer.site { border-top: 1px solid var(--border); padding: 32px 0; }
footer.site .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; max-width: 760px; }
footer.site .disclaimer { color: var(--text-faint); font-size: 0.8rem; }
footer.site .links a { color: var(--text-dim); font-size: 0.85rem; }
