/* ============================================================
   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;
  --coeur-bg:   #00A55038;
  --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;
  --coeur-bg:   #00A5502E;
  --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: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  padding: 0 24px;
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow);
}

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

.header-saison-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 20px;
  border-left: 1px solid var(--bord);
  border-right: 1px solid var(--bord);
}
#select-saison-header {
  background: none;
  border: none;
  color: var(--txt);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 0;
  cursor: pointer;
  outline: none;
  text-align: center;
}
#select-saison-header option {
  background: var(--bg2);
  color: var(--txt);
  text-transform: none;
}
#badge-saison-archivee {
  font-size: .6rem;
  font-weight: 700;
  color: var(--or);
  background: var(--or-pale);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: normal;
  text-transform: none;
}

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

.header-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  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); }

/* Texte long/court selon la place disponible (ex: Notifications / Notifs) */
.texte-court { display: none; }
.espace-pc   { display: none; }

@media (max-width: 480px) {
  .btn-theme .btn-theme-texte { display: none; }
  .logo { font-size: 1.05rem; }
  .texte-long  { display: none; }
  .texte-court { display: inline; }
}

@media (max-width: 640px) {
  header { padding: 8px 14px; }
}

@media (min-width: 641px) {
  .espace-pc { display: inline; }
}

.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;
}

/* Petit bouton "Règles" à part, ne prend pas la même largeur que les onglets */
nav#main-nav button.nav-btn-info {
  flex: 0 0 auto;
  padding: 0 10px;
}

/* ── Mobile : boutons carrés icône au-dessus du texte (façon CDM) ── */
@media (max-width: 480px) {
  nav#main-nav {
    padding: 6px 6px;
    gap: 3px;
  }
  nav#main-nav button {
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px;
    height: auto;
    min-width: 0;
    border-bottom: none;
    border-radius: 8px;
  }
  nav#main-nav button.nav-btn-info { flex: 1 1 0; }
  nav#main-nav .nav-icon { font-size: 17px; line-height: 1; }
  nav#main-nav .nav-txt  { font-size: 9.5px; line-height: 1.15; white-space: normal; font-weight: 500; }
  nav#main-nav button.active {
    background: var(--vert-pale);
    border-bottom: none;
    border-radius: 8px;
  }
}

/* ── Contenu de la fenêtre Règlement ── */
.reglement-contenu h4 {
  font-size: .95rem;
  color: var(--vert);
  margin: 16px 0 8px;
}
.reglement-contenu h4:first-child { margin-top: 4px; }
.reglement-contenu ul {
  margin: 0;
  padding-left: 20px;
  color: var(--txt);
  font-size: .88rem;
  line-height: 1.6;
}
.reglement-contenu li { margin-bottom: 4px; }

/* ── Podium > Stats — taux de réussite ── */
.stats-card {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.stats-card-titre {
  font-size: .85rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.stats-ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--bord);
  font-size: .88rem;
}
.stats-ligne:last-child { border-bottom: none; }
.stats-ligne .lbl { color: var(--txt2); }
.stats-ligne .val { font-weight: 700; color: var(--vert); }
.stats-ligne .pct { color: var(--txt2); font-size: .78rem; margin-left: 6px; }

.stats-taux-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.stats-taux-table th {
  text-align: center;
  padding: 8px 6px;
  font-size: .72rem;
  color: var(--txt2);
  border-bottom: 1px solid var(--bord);
  font-weight: 600;
}
.stats-taux-table th:first-child { text-align: left; }
.stats-taux-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--bord); }
.stats-taux-table td:first-child { text-align: left; white-space: nowrap; }
.stats-taux-table tr:hover td { background: var(--bg3); }
.stats-taux-pct { font-weight: 700; }
.stats-taux-sous { font-size: .72rem; color: var(--txt2); }

/* ── Podium > Évolution — graphiques SVG ── */
.evolution-section { margin-bottom: 24px; }
.evolution-titre {
  font-size: .85rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 10px;
}
.evolution-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.evolution-echelle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--txt2);
}
.evolution-echelle select {
  background: var(--bg3);
  border: 1px solid var(--bord);
  color: var(--txt);
  border-radius: var(--radius-s);
  padding: 4px 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}
.evolution-scroll {
  overflow-x: auto;
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 12px 8px;
}
.evolution-scroll svg { display: block; }
.evolution-note {
  font-size: .78rem;
  color: var(--txt2);
  text-align: center;
  margin-top: 4px;
}

/* ── Stats détaillées du match (onglet Stats des cartes) ── */
.buts-match-titre {
  font-size: .76rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.buts-match-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bord);
}
.but-ligne {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: .78rem;
  margin-bottom: 4px;
}
.buts-match-col-droite .but-ligne { flex-direction: row-reverse; text-align: right; }
.but-minute { font-weight: 700; color: var(--or); flex-shrink: 0; }
.but-joueur { color: var(--txt); font-weight: 600; }
.but-assist { color: var(--txt2); font-size: .72rem; }

.stats-match-entetes {
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  font-weight: 700;
  color: var(--txt2);
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--bord);
  margin-bottom: 10px;
}
.stat-ligne { margin-bottom: 11px; }
.stat-ligne:last-child { margin-bottom: 0; }
.stat-valeurs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .78rem;
  margin-bottom: 4px;
}
.stat-val-dom, .stat-val-ext {
  font-weight: 700;
  color: var(--txt);
  min-width: 30px;
  flex-shrink: 0;
}
.stat-val-dom { text-align: left; }
.stat-val-ext { text-align: right; }
.stat-label {
  color: var(--txt2);
  font-size: .72rem;
  text-align: center;
  flex: 1;
}
.stat-barre {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg3);
}
.stat-barre-dom { background: var(--vert); }
.stat-barre-ext { background: var(--ldc); }

/* ── 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;
  align-items: start;
  gap: 10px;
  margin: 4px auto 0;
}

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

/* Si le nombre de matchs de la journée est impair, la dernière carte
   se retrouve seule sur sa ligne — on la centre au lieu de la laisser
   collée à gauche (ex: 9ème match d'une journée de Ligue 1) */
@media (min-width: 641px) {
  .matches-grid > .match-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: calc(50% - 5px);
  }
}

.match-card {
  background: var(--bg2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  overflow: hidden;
  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;
}

/* ── É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; }

.team-name-link {
  cursor: pointer;
  transition: color .2s;
}
.team-name-link:hover { color: var(--vert); text-decoration: underline; }

/* ── 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);
}

/* Zone résultat (badge + hint) — la ligne badge est toujours présente
   dans le DOM (invisible si pas de pronostic) pour garantir un
   alignement pixel-perfect entre toutes les cartes "Terminé" */
.match-result-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.match-result-zone .prono-hint { margin-top: 0; }
.invisible { visibility: hidden; }

/* Résultat prono */
.prono-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 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); }

/* ── EN-TÊTE CARTE (journée / date / heure / statut) — toujours visible ── */
.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: var(--ldc);
  font-size: .74rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.match-header-date {
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-header-statut {
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: .92;
}
.match-header-statut-en-cours { opacity: 1; }

/* ── PIED DE CARTE — raccourcis, toujours visibles ── */
.match-footer {
  display: flex;
  padding: 0 10px;
  border-top: 1px solid var(--bord);
  overflow-x: auto;
  scrollbar-width: none;
}
.match-footer::-webkit-scrollbar { display: none; }

.match-footer button {
  background: none;
  border: none;
  border-top: 2px solid transparent;
  color: var(--txt2);
  padding: 0 9px;
  height: 36px;
  font-size: .74rem;
  white-space: nowrap;
  transition: all .2s;
}
.match-footer button:hover { color: var(--txt); }
.match-footer button.active { color: var(--or); border-top-color: var(--or); }

.footer-label-court { display: none; }

@media (max-width: 480px) {
  .match-footer button { padding: 0 6px; font-size: .7rem; }
  .footer-label-full  { display: none; }
  .footer-label-court { display: inline; }
}

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

.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 effectif — scrollable */
#modal-club .modal {
  max-width: 500px;
  height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
}
#modal-club-contenu {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Modal classement (depuis une carte match) — scrollable, même principe */
#modal-classement-match .modal {
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#modal-classement-match-contenu {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ============================================================
   MODAL COMPOSITION — terrain en perspective + banc
   ============================================================ */
.modal-composition-box {
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 18px;
}

.compo-formation {
  text-align: center;
  font-size: .8rem;
  color: var(--txt2);
  margin: 4px 0 10px;
}
.compo-formation strong { color: var(--txt); }

.compo-coach {
  text-align: center;
  font-size: .74rem;
  color: var(--txt3);
  margin: 10px 0 4px;
}

/* ── Terrain en perspective (trapèze vert sur cadre rectangulaire noir) ── */
.pitch-wrap {
  margin: 0 auto;
  width: 100%;
  max-width: 360px;
  background: #0b0e12;
  border-radius: 12px;
  padding: 14px 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.35);
}

.pitch {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(180deg, #1a7a42 0%, #14622f 55%, #0f4d25 100%);
  border-radius: 4px;
  overflow: hidden;
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 12px 28px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
}
/* Bandes de tonte alternées */
.pitch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.05) 0, rgba(255,255,255,.05) 12.5%,
    transparent 12.5%, transparent 25%
  );
  pointer-events: none;
}

.pitch-lines-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Joueurs positionnés sur le terrain ── */
.pitch-player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 54px;
  z-index: 2;
}
.pitch-player-photo-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}
.pitch-player-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.5);
  display: block;
}
.pitch-player-num {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: var(--vert);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  z-index: 3;
}
.pitch-player-name {
  margin-top: 3px;
  font-size: .62rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.7);
  line-height: 1.15;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Fallback photo (initiale) — mêmes dimensions que l'image remplacée */
.photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg3);
  color: var(--txt2);
  font-weight: 800;
}
.pitch-player-photo.photo-fallback { font-size: 1rem; }

/* ── Banc de touche ── */
.bench-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--txt);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bench-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bench-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg3);
  border-radius: var(--radius-s);
  padding: 6px 10px;
}
.bench-player-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
  display: block;
}
.bench-player-photo.photo-fallback { font-size: .8rem; }
.bench-player-num {
  width: 20px;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: var(--txt2);
  flex-shrink: 0;
}
.bench-player-nom { font-size: .78rem; font-weight: 600; flex: 1; }
.bench-player-poste { font-size: .68rem; color: var(--txt3); }

.bench-groupe-titre {
  font-size: .68rem;
  font-weight: 700;
  color: var(--txt2);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 10px 0 4px;
}
.bench-groupe-titre:first-child { margin-top: 0; }
.bench-groupe-titre-compact { font-size: .62rem; margin: 8px 0 3px; }
.bench-separateur {
  height: 1px;
  background: var(--bord);
  margin: 8px 0 0;
}

/* ============================================================
   VUE COMBINÉE — terrain unique en largeur, coupé en 2
   ============================================================ */
.modal-composition-wide { max-width: 640px; }

.compo-vs-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 10px;
  flex-wrap: wrap;
}
.compo-vs-team {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.compo-vs-team.droite { flex-direction: row-reverse; text-align: right; }
.compo-vs-nom {
  font-size: .86rem;
  font-weight: 800;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compo-vs-formation {
  font-size: .72rem;
  font-weight: 600;
  color: var(--txt2);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.pitch-h-wrap {
  background: #0b0e12;
  border-radius: 12px;
  padding: 12px 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 8px 20px rgba(0,0,0,.35);
}
.pitch-h {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(90deg, #14622f 0%, #1a7a42 50%, #14622f 100%);
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.5);
}
.pitch-h::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    rgba(255,255,255,.05) 0, rgba(255,255,255,.05) 12.5%,
    transparent 12.5%, transparent 25%
  );
  pointer-events: none;
}
.pitch-h-mid {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: rgba(255,255,255,.5); transform: translateX(-50%);
}
.pitch-h-circle {
  position: absolute; left: 50%; top: 50%;
  width: 17%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,.45);
  border-radius: 50%;
}
.pitch-h-box-left {
  position: absolute; left: 0; top: 20%; bottom: 20%; width: 13%;
  border: 2px solid rgba(255,255,255,.45); border-left: none;
}
.pitch-h-box-right {
  position: absolute; right: 0; top: 20%; bottom: 20%; width: 13%;
  border: 2px solid rgba(255,255,255,.45); border-right: none;
}
.pitch-h-goal-left {
  position: absolute; left: 0; top: 42%; height: 16%; width: 1.8%;
  background: rgba(255,255,255,.85); border-radius: 0 2px 2px 0;
}
.pitch-h-goal-right {
  position: absolute; right: 0; top: 42%; height: 16%; width: 1.8%;
  background: rgba(255,255,255,.85); border-radius: 2px 0 0 2px;
}

.pitch-player-h { width: 36px; }
.pitch-player-photo-wrap-h { position: relative; width: 24px; height: 24px; margin: 0 auto; }
.pitch-player-photo-h {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  display: block;
}
.pitch-player-photo-h.photo-fallback { display: flex; align-items: center; justify-content: center; font-size: .66rem; }
.pitch-player-num-h {
  position: absolute; bottom: -2px; right: -2px;
  width: 12px; height: 12px; font-size: .5rem;
}
.pitch-player-name-h {
  margin-top: 2px;
  font-size: .46rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
  line-height: 1.1;
  max-width: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.compo-bench-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 14px;
  position: relative;
}
.compo-bench-cols::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: var(--bord);
  transform: translateX(-8px);
}
.bench-title-compact { margin: 0 0 8px; font-size: .76rem; }
.bench-title-right { justify-content: flex-end; text-align: right; }
.bench-player-compact { padding: 5px 8px; gap: 8px; }
.bench-player-compact .bench-player-photo { width: 26px; height: 26px; }
.bench-player-compact .bench-player-nom {
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  /* Les 2 colonnes restent côte à côte même sur mobile, séparées par le
     trait vertical ci-dessus — juste la police qui se resserre un peu plus. */
  .bench-player-compact { padding: 4px 6px; gap: 6px; }
  .bench-player-compact .bench-player-photo { width: 22px; height: 22px; }
  .bench-player-compact .bench-player-num { width: 16px; font-size: .66rem; }
  .bench-player-compact .bench-player-nom { font-size: .64rem; }
  .bench-groupe-titre-compact { font-size: .56rem; margin: 6px 0 2px; }
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-right: 30px;
  cursor: move;
  user-select: none;
}
.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); }

.admin-effectif-ligne {
  padding: 8px 10px;
  border-bottom: 1px solid var(--bord);
  font-size: .84rem;
}
.admin-effectif-ligne:last-child { border-bottom: none; }
.admin-effectif-ligne div { font-size: .8rem; margin-top: 2px; padding-left: 8px; }

/* ── Filigrane "VERSION DE TEST" (environnements -test uniquement) ── */
#filigrane-test {
  position: fixed;
  inset: -20vh -20vw;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: space-between;
  justify-content: space-between;
  gap: 8vh 4vw;
  transform: rotate(-28deg);
}
#filigrane-test span {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(245, 166, 35, .16);
  text-transform: uppercase;
  white-space: nowrap;
  flex: 0 0 auto;
}
.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; }
  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; }
}

.login-lien {
  text-align: center;
  font-size: .84rem;
  color: #666;
  margin-top: 8px;
}
.login-lien a {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: none;
}

/* ============================================================
   ÉQUIPE DE CŒUR — surlignage dans le classement et la grille
   ============================================================ */
/* Classement équipes : liseré doré à gauche, compatible avec les
   couleurs de qualification déjà appliquées sur la ligne */
.classement-table tr.coeur-row td:first-child,
.classement-table tr.coeur-row td.rang {
  box-shadow: inset 4px 0 0 var(--or);
}
.coeur-etoile { margin-left: 4px; }

/* Surlignage temporaire des 2 équipes d'un match, dans le modal classement
   ouvert depuis une carte match — couleur bleue, distincte de l'or (équipe
   de cœur) et des couleurs de qualification */
.classement-table tr.match-highlight-row {
  background: rgba(13, 110, 253, .14);
}
.classement-table tr.match-highlight-row td.rang {
  box-shadow: inset 4px 0 0 #0d6efd;
}

/* Grille complète : ligne ET colonne du club choisi surlignées */
.grille-table th.coeur-col,
.grille-table td.coeur-col,
.grille-table tr.coeur-row > td,
.grille-table tr.coeur-row > th.grille-th-dom {
  background: var(--coeur-bg) !important;
}
