/* AlafeelGood — récap de sortie, célébration, wall of fame, relecture 3D */

/* Récap */
.recap-tuiles .tuile .valeur { font-size: 1.3rem; }
.actions-recap { margin: 12px 0 14px; }
.actions-recap .btn { flex: 1 1 160px; }
.trophees-liste { display: flex; gap: 10px; overflow-x: auto; padding: 10px 2px 4px; scrollbar-width: none; }
.trophee { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.trophee b { font-size: .82rem; line-height: 1.15; }
.trophee small { color: var(--texte2); font-size: .74rem; }
.record-medaille { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto;
  background: radial-gradient(circle at 35% 30%, #FFE27A, #D99A00); color: #0B1220; box-shadow: 0 10px 30px rgba(255, 176, 32, .4); }
.record-medaille .ico { width: 56px; height: 56px; }
.record-medaille.petite { width: 56px; height: 56px; box-shadow: none; }
.record-medaille.petite .ico { width: 26px; height: 26px; }

.photo-finish { margin: 0 0 14px; border-radius: var(--rayon); overflow: hidden; position: relative; background: var(--surface); }
.photo-finish img { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.photo-finish figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px;
  background: linear-gradient(transparent, rgba(11, 18, 32, .85)); color: #fff; font-weight: 700; }
.photo-changer { cursor: pointer; font-size: .85rem; background: rgba(255, 255, 255, .18); padding: 6px 12px; border-radius: 999px; }
.photo-invite { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--rayon); padding: 14px; margin-bottom: 14px; border: 2px dashed var(--bord); }
.photo-invite .illu { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-doux); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.photo-invite .illu .ico { width: 28px; height: 28px; }
.photo-invite .boutons { grid-column: 1 / -1; }
.photo-invite label.btn { cursor: pointer; }
.ajouter-photo { margin: 0 0 10px; cursor: pointer; }
.legende-pentes .degrade { display: inline-flex; gap: 0; }
.legende-pentes .degrade i { width: 16px; margin: 0; border-radius: 0; }
.legende-pentes .degrade i:first-child { border-radius: 4px 0 0 4px; }
.legende-pentes .degrade i:last-child { border-radius: 0 4px 4px 0; }
.repere-recap span { position: absolute; transform: translate(-50%, -130%); white-space: nowrap; background: rgba(11, 18, 32, .9); color: #fff; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.repere-recap.vmax span { color: #FACC15; }
.repere-recap.sommet span { color: #86EFAC; }

.splits { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; max-height: 420px; overflow-y: auto; }
.split { display: grid; grid-template-columns: 52px 1fr 64px 58px; gap: 8px; align-items: center; font-size: .86rem; font-variant-numeric: tabular-nums; }
.split.meilleur { font-weight: 800; }
.split.meilleur .sp-num { color: var(--accent); }
.sp-num { color: var(--texte2); font-weight: 700; }
.sp-barre { position: relative; height: 22px; background: var(--surface2); border-radius: 6px; overflow: hidden; }
.sp-barre i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; opacity: .85; }
.sp-barre em { position: relative; z-index: 1; font-style: normal; font-weight: 700; padding-left: 8px; line-height: 22px; font-size: .78rem; color: #0B1220; text-shadow: 0 0 4px rgba(255, 255, 255, .6); }
.sp-temps { text-align: right; font-weight: 700; }
.sp-pente { text-align: right; color: var(--texte2); }
.montees { display: flex; flex-direction: column; gap: 8px; }
.montee { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 14px; padding: 8px 10px; }
.mt-num { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--c); color: #0B1220; }
.mt-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mt-chiffres { text-align: right; display: flex; flex-direction: column; }
.mt-chiffres small { color: var(--texte2); font-size: .76rem; }

/* Célébration */
.celebration { position: fixed; inset: 0; z-index: 5000; background: rgba(11, 18, 32, .88); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fondu .3s; }
.celebration.sortie { opacity: 0; transition: opacity .25s; }
.celebration .confettis { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celeb-carte { position: relative; width: 100%; max-width: 380px; text-align: center; }
.celeb-badge { animation: revele .9s cubic-bezier(.2, 1.4, .4, 1) both; filter: drop-shadow(0 10px 30px rgba(255, 176, 32, .45)); }
@keyframes revele { 0% { transform: scale(.2) rotate(-200deg); opacity: 0; } 70% { transform: scale(1.12) rotate(8deg); opacity: 1; } 100% { transform: none; } }
.celeb-titre { font-size: 1.7rem; font-weight: 800; color: #fff; margin-top: 14px; animation: entree .5s .4s both; }
.celeb-sous { color: var(--accent); font-weight: 800; font-size: 1.1rem; margin: 4px 0 20px; animation: entree .5s .55s both; }
.celeb-points { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.celeb-points i { width: 8px; height: 8px; border-radius: 50%; background: #475569; }
.celeb-points i.actif { background: var(--accent); width: 22px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .celeb-badge, .celeb-titre, .celeb-sous { animation: none; } }

/* Accès au wall of fame */
.carte-fame { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 12px 14px; border-radius: var(--rayon); text-decoration: none; color: var(--texte);
  background: linear-gradient(120deg, rgba(255, 176, 32, .22), rgba(167, 139, 250, .16)); border: 1px solid rgba(255, 176, 32, .35); }
.carte-fame span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.carte-fame small { color: var(--texte2); }
.cf-ico { width: 42px; height: 42px; border-radius: 14px; background: var(--accent); color: var(--accent-texte); display: flex; align-items: center; justify-content: center; }
.cf-ico .ico { width: 24px; height: 24px; }
.cf-fleche .ico { transform: rotate(180deg); color: var(--texte2); }

/* Wall of fame */
.banniere-fame { border-radius: 24px; padding: 18px; background: radial-gradient(circle at 20% 0%, rgba(255, 226, 122, .35), transparent 60%), linear-gradient(140deg, #1E2A44, #0B1220); box-shadow: var(--ombre); }
.bf-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.bf-chiffres b { display: block; font-size: 2rem; color: #FFE27A; }
.bf-chiffres small { color: #CBD5E1; font-weight: 700; }
.records-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .records-grille { grid-template-columns: repeat(3, 1fr); } }
.record-carte { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--rayon); background: var(--surface); text-decoration: none; color: inherit; border-top: 3px solid var(--accent); }
.record-carte.vide { opacity: .55; border-top-color: var(--bord); }
.rc-ico { color: var(--accent); }
.rc-ico .ico { width: 22px; height: 22px; }
.rc-nom { font-size: .8rem; font-weight: 700; color: var(--texte2); text-transform: uppercase; letter-spacing: .03em; }
.rc-val { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rc-date { font-size: .75rem; color: var(--texte2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badges-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .badges-grille { grid-template-columns: repeat(4, 1fr); } }
.badge-carte { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 10px; border-radius: var(--rayon); background: var(--surface); }
.badge-carte small { color: var(--texte2); font-size: .74rem; min-height: 2.2em; }
.badge-carte.verrouille b { color: var(--texte2); }
.badge-svg { transition: transform .2s; }
.badge-carte:hover .badge-svg { transform: scale(1.05) rotate(-3deg); }
.bc-barre { width: 100%; height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin-top: 4px; }
.bc-barre i { display: block; height: 100%; border-radius: 999px; }
.bc-prog { font-size: .74rem; color: var(--texte2); font-variant-numeric: tabular-nums; }
.bc-prog.or { color: #FFE27A; font-weight: 700; }
.galerie { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vignette { position: relative; aspect-ratio: 1; border-radius: 12px; background: var(--surface2) center / cover no-repeat; overflow: hidden; }
.v-date { position: absolute; left: 6px; bottom: 6px; font-size: .7rem; font-weight: 700; background: rgba(11, 18, 32, .75); color: #fff; padding: 2px 6px; border-radius: 999px; }
.fame-equipe { display: flex; flex-direction: column; gap: 6px; }
.fe-ligne { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; font-size: .88rem; }
.fe-nom { color: var(--texte2); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.fe-nom .ico { width: 16px; height: 16px; }
.fe-val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.fe-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fe-membre { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: .82rem; }
.fe-membre i { font-style: normal; font-weight: 800; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; color: #0B1220; }
.fe-membre i.or { background: #FFE27A; } .fe-membre i.argent { background: #E2E8F0; } .fe-membre i.bronze { background: #E7A46B; }

/* Relecture 3D */
.ecran-relecture { height: 100%; }
.relecture { position: fixed; inset: 0; background: #0B1220; }
.relecture .rl-carte { position: absolute; inset: 0; } /* plus spécifique que .maplibregl-map (position: relative) */
.rl-haut { position: absolute; top: calc(10px + var(--sat)); left: 10px; right: 10px; display: flex; align-items: center; gap: 10px; z-index: 5; }
.rl-titre { background: rgba(11, 18, 32, .78); color: #fff; border-radius: 16px; padding: 6px 12px; display: flex; flex-direction: column; min-width: 0; }
.rl-titre b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-titre small { color: #CBD5E1; font-size: .74rem; }
.rl-chargement { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); background: rgba(11, 18, 32, .85); color: #fff; font-weight: 700; padding: 12px 18px; border-radius: 999px; display: flex; gap: 10px; align-items: center; z-index: 5; }
.rl-chargement[hidden] { display: none; }
.rl-bas { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 30px 12px calc(12px + var(--sab)); background: linear-gradient(transparent, rgba(11, 18, 32, .82) 30%, rgba(11, 18, 32, .95)); color: #fff; }
.rl-chiffres { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.rl-chiffres b { display: block; font-size: clamp(1.3rem, 6vw, 2rem); font-variant-numeric: tabular-nums; }
.rl-chiffres small { color: #CBD5E1; font-weight: 700; font-size: .72rem; text-transform: uppercase; }
.rl-profil { height: 48px; margin: 8px 0; }
.rl-profil canvas { width: 100%; height: 100%; display: block; }
.rl-commandes { display: flex; align-items: center; gap: 10px; }
.rl-commandes input[type="range"] { flex: 1; }
.rl-commandes .segments { background: rgba(255, 255, 255, .1); }
.rl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.rl-actions .btn { flex: 1 1 120px; }
.rl-leger { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #CBD5E1; }
.rl-leger input { width: 20px; height: 20px; accent-color: var(--accent); }
.relecture .maplibregl-ctrl-attrib { font-size: 10px; }
.relecture .maplibregl-ctrl-bottom-right { bottom: auto; top: calc(66px + var(--sat)); }
@media (orientation: landscape) and (max-height: 500px) {
  .rl-bas { left: auto; width: 46%; top: 0; padding-top: calc(70px + var(--sat)); background: linear-gradient(90deg, transparent, rgba(11, 18, 32, .9) 20%); }
  .rl-profil { height: 40px; }
}
.modale.export .barre-export { height: 10px; border-radius: 999px; background: var(--surface2); overflow: hidden; margin-top: 10px; }
.modale.export .barre-export i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.modale.export.pret .apercu-export { margin: 12px 0 6px; border-radius: 16px; overflow: hidden; background: #000; display: flex; justify-content: center; }
.modale.export.pret .apercu-export video, .modale.export.pret .apercu-export img { display: block; max-width: 100%; max-height: 52vh; }

/* Feuille de partage : aperçu, dispositions, photo */
.modale.export.partage { max-width: 520px; }
.modale.export.partage .apercu-export { margin: 10px 0 8px; border-radius: 16px; overflow: hidden; background: #000; display: flex; justify-content: center; touch-action: none; }
.modale.export.partage .apercu-export canvas, .modale.export.partage .apercu-export video { display: block; max-width: 100%; max-height: 46vh; width: auto; height: auto; }
.pt-dispos { display: flex; align-items: center; gap: 6px; justify-content: center; }
.pt-dispos .segments { flex: 1; min-width: 0; display: grid; grid-auto-columns: minmax(0, 1fr); }
.pt-dispos .btn-icone { width: 36px; height: 36px; flex: none; }
.pt-dispos .btn-icone.suivant .ico { transform: rotate(180deg); }
#pt-aide { margin: 4px 0 0; }
.pt-photo { margin-top: 10px; }
.pt-ajout { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 2px dashed var(--bord); border-radius: 16px; }
.pt-ajout b { display: flex; align-items: center; gap: 8px; }
.pt-ajout small { color: var(--texte2); }
.pt-choix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pt-choix .btn { flex: 1 1 150px; }
.pt-courante { display: flex; align-items: center; gap: 12px; }
.pt-mini { width: 64px; height: 64px; border-radius: 12px; flex: none; border: 3px solid var(--accent); }
.pt-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-liens { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-photo .interrupteur.petit { min-height: 44px; margin-top: 6px; }
.pt-progres { margin-top: 8px; }
.pt-dispos[hidden], .pt-progres[hidden] { display: none; }
