/* BVPB — Résultats de tournoi : styles du HTML produit par assets/js/resultats.js.
   Chargé par tournois.html (modale) et par /admin/ (aperçu) : même rendu partout.
   Jetons avec repli, pour fonctionner avec ou sans bvpb.css. */

.res-empty { color: var(--bvpb-muted, #847E76); margin: 0; }
.res-muted { color: var(--bvpb-muted, #847E76); font-weight: 600; }
.res-title {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--bvpb-muted, #847E76); margin: 18px 0 8px;
}
.res-title:first-child { margin-top: 0; }

/* Récapitulatif */
.res-recap {
  background: var(--bvpb-sand, #F7F4EF); border-radius: 14px; padding: 14px 16px; margin-bottom: 4px;
}
.res-recap__stats { display: flex; gap: 8px; }
.res-stat {
  flex: 1; background: #fff; border-radius: 10px; padding: 10px 8px; text-align: center; min-width: 0;
  box-shadow: 0 1px 2px rgba(46, 43, 40, 0.05);
}
.res-stat b { display: block; font-size: 1.4rem; line-height: 1.1; color: var(--bvpb-ink, #2E2B28); }
.res-stat span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bvpb-muted, #847E76); }
.res-recap__format { margin-top: 10px; font-weight: 800; color: var(--bvpb-ink, #2E2B28); font-size: 0.92rem; }
.res-teams { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.res-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fff;
  border: 1px solid rgba(46, 43, 40, 0.12); font-size: 0.8rem; font-weight: 700; color: var(--bvpb-body, #4B4742);
}

/* Tableaux */
.res-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid rgba(46, 43, 40, 0.1); background: #fff; }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; color: var(--bvpb-body, #4B4742); margin: 0; }
.res-table th, .res-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(46, 43, 40, 0.08); vertical-align: middle; }
.res-table thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--bvpb-muted, #847E76);
  background: var(--bvpb-sand, #F7F4EF); border-bottom: 2px solid rgba(46, 43, 40, 0.1); white-space: nowrap;
}
.res-table tbody tr:last-child td { border-bottom: 0; }
.res-table tbody tr:hover td { background: rgba(242, 123, 53, 0.05); }
.res-col-rank { width: 52px; text-align: center !important; }
.res-col-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-team b { color: var(--bvpb-ink, #2E2B28); }
.res-team small { display: block; color: var(--bvpb-muted, #847E76); font-size: 0.75rem; }
.res-row--podium td { background: rgba(242, 123, 53, 0.04); }
.res-rank {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px;
  background: #ECE7DE; color: var(--bvpb-ink, #2E2B28); font-weight: 800; font-size: 0.85rem;
}
.res-rank--1 { background: linear-gradient(135deg, #F7D774, #E0B12E); color: #4d3800; box-shadow: 0 2px 6px rgba(224, 177, 46, 0.4); }
.res-rank--2 { background: linear-gradient(135deg, #E6E6E6, #B9B9B9); color: #333; }
.res-rank--3 { background: linear-gradient(135deg, #E3A876, #B8703A); color: #fff; }

/* Matchs par tour */
.res-matches { display: grid; gap: 12px; }
.res-stage { background: #fff; border: 1px solid rgba(46, 43, 40, 0.1); border-radius: 12px; padding: 10px 12px 4px; }
.res-stage__name { font-weight: 800; color: var(--bvpb-ink, #2E2B28); margin-bottom: 6px; }
.res-round__name {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--bvpb-flame-deep, #DD5F17); margin: 8px 0 4px;
}
.res-match {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 7px 0; border-top: 1px solid rgba(46, 43, 40, 0.06); font-size: 0.92rem;
}
.res-match__team { min-width: 0; overflow-wrap: anywhere; color: var(--bvpb-body, #4B4742); }
.res-match__team--right { text-align: right; }
.res-match__team.is-winner { font-weight: 800; color: var(--bvpb-ink, #2E2B28); }
.res-match__team--tbd { color: var(--bvpb-muted, #847E76); font-style: italic; }
.res-match__team.is-winner::before { content: "🏆 "; font-size: 0.8em; }
.res-match__team--right.is-winner::before { content: ""; }
.res-match__team--right.is-winner::after { content: " 🏆"; font-size: 0.8em; }
.res-match__score {
  font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 2px 10px;
  border-radius: 999px; background: var(--bvpb-sand, #F7F4EF); color: var(--bvpb-ink, #2E2B28); font-size: 0.9rem;
}
.res-match__score i { font-style: normal; color: var(--bvpb-muted, #847E76); font-weight: 600; }

/* Bracket (brackets-viewer) */
/* Focus sur une équipe (page Tournois) */
.res-team--link { cursor: pointer; }
.res-team--link:hover, .res-team--link:focus-visible { color: var(--bvpb-flame-deep, #DD5F17); outline: none; }
.res-team--link.res-chip:hover, .res-team--link.res-chip:focus-visible { border-color: var(--bvpb-flame, #F27B35); }
.res-team--link:focus-visible { box-shadow: 0 0 0 2px var(--bvpb-flame, #F27B35); border-radius: 6px; }
.res-chip.is-focus { background: var(--bvpb-flame, #F27B35); border-color: var(--bvpb-flame, #F27B35); color: #fff; }
.res-match__team.is-focus { color: var(--bvpb-flame-deep, #DD5F17); }
tr.is-focus td { background: rgba(242, 123, 53, 0.12) !important; }
.res-focus .res-match--off, .res-focus .res-stage--off, .res-focus .res-round__name--off { display: none; }
.res-focus__bandeau {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  padding: 8px 12px; border-radius: 10px; background: var(--bvpb-sand, #F7F4EF);
  border-left: 4px solid var(--bvpb-flame, #F27B35);
}
.res-focus__nom { font-weight: 800; color: var(--bvpb-ink, #2E2B28); }
.res-focus__bilan { color: var(--bvpb-muted, #847E76); font-size: 0.9rem; font-weight: 600; }

.res-match--link { cursor: pointer; border-radius: 8px; }
.res-match--link:hover, .res-match--link:focus-visible { background: rgba(242, 123, 53, 0.07); outline: none; }
.res-match--link:focus-visible { box-shadow: inset 0 0 0 2px var(--bvpb-flame, #F27B35); }

.res-bracket {
  min-height: 320px; max-height: 70vh; border: 1px solid rgba(46, 43, 40, 0.1); border-radius: 12px;
  padding: 12px; background: #fff; overflow: auto;
}

/* brackets-viewer aux couleurs du club (les variables sont lues par la lib). */
.res-bracket.brackets-viewer {
  --primary-background: #fff;
  --secondary-background: var(--bvpb-sand, #F7F4EF);
  --font-color: var(--bvpb-ink, #2E2B28);
  --win-color: var(--bvpb-green, #3C7334);
  --loss-color: var(--bvpb-flame-deep, #DD5F17);
  --label-color: var(--bvpb-muted, #847E76);
  --hint-color: var(--bvpb-muted, #847E76);
  --connector-color: #C9C2B6;
  --border-color: rgba(46, 43, 40, 0.14);
  --border-hover-color: var(--bvpb-flame, #F27B35);
  --border-selected-color: var(--bvpb-flame-deep, #DD5F17);
  --bracket-title-color: var(--bvpb-muted, #847E76);
  --table-header-color: var(--bvpb-muted, #847E76);
  --ready-color: var(--bvpb-amber, #D98943);
  --running-color: var(--bvpb-flame, #F27B35);
  --highlight-color: var(--bvpb-flame, #F27B35);
  --qualified-color: var(--bvpb-green, #3C7334);
  --eliminated-color: var(--bvpb-flame-deep, #DD5F17);
  --control-background: var(--bvpb-sand, #F7F4EF);
  --focus-color: var(--bvpb-flame, #F27B35);
  --focus-background: rgba(242, 123, 53, 0.14);
  --text-size: 13px;
  --match-width: 170px;
  --match-border-radius: 8px;
  padding: 12px;
  font-family: var(--bvpb-font, inherit);
}
.res-bracket.brackets-viewer h1 { display: none; } /* le titre de la modale suffit */
.res-bracket.brackets-viewer .zoom-controls { margin-bottom: 4px; }
.res-bracket.brackets-viewer h2 { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.res-bracket.brackets-viewer h3 { font-weight: 800; font-size: 0.8rem; border-radius: 8px; }
.res-bracket.brackets-viewer .participant.win .name { color: var(--bvpb-ink, #2E2B28); }
@media (max-width: 767.98px) {
  .res-bracket { max-height: none; padding: 8px; }
  .res-bracket.brackets-viewer { --match-width: 150px; --text-size: 12px; }
}
