.bracket-scroll { overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--sp-3); }
.bracket { position: relative; display: flex; gap: var(--sp-5); align-items: stretch; width: 100%; }
.bk-round { display: flex; flex-direction: column; flex: 1 1 180px; min-width: 180px; }
.bk-round-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: 6px 0; margin-bottom: var(--sp-2); background: var(--bg); font: 700 .8rem/1 var(--display);
  text-transform: uppercase; letter-spacing: .06em; color: var(--brand-700);
}
.bk-coef { font-size: .7rem; padding: 1px 6px; border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-700); }
.bk-slots { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: var(--sp-3); }
.bk-cell {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 8px 10px; min-width: 0;
}
.bk-cell.is-open { cursor: pointer; border-color: var(--brand-200); }
.bk-cell.is-open:hover { border-color: var(--brand); }
.bk-cell[data-match-id]:not(.is-open) { cursor: pointer; }
.bk-cell[data-match-id]:not(.is-open):hover { border-color: var(--line-strong); }
.bk-cell.is-finished { background: var(--surface-2); }
.bk-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.bk-num { font-size: .62rem; color: var(--faint); letter-spacing: .04em; font-weight: 700; }
.bk-date { font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bk-row + .bk-row { margin-top: 3px; }
.bk-row .flag { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; }
.flag-ph { display: inline-block; width: 18px; height: 13px; border-radius: 2px; background: var(--line); flex: 0 0 auto; }
.bk-team { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.bk-team.bk-ph { color: var(--muted); font-style: italic; }
.bk-badge, .bk-score { flex: 0 0 auto; min-width: 18px; text-align: center; font-weight: 700; font-size: .82rem; }
.bk-pen { font-weight: 700; font-size: .72rem; color: var(--faint); }
.bk-row.is-winner .bk-pen { color: var(--brand-700); }
.bk-badge { color: var(--brand-700); }
.bk-pts { margin-top: 4px; font-size: .72rem; font-weight: 700; color: var(--brand-700); }
.bk-cta { margin-top: 4px; font-size: .72rem; color: var(--muted); }
.bk-finals-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
  min-width: 180px;
  justify-content: center;
  gap: var(--sp-4);
  position: relative;
}
.bk-finals-stack .bk-round { flex: 0 0 auto; min-width: 0; }
.bk-finals-stack .bk-slots { flex: 0 0 auto; justify-content: flex-start; }
.bk-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; }
.bk-round, .bk-cell { position: relative; z-index: 1; }

.bk-sheet[hidden] { display: none; }
/* Hauteur = viewport visible (dvh) pour ne pas passer sous la barre du navigateur mobile. */
.bk-sheet {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100dvh;
  z-index: 100; display: flex; align-items: flex-end; /* au-dessus de la tabbar (z 60) */
}
.bk-sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.bk-sheet-panel {
  position: relative; width: 100%; max-height: 100%; overflow-y: auto;
  -webkit-overflow-scrolling: touch; background: var(--surface);
  border-radius: var(--r) var(--r) 0 0; padding: var(--sp-5) var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow); animation: bk-sheet-up .18s ease-out;
}
@keyframes bk-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bk-sheet-x { position: absolute; top: 10px; right: 12px; font-size: 1.1rem; color: var(--muted); }
.bk-sheet-head { display: flex; align-items: center; gap: 8px; }
.bk-sheet-num { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--faint); }
.bk-sheet-coef[hidden] { display: none; }
.bk-sheet-coef { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: var(--r-pill); background: var(--brand-50); color: var(--brand-700); }
.bk-sheet-date { font-size: .82rem; color: var(--muted); margin: 2px 0 var(--sp-4); }
.bk-sheet-date::first-letter { text-transform: uppercase; }
.bk-sheet-teams { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; }
/* Équipe = drapeau au-dessus, nom en dessous (compact, largeur limitée). */
.bk-sheet-home, .bk-sheet-away {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  font-weight: 700; text-align: center; max-width: 96px; flex: 0 0 auto;
}
.bk-sheet-home .flag, .bk-sheet-away .flag { width: 34px; height: 23px; object-fit: cover; border-radius: 3px; }
.bk-sheet-home .flag-ph, .bk-sheet-away .flag-ph { width: 34px; height: 23px; border-radius: 3px; }
.bk-sheet-name { font-size: .85rem; line-height: 1.2; }
.bk-sheet-detail[hidden] { display: none; }
.bk-sheet-detail { display: inline-block; margin-top: var(--sp-4); font-size: .85rem; font-weight: 600; color: var(--brand-700); }
.bk-sheet-detail:hover { text-decoration: underline; }
@media (min-width: 640px) {
  .bk-sheet { align-items: center; justify-content: center; }
  .bk-sheet-panel { max-width: 420px; border-radius: var(--r); }
}
@media (max-width: 639px) {
  .bracket-scroll {
    margin-left: calc(-1 * var(--sp-3));
    margin-right: calc(-1 * var(--sp-3));
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
  }
  .bk-round { min-width: 156px; flex-basis: 156px; }
  .bk-finals-stack { min-width: 156px; flex-basis: 156px; }
}

/* ===== États phase finale : vainqueur / éliminé + prono vs résultat ===== */
.bk-row.is-winner .bk-team { font-weight: 800; color: var(--ink); }
.bk-row.is-winner .bk-score { color: var(--brand-700); }
.bk-row.is-eliminated { opacity: .5; }
.bk-row.is-eliminated .bk-team { text-decoration: line-through; text-decoration-color: var(--faint); }
.bk-adv { flex: 0 0 auto; margin-left: 4px; color: var(--brand); font-weight: 800; font-size: .8rem; line-height: 1; }

.bk-result { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--line); font-size: .7rem; font-weight: 700; }
.bk-result-pred { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-result-pts { flex: 0 0 auto; }
.bk-result.is-exact .bk-result-pts { color: var(--brand-700); }
.bk-result.is-good  .bk-result-pts { color: var(--warn); }
.bk-result.is-miss  .bk-result-pts { color: var(--faint); }
.bk-result.is-none { color: var(--faint); font-style: italic; justify-content: flex-start; }
