/* ============================================================
   PRONO-L1 — Feuille de styles principale
   Style.css — Mode sombre par défaut, mode clair disponible
   Palette : fond sombre #0D1117, vert #00A550, or #F5A623
   ============================================================ */

/* ── TOKENS MODE SOMBRE (défaut) ── */
:root {
  /* Palette principale */
  --vert:       #00A550;
  --vert-f:     #007A3A;
  --vert-pale:  #00A55020;
  --or:         #F5A623;
  --or-pale:    #F5A62320;
  --rouge:      #E03030;
  --rouge-pale: #E0303020;

  /* Fonds */
  --bg:         #0D1117;
  --bg2:        #161B22;
  --bg3:        #1F2937;
  --bg4:        #263040;

  /* Bordures & textes */
  --bord:       #2D3748;
  --bord-f:     #3D4A5C;
  --txt:        #E8EDF2;
  --txt2:       #8B98A8;
  --txt3:       #4A5568;
  --blanc:      #FFFFFF;

  /* Qualifications */
  --ldc:        #3B82F6;
  --europa:     #F59E0B;
  --conference: #84CC16;
  --barrage:    #F97316;
  --relégation: #E03030;

  /* Forme matchs */
  --forme-w:    #00A550;
  --forme-d:    #F5A623;
  --forme-l:    #E03030;

  /* Badges résultats */
  --badge-exact:   #00A550;
  --badge-bon:     #F5A623;
  --badge-mauvais: #E03030;

  /* Dimensions */
  --radius:     10px;
  --radius-s:   6px;
  --radius-xs:  4px;
  --header-h:   58px;
  --nav-h:      46px;
  --subnav-h:   38px;
  --shadow:     0 2px 8px rgba(0,0,0,.4);
  --shadow-f:   0 4px 16px rgba(0,0,0,.6);
}

/* ── TOKENS MODE CLAIR ── */
[data-theme="light"] {
  --bg:         #F0F4F8;
  --bg2:        #FFFFFF;
  --bg3:        #E8EDF2;
  --bg4:        #D8E2EE;
  --bord:       #CBD5E0;
  --bord-f:     #A0AEC0;
  --txt:        #1A202C;
  --txt2:       #4A5568;
  --txt3:       #A0AEC0;
  --vert-pale:  #00A55015;
  --or-pale:    #F5A62315;
  --rouge-pale: #E0303015;
  --shadow:     0 2px 8px rgba(0,0,0,.1);
  --shadow-f:   0 4px 16px rgba(0,0,0,.15);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  transition: background .3s, color .3s;
  line-height: 1.5;
}

a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── SCROLLBAR (webkit) ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bord-f); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt3); }

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--bg2);
  border-bottom: 2px solid var(--vert);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow);
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--blanc);
  line-height: 1.2;
}
.logo span { color: var(--vert); }
.logo small {
  font-size: .62rem;
  font-weight: 400;
  color: var(--txt2);
  display: block;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: .72rem;
}
.header-links a {
  color: var(--txt2);
  transition: color .2s;
  white-space: nowrap;
}
.header-links a:hover { color: var(--vert); text-decoration: none; }

.btn-theme {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt2);
  padding: 5px 7px;
  border-radius: var(--radius-s);
  font-size: .72rem;
  transition: all .2s;
  white-space: nowrap;
}
.btn-theme:hover { border-color: var(--vert); color: var(--vert); }

@media (max-width: 480px) {
  .btn-theme .btn-theme-texte { display: none; }
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--vert);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
  position: relative;
}
.avatar:hover { background: var(--vert-f); }

/* ============================================================
   NAVIGATION PRINCIPALE
   ============================================================ */
nav#main-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--bord);
  display: flex;
  gap: 2px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
nav#main-nav::-webkit-scrollbar { display: none; }

nav#main-nav button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--txt2);
  padding: 0 16px;
  height: var(--nav-h);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
nav#main-nav button:hover { color: var(--txt); }
nav#main-nav button.active {
  color: var(--vert);
  border-bottom-color: var(--vert);
  font-weight: 600;
}

/* ── SOUS-ONGLETS — resserrés ── */
#subtabs {
  background: var(--bg3);
  border-bottom: 1px solid var(--bord);
  display: flex;
  gap: 0;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
#subtabs::-webkit-scrollbar { display: none; }
#subtabs:empty { display: none; }

#subtabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--txt2);
  padding: 0 8px;
  height: var(--subnav-h);
  font-size: .74rem;
  white-space: nowrap;
  transition: all .2s;
}
#subtabs button:hover { color: var(--txt); }
#subtabs button.active { color: var(--or); border-bottom-color: var(--or); font-weight:600; }

/* ── GRILLE 18×18 avec logos ── */
.grille-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  margin: 0 auto 2px;
}
.grille-th-dom {
  text-align: left;
  white-space: nowrap;
  min-width: 120px;
}
.grille-nom-dom { font-size: .72rem; font-weight: 600; }
.grille-code-dom { display: none; font-size: .7rem; color: var(--txt2); }
.grille-code-ext { font-size: .65rem; color: var(--txt2); }

@media (max-width: 640px) {
  .grille-nom-dom { display: none; }
  .grille-code-dom { display: inline; }
  .grille-th-dom { min-width: 50px; }
  .grille-logo { width: 14px; height: 14px; }
}

/* ============================================================
   CONTENU PRINCIPAL
   ============================================================ */
main {
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.hidden { display: none !important; }

/* ── TITRES DE SECTION ── */
.section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--bord);
}

/* ── NOTE MAQUETTE / INFO ── */
.note-info {
  background: var(--or-pale);
  border: 1px dashed var(--or);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--or);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   JOURNÉE — EN-TÊTE ET NAVIGATION
   ============================================================ */
.journee-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 56px;
}

.journee-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.journee-nav button {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-s);
  font-size: .9rem;
  transition: all .2s;
  flex-shrink: 0;
}
.journee-nav button:hover { border-color: var(--vert); color: var(--vert); }
.journee-nav button:disabled { opacity: .4; cursor: not-allowed; }

.journee-nav select,
.journee-nav-select {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt);
  border-radius: var(--radius-s);
  padding: 0 8px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  height: 34px;
  transition: border-color .2s;
}
.journee-nav select:hover,
.journee-nav-select:hover { border-color: var(--vert); }

.journee-nav-btn {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-s);
  font-size: .9rem;
  transition: all .2s;
  flex-shrink: 0;
  cursor: pointer;
}
.journee-nav-btn:hover { border-color: var(--vert); color: var(--vert); }
.journee-nav-btn:disabled { opacity: .4; cursor: not-allowed; }

.journee-label {
  font-size: 1.05rem;
  font-weight: 700;
}
.journee-date {
  font-size: .75rem;
  color: var(--txt2);
  margin-top: 2px;
  text-align: center;
}

.badge-j {
  background: var(--vert);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}
.badge-j.terminee { background: var(--txt3); }
.badge-j.en-cours { background: var(--rouge); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

/* ============================================================
   CARTE MATCH
   ============================================================ */
.matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px auto 0;
}

@media (max-width: 640px) {
  .matches-grid { grid-template-columns: 1fr; }
}

.match-card {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
  position: relative;
  z-index: 1;
}
.match-card:hover { border-color: var(--bord-f); }
.match-card.expanded { border-color: var(--vert); box-shadow: var(--shadow); }
.match-card.reporte { opacity: .7; border-style: dashed; }

.match-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

/* ── ÉQUIPE ── */
.team {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team.right { flex-direction: row-reverse; }

.team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.team-logo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--txt2);
  flex-shrink: 0;
}

.team-name { font-weight: 700; font-size: 1rem; }
.team.right .team-name { text-align: right; }

/* ── FORME (5 points) ── */
.team-forme {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}
.team.right .team-forme { justify-content: flex-end; }

.forme-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.forme-dot.W { background: var(--forme-w); }
.forme-dot.D { background: var(--forme-d); }
.forme-dot.L { background: var(--forme-l); }

/* ── CENTRE MATCH ── */
.match-center { text-align: center; min-width: 120px; }

.match-heure {
  font-size: .75rem;
  color: var(--txt2);
  margin-bottom: 6px;
}

.match-score-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Inputs pronostic */
.prono-input {
  width: 44px;
  height: 44px;
  background: var(--bg3);
  border: 2px solid var(--bord);
  border-radius: var(--radius-s);
  color: var(--txt);
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color .2s;
  -moz-appearance: textfield;
}
.prono-input::-webkit-outer-spin-button,
.prono-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.prono-input:focus { border-color: var(--vert); }
.prono-input.saisi { border-color: var(--vert); background: var(--vert-pale); }
.prono-input:disabled {
  opacity: .5;
  cursor: not-allowed;
  border-color: var(--bord);
  background: var(--bg3);
}

.score-sep {
  color: var(--txt3);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Score final affiché après match */
.score-final {
  background: var(--bg3);
  border-radius: var(--radius-s);
  padding: 6px 14px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--txt);
}

/* Résultat prono */
.prono-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  font-size: .75rem;
}

.badge-exact   { background: var(--badge-exact);   color: #fff; padding: 2px 7px; border-radius: 20px; font-weight: 700; font-size: .72rem; }
.badge-bon     { background: var(--badge-bon);     color: #000; padding: 2px 7px; border-radius: 20px; font-weight: 700; font-size: .72rem; }
.badge-mauvais { background: var(--badge-mauvais); color: #fff; padding: 2px 7px; border-radius: 20px; font-weight: 700; font-size: .72rem; }
.badge-pts     { color: var(--vert); font-weight: 700; }

.prono-hint { font-size: .7rem; color: var(--txt3); margin-top: 4px; }
.prono-hint.ok { color: var(--vert); }

/* ── DÉTAIL MATCH (panneau dépliable) ── */
.match-detail {
  border-top: 1px solid var(--bord);
  display: none;
}
.match-card.expanded .match-detail { display: block; }

.detail-tabs {
  display: flex;
  padding: 0 18px;
  border-bottom: 1px solid var(--bord);
  overflow-x: auto;
  scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--txt2);
  padding: 0 14px;
  height: 36px;
  font-size: .78rem;
  white-space: nowrap;
  transition: all .2s;
}
.detail-tabs button:hover { color: var(--txt); }
.detail-tabs button.active { color: var(--or); border-bottom-color: var(--or); }

.detail-body { padding: 10px 14px; }
.detail-panel { display: none; }
.detail-panel.active { display: block; }

/* ── H2H ── */
.h2h-list { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.h2h-row {
  display: flex;
  align-items: center;
  font-size: .82rem;
  gap: 0;
  width: 100%;
  justify-content: center;
}
.h2h-date {
  color: var(--txt2);
  font-size: .68rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 8px;
  min-width: 62px;
}
.h2h-nom-dom {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  padding-right: 8px;
  width: 90px;
  flex-shrink: 0;
}
.h2h-score {
  text-align: center;
  font-weight: 700;
  background: var(--bg3);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: .84rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.h2h-score.dom { color: var(--vert); }
.h2h-score.ext { color: var(--rouge); }
.h2h-score.nul { color: var(--or); }
.h2h-nom-ext {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  padding-left: 8px;
  width: 90px;
  flex-shrink: 0;
}

/* ── STATS BARRES ── */
.stat-row { display: flex; flex-direction: column; gap: 10px; }
.stat-item {
  display: grid;
  grid-template-columns: 90px 36px 1fr 1fr 36px 90px;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
}
.stat-label { color: var(--txt2); font-size: .75rem; }
.stat-label.right { text-align: right; }
.stat-val { font-weight: 700; text-align: center; }
.stat-bar-wrap { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.stat-bar { height: 100%; border-radius: 3px; }
.stat-bar.dom { background: var(--vert); }
.stat-bar.ext { background: var(--or); float: right; }

/* ============================================================
   CLASSEMENT ÉQUIPES
   ============================================================ */
.legende {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: .73rem;
  color: var(--txt2);
}
.legende-item { display: flex; align-items: center; gap: 5px; }
.leg-dot { width: 12px; height: 4px; border-radius: 2px; flex-shrink: 0; }

/* Wrapper scrollable horizontal */
.classement-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Indicateur scroll à droite */
.scroll-hint {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 32px;
  background: linear-gradient(to right, transparent, var(--bg2));
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: .9rem;
  color: var(--txt2);
  transition: opacity .3s;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.scroll-hint.hidden { opacity: 0; }

.classement-table {
  border-collapse: collapse;
  font-size: .82rem;
  width: 100%;
}

/* Nom court visible sur PC, code sur mobile */
.club-nom-court { font-weight: 600; }
.club-code-mobile { display: none; font-weight: 600; font-size: .75rem; }
.classement-table th {
  color: var(--txt2);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2px;
  padding: 7px 5px;
  text-align: center;
  border-bottom: 1px solid var(--bord);
  white-space: nowrap;
}
.classement-table th:first-child { text-align: center; width: 28px; }
.classement-table th:nth-child(2) { text-align: left; }

.classement-table td {
  padding: 7px 5px;
  text-align: center;
  border-bottom: 1px solid var(--bord);
  transition: background .15s;
  white-space: nowrap;
}
.classement-table td:first-child { text-align: center; }
.classement-table td:nth-child(2) { text-align: left; }
.classement-table tr:hover td { background: var(--bg3); }

/* Bordures + fond qualifications — stabilo soutenu */
.classement-table tr.qualif-ldc td:first-child    { border-left: 4px solid var(--ldc); }
.classement-table tr.qualif-europa td:first-child  { border-left: 4px solid var(--europa); }
.classement-table tr.qualif-conf td:first-child    { border-left: 4px solid var(--conference); }
.classement-table tr.barrage td:first-child        { border-left: 4px solid var(--barrage); }
.classement-table tr.relegue td:first-child        { border-left: 4px solid var(--relégation); }

/* Stabilo sur le nom du club */
.classement-table tr.qualif-ldc    .nom-qualif { background: rgba(59,130,246,.25);  border-radius:3px; padding:1px 5px; }
.classement-table tr.qualif-europa .nom-qualif { background: rgba(245,158,11,.25); border-radius:3px; padding:1px 5px; }
.classement-table tr.qualif-conf   .nom-qualif { background: rgba(132,204,22,.25); border-radius:3px; padding:1px 5px; }
.classement-table tr.barrage       .nom-qualif { background: rgba(249,115,22,.25); border-radius:3px; padding:1px 5px; }
.classement-table tr.relegue       .nom-qualif { background: rgba(224,48,48,.25);  border-radius:3px; padding:1px 5px; }

.rang { font-weight: 700; color: var(--txt2); width: 24px; }
.rang.top3 { color: var(--or); }

.club-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.club-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.club-nom { font-weight: 600; }

.pts-cell { font-weight: 800; color: var(--vert); font-size: .95rem; }
.pts-rouge { color: var(--rouge); }
.pts-or    { color: var(--or); }

.forme-cell { display: flex; gap: 3px; justify-content: center; }

/* ============================================================
   CLASSEMENT JOUEURS — PODIUM
   ============================================================ */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin: 16px 0 28px;
}
.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.podium-avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}
/* 2e, 1er, 3e dans le DOM — 1er au centre plus grand */
.podium-place:nth-child(1) .podium-avatar { width: 52px; height: 52px; font-size: 1.1rem; background: #9CA3AF; }
.podium-place:nth-child(2) .podium-avatar { width: 64px; height: 64px; font-size: 1.3rem; background: var(--or); }
.podium-place:nth-child(3) .podium-avatar { width: 46px; height: 46px; font-size: .95rem; background: #92400E; }

.podium-bloc {
  border-radius: var(--radius-s) var(--radius-s) 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  width: 80px;
}
.podium-place:nth-child(1) .podium-bloc { height: 60px;  background: #9CA3AF; }
.podium-place:nth-child(2) .podium-bloc { height: 90px;  background: var(--or); }
.podium-place:nth-child(3) .podium-bloc { height: 44px;  background: #92400E; }

.podium-nom { font-size: .78rem; color: var(--txt2); font-weight: 600; }
.podium-pts { font-size: .72rem; color: var(--txt3); }

/* Tableau joueurs */
.joueurs-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.joueurs-table th {
  color: var(--txt2);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid var(--bord);
}
.joueurs-table th:nth-child(2) { text-align: left; }
.joueurs-table td { padding: 10px 10px; text-align: center; border-bottom: 1px solid var(--bord); }
.joueurs-table td:nth-child(2) { text-align: left; }
.joueurs-table tr:hover td { background: var(--bg3); }

.user-cell { display: flex; align-items: center; gap: 8px; }
.user-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .78rem;
  color: #fff;
  flex-shrink: 0;
  background: var(--vert);
}

/* ============================================================
   BONUS
   ============================================================ */
.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.bonus-card {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .2s;
}
.bonus-card:hover { border-color: var(--or); }
.bonus-card.valide { border-color: var(--vert); }
.bonus-card.expire { opacity: .6; }

.bonus-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}
.bonus-label { font-weight: 700; font-size: .92rem; }
.bonus-pts {
  background: var(--or);
  color: #000;
  font-weight: 800;
  font-size: .72rem;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.bonus-select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--bord);
  border-radius: var(--radius-s);
  color: var(--txt);
  padding: 9px 12px;
  font-size: .86rem;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  margin-bottom: 4px;
}
.bonus-select:focus { border-color: var(--or); }
.bonus-select:disabled { opacity: .5; cursor: not-allowed; }

.bonus-deadline {
  font-size: .72rem;
  color: var(--txt3);
  margin-top: 6px;
}
.bonus-deadline.urgent { color: var(--rouge); }

/* ============================================================
   FORMULAIRES & INPUTS GÉNÉRIQUES
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: .82rem; color: var(--txt2); font-weight: 500; }

.input-field {
  background: var(--bg3);
  border: 1px solid var(--bord);
  border-radius: var(--radius-s);
  color: var(--txt);
  padding: 10px 14px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.input-field:focus { border-color: var(--vert); }
.input-field.error { border-color: var(--rouge); }

/* ── BOUTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-s);
  font-size: .88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--vert); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--vert-f); }

.btn-secondary {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--vert); color: var(--vert); }

.btn-danger { background: var(--rouge); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b52424; }

.btn-or { background: var(--or); color: #000; }
.btn-or:hover:not(:disabled) { background: #d4891a; }

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-full { width: 100%; }

/* ── MESSAGES D'ERREUR / SUCCÈS ── */
.msg-erreur {
  background: var(--rouge-pale);
  border: 1px solid var(--rouge);
  border-radius: var(--radius-s);
  color: var(--rouge);
  padding: 10px 14px;
  font-size: .84rem;
  margin-top: 10px;
}
.msg-ok {
  background: var(--vert-pale);
  border: 1px solid var(--vert);
  border-radius: var(--radius-s);
  color: var(--vert);
  padding: 10px 14px;
  font-size: .84rem;
  margin-top: 10px;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-f);
  position: relative;
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-right: 30px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--txt2);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--txt); }

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--txt2);
  font-size: .88rem;
  gap: 10px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bord);
  border-top-color: var(--vert);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--txt2);
  font-size: .88rem;
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ============================================================
   GRILLE COMPLÈTE 18x18
   ============================================================ */
.grille-wrapper { overflow-x: auto; }
.grille-table {
  border-collapse: collapse;
  font-size: .72rem;
  min-width: 700px;
}
.grille-table th, .grille-table td {
  padding: 6px 8px;
  border: 1px solid var(--bord);
  text-align: center;
  white-space: nowrap;
}
.grille-table th {
  background: var(--bg3);
  color: var(--txt2);
  font-weight: 600;
}
.grille-table td.diag { background: var(--bg3); color: var(--txt3); }
.grille-table td.dom  { color: var(--vert); font-weight: 700; }
.grille-table td.nul  { color: var(--or);   font-weight: 700; }
.grille-table td.ext  { color: var(--rouge); font-weight: 700; }

/* ============================================================
   PROGRAMME & RÉSULTATS
   ============================================================ */
.match-liste { display: flex; flex-direction: column; gap: 8px; max-width: 660px; margin: 0 auto; }

.match-ligne {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 140px 160px 62px 160px 28px;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  transition: border-color .2s;
  min-height: 54px;
}
.match-ligne:hover { border-color: var(--bord-f); }

.ml-date {
  color: var(--txt2);
  font-size: .71rem;
  white-space: nowrap;
  overflow: hidden;
}

.ml-equipe-dom {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  min-width: 0;
}
.ml-equipe-dom img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.ml-equipe-dom span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ml-equipe-ext {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-weight: 600;
  min-width: 0;
}
.ml-equipe-ext img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.ml-equipe-ext span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }

.ml-score {
  background: var(--bg3);
  border-radius: var(--radius-xs);
  padding: 4px 5px;
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
}
.ml-j { color: var(--txt3); font-size: .68rem; text-align: right; white-space: nowrap; }

@media (max-width: 640px) {
  .match-ligne {
    grid-template-columns: 90px minmax(0,1fr) 46px minmax(0,1fr) 20px;
    padding: 7px 8px;
    gap: 4px;
    font-size: .75rem;
  }
  .ml-date { font-size: .67rem; white-space: normal; line-height: 1.3; }
  .ml-equipe-dom img,
  .ml-equipe-ext img { width: 14px; height: 14px; }
}

/* ============================================================
   FICHE CLUB
   ============================================================ */
.fiche-club {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.fiche-club-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.fiche-club-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.fiche-club-nom { font-size: 1.2rem; font-weight: 800; }
.fiche-club-info { font-size: .82rem; color: var(--txt2); margin-top: 2px; }

.stats-club-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.stat-club-item {
  background: var(--bg3);
  border-radius: var(--radius-s);
  padding: 10px;
  text-align: center;
}
.stat-club-val { font-size: 1.3rem; font-weight: 800; color: var(--vert); }
.stat-club-lbl { font-size: .7rem; color: var(--txt2); margin-top: 2px; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.admin-card {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 16px;
}
.admin-card-title { font-weight: 700; margin-bottom: 8px; font-size: .9rem; }
.admin-card p { font-size: .8rem; color: var(--txt2); margin-bottom: 12px; }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.txt-vert   { color: var(--vert); }
.txt-or     { color: var(--or); }
.txt-rouge  { color: var(--rouge); }
.txt2       { color: var(--txt2); }
.txt3       { color: var(--txt3); }
.fw700      { font-weight: 700; }
.fw800      { font-weight: 800; }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.mt8        { margin-top: 8px; }
.mt16       { margin-top: 16px; }
.mb8        { margin-bottom: 8px; }
.mb16       { margin-bottom: 16px; }
.gap8       { gap: 8px; }
.flex       { display: flex; }
.flex-center{ display: flex; align-items: center; justify-content: center; }

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 640px) {
  main { padding: 14px 12px; }
  header { padding: 0 14px; }
  nav#main-nav { padding: 0 10px; }
  #subtabs { padding: 0 10px; }

  .match-main {
    grid-template-columns: 1fr auto 1fr;
    padding: 12px 12px;
    gap: 6px;
  }
  .team-name { font-size: .82rem; }
  .prono-input { width: 38px; height: 38px; font-size: 1rem; }

  /* Classement mobile : nom complet, toutes colonnes scrollables */
  .club-nom-court { display: inline; }
  .club-code-mobile { display: none; }
  .classement-table { font-size: .72rem; width: auto; }
  .classement-table th,
  .classement-table td { padding: 5px 3px; }

  .stat-item {
    grid-template-columns: 70px 30px 1fr 1fr 30px 70px;
    font-size: .72rem;
  }

  .bonus-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }

  .modal { padding: 18px; }

  .header-links { display: none; }

  .h2h-row { font-size: .76rem; }
  .h2h-date { min-width: 52px; margin-right: 5px; }
  .h2h-nom-dom, .h2h-nom-ext { max-width: 80px; }
}

/* ============================================================
   ÉCRAN LOGIN — Style CDM 2026 adapté PronoLigue 1
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a3a6b 0%, #0d6efd 50%, #1a3a6b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 160px;
  height: auto;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: .9rem;
  color: #666;
  font-weight: 500;
}

.login-input {
  width: 100%;
  background: #f5f7fa;
  border: 1.5px solid #e0e6ef;
  border-radius: 10px;
  color: #1a202c;
  padding: 12px 16px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  margin-bottom: 12px;
  display: block;
}
.login-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}
.login-input::placeholder { color: #aab; }

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #0d6efd, #1a3a6b);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-bottom: 4px;
  letter-spacing: .3px;
}
.login-btn:hover { opacity: .92; }
.login-btn:active { transform: scale(.98); }

.login-card a {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 500;
}
.login-card a:hover { text-decoration: underline; }

.login-card .msg-erreur {
  background: #fff0f0;
  border-color: #f87171;
  color: #dc2626;
}
.login-card .msg-ok {
  background: #f0fff4;
  border-color: #4ade80;
  color: #16a34a;
}

@media (max-width: 440px) {
  .login-card { padding: 28px 20px 20px; }
  .login-logo { width: 130px; }
}
