/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #0a3d1f;
  --green-mid:   #155830;
  --green-light: #1e7c46;
  --gold:        #d4af37;
  --gold-light:  #f0d060;
  --white:       #ffffff;
  --gray-50:     #f9faf9;
  --gray-100:    #f4f6f4;
  --gray-200:    #e2e8e2;
  --gray-400:    #9aab9a;
  --gray-600:    #556055;
  --text:        #1a2e1a;
  --blue:        #1565c0;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(0,0,0,.12);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.08);
}

html { font-size: 15px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── Header ───────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 60%, var(--green-light) 100%);
  color: var(--white);
  padding: 1.1rem 1.5rem .75rem;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
}

.header-title { display: flex; align-items: center; gap: .9rem; }
.trophy { font-size: 2.2rem; }

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: .3px;
}

.header-sub { font-size: .78rem; opacity: .85; margin-top: .1rem; }

/* ── Lang switcher ────────────────────────────────────────── */
.lang-switcher { display: flex; gap: .3rem; align-items: center; }

.lang-btn {
  padding: .26rem .68rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.3);
  background: transparent;
  color: rgba(255,255,255,.8);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .8px;
  cursor: pointer;
  transition: all .14s;
  font-family: inherit;
}
.lang-btn:hover { background: rgba(255,255,255,.2); color: var(--white); }
.lang-btn.active { background: var(--gold); border-color: var(--gold); color: var(--green-dark); }
.lang-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/* ── Main navigation ──────────────────────────────────────── */
.main-nav {
  background: var(--green-dark);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 200;
}

.main-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 42px;
}

.nav-link {
  display: inline-block;
  padding: .65rem 1.1rem;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: all .14s;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.07); }
.nav-link:focus-visible { outline: 2px solid var(--gold-light); outline-offset: -2px; }
.nav-link.active { color: var(--gold-light); border-bottom-color: var(--gold); font-weight: 700; }

.nav-spacer { flex: 1; }

/* User info in nav */
.nav-user-name {
  font-size: .8rem;
  color: rgba(255,255,255,.8);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

#nav-user-info {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.nav-logout-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: .72rem;
  padding: .1rem .4rem;
  transition: all .14s;
}
.nav-logout-btn:hover { background: rgba(255,255,255,.15); color: var(--white); }

/* ── Next match banner (index only) ──────────────────────── */
.next-match-banner {
  max-width: 1280px;
  margin: .6rem auto 0;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(212,175,55,.4);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
}
.next-label { font-size: .66rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold); font-weight: 700; }
.next-teams { font-size: .96rem; font-weight: 600; }
.next-teams em { font-style: normal; opacity: .6; margin: 0 .3rem; }
.next-time { font-size: .76rem; opacity: .8; }
.next-local { opacity: .65; }
.next-venue { font-size: .73rem; opacity: .7; }
.next-score { font-size: 1.2rem; font-weight: 800; color: var(--gold-light); margin-left: auto; white-space: nowrap; }
.next-datetime { font-weight: 700; color: var(--gold-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown { font-size: .88rem; font-weight: 700; color: var(--gold-light); font-variant-numeric: tabular-nums; margin-left: auto; }
.banner-warn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(234,179,8,.18);
  border: 1px solid rgba(234,179,8,.55);
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .76rem;
  font-weight: 600;
  color: #fef08a;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.banner-warn:hover { background: rgba(234,179,8,.35); color: #fff; }

/* ── Filter bar (index only) ──────────────────────────────── */
.filters {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 42px;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

.filters-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}

.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem; }

.filter-label {
  font-size: .7rem;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-right: .1rem;
  white-space: nowrap;
}

.filter-select {
  padding: .22rem .5rem;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: .74rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  max-width: 7rem;
}
.filter-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn {
  display: inline-block;
  padding: .22rem .62rem;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: .74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .13s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--white); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.active { background: var(--green-dark); border-color: var(--green-dark); color: var(--gold-light); font-weight: 700; }

/* Bouton auto-sélectionné (filtre initial sur le groupe du prochain match) */
.btn.active.auto {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 70%, var(--gold) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35);
  animation: btn-auto-pulse 2.4s ease-in-out infinite;
}
.btn.active.auto:active { animation: none; transform: scale(0.98); }
@keyframes btn-auto-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35); }
  50%      { box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.active.auto { animation: none; }
  .btn, .lang-btn, .nav-link, .nav-logout-btn, .lang-btn, .btn, .score-input { transition: none; }
  .loading::before { animation: none; border-top-color: var(--green-mid); }
}

.btn-auto-hint {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.3rem;
  white-space: nowrap;
}

/* ── Main content ─────────────────────────────────────────── */
main {
  max-width: 1280px;
  margin: 1.2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.page-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .4rem; }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--green-dark); padding-left: .4rem; border-left: 4px solid var(--gold); white-space: nowrap; }
.page-header .rank-toggle-label { flex-shrink: 0; }
.loading, .empty { 
  padding: 3rem; 
  text-align: center; 
  color: var(--gray-600);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.loading::before {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--green-mid);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty   { padding: 2rem; }

/* ── Group section (matches page) ────────────────────────── */
.group-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  border-left: 4px solid var(--gold);
  padding-left: 0.45rem;
}

.group-badge-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--green-dark);
  color: var(--gold-light);
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 800;
}

.group-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.group-standings { overflow-x: auto; }
.group-matches   { overflow-x: auto; }

/* ── Standings (classement FIFA par groupe) ───────────────── */
.standings-wrap { }
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.standings-table thead th {
  background: var(--green-mid);
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.45rem 0.3rem;
  white-space: nowrap;
}
.standings-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: background 0.1s;
}
.standings-table tbody tr:hover { background: #f0f8f0; }
.standings-table tbody tr:last-child { border-bottom: none; }
.standings-table td { padding: 0.4rem 0.3rem; }
.std-pos   { text-align: center; width: 26px; font-weight: 700; color: var(--gray-600); }
.std-team  { font-weight: 600; min-width: 110px; padding-left: 0.4rem; }
.std-num   { text-align: center; color: var(--gray-600); font-variant-numeric: tabular-nums; min-width: 26px; }
.std-pts   { text-align: center; font-size: 0.92rem; background: rgba(212, 175, 55, 0.08); }
.std-pts strong { color: var(--green-dark); font-weight: 800; }

.std-pos.pos-1 { color: var(--gold); }
.std-pos.pos-2 { color: var(--green-mid); }
.std-pos.pos-3 { color: var(--blue); }

/* ── Phase section (matches page) ────────────────────────── */
.phase-title {
  font-size: .98rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .5rem;
  padding-left: .42rem;
  border-left: 4px solid var(--gold);
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.group-badge {
  background: var(--green-dark);
  color: var(--gold-light);
  font-size: .7rem;
  padding: .14rem .5rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: .5px;
}

/* ── Table (matches page) ─────────────────────────────────── */
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 700px; }

thead th {
  background: var(--green-dark);
  color: var(--gold-light);
  font-weight: 600;
  font-size: .69rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: .58rem .7rem;
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--gray-200); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f8f0; }
tbody tr.row-today { background: #fffde7; }

td { padding: .48rem .7rem; vertical-align: middle; }

.col-num   { width: 38px; text-align: center; color: var(--gray-400); font-size: .74rem; }
.col-date  { width: 76px; }
.col-time  { width: 86px; }
.col-team  { min-width: 115px; }
.col-score { width: 58px; text-align: center; }
.col-venue { min-width: 130px; }
.col-city  { min-width: 86px; }
.col-status{ width: 86px; }

.team-right { text-align: right; font-weight: 600; }
.team-left  { text-align: left;  font-weight: 600; }

td.col-date b, td.col-time b { display: block; }
td.col-date small, td.col-time small { display: block; font-size: .69rem; color: var(--gray-400); }

.score { display: inline-block; background: var(--green-dark); color: var(--white); font-weight: 700; padding: .16rem .48rem; border-radius: 4px; font-size: .78rem; white-space: nowrap; }
.score-vs { color: var(--gray-400); }
.col-venue, .col-city { font-size: .74rem; color: var(--gray-600); }

.badge { display: inline-block; padding: .16rem .5rem; border-radius: 20px; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.badge-upcoming { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.badge-live     { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; animation: pulse 1.4s infinite; }
.badge-done     { background: var(--gray-200); color: var(--gray-600); border: 1px solid #ccc; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ── Row done (match terminé) ─────────────────────────────── */
tbody tr.row-done { background: rgba(244, 246, 244, 0.4); }
tbody tr.row-done:hover { background: #f0f8f0; }

/* ── Score mi-temps (à côté du score final) ────────────────── */
.ht-score {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: var(--gray-600);
  font-weight: 600;
  background: var(--gray-100);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
}

/* ── Score tirs au but (à côté du score final) ──────────────── */
.penalty-score {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: #e65100;
  font-weight: 700;
  background: #fff3e0;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  border: 1px solid #ffcc80;
}

/* ── Cellule score élargie en mode admin ───────────────────── */
td.col-score { min-width: 130px; }

/* ── Formulaire de saisie admin (inline dans la ligne) ────── */
.admin-score-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.admin-row label {
  font-size: 0.66rem;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 36px;
  text-align: right;
}
.admin-row-ht { opacity: 0.85; }
.admin-row-ht .score-input { background: var(--gray-50); font-size: 0.88rem; }
.admin-row-penalty { background: #fff3e0; border-radius: 4px; padding: 0.1rem 0.3rem; border: 1px solid #ffcc80; }
.admin-row-penalty .score-input { background: #fff8e1; font-size: 0.88rem; font-weight: 700; }

.btn-save-score {
  margin-top: 0.15rem;
  padding: 0.2rem 0.65rem;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.13s;
}
.btn-save-score:hover { background: var(--green-mid); }
.btn-save-score:disabled { opacity: 0.5; cursor: wait; }

.admin-save-msg { font-size: 0.7rem; font-weight: 700; min-width: 18px; }
.admin-msg-ok  { color: #2e7d32; }
.admin-msg-err { color: #c62828; }

/* ── Bouton & badge admin dans la barre de filtres ────────── */
.btn-admin {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--green-dark);
  border-color: var(--gold);
  font-weight: 700;
}
.btn-admin:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--gold-light);
}
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--green-dark);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.admin-badge::before { content: '🔓'; }

/* Mode admin : indicateur subtil sur la page */
body.is-admin .group-section,
body.is-admin .phase-section { box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
body.is-admin .score-input { border-color: var(--gold); }


/* ── Card section (utilisateurs, classement) ──────────────── */
.card-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem 1.6rem;
}

.section-title {
  font-size: .96rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--gray-200);
}

/* ── Users page ───────────────────────────────────────────── */
.users-form { display: flex; flex-direction: column; gap: .75rem; max-width: 400px; }

.form-row { display: flex; flex-direction: column; gap: .25rem; }
.form-row label { font-size: .8rem; font-weight: 600; color: var(--gray-600); }
.form-row input {
  padding: .5rem .75rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: .88rem;
  font-family: inherit;
  transition: border-color .14s;
}
.form-row input:focus { outline: none; border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(21,88,48,.1); }
.form-hint { font-size: .72rem; color: var(--gray-400); }

.btn-primary {
  padding: .5rem 1.2rem;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s;
  align-self: flex-start;
}
.btn-primary:hover { background: var(--green-mid); }

.form-msg { font-size: .8rem; margin-top: .4rem; padding: .4rem .7rem; border-radius: 4px; }
.form-msg:empty { display: none; }
.form-msg-ok    { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.form-msg-error { background: #fde8e8; color: #c62828; border: 1px solid #ef9a9a; }

.users-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: .35rem .85rem;
  font-size: .82rem;
  color: var(--text);
}
.user-chip-name { line-height: 1; }

.user-admin-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--gold);
  color: var(--green-dark);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.user-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #c62828;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.13s, transform 0.13s;
}
.user-delete-btn:hover { background: #b71c1c; transform: scale(1.1); }

.users-empty { color: var(--gray-400); font-size: .85rem; }

/* ── Toggle mode admin (dans la nav) ─────────────────────── */
.nav-admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.3);
  background: transparent;
  color: rgba(255,255,255,.75);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s;
  white-space: nowrap;
}
.nav-admin-toggle:hover { background: rgba(255,255,255,.12); color: var(--white); }
.nav-admin-toggle:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.nav-admin-toggle.on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-dark);
}
.nav-admin-toggle .admin-toggle-icon { font-size: 0.9rem; vertical-align: middle; }
.nav-refresh-btn {
  display: inline-flex;
  align-items: center;
  margin-left: .5rem;
  padding: .25rem .45rem;
  border-radius: 20px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-light);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .14s;
  white-space: nowrap;
}
.nav-refresh-btn:hover:not(:disabled) { background: var(--gold); color: var(--green-dark); }
.nav-refresh-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.nav-refresh-btn:disabled { opacity: .45; cursor: default; }

/* ── Classement page ──────────────────────────────────────── */
.rank-toggle-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 600; color: var(--green-dark); cursor: pointer;
}
.rank-toggle-label input[type=checkbox] { width: 1rem; height: 1rem; cursor: pointer; }

.rank-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.rank-empty { background: var(--white); border-radius: var(--radius); padding: 3rem; text-align: center; color: var(--gray-400); font-size: .9rem; line-height: 1.7; box-shadow: var(--shadow-sm); }

.rank-table { width: 100%; border-collapse: collapse; font-size: .85rem; min-width: 400px; }
.rank-table thead th {
  background: var(--green-dark);
  color: var(--gold-light);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: .65rem .9rem;
  text-align: left;
}
.rank-table thead th:first-child,
.rank-table thead th:nth-child(3),
.rank-table thead th:nth-child(4),
.rank-table thead th:nth-child(5),
.rank-table thead th:nth-child(6) { text-align: center; }

.rank-row { border-bottom: 1px solid var(--gray-200); transition: background .12s; }
.rank-row:hover { background: #f0f8f0; }
.rank-row.rank-top { background: #f9fde8; }
.rank-row.rank-top:hover { background: #f5f9d0; }

.rank-table td { padding: .7rem .9rem; }
.rank-pos    { text-align: center; font-size: .95rem; }
.rank-name   { font-weight: 600; }
.rank-pts    { text-align: center; font-size: 1.05rem; }
.rank-pts strong { color: var(--green-dark); }
.rank-exact, .rank-result, .rank-played { text-align: center; color: var(--gray-600); }

/* Detail row */
.rank-detail-row td { padding: 0; background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
.rank-detail-grid { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; }
.rank-detail-card {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  font-size: .76rem;
  min-width: 150px;
  border: 1px solid transparent;
}
.rank-detail-exact  { background: #e8f5e9; border-color: #a5d6a7; }
.rank-detail-result { background: #fff8e1; border-color: #ffe082; }
.rank-detail-wrong  { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-600); }

.rd-teams { font-weight: 600; }
.rd-teams em { font-style: normal; opacity: .6; margin: 0 .25rem; }
.rd-score { font-size: .82rem; font-weight: 700; }
.rd-pro   { font-size: .78rem; color: var(--gray-600); }
.rd-badge { font-size: .7rem; font-weight: 600; opacity: .85; }

.rank-detail-more {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: .35rem 0 .1rem;
}
.rank-detail-extra { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }
.rank-detail-extra.hidden { display: none; }

/* ── Tableau matchs × joueurs (classement) ────────────────── */
.mtt-section {
  margin-top: 1.5rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem;
}
.mtt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mtt-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .78rem;
  white-space: nowrap;
}
.mtt-table thead tr {
  background: var(--green-dark);
  color: var(--gold-light);
}
.mtt-th-match {
  text-align: left;
  padding: .55rem .8rem;
  font-weight: 600;
  min-width: 135px;
  position: sticky;
  left: 0;
  background: var(--green-dark);
  z-index: 2;
  box-shadow: 3px 0 6px -2px rgba(0,0,0,.25);
}
.mtt-th-player {
  padding: .55rem .7rem;
  text-align: center;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mtt-match-cell {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
  padding: .55rem .8rem;
  min-width: 135px;
  vertical-align: middle;
  box-shadow: 3px 0 6px -2px rgba(0,0,0,.15);
  border-bottom: 1px solid var(--gray-200);
}
.mtt-teams { display: block; font-weight: 600; font-size: .78rem; }
.mtt-teams em { font-style: normal; opacity: .6; margin: 0 .2rem; }
.mtt-t1, .mtt-t2 { display: inline; }
.mtt-real-score {
  display: block;
  font-weight: 700;
  color: var(--green-dark);
  font-size: .85rem;
}
.mtt-date { display: block; font-size: .7rem; color: var(--gray-400); }

.mtt-cell {
  text-align: center;
  padding: .45rem .6rem;
  border-left: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.mtt-table tbody tr:hover .mtt-cell,
.mtt-table tbody tr:hover .mtt-match-cell { background: #f0f8f0; }
.mtt-table tbody tr:hover .mtt-match-cell { background: #e8f4e8; }

@media (max-width: 768px) {
  .mtt-match-cell { min-width: 75px; }
  .mtt-match-inner {
    display: flex;
    flex-direction: column;
    gap: .08rem;
    white-space: normal;
  }
  .mtt-teams { display: contents; }
  .mtt-teams em { display: none; }
  .mtt-t1 { order: 0; }
  .mtt-real-score { order: 1; font-size: .9rem; }
  .mtt-t2 { order: 2; }
  .mtt-date { order: 3; }
}

.mtt-pro-score { display: block; font-weight: 600; }
.mtt-pts {
  display: inline-block;
  margin-top: .15rem;
  padding: .1rem .35rem;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
}
.mtt-exact  { background: #f0fdf4; }
.mtt-result { background: #fffbeb; }
.mtt-wrong  { background: var(--gray-100); }
.mtt-none   { color: var(--gray-400); }

.mtt-exact  .mtt-pts { background: #bbf7d0; color: #14532d; }
.mtt-result .mtt-pts { background: #fef3c7; color: #92400e; }
.mtt-wrong  .mtt-pts { background: var(--gray-200); color: var(--gray-600); }
.mtt-v2 { display: block; font-size: .6rem; color: var(--gray-500); margin-top: .1rem; font-weight: 600; }

.mtt-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding: .75rem 0 .25rem;
  font-size: .78rem;
  color: var(--gray-600);
}
.mtt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.mtt-swatch {
  display: inline-block;
  width: .75rem;
  height: .75rem;
  border-radius: 3px;
}
.mtt-swatch-exact  { background: #bbf7d0; border: 1px solid #86efac; }
.mtt-swatch-result { background: #fef3c7; border: 1px solid #fde68a; }
.mtt-swatch-wrong  { background: var(--gray-200); border: 1px solid var(--gray-300); }

/* ── Tableau coverage (pronostics) ────────────────────────── */
.coverage-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1.5rem;
}
.coverage-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.coverage-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: .8rem;
  white-space: nowrap;
}
.coverage-table thead tr {
  background: var(--green-dark);
  color: var(--gold-light);
}
.cov-th-match {
  position: sticky;
  left: 0;
  background: var(--green-dark);
  z-index: 2;
  padding: .4rem .5rem;
  min-width: 90px;
  max-width: 90px;
  text-align: left;
  box-shadow: 3px 0 6px -2px rgba(0,0,0,.25);
}
.cov-th-player {
  padding: .5rem .7rem;
  text-align: center;
  font-weight: 600;
  min-width: 70px;
  border-left: 1px solid rgba(255,255,255,.15);
}
.cov-match-cell {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
  padding: .35rem .5rem;
  min-width: 90px;
  max-width: 90px;
  vertical-align: middle;
  box-shadow: 3px 0 6px -2px rgba(0,0,0,.15);
  border-bottom: 1px solid var(--gray-200);
}
.cov-teams { display: block; font-weight: 600; font-size: .72rem; }
.cov-t1, .cov-t2 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cov-vs { display: block; font-style: normal; opacity: .5; font-size: .6rem; font-weight: 400; margin: 0; }
.cov-date { display: none; }
.cov-cell {
  text-align: center;
  padding: .5rem .6rem;
  border-left: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
}
.coverage-table tbody tr:nth-child(even) .cov-cell,
.coverage-table tbody tr:nth-child(even) .cov-match-cell { background: var(--gray-100); }
.coverage-table tbody tr:nth-child(even) .cov-mine-cell  { background: #dcfce7; }
.coverage-table tbody tr:nth-child(even) .cov-mine-cell:hover { background: #bbf7d0; }
.cov-dot { font-size: 1.1rem; line-height: 1; cursor: default; }
.cov-yes { color: #16a34a; }
.cov-no  { color: #dc2626; }

/* Colonne de l'utilisateur connecté */
.cov-th-me { background: rgba(212,175,55,.25); }
.cov-pencil-no { font-size: 1rem; cursor: pointer; opacity: .85; }
.cov-mine-cell {
  cursor: pointer;
  background: #f0fdf4;
  transition: background .12s;
  min-width: 90px;
}
.cov-mine-cell:hover { background: #dcfce7; }
.cov-mine-cell.editing { background: var(--white); cursor: default; }
.cov-mine-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
}
.cov-mine-score { font-weight: 700; font-size: .8rem; }
.cov-edit-hint  { opacity: .35; font-size: .72rem; }
.cov-mine-cell:hover .cov-edit-hint { opacity: .9; }

/* Lignes de matchs commencés (lecture seule) */
.row-started .cov-match-cell,
.row-started .cov-cell { opacity: .75; }
.hide-started .row-started { display: none; }
.mtt-hide-old .mtt-old-row { display: none; }
.cov-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.cov-header-row .section-title { margin-bottom: 0; }
.cov-toggle-started {
  padding: .22rem .7rem;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .14s;
  white-space: nowrap;
}
.cov-toggle-started:hover { border-color: var(--green-light); color: var(--green-light); }
.cov-lock-badge { font-size: .75rem; margin-right: .25rem; vertical-align: middle; }
@keyframes pencil-blink { 0%,100%{opacity:1} 50%{opacity:.15} }
.cov-pencil-urgent { animation: pencil-blink 1s ease-in-out infinite; }
.cov-dot-urgent { animation: pencil-blink 1s ease-in-out infinite; }
.cov-started-cell { cursor: default; background: var(--gray-100) !important; }
.coverage-table tbody tr.row-started:nth-child(even) .cov-started-cell { background: #e5e7eb !important; }
.cov-no-pro { color: #9ca3af; font-size: .85rem; }
.cov-pro-invalid { background: #fee2e2 !important; }
.cov-pro-invalid .cov-mine-score { color: #dc2626; font-weight: 700; }
.pro-invalid { background: #fee2e2; border-radius: 4px; }

/* Formulaire inline */
.cov-inline-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .2rem 0;
}
.cov-form-scores {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex-wrap: nowrap;
}
.cov-input {
  width: 2.2rem;
  text-align: center;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: .15rem .1rem;
  font-size: .8rem;
  font-family: inherit;
  -moz-appearance: textfield;
}
.cov-input::-webkit-outer-spin-button,
.cov-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.cov-input:focus { outline: none; border-color: var(--green-mid); }
.cov-input-ht { width: 1.9rem; }
.cov-paren { color: var(--gray-400); font-size: .8rem; }
.cov-form-btns { display: flex; gap: .3rem; }
.cov-legend {
  margin-top: .6rem;
  font-size: .78rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.cov-legend .cov-dot { font-size: .95rem; }

/* ── Pronostics page ──────────────────────────────────────── */
.pro-login-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  max-width: 420px;
  margin: 0 auto;
}
.pro-login-box h2 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: .5rem; }
.pro-login-box p  { font-size: .85rem; color: var(--gray-600); margin-bottom: 1rem; }

.pro-login-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pro-login-form input {
  flex: 1;
  min-width: 180px;
  padding: .5rem .75rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: .88rem;
  font-family: inherit;
}
.pro-login-form input:focus { outline: none; border-color: var(--green-mid); }

/* Header connecté */
.pro-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  box-shadow: var(--shadow-sm);
  font-size: .85rem;
}
.pro-header strong { color: var(--green-dark); }
.btn-logout-inline {
  margin-left: auto;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: .28rem .7rem;
  font-size: .76rem;
  cursor: pointer;
  color: var(--gray-600);
  font-family: inherit;
  transition: all .13s;
}
.btn-logout-inline:hover { background: #fee; border-color: #f99; color: #c62828; }

/* Sections pronostics */
.pro-section { display: flex; flex-direction: column; gap: .7rem; }
.pro-empty { color: var(--gray-400); font-size: .85rem; padding: .5rem; }

/* Cards de match */
.pro-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.pro-card-started { border-left: 3px solid var(--green-light); }

.pro-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
  padding: .6rem .9rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.pro-card-teams { font-weight: 600; font-size: .9rem; flex: 1; min-width: 180px; }
.pro-card-teams em { font-style: normal; opacity: .5; margin: 0 .3rem; }
.real-score { background: var(--green-dark); color: var(--white); padding: .1rem .45rem; border-radius: 4px; font-size: .85rem; }
.pro-card-date { font-size: .75rem; color: var(--gray-600); }
.no-result { font-size: .72rem; color: var(--gray-400); font-style: italic; }

.pro-card-body { padding: .65rem .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pro-card-label { font-size: .78rem; font-weight: 600; color: var(--gray-600); white-space: nowrap; }

/* Formulaire pronostic */
.pro-form { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.score-input {
  width: 52px;
  text-align: center;
  padding: .35rem .4rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  -moz-appearance: textfield;
}
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.score-input:focus { outline: none; border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(21, 88, 48, 0.12); }
.score-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; }
.score-sep { font-size: 1.1rem; font-weight: 700; color: var(--gray-400); }

.btn-small {
  padding: .3rem .75rem;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .13s;
  color: var(--text);
}
.btn-small:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--white); }
.btn-small.btn-primary { background: var(--green-dark); border-color: var(--green-dark); color: var(--white); }
.btn-small.btn-primary:hover { background: var(--green-mid); }

.pro-score-display { font-size: 1rem; font-weight: 700; color: var(--green-dark); }
.pro-no-pro { font-size: .8rem; color: var(--gray-400); font-style: italic; }

/* ── Page Config / Règles de points ───────────────────── */
.page-subtitle { color: var(--gray-400); font-size: .88rem; margin: .35rem 0 1.1rem .4rem; }

.settings-wrap { display: flex; flex-direction: column; gap: 1.2rem; }

.settings-status {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--white); border-radius: var(--radius);
  padding: .8rem 1.1rem; box-shadow: var(--shadow-sm);
  font-size: .85rem; flex-wrap: wrap;
}
.settings-mode {
  display: inline-block; padding: .3rem .7rem; border-radius: 20px;
  font-weight: 700; font-size: .78rem; letter-spacing: .3px;
}
.settings-mode.is-admin    { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--green-dark); }
.settings-mode.is-readonly { background: var(--gray-200); color: var(--gray-400); }
.settings-updated { color: var(--gray-400); font-size: .78rem; font-style: italic; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.settings-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border-top: 3px solid var(--green-light);
  transition: box-shadow .2s;
}
body.is-admin .settings-card { border-top-color: var(--gold); }
body.is-admin .settings-card:hover { box-shadow: var(--shadow); }

.settings-card-head {
  background: var(--green-dark);
  color: var(--gold-light);
  padding: .7rem 1rem;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .3px;
}
.settings-card-phase { display: block; }

.settings-card-body { padding: .6rem 1rem .9rem; display: flex; flex-direction: column; gap: .55rem; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .35rem 0;
  border-bottom: 1px dashed rgba(0,0,0,.06);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: .82rem; color: var(--green-dark); flex: 1; min-width: 0; }
.setting-input-wrap {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--gray-100); border-radius: 6px; padding: .15rem .5rem;
  border: 1px solid transparent; transition: border-color .15s;
}
body.is-admin .setting-input-wrap { background: #fffbe6; }
.setting-input-wrap:focus-within { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(21,88,48,.08); }
.setting-input {
  width: 50px; padding: .25rem .1rem; border: none; background: transparent;
  text-align: right; font-weight: 700; font-size: .95rem; color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.setting-input:focus { outline: none; }
.setting-input:disabled { color: var(--green-dark); opacity: .85; cursor: not-allowed; }
.setting-suffix { font-size: .7rem; color: var(--gray-400); font-weight: 600; }

.settings-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--white); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.settings-save-msg { font-size: .85rem; }
.settings-save-msg.is-loading { color: var(--gray-400); }
.settings-save-msg.is-success { color: var(--green-light); font-weight: 700; }
.settings-save-msg.is-error   { color: #b00020; font-weight: 600; }

.settings-bracket {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--white); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}
.settings-bracket-hint { font-size: .85rem; color: var(--gray-400); margin: 0; }

.phase-resolve {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin: .5rem 0 .75rem;
}
.bracket-msg { font-size: .85rem; }
.bracket-msg.is-loading { color: var(--gray-400); }
.bracket-msg.is-success { color: var(--green-light); font-weight: 700; }
.bracket-msg.is-error   { color: #b00020; font-weight: 600; }

.settings-topbar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.settings-topbar-btn {
  padding: .5rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.settings-topbar-btn:hover { opacity: .85; }
.settings-logout-btn  { background: #fee2e2; color: #b91c1c; }
.settings-refresh-btn { background: var(--gray-200); color: var(--text); }

.settings-change-key {
  margin-top: 0;
  margin-bottom: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
}

.settings-note {
  color: var(--gray-400); font-size: .75rem; font-style: italic;
  text-align: center; padding: .5rem 1rem 1rem;
}

.error-box {
  background: #fff3f3; border: 1px solid #f3b9b9; border-left: 4px solid #b00020;
  color: #b00020; padding: 1rem 1.2rem; border-radius: var(--radius);
  font-size: .9rem; text-align: center;
}

/* Résultat + points */
.pro-mine-result { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; width: 100%; }
.pro-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
}
.pro-badge-exact  { background: #c8e6c9; color: #1b5e20; }
.pro-badge-result { background: #fff8e1; color: #e65100; border: 1px solid #ffe082; }
.pro-badge-wrong  { background: var(--gray-200); color: var(--gray-600); }

/* Pronostics des autres */
.pro-others-details { width: 100%; margin-top: .4rem; }
.pro-others-details summary {
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  padding: .3rem 0;
  user-select: none;
}
.pro-others-details summary:hover { color: var(--green-dark); }

.pro-others-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.pro-all-grid    { display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .25rem; width: 100%; }
.pro-other-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: .3rem .65rem;
  font-size: .78rem;
}
.pro-mine-row {
  background: #f0fdf4;
  border-color: #86efac;
  font-weight: 600;
}
.pro-other-name  { font-weight: 600; color: var(--gray-600); }
.pro-mine-row .pro-other-name { color: var(--green-dark); }
.pro-other-score { font-weight: 700; }
.pro-row-nosub { opacity: .5; }
.pro-no-sub { font-style: italic; color: var(--gray-400); font-weight: 400; }

/* Toast */
.pro-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .65rem 1.4rem;
  border-radius: 24px;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  z-index: 9999;
  transition: opacity .3s;
  white-space: pre-line;
  max-width: 90vw;
  line-height: 1.5;
}
.pro-toast.hidden { opacity: 0; pointer-events: none; }
.pro-toast-ok    { background: var(--green-dark); color: var(--white); }
.pro-toast-error { background: #c62828; color: var(--white); }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.3rem;
  font-size: .74rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 800px) {
  .header-inner   { flex-direction: column; align-items: flex-start; }
  .lang-switcher  { align-self: flex-end; }
  .main-nav-inner { flex-wrap: wrap; gap: 0; padding: 0 .5rem; }
  .nav-spacer     { display: none; }
  #nav-user-info  { width: 100%; padding: .3rem .5rem; border-top: 1px solid rgba(255,255,255,.1); font-size: .76rem; }
  .next-match-banner { flex-direction: column; align-items: flex-start; }
  .countdown      { margin-left: 0; }
  .filters-inner  { flex-direction: column; align-items: flex-start; }
  .col-venue, .col-city { display: none; }
  .card-section   { padding: 1rem; }
}

@media (max-width: 500px) {
  .col-num        { display: none; }
  .header-title h1{ font-size: 1.05rem; }
  .pro-card-head  { flex-direction: column; align-items: flex-start; }
}

/* ── Bouton rafraîchir ────────────────────────────────── */
.nav-refresh-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.nav-refresh-btn:hover { background: rgba(255,255,255,.2); color: var(--white); transform: rotate(180deg); }
.nav-refresh-btn:active { transform: rotate(360deg); }

/* ── Bouton connexion dans la nav ─────────────────────── */
.nav-login-btn {
  background: var(--gold);
  border: none;
  border-radius: 20px;
  color: var(--green-dark);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .4px;
  padding: .3rem .85rem;
  font-family: inherit;
  transition: background .14s;
}
.nav-login-btn:hover { background: var(--gold-light); }

/* ── Modal de connexion (depuis la nav) ───────────────── */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.login-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
  padding: 2.2rem 2rem 1.8rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
}
.login-modal h2 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: .4rem; }
.login-modal p  { font-size: .85rem; color: var(--gray-600); margin-bottom: 1.1rem; }
.login-modal .pro-login-form { justify-content: center; }
.login-modal-close {
  position: absolute;
  top: .6rem; right: .7rem;
  background: none; border: none;
  font-size: 1rem; cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .13s;
}
.login-modal-close:hover { color: var(--text); }

/* ── Auth gate (accès réservé) ────────────────────────── */
.auth-gate {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2.5rem 2rem;
  max-width: 420px;
  margin: 2rem auto 0;
  text-align: center;
}
.auth-gate-lock { font-size: 2.4rem; margin-bottom: .75rem; }
.auth-gate h2 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: .5rem; }
.auth-gate p  { font-size: .85rem; color: var(--gray-600); margin-bottom: 1.2rem; }
.auth-gate .pro-login-form { justify-content: center; }

/* ── Liens nav protégés : cachés si non connecté ─────── */
body:not(.is-logged-in) .nav-link[data-page="classement"],
body:not(.is-logged-in) .nav-link[data-page="pronostics"],
body:not(.is-logged-in) .nav-link[data-page="users"],
body:not(.is-logged-in) .nav-link[data-page="settings"] {
  display: none;
}
body:not(.user-is-admin) .nav-link[data-page="users"] {
  display: none;
}

/* ── Historique du classement (modal) ────────────────── */
.rank-header-controls {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-left: 1rem;
}
.rank-history-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: .2rem .5rem;
  font-size: .85rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: background .13s, border-color .13s;
  line-height: 1.4;
}
.rank-history-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}
.history-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}
.history-modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 50px rgba(0,0,0,.28);
  padding: 1.8rem 1.5rem 1.5rem;
  width: 95vw;
  max-width: 1100px;
  height: 90vh;
  max-height: 750px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.history-modal-title {
  font-size: 1.05rem;
  color: var(--green-dark);
  margin: 0 0 1rem;
  padding-right: 2rem;
}
.history-modal-close {
  position: absolute;
  top: .6rem; right: .7rem;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: 4px;
  transition: color .13s;
}
.history-modal-close:hover { color: var(--text); }
.history-chart-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}
.history-chart-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--gray-200);
  margin-top: .75rem;
}
.history-legend-item {
  font-size: .8rem;
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.history-legend-item small {
  color: var(--gray-500);
  margin-left: .1rem;
}
.history-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Admin : checkbox Terminé ────────────────────────── */
.admin-row-done {
  margin-top: .3rem;
  padding-top: .3rem;
  border-top: 1px solid var(--gray-200);
}
.done-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--gray-600);
  cursor: pointer;
}
.done-label input { margin: 0; }
