:root {
  --bleu: #1d5fae;
  --bleu-fonce: #123f75;
  --rouge: #d71920;
  --fond: #f4f6f9;
  --carte: #ffffff;
  --texte: #1c2430;
  --gris: #667085;
  --ligne: #e3e7ee;
  --pair: #f8fafc;
  --or: #c9a227;
  --argent: #9aa4b1;
  --bronze: #b0703c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; background: var(--fond); color: var(--texte); font-size: 14px; }

header { background: var(--bleu); color: #fff; border-bottom: 5px solid var(--rouge); }
.bandeau { max-width: 1200px; margin: 0 auto; padding: 18px 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sur-titre { font-size: 13px; opacity: .85; letter-spacing: .03em; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: 24px; font-weight: 600; }
.saison { font-size: 15px; font-weight: 600; background: rgba(255,255,255,.15); padding: 6px 12px; border-radius: 6px; }

main { max-width: 1200px; margin: 0 auto; padding: 20px; }

.barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--carte); padding: 14px 16px; border-radius: 10px; border: 1px solid var(--ligne); }
.barre label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.espace { flex: 1; }
select { font: inherit; padding: 7px 10px; border-radius: 6px; border: 1px solid #c9d0db; min-width: 170px; }
button { font: inherit; border-radius: 6px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; }
button.principal { background: var(--rouge); color: #fff; font-weight: 600; }
button.principal:hover { background: #b8141a; }
button.secondaire { background: #fff; border-color: #c9d0db; color: var(--texte); }
button:disabled { opacity: .5; cursor: default; }
.maj { color: var(--gris); font-size: 13px; }

.progression { margin-top: 12px; background: #0f1b2d; color: #cfe3ff; font-family: Consolas, monospace; font-size: 12.5px; padding: 12px 14px; border-radius: 8px; max-height: 180px; overflow: auto; white-space: pre-wrap; }
.progression .err { color: #ff9c9c; }

.onglets { display: flex; gap: 4px; margin-top: 20px; border-bottom: 2px solid var(--ligne); flex-wrap: wrap; }
.onglets button { background: none; border-radius: 6px 6px 0 0; padding: 9px 16px; color: var(--gris); font-weight: 600; margin-bottom: -2px; border-bottom: 2px solid transparent; }
.onglets button.actif { color: var(--bleu); border-bottom-color: var(--bleu); background: var(--carte); }
.onglets button .etat { font-weight: 400; font-size: 12px; margin-left: 6px; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 0 0 10px 10px; padding: 16px; overflow-x: auto; }
.carte + .carte { margin-top: 16px; border-radius: 10px; }
.carte h2 { margin: 0 0 4px; font-size: 17px; color: var(--bleu-fonce); }
.carte .sous { color: var(--gris); font-size: 13px; margin-bottom: 12px; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); font-weight: 600; padding: 8px 8px; border-bottom: 2px solid var(--ligne); white-space: nowrap; }
td { padding: 8px 8px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--pair); }
tbody tr:hover { background: #eef4fc; }
th.n, td.n { text-align: right; }
th.c, td.c { text-align: center; }
td.joueur { font-weight: 600; }
td.club { color: var(--gris); font-size: 13px; }
td.total { font-weight: 700; color: var(--bleu-fonce); font-size: 15px; }
td.mg { font-weight: 600; }
.rang { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; background: #eef1f5; }
.r1 .rang { background: var(--or); color: #fff; }
.r2 .rang { background: var(--argent); color: #fff; }
.r3 .rang { background: var(--bronze); color: #fff; }
.pt-tournoi { display: inline-block; min-width: 52px; }
.pt-tournoi small { color: var(--gris); font-size: 11px; margin-left: 3px; }
.absent { color: #b5bdc9; }
.badge { display: inline-block; background: #e8f0fb; color: var(--bleu); font-weight: 700; border-radius: 4px; padding: 2px 8px; }

.vide { text-align: center; color: var(--gris); padding: 40px 10px; }
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--bleu); font-weight: 600; font-size: 13px; }
details table { margin-top: 8px; font-size: 13px; }
.gagnant { font-weight: 700; }

dialog { border: none; border-radius: 12px; padding: 22px 24px; width: min(380px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15, 27, 45, .45); }
dialog h3 { margin: 0 0 6px; color: var(--bleu-fonce); font-size: 17px; }
dialog p { margin: 0 0 14px; color: var(--gris); font-size: 13px; line-height: 1.45; }
dialog label { display: block; font-weight: 600; margin-bottom: 6px; }
dialog input { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #c9d0db; border-radius: 6px; }
dialog input:focus { outline: 2px solid var(--bleu); outline-offset: 1px; }
.mdp-erreur { color: var(--rouge); font-size: 13px; min-height: 18px; margin-top: 6px; }
.dlg-boutons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

footer { color: var(--gris); font-size: 12px; margin-top: 24px; line-height: 1.5; }

@media (max-width: 640px) {
  main { padding: 12px; }
  h1 { font-size: 20px; }
  .espace { display: none; }
}

@media print {
  header { background: none; color: #000; border-bottom: 2px solid #000; }
  .barre, .progression, .onglets, details, button { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .carte { border: none; padding: 0; }
  td, th { padding: 4px 6px; }
}
