/* Page publique des résultats : même habillage que le site « Une dernière boucle »
   (direction « Dossard » : crème, bleu nuit, bleu vif, orange, titres en Anton).
   Lisible sur téléphone, clair ou sombre selon le réglage de l'appareil. */

@font-face {
  font-family: 'Anton';
  src: url('/public/polices/anton-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/public/polices/archivo-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* Couleurs fixes du site */
  --creme: #f7ecaf;
  --orange-site: #e1732e;
  --bleu: #2f0dda;
  --nuit: #120a4a;

  --fond: var(--creme);
  --carte: #fffbe3;
  --texte: var(--nuit);
  --texte-2: #3f3970;
  --bord: var(--nuit);
  --accent: var(--bleu);
  --ombre: var(--nuit);
  --vert: #14692d;
  --orange: #a8480f;   /* texte « en retard » : l'orange du site, foncé pour rester lisible */
  --rouge: #b3261e;
  --gris: #5b5680;
  --trait: 3px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: var(--nuit);
    --carte: #1d1370;
    --texte: var(--creme);
    --texte-2: #d4cb9a;
    --bord: var(--creme);
    --accent: var(--creme);
    --ombre: var(--orange-site);
    --vert: #6fdc8c;
    --orange: #f0a070;
    --rouge: #ff9a8f;
    --gris: #b0aac8;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Archivo', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.45;
}
header, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 16px; }
h1 {
  margin: 0;
  font-family: 'Anton', 'Arial Narrow', sans-serif;
  font-weight: 400;
  font-size: clamp(2.5rem, 11vw, 4.5rem);
  line-height: .95;
  text-transform: uppercase;
  color: var(--accent);
}
/* Le titre est le logotype : toute la largeur de la colonne, sur une seule ligne, bleu (crème en mode sombre),
   avec le coureur orange sur la boucle. */
.titre-logo { padding-top: 4px; }
.titre-logo .logo { display: block; width: 100%; height: auto; overflow: visible; }
/* Texte lu par les lecteurs d'écran mais invisible à l'œil. */
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
h2 {
  margin: 32px 0 4px;
  font-family: 'Anton', 'Arial Narrow', sans-serif;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}
.sous-titre, .aide, footer { color: var(--texte-2); font-size: .95rem; }
.sous-titre { margin: 10px 0 0; font-weight: 500; }
.lien-site { margin: 0 0 16px; padding-bottom: 12px; border-bottom: var(--trait) solid var(--bord); font-size: 1rem; font-weight: 700; }
.lien-site a { display: inline-block; padding: 8px 0; color: var(--texte); text-decoration: none; }
.lien-site a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
:focus-visible { outline: 3px solid var(--orange-site); outline-offset: 3px; }
[hidden] { display: none !important; }
.aide { margin: 0 0 12px; }
footer { margin-top: 32px; padding-top: 16px; padding-bottom: 32px; border-top: var(--trait) solid var(--bord); }
.bandeau-test {
  background: var(--orange-site); color: var(--nuit); font-weight: 700; padding: 10px 14px;
  border: var(--trait) solid var(--nuit); margin: 16px 0 0;
}

.etat {
  background: var(--bleu); color: var(--creme); border: var(--trait) solid var(--bord);
  box-shadow: 8px 8px 0 var(--ombre);
  padding: 20px 16px; margin: 24px 8px 0 0; text-align: center;
}
.etat p { margin: 0; }
.etat-titre { font-size: 1.15rem; font-weight: 700; }
.etat-compte {
  font-family: 'Anton', 'Arial Narrow', sans-serif;
  font-size: clamp(3.5rem, 18vw, 6rem); line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.etat-detail { margin-top: 4px !important; font-weight: 500; }

/* Avant le départ : invitation à parrainer, à la place des totaux */
.avant-course { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 28px 0 0; font-weight: 500; }
.bouton {
  display: inline-block; min-height: 48px; padding: 13px 24px;
  background: var(--orange-site); color: var(--nuit); border: var(--trait) solid var(--nuit);
  font-weight: 700; line-height: 1.2; text-decoration: none;
}
.bouton:hover { box-shadow: 4px 4px 0 var(--ombre); transform: translate(-2px, -2px); }
.inscrit {
  display: flex; align-items: baseline; gap: 10px; min-height: 52px; padding: 12px 14px;
  background: var(--carte); border: var(--trait) solid var(--bord);
}
.inscrit .dossard { font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 1.25rem; color: var(--accent); }
.inscrit .nom { font-weight: 700; overflow-wrap: anywhere; }

.totaux { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }
@media (min-width: 560px) { .totaux { grid-template-columns: repeat(4, 1fr); } }
.total {
  background: var(--carte); border: var(--trait) solid var(--bord); padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.total .valeur {
  font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 2rem; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--accent);
}
.total .libelle { color: var(--texte-2); font-size: .9rem; font-weight: 500; }
.total-dons { background: var(--orange-site); border-color: var(--nuit); }
.total-dons .valeur, .total-dons .libelle { color: var(--nuit); }

.fraicheur { text-align: center; font-size: .95rem; color: var(--texte-2); margin: 14px 0 0; }
.fraicheur.retard { color: var(--orange); font-weight: 700; }
.fraicheur.ancien { color: var(--rouge); font-weight: 700; }

.coureurs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coureurs details { background: var(--carte); border: var(--trait) solid var(--bord); overflow: hidden; }
.coureurs summary {
  display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: 10px;
  min-height: 56px; padding: 10px 14px; cursor: pointer; list-style: none;
}
.coureurs summary::-webkit-details-marker { display: none; }
.rang { font-family: 'Anton', 'Arial Narrow', sans-serif; font-size: 1.5rem; color: var(--texte-2); text-align: right; }
.qui { min-width: 0; }
.qui .nom { font-weight: 700; overflow-wrap: anywhere; }
.qui .dossard { color: var(--texte-2); font-size: .9rem; margin-right: 4px; }
.qui .etat-coureur { display: block; font-size: .9rem; color: var(--texte-2); }
.etat-coureur.en_course, .etat-coureur.vainqueur { color: var(--vert); font-weight: 700; }
.etat-coureur.elimine, .etat-coureur.abandon { color: var(--gris); }
.nb { text-align: right; }
.nb strong {
  font-family: 'Anton', 'Arial Narrow', sans-serif; font-weight: 400; font-size: 2rem; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--accent);
}
.nb span { display: block; font-size: .8rem; color: var(--texte-2); }
.sorti summary { opacity: .8; }
.vainqueur-ligne { background: var(--orange-site) !important; border-color: var(--nuit) !important; box-shadow: 6px 6px 0 var(--ombre); margin-right: 6px; }
.vainqueur-ligne summary *, .vainqueur-ligne .detail, .vainqueur-ligne .detail .resume { color: var(--nuit) !important; }

.detail { border-top: var(--trait) solid var(--bord); padding: 12px 14px; font-size: .95rem; }
.detail .resume { color: var(--texte-2); margin: 0 0 8px; }
.temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.temps li { background: var(--fond); color: var(--texte); border: 1px solid var(--bord); padding: 4px 6px; font-variant-numeric: tabular-nums; }
.temps li span { color: var(--texte-2); font-size: .85rem; margin-right: 4px; }
.vide { color: var(--texte-2); text-align: center; padding: 16px; }
