/* ---------- F13 : arbre (Buildfight, Zone Wars, Réalistic) et classement Endgame. Maquettes du 23 nov. 2026. ---------- */
#v-tournoi { --or-t: var(--or, #fbbf24); --argent-t: #cbd5e1; --bronze-t: #d08a4e; --f-grand: Anton, Impact, sans-serif; }

/* Dans la grille de la page, l'arbre ne doit pas élargir la page : il défile tout seul. */
.section-arbre, .section-classement { min-width: 0; }

/* Bandeau : titre, EN DIRECT, les étapes */
.bandeau-a { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 14px; }
.bandeau-a h2, .section-classement h2 { margin: 0; font: italic 400 30px/1 var(--f-grand); text-transform: uppercase; }
.direct-a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 8px; background: var(--rouge); color: #fff; font: 800 12px/1 var(--f-titre); letter-spacing: .04em; }
.direct-a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pouls-a 1.1s ease-in-out infinite; }
@keyframes pouls-a { 50% { opacity: .25; } }
.etapes-a { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.etapes-a span { padding: 6px 14px; transform: skewX(-12deg); background: var(--plaque); color: var(--gris); font: 700 12.5px/1 var(--f-titre); }
.etapes-a span.fait { color: var(--texte); }
.etapes-a span.ici { background: var(--rouge); color: #fff; }

/* L'arbre : une colonne par tour, puis le vainqueur. Les lignes sont un SVG dessiné par-dessus. */
.zone-a { overflow-x: auto; padding: 8px 4px 20px; }
.arbre-a { position: relative; display: grid; grid-template-columns: repeat(var(--tours), minmax(250px, 1fr)) minmax(200px, .8fr); gap: 0 56px; min-width: calc(var(--tours) * 300px + 250px); }
.liens-a { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.liens-a path { fill: none; stroke: var(--trait); stroke-width: 2; stroke-linejoin: round; }
.liens-a path.qualifie { stroke: var(--trait-fort, #41536f); }
.liens-a path.chaud { stroke: var(--or-t); stroke-width: 3; }
.tour-a { display: flex; flex-direction: column; }
.tour-a h3 { margin: 0 0 12px; color: var(--gris); font: italic 400 22px/1 var(--f-grand); text-transform: uppercase; }
.tour-a.ici h3 { color: var(--texte); }
.cases-a { display: flex; flex: 1; flex-direction: column; justify-content: space-around; gap: 18px; }

.match-a { position: relative; z-index: 1; overflow: hidden; background: var(--plaque); border: 1px solid var(--trait); border-radius: 14px; }
.match-a.moi { border-color: rgb(251 191 36 / .55); }
.match-a.direct { border-color: rgb(232 32 46 / .7); box-shadow: 0 0 0 1px rgb(232 32 46 / .4), 0 12px 34px rgb(232 32 46 / .25); }
.haut-a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; background: rgb(255 255 255 / .03); border-bottom: 1px solid var(--trait); color: var(--gris); font: 600 11.5px/1.2 var(--f-texte); }
.match-a.direct .haut-a { background: rgb(232 32 46 / .14); color: #ffd0d4; }
.ligne-a { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 12px; }
.ligne-a.eq { grid-template-columns: auto minmax(0, 1fr); }
.ligne-a + .ligne-a { border-top: 1px solid rgb(255 255 255 / .05); }
.ligne-a img, .sans-rang { width: 30px; height: 30px; object-fit: contain; }
.sans-rang { display: inline-block; border-radius: 50%; background: var(--plaque-2, #213046); }
.nom-a { overflow: hidden; font: 700 15px/1.15 var(--f-titre); text-overflow: ellipsis; white-space: nowrap; }
.nom-a a { color: inherit; }
.nom-a small { display: block; color: var(--gris); font: 500 11px/1.2 var(--f-texte); }
.mates-a { color: var(--gris); font-weight: 600; }
.ok-a { color: var(--ok); }
.ligne-a.perd { opacity: .45; }
.ligne-a.moi .nom-a { color: var(--or-t); }
.ligne-a.moi .mates-a { color: #fde7a7; }
.ligne-a.vide .nom-a { color: var(--gris); font-style: italic; font-weight: 500; }

/* Les logos d'une équipe, l'un sur l'autre */
.pile-rangs { position: relative; display: inline-block; width: calc(28px + (var(--n) - 1) * 14px); height: 30px; }
.pile-rangs img, .pile-rangs .sans-rang { position: absolute; top: 1px; width: 28px; height: 28px; }
.pile-rangs > :nth-child(2) { left: 14px; }
.pile-rangs > :nth-child(3) { left: 28px; }
.pile-rangs > :nth-child(4) { left: 42px; }

.action-a { display: grid; gap: 8px; padding: 0 12px 12px; }
.action-a .declarer-arbre { margin-top: 0; }
.action-a .declarer-arbre > span { flex-basis: 100%; color: var(--gris); font-size: 12px; }
.action-a .declarer-arbre .btn { flex: 1; }

/* Le vainqueur */
.champion-a { position: relative; z-index: 1; align-self: center; display: grid; justify-items: center; gap: 8px; width: 100%; padding: 26px 18px; text-align: center; background: linear-gradient(160deg, rgb(251 191 36 / .16), rgb(25 36 53 / .9) 60%); border: 1px solid rgb(251 191 36 / .4); border-radius: 18px; }
.coupe-a { font-size: 46px; filter: drop-shadow(0 6px 18px rgb(251 191 36 / .45)); }
.champion-a strong { color: var(--gris); font: italic 400 26px/1.05 var(--f-grand); text-transform: uppercase; overflow-wrap: anywhere; }
.champion-a.trouve strong { color: var(--texte); }
.champion-a strong a { color: inherit; }
.champion-a strong.moi { color: var(--or-t); }
.champion-a small { color: var(--gris); }
.champion-a b { color: var(--or-t); font: 800 20px/1 var(--f-titre); }

.legende-a { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; color: var(--gris); font-size: 13px; }
.legende-a i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.legende-a i.or { background: var(--or-t); }
.legende-a i.rouge { background: var(--rouge); }
.legende-a i.vert { background: var(--ok); }

/* ---------- Endgame : le classement ---------- */
.section-classement h2 { margin-bottom: 18px; }
.tag-e { display: inline-block; margin-left: 12px; padding: 5px 11px; border-radius: 8px; background: var(--plaque-2, #213046); color: var(--gris); font: 700 12px/1 var(--f-titre); font-style: normal; vertical-align: 6px; }
.tag-e.direct { background: var(--rouge); color: #fff; }
.podium-e { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 14px; max-width: 820px; margin: 0 auto; }
.marche-e { display: grid; justify-items: center; gap: 8px; text-align: center; }
.marche-e img, .marche-e .sans-rang { width: 74px; height: 74px; object-fit: contain; }
.marche-e.p1 img, .marche-e.p1 .sans-rang { width: 92px; height: 92px; }
.pseudo-e { font: 800 18px/1.15 var(--f-titre); overflow-wrap: anywhere; }
.pseudo-e a { color: inherit; }
.pseudo-e.moi { color: var(--or-t); }
.gain-e { color: var(--or-t); font: 700 13px/1 var(--f-titre); }
.couronne-e { font-size: 30px; line-height: 1; }
.socle-e { display: grid; place-items: center; width: 100%; border-radius: 16px 16px 6px 6px; font: italic 400 64px/1 var(--f-grand); }
.p1 .socle-e { height: 190px; background: linear-gradient(180deg, rgb(251 191 36 / .35), rgb(251 191 36 / .08)); border: 1px solid rgb(251 191 36 / .55); color: var(--or-t); box-shadow: 0 18px 50px rgb(251 191 36 / .18); }
.p2 .socle-e { height: 140px; background: linear-gradient(180deg, rgb(203 213 225 / .25), rgb(203 213 225 / .05)); border: 1px solid rgb(203 213 225 / .4); color: var(--argent-t); }
.p3 .socle-e { height: 110px; background: linear-gradient(180deg, rgb(208 138 78 / .28), rgb(208 138 78 / .06)); border: 1px solid rgb(208 138 78 / .45); color: var(--bronze-t); }

.encours-e { display: grid; gap: 8px; padding: 18px 20px; border-radius: 16px; background: rgb(232 32 46 / .1); border: 1px dashed rgb(232 32 46 / .45); }
.encours-e strong { font: italic 400 22px/1 var(--f-grand); text-transform: uppercase; }
.encours-e p { margin: 0; color: var(--gris); }
.encours-e .form-podium { margin-top: 6px; }
.encours-e .form-podium .etiquette { flex-basis: 100%; }

.autres-e { margin-top: 30px; }
.autres-e h3 { margin: 0 0 10px; color: var(--gris); font: 700 14px/1 var(--f-titre); text-transform: uppercase; letter-spacing: .06em; }
.grille-e { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.joueur-e { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; background: var(--plaque); border: 1px solid var(--trait); border-radius: 12px; }
.joueur-e.moi { border-color: rgb(251 191 36 / .55); }
.joueur-e img, .joueur-e .sans-rang { flex: none; width: 28px; height: 28px; object-fit: contain; }
.joueur-e span { overflow: hidden; font: 600 14px/1.2 var(--f-titre); text-overflow: ellipsis; white-space: nowrap; }
.joueur-e a { color: inherit; }

@media (max-width: 760px) {
  .etapes-a { margin-left: 0; }
  .arbre-a { grid-template-columns: repeat(calc(var(--tours) + 1), 78vw); gap: 0 28px; min-width: 0; }
  .zone-a { scroll-snap-type: x mandatory; }
  .tour-a { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .podium-e { gap: 8px; }
  .marche-e img, .marche-e .sans-rang { width: 52px; height: 52px; }
  .marche-e.p1 img, .marche-e.p1 .sans-rang { width: 64px; height: 64px; }
  .pseudo-e { font-size: 14px; }
  .socle-e { font-size: 44px; }
  .p1 .socle-e { height: 140px; } .p2 .socle-e { height: 104px; } .p3 .socle-e { height: 82px; }
}
@media (prefers-reduced-motion: reduce) { .direct-a::before { animation: none; } }
