/* AlafeelGood v28 (v29 : 16 badges) — ascensions de légende du Tour de France : grille de badges (Mes cols), vignettes spéciales,
   fiche du col, moment du déblocage en plein écran, récap. Chargée après css/v27.css. Jetons de la charte v2 ;
   cibles tactiles d'au moins 44 px ; tricolore réservé à la célébration (badge débloqué, animation). */

/* ---------------------------------------------------------------- Mes cols : section en tête */
.legendes-section { margin: 4px 0 18px; }
.legendes-section .titre-section { margin: 0; }
.leg-compte { font-family: var(--font-titre); font-weight: 700; color: var(--texte2); font-size: 1.05rem; }
.leg-compte b { color: var(--accent); font-size: 1.35rem; }
/* v29 : 16 badges. Grille sur 6 pistes (3 badges par ligne, chacun sur 2 pistes ; mêmes vignettes qu'avec 3 colonnes)
   pour centrer une dernière ligne incomplète, quel que soit le nombre de badges (1 ou 2 restants) ; 10 pistes et
   5 badges par ligne à partir de 560 px (1 à 4 restants centrés). */
.grille-legendes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 10px 0 10px; }
.grille-legendes > .vignette-legende { grid-column: span 2; }
.grille-legendes > .vignette-legende:last-child:nth-child(3n+1) { grid-column: 3 / span 2; }
.grille-legendes > .vignette-legende:nth-last-child(2):nth-child(3n+1) { grid-column: 2 / span 2; }
@media (min-width: 560px) {
  .grille-legendes { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
  .grille-legendes > .vignette-legende:last-child:nth-child(3n+1),
  .grille-legendes > .vignette-legende:nth-last-child(2):nth-child(3n+1) { grid-column: span 2; }
  .grille-legendes > .vignette-legende:last-child:nth-child(5n+1) { grid-column: 5 / span 2; }
  .grille-legendes > .vignette-legende:nth-last-child(2):nth-child(5n+1) { grid-column: 4 / span 2; }
  .grille-legendes > .vignette-legende:nth-last-child(3):nth-child(5n+1) { grid-column: 3 / span 2; }
  .grille-legendes > .vignette-legende:nth-last-child(4):nth-child(5n+1) { grid-column: 2 / span 2; }
}
.vignette-legende { display: block; aspect-ratio: 5 / 7; border-radius: var(--rayon); min-height: 44px; position: relative; }
.vignette-legende canvas { display: block; width: 100%; height: 100%; border-radius: var(--rayon); }
.vignette-legende.debloquee canvas { box-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.vignette-legende.a-debloquer canvas { opacity: .92; }
.vignette-legende:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.regles-legendes { border: 1px solid var(--filet); border-radius: var(--rayon); padding: 0 12px; }
.regles-legendes summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.regles-legendes dl { margin: 0 0 12px; display: grid; gap: 6px; }
.regles-legendes dt { font-family: var(--font-titre); font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; margin-top: 6px; }
.regles-legendes dd { margin: 0; color: var(--texte2); font-size: .92rem; line-height: 1.4; }

/* vignette spéciale dans les listes par massif */
.massif li.col-legende { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.massif li.col-legende > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vignette-legende.petite { flex: none; width: 34px; min-height: 0; }
.tag-legende { display: inline-flex; align-items: center; min-height: 24px; align-self: flex-start; padding: 0 6px; font-size: .72rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none; color: var(--texte); border-left: 3px solid #5980A6; box-shadow: inset 0 -2px 0 #D23C3C; background: var(--accent-doux); }

/* ---------------------------------------------------------------- fiche d'une ascension */
.page-legende .entete .micro { display: block; color: var(--accent); }
.legende-scene { width: min(280px, 70vw); margin: 2px auto 14px; aspect-ratio: 5 / 7; }
.legende-rendu { display: block; width: 100%; height: 100%; border-radius: var(--rayon); box-shadow: var(--ombre); }
.leg-statut { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.leg-statut > .ico { flex: none; width: 26px; height: 26px; color: var(--texte2); margin-top: 2px; }
.leg-statut.ok > .ico { color: var(--ok); }
.leg-statut b { display: block; font-family: var(--font-titre); font-size: 1.2rem; }
.leg-statut small { display: block; color: var(--texte2); line-height: 1.4; }
.leg-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.leg-partage { display: grid; gap: 10px; margin-top: 12px; }
.page-legende .deux-boutons { margin-top: 4px; }
.page-legende .deux-boutons .btn { min-height: 52px; }
.leg-ascensions { list-style: none; margin: 6px 0 0; padding: 0; }
.leg-ascensions a { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; color: var(--texte); text-decoration: none; border-bottom: 1px solid var(--filet); }
.leg-ascensions small { display: block; color: var(--texte2); }
.leg-temps { font-family: var(--font-titre); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.leg-reperes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 10px; }
.leg-reperes div { border: 1px solid var(--filet); padding: 8px; border-radius: var(--rayon); min-width: 0; }
.leg-reperes b { display: block; font-family: var(--font-titre); font-weight: 700; font-size: 1.25rem; overflow-wrap: anywhere; }
.leg-reperes small { display: block; color: var(--texte2); font-size: .76rem; overflow-wrap: anywhere; }
.leg-faits { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.45; }
.leg-versant { padding: 10px 0; border-bottom: 1px solid var(--filet); }
.leg-versant:last-of-type { border-bottom: 0; }
.leg-versant .ligne { gap: 8px; flex-wrap: wrap; }
.profil-versant { display: block; width: 100%; height: 64px; margin: 8px 0; background: var(--bg); border-radius: var(--rayon); }
.leg-chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.leg-chiffres dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--texte2); }
.leg-chiffres dd { margin: 0; font-family: var(--font-titre); font-weight: 700; font-size: 1.15rem; }
.leg-chiffres small { font-family: var(--font-texte); font-weight: 500; font-size: .75rem; color: var(--texte2); }
.leg-sources a { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- équipe : légendes des membres */
.leg-membres { list-style: none; margin: 0; padding: 0; }
.leg-membres li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--filet); }
.leg-membres .corps { flex: 1; min-width: 0; }
.leg-puces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.leg-puce { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: .76rem; font-weight: 600; color: var(--texte); text-decoration: none;
  background: var(--surface2); border-left: 3px solid #5980A6; box-shadow: inset 0 -2px 0 #D23C3C; border-radius: 2px; }

/* ---------------------------------------------------------------- récap de la sortie */
.recap-legendes h3 { margin-top: 0; }
.recap-legende { display: flex; align-items: center; gap: 12px; min-height: 56px; color: var(--texte); text-decoration: none; border-top: 1px solid var(--filet); }
.recap-legende .rl-num { flex: none; width: 38px; height: 38px; display: grid; place-items: center; font-family: var(--font-titre); font-weight: 800; font-style: italic; font-size: 1.15rem;
  color: #F2F2F3; background: #1D2D3D; border-left: 4px solid #5980A6; box-shadow: inset -4px 0 0 #D23C3C; border-radius: 2px; }
.recap-legende .rl-corps { flex: 1; min-width: 0; }
.recap-legende small { display: block; color: var(--texte2); }
.recap-legende .rl-temps { font-family: var(--font-titre); font-weight: 700; font-size: 1.3rem; }
.leg-refus { display: flex; gap: 6px; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- moment du déblocage (plein écran, toujours Nuit) */
.leg-celeb { position: fixed; inset: 0; z-index: 9000; overflow-y: auto; overscroll-behavior: contain;
  --bg: #111A24; --surface: #1D2D3D; --surface2: #2C455D; --bord: #416180; --filet: rgba(148,188,227,.22); --texte: #F2F2F3; --texte2: #B7B7BA;
  --accent: #94BCE3; --accent-texte: #111A24; --accent-doux: rgba(148,188,227,.14);
  background: #111A24; color: #F2F2F3; padding: calc(var(--sat, 0px) + 14px) 16px calc(var(--sab, 0px) + 16px); }
.leg-confettis { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.leg-celeb-corps { position: relative; z-index: 2; max-width: 420px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.leg-celeb .micro { color: #94BCE3; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.leg-celeb-badge { position: relative; width: min(200px, 50vw, 30vh); aspect-ratio: 5 / 7; margin: 6px 0 4px; }
.leg-celeb-badge > div { position: absolute; inset: 0; }
.leg-celeb-badge canvas { display: block; width: 100%; height: 100%; border-radius: var(--rayon); }
.leg-couleur canvas { box-shadow: 0 10px 34px rgba(0, 0, 0, .55); }
.leg-celeb h2 { font-family: var(--font-titre); font-weight: 800; font-style: italic; font-size: 2.1rem; line-height: 1.05; margin: 2px 0 0; }
.leg-celeb-alt { margin: 0; color: #B7B7BA; font-weight: 500; }
.leg-celeb-tour { margin: 4px 0 2px; font-size: .92rem; line-height: 1.4; color: #D4D4D7; }
.leg-celeb-tour b { color: #94BCE3; }
.leg-celeb-perf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; margin-top: 4px; }
.leg-celeb-perf div { border: 1px solid rgba(148,188,227,.3); border-radius: var(--rayon); padding: 6px 2px; min-width: 0; }
.leg-celeb-perf b { display: block; font-family: var(--font-titre); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.leg-celeb-perf small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #B7B7BA; line-height: 1.2; }
.leg-celeb-date { margin: 2px 0 4px; color: #B7B7BA; font-size: .9rem; }
.leg-celeb-boutons { display: grid; gap: 10px; width: 100%; }
.leg-celeb-boutons .btn { min-height: 52px; }
.leg-sillage { display: block; align-self: flex-end; width: 42%; height: 22px; margin: 2px -4px -4px 0; transform: skewX(-14deg); pointer-events: none; }
.leg-sillage b { display: block; height: 4px; margin: 0 0 3px auto; }
.leg-sillage b:nth-child(1) { background: #5980A6; width: 100%; }
.leg-sillage b:nth-child(2) { background: #F2F2F3; width: 82%; }
.leg-sillage b:nth-child(3) { background: #D23C3C; width: 64%; }
@media (min-height: 760px) { .leg-celeb-badge { width: min(220px, 56vw, 32vh); } }

/* animation : le badge gris se colore du pied au sommet, puis le texte apparaît */
.leg-celeb:not(.sans-anim) .leg-c0 { animation: leg-entree .55s cubic-bezier(.2, .9, .3, 1.2) both; }
.leg-celeb:not(.sans-anim) .leg-couleur { animation: leg-couleur 1.15s .35s ease-out both; }
.leg-celeb:not(.sans-anim) .leg-sillage b { animation: leg-sillage .6s ease-out both; }
.leg-celeb:not(.sans-anim) .leg-sillage b:nth-child(2) { animation-delay: .08s; }
.leg-celeb:not(.sans-anim) .leg-sillage b:nth-child(3) { animation-delay: .16s; }
.leg-celeb:not(.sans-anim) .leg-c1 { animation: leg-texte .4s .1s both; }
.leg-celeb:not(.sans-anim) .leg-c2 { animation: leg-texte .45s 1.25s both; }
.leg-celeb:not(.sans-anim) .leg-c3 { animation: leg-texte .45s 1.45s both; }
.leg-celeb:not(.sans-anim) .leg-c4 { animation: leg-texte .45s 1.65s both; }
.leg-celeb.sortie { opacity: 0; transition: opacity .2s; }
@keyframes leg-entree { from { opacity: 0; transform: scale(.72) rotate(-5deg); } to { opacity: 1; transform: none; } }
@keyframes leg-couleur { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes leg-sillage { from { transform: translateX(60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes leg-texte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .leg-celeb *, .leg-celeb { animation: none !important; transition: none !important; }
  .leg-confettis { display: none; }
}
