/* Interface de discussion. Palette « papier » chaude, colonne de lecture étroite,
   message de l'assistant sans bulle : la réponse est le contenu principal de la page,
   pas un élément d'une conversation en vis-à-vis.

   Aucune police distante n'est chargée : la CSP de l'application interdit les origines
   tierces, et une police qui ne se charge pas coûte plus qu'elle n'apporte. */

:root {
  --bg: #faf9f5;
  --panel: #ffffff;
  --raised: #ffffff;
  --border: #e6e3da;
  --border-soft: #efece4;
  --text: #1f1e1d;
  --muted: #6c6a65;
  --accent: #c96442;
  --accent-hover: #b25538;
  --accent-ink: #ffffff;
  --accent-wash: rgba(201, 100, 66, 0.08);
  --danger: #b3413a;
  --bubble-user: #f0eee6;
  --win: #3f8f5f;
  --draw: #9a968c;
  --loss: #c0544c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.05), 0 8px 28px rgba(31, 30, 29, 0.07);
  --shadow-soft: 0 1px 3px rgba(31, 30, 29, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --panel: #30302e;
    --raised: #2e2e2c;
    --border: #45443f;
    --border-soft: #3a3a37;
    --text: #f5f4ef;
    --muted: #a5a29a;
    --accent: #d97757;
    --accent-hover: #e08a6d;
    --accent-ink: #1f1e1d;
    --accent-wash: rgba(217, 119, 87, 0.14);
    --danger: #e0756c;
    --bubble-user: #3a3a36;
    --win: #5aa878;
    --draw: #8e8b84;
    --loss: #d2695f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.28);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, "Apple Color Emoji", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------- en-tête */
header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
header h1 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.012em;
  display: flex;
  align-items: center;
  gap: 8px;
}
header .actions { display: flex; align-items: center; gap: 6px; }
.status { color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------- boutons */
button {
  font: inherit;
  font-size: 13.5px;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: none; border-color: transparent; color: var(--muted); }
button.ghost:hover { color: var(--text); background: var(--accent-wash); }
button.primary { background: var(--accent); color: var(--accent-ink); font-weight: 550; border-radius: var(--radius-sm); }
button.primary:hover { background: var(--accent-hover); }
button.primary:disabled { opacity: 0.4; cursor: default; background: var(--accent); }
button.danger { background: none; border-color: var(--danger); color: var(--danger); border-radius: var(--radius-sm); }
button.danger:hover { background: var(--danger); color: #fff; }

/* -------------------------------------------------------------- conversation */
main#log {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.msg { position: relative; overflow-wrap: anywhere; }

/* Le message de l'utilisateur est une bulle courte ; celui du modèle est du texte
   courant, sans cadre, pour se lire comme un document plutôt qu'une réplique. */
.msg.user {
  align-self: flex-end;
  max-width: 85%;
  padding: 11px 16px;
  border-radius: 18px 18px 4px 18px;
  background: var(--bubble-user);
  white-space: pre-wrap;
  font-size: 15.5px;
}
.msg.bot { align-self: stretch; max-width: 100%; font-size: 16px; }
.msg.pending { color: var(--muted); font-style: italic; }
.msg.error {
  align-self: stretch;
  color: var(--danger);
  border-left: 3px solid var(--danger);
  padding-left: 14px;
}

.msg .meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px; font-size: 11.5px; color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.msg:hover .meta, .msg:focus-within .meta { opacity: 1; }
.msg .copy {
  background: none; border: none; color: var(--muted);
  padding: 3px 8px; font-size: 11.5px; border-radius: 6px;
}
.msg .copy:hover { color: var(--text); background: var(--accent-wash); }

.msg p { margin: 0 0 12px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 8px 0 12px 22px; padding: 0; }
.msg li { margin: 4px 0; }
.msg h3 { font-size: 16px; font-weight: 600; margin: 18px 0 8px; letter-spacing: -0.01em; }
.msg strong { font-weight: 600; }
.msg code {
  background: var(--bubble-user);
  padding: 2px 6px; border-radius: 5px; font-size: 13.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.msg pre {
  background: var(--bubble-user);
  padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto;
  border: 1px solid var(--border-soft);
}
.msg pre code { background: none; padding: 0; }

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.msg table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.msg th, .msg td { border-bottom: 1px solid var(--border-soft); padding: 9px 13px; text-align: left; white-space: nowrap; }
.msg tr:last-child td { border-bottom: none; }
.msg th { background: var(--bubble-user); font-weight: 600; font-size: 12.5px; letter-spacing: 0.01em; }

/* ----------------------------------------------------------------- composeur */
form {
  position: sticky;
  bottom: 0;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 24px 6px;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

/* Le cadre entoure la zone de saisie et son bouton : l'ensemble se lit comme un seul
   champ, et le bouton n'a pas l'air d'un élément détaché posé à côté. */
.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }

textarea {
  width: 100%;
  resize: none;
  max-height: 220px;
  background: none;
  border: none;
  color: var(--text);
  padding: 2px 4px;
  font: inherit;
  font-size: 15.5px;
  line-height: 1.6;
}
textarea:focus-visible { outline: none; }
textarea::placeholder { color: var(--muted); }

.composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.disclaimer {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 16px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- dialogues */
dialog {
  max-width: 560px;
  width: calc(100% - 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 26px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(31, 30, 29, 0.45); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; letter-spacing: -0.012em; }
dialog p, dialog li { font-size: 14px; color: var(--text); }
dialog .muted { color: var(--muted); }
dialog ul { margin: 8px 0 14px 20px; padding: 0; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }

@media (max-width: 620px) {
  header { padding: 11px 16px; }
  header h1 { font-size: 14.5px; }
  main#log { padding: 20px 16px 4px; gap: 20px; }
  .msg.user { max-width: 100%; }
  form { padding: 10px 16px 4px; }
  .disclaimer { padding: 0 16px 14px; }
}

/* ------------------------------------------------------------- cartes de match */
.matches { display: flex; flex-direction: column; gap: 10px; align-self: stretch; margin: 4px 0; }

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 15px 16px 12px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.match .side { display: flex; align-items: center; gap: 11px; min-width: 0; }
.match .side.home { justify-content: flex-end; text-align: right; }
.match .side.away { justify-content: flex-start; text-align: left; }
.match .side .name { font-weight: 550; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.match .crest {
  width: 32px; height: 32px; flex: 0 0 32px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--bubble-user);
}
.match .crest.placeholder {
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}

.match .center { text-align: center; min-width: 82px; }
.match .score { font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.match .kickoff { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.match .when { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }

.match .badge {
  display: inline-block; margin-top: 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
}
.match .badge.live { background: var(--danger); color: #fff; }
.match .badge.done { color: var(--muted); border: 1px solid var(--border); }

.match .competition {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
  margin-top: 4px;
}

@media (max-width: 620px) {
  .match { padding: 12px 11px 10px; gap: 7px; }
  .match .side .name { font-size: 13px; }
  .match .crest { width: 27px; height: 27px; flex-basis: 27px; }
  .match .score { font-size: 19px; }
  .match .center { min-width: 68px; }
}

/* --------------------------------------------------------- cartes de forme */
.form-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.form-head {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.form-head .name { font-weight: 600; font-size: 15px; flex: 1; letter-spacing: -0.01em; }
.form-head .record { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.form-head .period { font-size: 10.5px; color: var(--muted); display: block; }

/* Une rencontre = une ligne lisible comme une carte de match, en plus compact. */
.form-match {
  display: grid;
  grid-template-columns: 4px 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.form-match:last-of-type { border-bottom: none; }
.form-match .outcome { width: 4px; height: 26px; border-radius: 2px; }
.form-match .outcome.V { background: var(--win); }
.form-match .outcome.N { background: var(--draw); }
.form-match .outcome.D { background: var(--loss); }

.form-match .team { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.form-match .team.left { justify-content: flex-end; text-align: right; }
.form-match .team .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-match .team .label.self { font-weight: 600; }
.form-match .crest { width: 21px; height: 21px; flex: 0 0 21px; border-radius: 5px; background: var(--bubble-user); }
.form-match .crest.placeholder { font-size: 8px; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.form-match .result { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 14px; min-width: 44px; text-align: center; }
.form-match .day { font-size: 10.5px; color: var(--muted); min-width: 44px; text-align: right; }

.form-stats {
  display: flex; flex-wrap: wrap; gap: 20px;
  padding: 13px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--bubble-user);
}
.form-stats .stat { display: flex; flex-direction: column; }
.form-stats .value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.form-stats .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1px; }
.form-stats .note { font-size: 11.5px; color: var(--muted); font-style: italic; align-self: center; }

/* ----------------------------------------------------- liste des discussions */
.conv-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; }
.conv {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  color: var(--text);
  font-size: 14px;
  width: 100%;
}
.conv:hover { background: var(--accent-wash); }
.conv.current { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-wash); }
.conv .titre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .meta-conv { font-size: 11px; color: var(--muted); white-space: nowrap; }
.conv-empty { color: var(--muted); font-size: 14px; padding: 14px 0; }

/* --------------------------------------------- feuille de match : les buteurs */
/* Deux colonnes qui prolongent celles des équipes : à gauche les buteurs de
   l'équipe à domicile, à droite ceux de l'équipe qui se déplace. */
.scorers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid var(--border-soft);
}
.scorer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.scorer-list li { display: flex; align-items: baseline; gap: 7px; font-size: 12.5px; line-height: 1.45; }
.scorer-list.home li { justify-content: flex-end; text-align: right; }
.scorer-list.home li { flex-direction: row-reverse; }
.scorer-list.away li { justify-content: flex-start; }
.scorer-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorer-min { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; font-size: 11.5px; }

@media (max-width: 620px) {
  .scorers { gap: 6px 10px; }
  .scorer-list li { font-size: 11.5px; }
}

/* ------------------------------------------------- fiches d'effectif */
/* Grille de vignettes : autant de joueurs par ligne que la largeur le permet,
   regroupés par poste comme sur une feuille de match. */
.squad-group { padding: 12px 16px 14px; border-bottom: 1px solid var(--border-soft); }
.squad-group:last-child { border-bottom: none; }

.squad-line {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.player-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.player { display: flex; align-items: center; gap: 9px; min-width: 0; }

.portrait {
  width: 34px; height: 34px; flex: 0 0 34px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--bubble-user);
  border: 1px solid var(--border-soft);
}
.portrait.placeholder {
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}

.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-name {
  font-size: 13px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-number { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .squad-group { padding: 10px 12px 12px; }
  .player-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
  .portrait { width: 30px; height: 30px; flex-basis: 30px; }
  .player-name { font-size: 12.5px; }
}

/* ------------------------------------------ étapes pendant qu'une réponse se construit */
/* Une question peut coûter une dizaine de secondes et plusieurs requêtes. Sans repères,
   l'attente ressemble à une panne. Les libellés viennent du serveur au moment où il
   franchit chaque étape : rien ne tourne à vide. */
.msg.pending { font-style: normal; }
.etapes { display: flex; flex-direction: column; gap: 4px; }

.etape {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--muted);
  animation: etape-entre 0.25s ease-out;
}
.etape.passee { opacity: 0.45; }

.etape-puce {
  width: 7px; height: 7px; flex: 0 0 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: etape-pulse 1.1s ease-in-out infinite;
}
.etape.passee .etape-puce { animation: none; background: var(--muted); opacity: 0.6; }

@keyframes etape-entre { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
@keyframes etape-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.45); opacity: 0.55; }
}

/* Une animation qui pulse en continu gêne certaines personnes ; l'information reste
   portée par le texte, donc la couper ne fait rien perdre. */
@media (prefers-reduced-motion: reduce) {
  .etape, .etape-puce { animation: none; }
}

/* =================================================== marque et menu d'en-tête */
.marque {
  display: flex; align-items: center; gap: 9px;
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.015em;
}
.marque-icone {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 9px;
  background: var(--accent-wash);
  font-size: 15px; line-height: 1;
}

.menu-conteneur { position: relative; }
.menu-declencheur { font-size: 17px; line-height: 1; padding: 5px 11px; letter-spacing: 0.06em; }

.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 214px; padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.menu[hidden] { display: none; }
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 7px;
  background: none; border: none; color: var(--text); font-size: 14px;
}
.menu-item:hover { background: var(--accent-wash); color: var(--accent); }
.menu-separateur { height: 1px; margin: 5px 8px; background: var(--border-soft); }

/* ========================================================== écran d'accueil */
/* Une page vide n'apprend rien de ce que l'application sait faire. Les exemples
   couvrent volontairement ses quatre registres — résultats, classements, effectifs,
   culture — plutôt que six variantes de la même question. */
.accueil {
  margin: auto 0;
  padding: 8px 0 24px;
  display: flex; flex-direction: column; gap: 14px;
  animation: accueil-entre 0.4s ease-out;
}
.accueil[hidden] { display: none; }

.accueil-salut {
  margin: 0;
  font-size: 30px; font-weight: 600; letter-spacing: -0.028em; line-height: 1.15;
}
.accueil-texte {
  margin: 0; max-width: 56ch;
  font-size: 15.5px; color: var(--muted); line-height: 1.6;
}
.accueil-texte strong { color: var(--text); font-weight: 600; }

.accueil-exemples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.exemple {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  text-align: left; font-size: 14.5px; color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.exemple:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: var(--accent-wash);
  transform: translateY(-1px);
}
.exemple-icone { font-size: 16px; flex: 0 0 auto; line-height: 1; }

@keyframes accueil-entre { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .accueil { animation: none; }
  .exemple:hover { transform: none; }
}

/* ======================================================= composeur, finitions */
.composer-actions { justify-content: space-between; }
.composer-aide { font-size: 11.5px; color: var(--muted); }

@media (max-width: 620px) {
  .marque-nom { display: none; }        /* l'icône suffit, la place manque */
  .accueil-salut { font-size: 24px; }
  .accueil-texte { font-size: 14.5px; }
  .accueil-exemples { grid-template-columns: 1fr; }
  .composer-aide { display: none; }
}

/* ------------------------------------------------------------ carte des statistiques */
/* La carte d'un match, puis une ligne par statistique : valeurs de part et d'autre du libellé,
   et une barre partagée aux couleurs des deux camps (domicile à gauche, extérieur à droite). */
:root { --stat-dom: #c96442; --stat-ext: #3f6fb5; }
@media (prefers-color-scheme: dark) { :root { --stat-dom: #e0855f; --stat-ext: #6f9be0; } }
.stats-card { row-gap: 14px; }
.stat-rows { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 11px; padding: 4px 4px 0; }
.stat-row { display: flex; flex-direction: column; gap: 5px; padding: 2px 6px; border-radius: 10px; }
.stat-row.en-avant { background: var(--accent-wash); padding: 8px 8px 9px; }
.stat-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 10px; }
.stat-label { font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; }
.stat-row.en-avant .stat-label { color: var(--text); font-weight: 650; }
.stat-val { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
.stat-val.home { text-align: left; }
.stat-val.away { text-align: right; }
.stat-val.lead { color: var(--text); font-weight: 700; }
.stat-bar { display: flex; gap: 3px; height: 6px; }
.stat-bar span { display: block; height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.stat-bar .home { background: var(--stat-dom); }
.stat-bar .away { background: var(--stat-ext); }
.stat-bar .vide { background: var(--border); }
.stat-row.en-avant .stat-bar { height: 8px; }

/* ------------------------------------------------------------ carte de classement */
.classement-card {
  padding: 14px 6px 8px;
  background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.classement-tete { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 10px; }
.classement-tete strong { font-size: 16px; }
.classement-tete span { font-size: 12px; color: var(--muted); }
.classement-groupe { padding: 10px 12px 4px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.classement-defile { overflow-x: auto; }
.classement-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.classement-table th {
  padding: 6px 6px; font-size: 11px; font-weight: 600; color: var(--muted);
  text-align: center; border-bottom: 1px solid var(--border);
}
.classement-table th.club { text-align: left; }
.classement-table td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--border-soft); }
.classement-table tr:last-child td { border-bottom: none; }
.classement-table td.pos { width: 26px; color: var(--muted); font-weight: 600; }
.classement-table td.club { text-align: left; white-space: nowrap; }
.classement-table td.club .crest {
  width: 20px; height: 20px; vertical-align: middle; margin-right: 8px;
  object-fit: contain; border-radius: 4px; background: none;
}
.classement-table td.club .crest.placeholder { display: inline-grid; place-items: center; font-size: 9px; background: var(--bubble-user); }
.classement-table td.club span { vertical-align: middle; }
.classement-table td.pts { font-weight: 750; }
.classement-table tr.moi td { background: var(--accent-wash); }
.classement-table tr.moi td.club span { font-weight: 650; }
.classement-table td.forme { white-space: nowrap; }
.classement-table .issue {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; margin: 0 1px; border-radius: 50%;
  font-size: 10px; font-weight: 800; color: #fff;
}
.classement-table .issue.V { background: var(--win); }
.classement-table .issue.N { background: var(--draw); }
.classement-table .issue.D { background: var(--loss); }
@media (max-width: 560px) {
  .classement-table .detail { display: none; }
  /* un nom long se coupe plutôt que de pousser les cinq derniers résultats hors de l'écran */
  .classement-table td.club span { display: inline-block; max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
  .classement-table td.club .crest { margin-right: 6px; }
  .classement-table td, .classement-table th { padding: 6px 4px; }
  .classement-table .issue { width: 14px; height: 14px; font-size: 8px; }
}

/* Jeu seul (JEU_SEUL=1) : ni onglets, ni menu de la discussion, dès le premier affichage (le script, lui,
   ne les cachait qu'une fois chargé). */
body[data-jeu-seul] header .onglets,
body[data-jeu-seul] header .menu-conteneur { display: none !important; }
