/* Les tournois en cours (vue /tournois, web/js/tournois.js) et le bloc
   « En lice à … » de la fiche joueur.

   Pensé d'abord pour un téléphone de 390 px : pas d'arbre de tableau (trop
   large), mais une carte par tournoi, des onglets de tours et des listes
   verticales. Les tailles de texte passent par les variables --texte-* de
   tokens.css, qui grandissent sur téléphone. */

.tournois-sommaire {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 16px;
}
.tournois-sommaire a { min-height: 36px; padding: 6px 12px; font-size: var(--texte-13); }

.carte-tournoi { margin-bottom: 16px; scroll-margin-top: 80px; }
.tournoi-tete h2 { margin: 0; }
.tournoi-tete .sous-titre { margin-bottom: 12px; }

.carte-tournoi h3 {
  font-size: var(--texte-15); letter-spacing: -.01em;
  margin: 14px 0 8px;
}
.carte-tournoi h3 .sous { color: var(--muted); font-weight: 600; margin-left: 4px; }

/* --- Encore en lice : la partie mise en avant ----------------------------- */
.tournoi-en-lice {
  background: var(--lilac-softer);
  border: 1px solid var(--lilac-soft);
  border-radius: var(--rayon-petit);
  padding: 2px 14px 10px;
}
.en-lice-liste {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.en-lice-liste li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.en-lice-nom { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.en-lice-elo { color: var(--ink-2); font-size: var(--texte-13); font-variant-numeric: tabular-nums; white-space: nowrap; }
.en-lice-suite { margin: 2px 0 0; color: var(--ink-2); font-size: var(--texte-13); line-height: 1.45; }

/* --- Le tableau, tour par tour -------------------------------------------- */
.tableau-tours { margin: 0 0 6px; }
.tableau-tours .sous { color: var(--muted-sur-metal); font-weight: 600; }
.tableau-tours button[aria-pressed="true"] .sous { color: var(--violet-dark); }

.tableau-liste {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tableau-match {
  border: 1px solid var(--line);
  border-radius: var(--rayon-petit);
  background: var(--verre-liste);
  padding: 8px 12px;
}
.tableau-ligne {
  display: flex; align-items: baseline; gap: 8px;
  font-size: var(--texte-14);
  padding: 2px 0;
}
.tableau-ligne .lien-joueur { flex: 1; min-width: 0; }
.tableau-ligne.perdant .lien-joueur { font-weight: 500; color: var(--ink-2); }
.tableau-ligne .issue {
  flex: none; width: 18px; text-align: center;
  font-size: var(--texte-12); font-weight: 800;
}
.tableau-ligne.gagnant .issue { color: var(--up-texte); }
.tableau-ligne.perdant .issue { color: var(--muted); }
.tableau-elo { color: var(--ink-2); font-size: var(--texte-13); font-variant-numeric: tabular-nums; }
.tableau-pied {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line);
  color: var(--muted); font-size: var(--texte-12-5);
}
.tableau-pied .score { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.tableau-gain { margin-left: auto; font-weight: 700; }

/* --- Fiche joueur : « En lice à … » --------------------------------------- */
.fiche-en-lice {
  margin: 10px 2px 0; padding: 8px 12px;
  border-radius: var(--rayon-petit);
  background: var(--lilac-softer); border: 1px solid var(--lilac-soft);
  font-size: var(--texte-13-5); color: var(--ink-2); line-height: 1.5;
}
.fiche-en-lice a:not(.lien-joueur) { color: var(--violet-dark); font-weight: 650; }

/* Téléphone : une seule colonne, et des onglets de tours qui défilent à
   l'horizontale plutôt que de s'empiler sur trois lignes. */
@media (max-width: 760px) {
  .en-lice-liste, .tableau-liste { grid-template-columns: 1fr; }
  .tableau-tours { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .tableau-tours button { flex: none; }
  .tournoi-en-lice { padding: 2px 12px 8px; }
}
