/* Profil, Mon compte, Mes amis */

.profil { max-width: var(--largeur); }
.profil-etroit { max-width: var(--largeur-texte); }

/* ---------- Avatars ---------- */
.avatar-membre { flex: none; width: 48px; height: 48px; object-fit: cover; background: var(--surface-2); border-radius: 50%; }
.profil-avatar { flex: none; width: 112px; height: 112px; object-fit: cover; background: var(--surface-2); border: 3px solid var(--line-strong); border-radius: 50%; }

/* ---------- En-tête du profil ---------- */
.profil-tete { position: relative; margin-bottom: .5rem; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-grand); }
.profil-banniere { display: flex; gap: 4px; height: clamp(110px, 18vw, 170px); overflow: hidden; background: var(--fond-banniere); border-bottom: 1px solid var(--line); }
.profil-banniere img { flex: 1 0 0; min-width: 70px; height: 100%; object-fit: cover; opacity: .45; }
.profil-banniere.avec-images { -webkit-mask-image: linear-gradient(#000 40%, rgba(0, 0, 0, .35)); mask-image: linear-gradient(#000 40%, rgba(0, 0, 0, .35)); }
.profil-tete-contenu { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; margin-top: -56px; padding: 0 1.5rem 1.1rem; }
.profil-tete-contenu .profil-avatar { position: relative; border: 4px solid var(--surface); }
.profil-chiffres { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0 1.5rem 1.4rem; list-style: none; }
.profil-chiffres li { display: flex; flex-direction: column; min-width: 6.5rem; padding: .5rem .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--rayon); }
.profil-chiffres strong { font-size: var(--taille-xl); font-weight: 900; line-height: 1.15; }
.profil-chiffres span { color: var(--muted); font-size: var(--taille-xs); }
@media (max-width: 575.98px) {
    .profil-tete .profil-identite h1 { font-size: clamp(1.45rem, 7vw, 2rem); overflow-wrap: break-word; }
    .profil-tete-contenu { margin-top: -44px; padding: 0 1rem 1rem; }
    .profil-tete-contenu .profil-avatar { width: 88px; height: 88px; }
    .profil-chiffres { padding: 0 1rem 1.1rem; }
    .profil-chiffres li { flex: 1 1 40%; min-width: 0; }
}
.profil-identite { flex: 1; min-width: 220px; }
.profil-identite h1 { margin: 0; font-size: var(--titre-page); overflow-wrap: anywhere; }
.profil-bio { margin: .35rem 0 0; font-size: var(--taille-l); overflow-wrap: anywhere; }
.profil-infos { margin: .4rem 0 0; color: var(--muted); font-size: var(--taille-m); }
.profil-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.profil-etat { color: var(--muted); font-size: var(--taille-m); font-weight: 700; }
.profil-etat-amis { color: var(--accent-text); }

/* ---------- Onglets ---------- */
.profil-onglets { display: flex; gap: .25rem; margin: 1.5rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.profil-onglets button { margin-bottom: -1px; padding: .6rem 1rem; color: var(--muted); font-weight: 700; background: none; border: 0; border-bottom: 2px solid transparent; }
.profil-onglets button:hover { color: var(--text); }
.profil-onglets button[aria-selected="true"] { color: var(--texte-fort); border-bottom-color: var(--accent); }
.profil-onglets span { margin-left: .2rem; color: var(--muted); font-size: var(--taille-s); }

/* sans JavaScript : un peu d'espace */
.profil-partie + .profil-partie { margin-top: 2.5rem; }
.profil-onglets:not([hidden]) ~ .profil-partie { margin-top: 0; }
.profil-partie-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.profil-partie-tete h2 { margin: 0; font-size: var(--taille-xxl); }
.profil-resume { margin: 0; color: var(--muted); }
.profil-vide { margin: 0; padding: 1rem; color: var(--muted); border-left: 2px solid var(--line-strong); }

/* ---------- Filtres ---------- */
.profil-filtres { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.profil-filtre { padding: .35rem .8rem; color: var(--muted); font-size: var(--taille-m); font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-pilule); }
.profil-filtre:hover { color: var(--text); border-color: var(--line-strong); }
.profil-filtre[aria-pressed="true"] { color: var(--texte-fort); background: var(--accent-soft); border-color: var(--accent); }
.profil-filtre span { margin-left: .15rem; color: var(--muted); font-weight: 400; }

/* ---------- Jaquettes ---------- */
.profil-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.5rem 1rem; }
.profil-carte { position: relative; display: flex; flex-direction: column; gap: .35rem; min-width: 0; color: var(--text); text-decoration: none; }
.profil-carte-image { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--rayon-petit); transition: border-color .15s ease, transform .2s ease, box-shadow .2s ease; }
.profil-carte-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profil-carte-image img.est-entete { object-fit: contain; }
.profil-carte-remplacant { display: grid; place-items: center; height: 100%; padding: .75rem; color: var(--muted); font-weight: 900; text-align: center; }
.profil-carte-titre { display: -webkit-box; overflow: hidden; color: var(--text); font-size: var(--taille-m); font-weight: 700; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
a.profil-carte-titre:hover, a.profil-carte:hover .profil-carte-titre { color: var(--texte-fort); text-decoration: underline; text-underline-offset: 3px; }
.profil-carte-info { color: var(--muted); font-size: var(--taille-s); }

/* Statut et note */
.profil-statut, .profil-note { position: absolute; padding: .15rem .45rem; color: var(--blanc); font-size: var(--taille-xxs); font-weight: 700; background: rgba(11, 9, 18, .85); border-radius: var(--rayon-petit); }
.profil-statut { bottom: .45rem; left: .45rem; }
.profil-note { top: .45rem; right: .45rem; }
.statut-en_cours { box-shadow: inset 3px 0 0 var(--succes); }
.statut-termine { box-shadow: inset 3px 0 0 var(--accent-text); }
.statut-a_voir { box-shadow: inset 3px 0 0 var(--attention); }
.statut-abandonne { box-shadow: inset 3px 0 0 var(--muted); }

.profil-carte-modifier { align-self: flex-start; padding: 0; color: var(--accent-text); font-size: var(--taille-s); font-weight: 700; background: none; border: 0; }
.profil-carte-modifier:hover { color: var(--texte-fort); text-decoration: underline; }
.profil-plus { display: block; margin: 1.5rem auto 0; }

/* Épisodes vus et bouton +1 */
.profil-progression { display: flex; align-items: center; gap: .45rem; }
.profil-progression-texte { flex: 0 0 auto; color: var(--muted); font-size: var(--taille-xs); font-variant-numeric: tabular-nums; }
.profil-progression-barre { flex: 1; min-width: 0; height: 5px; overflow: hidden; background: var(--surface-2); border: 0; border-radius: var(--rayon-pilule); -webkit-appearance: none; appearance: none; }
.profil-progression-barre::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--rayon-pilule); }
.profil-progression-barre::-webkit-progress-value { background: var(--accent); border-radius: var(--rayon-pilule); }
.profil-progression-barre::-moz-progress-bar { background: var(--accent); border-radius: var(--rayon-pilule); }
.profil-plus-un { flex: 0 0 auto; margin-left: auto; padding: .05rem .5rem; color: var(--accent-text); font-size: var(--taille-xs); font-weight: 900; background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--rayon-pilule); transition: border-color .15s ease, color .15s ease; }
.profil-plus-un:hover { color: var(--texte-fort); border-color: var(--accent); }
.profil-plus-un:disabled { opacity: .5; }
.profil-episodes-champ { display: flex; align-items: center; gap: .75rem; }
.profil-episodes-champ input { max-width: 8rem; }
.profil-episodes-champ span { color: var(--muted); }

/* Onglet En commun */
.profil-commun-groupe + .profil-commun-groupe, #commun-jeux { display: block; margin-top: 2.25rem; }
.profil-commun-groupe h3 { margin: 0 0 1rem; font-size: var(--taille-l); }
.profil-commun-groupe h3 span { margin-left: .35rem; color: var(--muted); font-size: var(--taille-m); font-weight: 700; }

/* ---------- Fenêtres ---------- */
.profil-fenetre { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 1.25rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.profil-fenetre::backdrop { background: rgba(5, 4, 9, .7); }
.profil-fenetre-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.profil-fenetre-tete h2 { margin: 0; font-size: var(--taille-xl); overflow-wrap: anywhere; }
.profil-fermer { padding: 0 .3rem; color: var(--muted); font-size: var(--taille-xxl); line-height: 1; background: none; border: 0; }
.profil-fermer:hover { color: var(--texte-fort); }
.profil-fenetre-etat { min-height: 1.2em; margin: .6rem 0 0; color: var(--muted); font-size: var(--taille-m); }
.profil-fenetre-etat:empty { min-height: 0; margin: 0; }
.profil-resultats:not(:empty) { margin-top: .75rem; }
.profil-fenetre-boutons { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

.profil-resultats { display: grid; gap: .35rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.profil-resultat { display: flex; align-items: center; gap: .75rem; padding: .45rem; background: var(--surface-2); border-radius: var(--rayon); }
.profil-resultat-image { flex: none; width: 42px; aspect-ratio: 2 / 3; object-fit: cover; background: var(--surface); border-radius: var(--rayon-petit); }
.profil-resultat-texte { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.profil-resultat-texte strong { display: -webkit-box; overflow: hidden; font-size: var(--taille-m); overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.profil-resultat-texte span { color: var(--muted); font-size: var(--taille-xs); }
.profil-resultat-action { display: flex; flex: none; align-items: center; gap: .4rem; }
.profil-resultat-action .form-select { width: auto; min-height: 0; }
.profil-resultat-deja { color: var(--accent-text); font-size: var(--taille-s); font-weight: 700; }

/* ---------- Membres ---------- */
.liste-membres { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.carte-membre { display: flex; flex: 1; align-items: center; gap: .75rem; min-width: 0; padding: .6rem .75rem; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); transition: border-color .15s ease; }
.carte-membre:hover { color: var(--text); }
.carte-membre-texte { display: flex; flex-direction: column; min-width: 0; }
.carte-membre-texte strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-membre-texte span { overflow: hidden; color: var(--muted); font-size: var(--taille-s); text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Mon compte / Mes amis ---------- */
/* Une carte par partie */
.profil-compte { max-width: 860px; }
.compte-bloc { margin-top: 1rem; padding: 1.25rem 1.4rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-grand); scroll-margin-top: 5.5rem; }
.compte-bloc h2 { margin: 0 0 1rem; font-size: var(--taille-xl); }
/* Sommaire de Mon compte */
.compte-sommaire { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .5rem; }
.compte-sommaire a { padding: .3rem .8rem; color: var(--muted); font-size: var(--taille-m); font-weight: 700; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-pilule); }
.compte-sommaire a:hover { color: var(--texte-fort); border-color: var(--accent); }
.compte-sommaire a[href="#partie-supprimer"]:hover { border-color: var(--danger-bouton); }
.compte-photo { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem; margin-bottom: .75rem; }
.compte-photo-actions { flex: 1; min-width: 240px; }
.compte-photo-erreur { margin: .5rem 0 0; color: var(--danger-clair); font-size: var(--taille-m); }
.compte-danger { border-color: rgba(180, 35, 24, .45); box-shadow: inset 3px 0 0 var(--danger-bouton); }
.compte-danger p { color: var(--muted); }
.compte-danger .btn-danger { color: var(--blanc); background: var(--danger-bouton); border-color: var(--danger-bouton); }
.compte-danger .btn-danger:hover { background: var(--danger-bouton-survol); border-color: var(--danger-bouton-survol); }
.compte-steam { display: flex; align-items: center; gap: .9rem; }
.compte-steam div { display: flex; flex-direction: column; }
.compte-steam span { color: var(--muted); font-size: var(--taille-m); }
.amis-recherche { display: flex; gap: .5rem; }
.amis-ligne { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.amis-boutons { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: .4rem; }
/* Fil d'activité des amis */
.amis-nombre { margin-left: .3rem; color: var(--muted); font-size: 1rem; font-weight: 400; }

@media (max-width: 600px) {
    .profil-tete { flex-direction: column; align-items: flex-start; }
    .profil-avatar { width: 88px; height: 88px; }
    .profil-grille { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1.25rem .75rem; }
    .amis-ligne { flex-wrap: wrap; }
    .profil-resultat { flex-wrap: wrap; }
    /* statut et bouton sur leur propre ligne, sous le titre */
    .profil-resultat-action { flex: 1 0 100%; padding-left: calc(42px + .75rem); }
    .profil-resultat-action .form-select { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .profil-carte:hover .profil-carte-image { transform: none; }
}

/* ---------- Onglet Forum ---------- */
.profil-forum { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.profil-forum li { padding: .85rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-grand); }
.profil-forum-tete { margin: 0; color: var(--muted); font-size: var(--taille-m); }
.profil-forum-tete a { color: var(--text); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.profil-forum-tete a:hover { color: var(--accent-text); }
.profil-forum-extrait { margin: .35rem 0 0; color: var(--text); overflow-wrap: anywhere; }
.profil-forum-meta { margin: .35rem 0 0; color: var(--texte-discret); font-size: var(--taille-xs); }

/* Cartes de jeux cliquables */
.profil-carte-bouton { padding: 0; text-align: left; background: none; border: 0; cursor: pointer; }
.profil-carte-bouton:focus-visible .profil-carte-image { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Fenêtre des succès */
.profil-fenetre-succes { width: min(640px, calc(100vw - 2rem)); }
.profil-succes-resume { margin: 0 0 .6rem; color: var(--muted); }
.profil-succes-barre { display: block; width: 100%; height: 8px; margin-bottom: 1rem; }
.profil-succes { display: grid; gap: .25rem; max-height: min(60vh, 520px); margin: 0 0 1rem; padding: 0 .25rem 0 0; overflow-y: auto; list-style: none; }
.profil-succes-ligne { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.profil-succes-icone { flex: 0 0 auto; width: 44px; height: 44px; object-fit: cover; background: var(--surface-2); border-radius: var(--rayon-petit); filter: grayscale(1); opacity: .45; }
.profil-succes-ligne.est-debloque .profil-succes-icone { filter: none; opacity: 1; }
.profil-succes-texte { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.profil-succes-texte strong { font-size: var(--taille-m); overflow-wrap: anywhere; }
.profil-succes-texte span { color: var(--muted); font-size: var(--taille-s); overflow-wrap: anywhere; }
.profil-succes-ligne:not(.est-debloque) .profil-succes-texte strong { color: var(--muted); }
.profil-succes-etat { flex: 0 0 auto; color: var(--texte-discret); font-size: var(--taille-xs); text-align: right; }
.est-debloque .profil-succes-etat { color: var(--succes); }
.profil-succes-steam { font-weight: 700; text-decoration: none; }
