/* ===== BRACKET – Thème sombre glass-morphism ===== */

/* Conteneur – transparent, s'intègre dans la section-card */
.BracketWrapper {
  padding: 16px 10px 10px;
  overflow: visible;
}

.BracketContainer {
  width: 100%;
  overflow: visible;
  position: relative;
}

/* Tableau flexbox horizontal */
.BracketTable {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 14px;
  width: 100%;
  position: relative;
  align-items: flex-start;
  justify-content: center;
}

/* ── Colonnes ── */
.BracketColumn {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.BracketColumnFinal {
  flex: 1.15 1 0;
  min-width: 0;
}

/* ── Cellule ── */
.BracketCell {
  z-index: 2;
  width: 100%;
}

/* ── Carte de match ── */
.BracketMatch {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Équipe ── */
.MatchTeam {
  width: 100%;
  min-height: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  font-size: 10.5px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  white-space: normal;
  overflow: hidden;
  line-height: 1.4;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s, border-color 0.15s;
}

.MatchTeam:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Finale – cases légèrement plus marquées */
.BracketMatchFinal .MatchTeam {
  border-width: 1.5px;
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
  font-size: 11px;
  padding: 6px 8px;
}

/* ── Équipe gagnante ── */
.TeamWinner {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.5);
  color: #a5d6a7;
  font-weight: 600;
}

.TeamWinner:hover {
  background: rgba(76, 175, 80, 0.28);
}

/* ── Vainqueur finale (3e case) ── */
.MatchWinnerFinal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  margin: 2px 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(76, 175, 80, 0.35);
  border: 1.5px solid rgba(76, 175, 80, 0.6);
  border-radius: 6px;
  text-align: center;
  white-space: normal;
  line-height: 1.4;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Pas de pseudo-éléments (connecteurs SVG) */
.BracketCell::after,
.BracketCell::before,
.BracketMatch::before,
.BracketMatch::after {
  display: none !important;
}

/* Override section-card */
.section-card:has(.BracketWrapper) {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* ===== RÉSULTATS DES MATCHS ===== */

.ScrDropdown {
  margin-top: 24px;
}

.ScrToggle {
  cursor: pointer;
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.ScrToggle::-webkit-details-marker {
  display: none;
}

.ScrToggle::before {
  content: '▾';
  font-size: 16px;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.25s;
  line-height: 1;
}

details:not([open])>.ScrToggle::before {
  transform: rotate(-90deg);
}

.ScrToggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.18);
}

/* ── Corps ── */
.ScrBody {
  padding-top: 20px;
}

/* ── Section par round ── */
.ScrSection {
  margin-bottom: 24px;
}

.ScrSection:last-child {
  margin-bottom: 0;
}

.ScrSectionTitle {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Grille ── */
.ScrGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* ── Carte ── */
.ScrCard {
  border-radius: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.2s;
}

.ScrCard:hover {
  background: rgba(255, 255, 255, 0.07);
  border-left-color: rgba(255, 255, 255, 0.25);
}

.ScrCardDone {
  border-left-color: rgba(76, 175, 80, 0.5);
}

.ScrCardDone:hover {
  border-left-color: rgba(76, 175, 80, 0.7);
}

.ScrCardFinale {
  border-left-width: 4px;
  border-left-color: rgba(255, 215, 0, 0.5);
}

.ScrCardFinale:hover {
  border-left-color: rgba(255, 215, 0, 0.8);
}

.ScrCardInner {
  padding: 10px 14px;
}

/* ── Ligne d'équipe ── */
.ScrCardTeam {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

/* Badge sets gagnés (à gauche du nom) */
.ScrCardBadge {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ScrBadgeWin {
  background: #4caf50;
}

.ScrBadgeLose {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
}

/* Nom */
.ScrCardName {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ScrCardWin .ScrCardName {
  color: #fff;
  font-weight: 700;
}

/* Scores par set (à droite) */
.ScrCardSets {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.ScrSet {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.ScrSetWin {
  color: #66bb6a !important;
  background: rgba(76, 175, 80, 0.15) !important;
}

.ScrSetLose {
  color: #ef5350 !important;
  background: rgba(239, 83, 80, 0.12) !important;
}

/* ── Séparateur central (statut) ── */
.ScrCardSep {
  text-align: center;
  padding: 3px 0;
}

.ScrCardStatus {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.2);
}

.ScrStatusDone {
  color: rgba(76, 175, 80, 0.6);
}

/* ===== BRACKET MOBILE — Carousel horizontal swipe ===== */

/* Masqué par défaut (visible uniquement ≤ 768px) */
.MobBracket {
  display: none;
}

/* ── Barre d'onglets ── */
.MobTabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0;
  scrollbar-width: none;
  z-index: 10;
  background: inherit;
  position: relative;
  /* pour le MobTabIndicator absolu */
}

.MobTabs::-webkit-scrollbar {
  display: none;
}

.MobTab {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
  text-align: center;
}

.MobTab:hover {
  color: rgba(255, 255, 255, 0.7);
}

.MobTabActive {
  color: #ffffff;
}

/* Indicateur glissant sous les onglets */
.MobTabIndicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #7c8cf8;
  border-radius: 2px 2px 0 0;
  will-change: transform, width;
  pointer-events: none;
}

/* ── Scroller horizontal ── */
.MobScroller {
  display: flex;
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-y;
}

.MobScroller::-webkit-scrollbar {
  display: none;
}

/* ── Panneau (une phase) ── */
.MobPanel {
  flex: 0 0 82%;
  min-width: 0;
  padding: 14px 10px 14px 14px;
}

/* Finale = pleine largeur (rien après) */
.MobPanel:last-child {
  flex: 0 0 100%;
  padding-right: 14px;
}

/* Réduire l'espace dans le panel Finale (souvent 1 seul match) */
.MobPanel:last-child .MobPanelTitle {
  margin-bottom: 8px;
  padding-bottom: 6px;
}

.MobPanel:last-child .MobMatch:last-child {
  margin-bottom: 0;
}

/* Titre de la phase dans le panel */
.MobPanelTitle {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Carte de match ── */
.MobMatch {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.MobMatchDone {
  border-left-color: rgba(76, 175, 80, 0.5);
}

/* En-tête du match */
.MobMatchHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ligne d'équipe */
.MobTeam {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.MobTeam:last-of-type {
  border-bottom: none;
}

.MobTeamWin {
  color: #ffffff;
  font-weight: 700;
  background: rgba(76, 175, 80, 0.08);
}

.MobTeamWin .MobTeamName {
  color: #a5d6a7;
}

.MobTeamName {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scores par set */
.MobTeamSets {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.MobSet {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
}

.MobSetWin {
  color: #66bb6a !important;
  background: rgba(76, 175, 80, 0.18) !important;
}

.MobSetLose {
  color: #ef5350 !important;
  background: rgba(239, 83, 80, 0.14) !important;
}

/* Badge sets gagnés */
.MobTeamBadge {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.MobBadgeWin {
  background: #4caf50;
}

.MobBadgeLose {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
}

/* Pied de carte */
.MobMatchFoot {
  padding: 5px 12px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===== RESPONSIVE ===== */

/* ── Tablettes & mobiles (≤ 992px) : carousel au lieu du bracket arbre ── */
@media (max-width: 992px) {

  /* MASQUER le bracket desktop arbre + dropdown scores */
  .BracketTable {
    display: none !important;
  }

  .BracketSvg {
    display: none !important;
  }

  .ScrDropdown {
    display: none !important;
  }

  /* AFFICHER le carousel mobile */
  .MobBracket {
    display: block;
  }

  .BracketWrapper {
    padding: 8px 0;
  }

  /* Empêcher le JS desktop de forcer une grande hauteur sur le conteneur */
  .BracketContainer {
    min-height: 0 !important;
    height: auto !important;
  }
}

/* ── Mobiles (≤ 768px) ── */
@media (max-width: 768px) {
  .MobTeam {
    font-size: 12px;
    padding: 8px 12px;
  }

  .MobMatchHead {
    font-size: 9px;
    padding: 6px 12px;
  }

  .MobPanelTitle {
    font-size: 13px;
  }
}

/* ── Petits mobiles (≤ 480px) ── */
@media (max-width: 480px) {
  .MobTab {
    padding: 8px 4px;
    font-size: 11px;
  }

  .MobPanel {
    flex: 0 0 85%;
    padding: 12px 8px 12px 12px;
  }

  .MobPanel:last-child {
    flex: 0 0 100%;
    padding-right: 12px;
  }

  .MobPanelTitle {
    font-size: 13px;
  }

  .MobTeam {
    padding: 7px 10px;
    font-size: 12px;
    gap: 6px;
  }

  .MobSet {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .MobTeamBadge {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .MobMatchHead {
    padding: 5px 10px;
    font-size: 9px;
  }

  .ScrToggle {
    font-size: 12px;
    padding: 9px 12px;
  }

  .ScrCardName {
    font-size: 10.5px;
  }

  .ScrCardBadge {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .ScrSet {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
}