/* CTLServ, tournoi.css
   Page du tournoi hebdomadaire. Reprend les variables et les blocs de main.css;
   rien n'est redefini ici qui existe deja la-bas. */

.trn { position: relative; padding: 116px 0 88px; }
.trn__bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.trn__in { position: relative; display: flex; flex-direction: column; gap: 26px; }

/* ---- En-tete + etat en direct ---- */
.trn-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 26px;
}
.trn-hero__txt { flex: 1 1 420px; min-width: 0; }

.trn-kicker {
  display: block; margin-bottom: 8px;
  font-size: 11px; font-weight: 600;text-transform: uppercase;
  color: var(--blue);
}
.trn-hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; }
.trn-lead { margin-top: 12px; max-width: 58ch; color: var(--muted); line-height: 1.65; }

.trn-live {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 220px;
  padding: 18px 26px;
  border: 1px solid var(--br); border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}
.trn-live--off { color: var(--muted); }
.trn-live__phase {
  font-size: 10px; font-weight: 600;text-transform: uppercase;
  color: var(--blue);
}
/* tabular-nums: sans ca le compte a rebours tremble a chaque seconde. */
.trn-live__count { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.trn-live__label { font-size: 12px; color: var(--muted); }
.trn-live__when {
  margin-top: 7px; padding-top: 7px;
  width: 100%; text-align: center;
  border-top: 1px solid var(--br);
  font-size: 12px; font-weight: 600;
}
.trn-live__when:empty { display: none; }

/* ---- Chiffres ---- */
.trn-stats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.trn-stat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 10px;
  border: 1px solid var(--br); border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  min-width: 0;
}
.trn-stat b {
  max-width: 100%;
  font-size: 22px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trn-stat span {
  font-size: 10px;text-transform: uppercase; color: var(--muted);
  text-align: center;
}

/* ---- Cartes ---- */
.trn-cols { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
@media (max-width: 900px) { .trn-cols { grid-template-columns: 1fr; } }

.trn-card {
  padding: 26px 28px;
  border: 1px solid var(--br); border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  min-width: 0;
}
.trn-card h2 { font-size: 19px; margin-bottom: 14px; }
.trn-card h3 {
  margin: 26px 0 10px;
  font-size: 11px; font-weight: 600;text-transform: uppercase;
  color: var(--muted);
}
.trn-note { font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ---- Etapes ----
   Le numero est une TUILE biseautee a -34deg, la forme de tout ce qui compte
   sur ce site. Meme construction que .btn: le biseau est porte par la tuile,
   et le contenu le rattrape avec --unskew, sinon le chiffre penche.
   `align-items: center`: la tuile se cale au milieu du bloc titre + phrase,
   pas sur la premiere ligne. */
.trn-steps { display: flex; flex-direction: column; gap: 18px; list-style: none; }
.trn-steps li { display: flex; align-items: center; gap: 16px; }

/* Degrade et texte blanc REPRIS de .btn--primary, a l'identique. Le bleu clair
   de --blue avec du texte fonce sortait du langage visuel du site, ou une tuile
   bleue porte toujours du blanc; et ce bleu profond est justement celui qui fait
   monter le blanc a 4,8:1 (cf. le commentaire de .btn--primary dans main.css). */
.trn-steps i {
  flex: none;
  width: 36px; height: 26px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(110deg, #0b4791 0%, #1d72cc 50%, #0b4791 100%);
  border-bottom: 2px solid var(--blue-lt);
  box-shadow: 0 0 16px rgba(38, 145, 245, .5);
  transform: skewX(var(--skew));
  font-style: normal;
}
/* Le chiffre: debiaise, donc optiquement centre dans la tuile. */
.trn-steps i span {
  display: block;
  transform: skewX(var(--unskew));
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.trn-steps b { display: block; margin-bottom: 3px; font-size: 14px; line-height: 1.5; }
.trn-steps p { font-size: 13px; line-height: 1.6; color: var(--muted); }

/* ---- Reglement ---- */
.trn-rules { display: flex; flex-direction: column; gap: 9px; list-style: none; }
.trn-rules li {
  position: relative; padding-left: 18px;
  font-size: 13px; line-height: 1.6; color: var(--muted);
}
.trn-rules li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.trn-rules b { color: var(--txt); font-weight: 600; }

/* ---- Vehicules ---- */
.trn-cars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.trn-car {
  padding: 5px 10px;
  border: 1px solid var(--br); border-radius: 6px;
  font-size: 11.5px; white-space: nowrap;
}

/* ---- Participants ---- */
.trn-list { list-style: none; display: flex; flex-direction: column; gap: 2px; max-height: 620px; overflow-y: auto; }
.trn-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  min-width: 0;
}
.trn-row:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.trn-row__seed {
  flex: none; width: 24px;
  font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); text-align: right;
}
.trn-row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-row__elo { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.trn-crew {
  flex: none;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  font-size: 10px; font-weight: 600;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Pastille de presence: pleine = confirme, creuse = inscrit seulement. */
.trn-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--muted); }
.trn-dot.on { background: var(--ok); border-color: var(--ok); }

.trn-empty { padding: 22px 0; font-size: 13px; color: var(--muted); }

/* ---- Arbre ---- */
.trn-card--wide { grid-column: 1 / -1; }
/* Defilement horizontal PROPRE: c'est ce conteneur qui defile, jamais la page. */
.trn-bracket {
  display: flex; gap: 26px; align-items: stretch;
  margin-top: 14px; padding-bottom: 10px;
  overflow-x: auto;
}
.trn-round { flex: none; width: 232px; display: flex; flex-direction: column; }
.trn-round__t {
  margin-bottom: 10px;
  font-size: 10px; font-weight: 600;text-transform: uppercase;
  color: var(--muted); text-align: center;
}
.trn-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }

.trn-match {
  border: 1px solid var(--br); border-radius: 9px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
}
.trn-match.live { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

.trn-slot {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 0;
}
.trn-slot + .trn-slot { border-top: 1px solid var(--br); }
.trn-slot.win { background: rgba(60, 217, 123, .1); }
.trn-slot.lose { opacity: .45; }
.trn-slot.empty { color: var(--muted); font-style: italic; }
.trn-slot__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-slot__e { flex: none; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.trn-foot {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-top: 1px solid var(--br);
  background: rgba(0, 0, 0, .22);
  font-size: 10.5px; color: var(--muted);
}
.trn-foot b { color: var(--blue); font-weight: 600; }
.trn-foot .trn-left { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Historique ---- */
.trn-history { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.trn-hrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
}
.trn-hrow:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.trn-hrow__d { flex: none; width: 96px; font-size: 12px; color: var(--muted); }
.trn-hrow__w { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-hrow__n { flex: none; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .trn { padding-top: 96px; }
  .trn-card { padding: 20px 18px; }
  .trn-live { width: 100%; }
}
