/* ==========================================================================
   PROFIL V2
   Toutes les couleurs passent par --pf-* / --accent : le thème choisi par le
   membre (themes.js, feature_theme_global) continue de tout piloter.
   Chargé après le <style> de profil.html et après da2026.css.
   ========================================================================== */

body .profile-page {
    max-width: 1400px;
    padding: 0 clamp(0.8rem, 3vw, 2.5rem) 4rem;
}

/* ── Recherche : pilule discrète ── */
body .pf-searchwrap { margin: 0 0 1.2rem; max-width: 560px; }
body .pf-searchinput {
    border: 0; border-radius: 999px; padding: 0.85rem 1.2rem 0.85rem 3rem;
    background: var(--pf-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
    transition: box-shadow 0.25s ease;
}
body .pf-searchinput:focus { box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
body .pf-results { border: 0; border-radius: 24px; box-shadow: var(--shadow-xl); }

body .pf-viewing { border: 0; border-radius: 20px; }

/* ── Bandeau héros ── */
body .pf-hero {
    border: 0; border-radius: clamp(28px, 3vw, 44px);
    background: var(--pf-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--shadow-lg);
    margin-bottom: 1rem;
}
body .pf-banner {
    position: relative;
    height: clamp(190px, 25vw, 340px);
}
/* La bannière se fond dans la surface : plus de coupure nette avec le corps. */
body .pf-banner::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, transparent 35%, var(--pf-surface) 100%);
}
body .pf-banner.has-image::after { height: 100%; background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.05)); }

body .pf-hero-body {
    margin-top: clamp(-110px, -9vw, -70px);
    padding: 0 clamp(1.2rem, 3.2vw, 3rem) clamp(1.4rem, 2.6vw, 2.4rem);
    gap: clamp(1rem, 2vw, 2rem);
    align-items: flex-end; z-index: 2;
}
body .pf-avatar {
    width: clamp(112px, 13vw, 184px); height: clamp(112px, 13vw, 184px);
    border-radius: clamp(30px, 4vw, 52px);
    border: 6px solid var(--pf-surface);
    box-shadow: 0 0 0 3px var(--accent), 0 30px 60px rgba(0, 0, 0, 0.5);
}
body .pf-avatar.no-ring { box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
body .pf-identity { padding-bottom: 0.4rem; }
body .pf-name {
    font-size: clamp(2.2rem, 4.8vw, 4.2rem);
    font-weight: 700; letter-spacing: -0.045em; line-height: 1.02;
}
body .pf-handle { font-size: 1.05rem; font-weight: 500; opacity: 0.7; }
body .pf-chips { margin-top: 1rem; gap: 0.45rem; }
body .pf-chip {
    border: 0; padding: 0.42rem 0.85rem; font-weight: 600;
    background: var(--accent-soft);
}
body .pf-chip.is-custom { background: var(--pf-subtle); }
body .pf-chip.is-badge { background: color-mix(in srgb, var(--bc) 20%, transparent); }

body .pf-actions { gap: 0.5rem; align-self: flex-end; padding-bottom: 0.4rem; }
body .pf-btn {
    border: 0; border-radius: 16px; padding: 0.7rem 1.1rem; font-weight: 600;
    background: var(--pf-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    transition: transform 0.35s var(--ease-out), background-color 0.3s ease, box-shadow 0.35s ease;
}
body .pf-btn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), var(--shadow-md); }
body .pf-btn.primary {
    background: var(--accent); color: #fff;
    box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 55%, black), 0 10px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
body .pf-btn.primary:active { transform: translateY(3px); box-shadow: none; }

/* ── Grille bento ── */
body .pf-grid {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem;
}
body .pf-card {
    grid-column: span 6;
    border: 0; border-radius: clamp(26px, 2.6vw, 36px);
    padding: clamp(1.3rem, 2.4vw, 2.1rem);
    background: var(--pf-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
}
body .pf-stats-card { grid-column: 1 / -1; padding: clamp(1rem, 1.8vw, 1.4rem); background: none; box-shadow: none; }
body .pf-bio-card { grid-column: span 7; }
body .pf-games-card { grid-column: span 5; }

body .pf-card-title {
    font-size: 0.74rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--pf-muted);
    margin-bottom: 1.1rem;
}
body .pf-card-title .material-symbols-outlined { font-size: 1.2rem; }
body .pf-stats-card .pf-card-title { display: none; }

body .pf-bio { font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.7; letter-spacing: -0.005em; }
body .pf-empty { font-style: normal; }

/* ── Statistiques : grosses tuiles ── */
body .pf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
body .pf-stat {
    position: relative; text-align: left; border: 0;
    padding: clamp(1.1rem, 2vw, 1.7rem); border-radius: clamp(24px, 2.4vw, 32px);
    background: var(--pf-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
    overflow: hidden;
}
body .pf-stat-ic {
    font-size: 1.5rem; color: var(--accent);
    width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px;
    background: var(--accent-soft); margin-bottom: 1.2rem;
}
body .pf-stat-val {
    font-size: clamp(1.9rem, 3.6vw, 3.2rem); font-weight: 700; letter-spacing: -0.045em;
    line-height: 1; color: var(--pf-text); font-variant-numeric: tabular-nums;
}
body .pf-stat-lbl { margin-top: 0.5rem; font-size: 0.85rem; font-weight: 500; }

/* Niveau : une grande tuile dans le flux des statistiques. */
body #pfBarreNiveau {
    margin: 0 0 1rem !important; padding: clamp(1rem, 1.8vw, 1.5rem) clamp(1.1rem, 2vw, 1.8rem);
    border: 0; border-radius: clamp(24px, 2.4vw, 32px);
    background:
        radial-gradient(500px 200px at 100% 0%, var(--accent-soft), transparent 70%),
        var(--pf-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow-sm);
}
body #pfBarreNiveau .badge-niveau {
    font-size: 1.1rem; padding: 0.4rem 0.9rem; border-radius: 14px; background: var(--accent); color: #fff;
}
body #pfBarreNiveau .jx-xp-track { height: 12px; border-radius: 999px; }
body #pfBarreNiveau .jx-xp-fill { background: var(--accent); border-radius: 999px; }

/* ── Jeux ── */
body .pf-games { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body .pf-game {
    border: 0; border-radius: 20px; padding: 0.75rem 0.9rem;
    background: var(--pf-subtle);
    transition: transform 0.35s var(--ease-out), background-color 0.25s ease;
}
body a.pf-game.is-link:hover { transform: translateY(-3px); border: 0; }
body .pf-game-icon { width: 38px; height: 38px; border-radius: 12px; }

/* ── Cartes de jeux : une vitrine plus aérée ── */
body .pf-cartesjeux-grille { grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 17vw, 250px), 1fr)); gap: 1.6rem; }
body .pf-cartejeu { border-radius: 24px; border: 0; }

/* ── Fenêtres (modifier le profil, paramètres, recadrage) ── */
body .pf-overlay { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: rgba(0, 0, 0, 0.55); }
body .pf-modal {
    border: 1px solid var(--border-strong); border-radius: 34px;
    background: var(--background-elevated); box-shadow: var(--shadow-xl);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
body .pf-overlay { transition-duration: 0.35s; }
body .pf-tab { border-radius: 999px; }
body .pf-input, body .pf-textarea, body .pf-select { border-radius: 16px; }
body .pf-crop-frame { border-radius: 22px; }

/* ── Mobile ── */
@media (max-width: 980px) {
    body .pf-bio-card, body .pf-games-card { grid-column: 1 / -1; }
    body .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    body .pf-hero-body { flex-direction: column; align-items: flex-start; margin-top: -64px; }
    body .pf-actions { width: 100%; }
    body .pf-card { grid-column: 1 / -1; }
}

/* ==========================================================================
   PROFIL : panneau « Modifier mon profil » entièrement remis à neuf
   ========================================================================== */
body .pf-modal.wide {
    max-width: 960px; border-radius: clamp(28px, 3vw, 44px);
    background: var(--background-elevated);
    box-shadow: 0 60px 140px -30px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
body .pf-modal-head {
    padding: clamp(1.2rem, 2.4vw, 1.8rem) clamp(1.2rem, 3vw, 2.2rem) 0.4rem;
    border: 0;
}
body .pf-modal-head h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; letter-spacing: -0.04em; }

/* Onglets : un contrôle segmenté, pas un soulignement. */
body .pf-tabs {
    display: flex; gap: 0.25rem; padding: 0.3rem; margin: 0.6rem clamp(1.2rem, 3vw, 2.2rem) 0.4rem;
    border: 0; border-radius: 999px; background: var(--background-card);
    overflow-x: auto; scrollbar-width: none;
}
body .pf-tabs::-webkit-scrollbar { display: none; }
body .pf-tab {
    flex: 1 0 auto; justify-content: center; gap: 0.45rem;
    padding: 0.6rem 1rem; border: 0; border-radius: 999px; background: none; font-weight: 600;
    color: var(--text-tertiary); border-bottom: 0;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
body .pf-tab:hover { color: var(--text-primary); }
body .pf-tab.active {
    color: var(--text-primary); border-bottom: 0;
    background: var(--background-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 4px 14px rgba(0, 0, 0, 0.3);
}
body .pf-tab.active .material-symbols-outlined { color: var(--accent); }
body .pf-panes { padding: 1.2rem clamp(1.2rem, 3vw, 2.2rem) 1rem; }
body .pf-pane.active { animation: paneSlide 0.5s var(--ease-out) both; }

/* Aperçu en direct */
body .pf-live { border: 0; border-radius: 30px; box-shadow: var(--shadow-md); overflow: hidden; }
body .pf-live-banner { height: 96px; }
body .pf-live-stat { border-radius: 16px; }
body .pf-live-titre { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; }

/* Thèmes : grandes tuiles, anneau de sélection. */
body .pf-themes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 0.8rem; }
body .pf-theme {
    border: 0; border-radius: 26px; overflow: hidden;
    box-shadow: 0 0 0 1px var(--border-color);
    transition: transform 0.45s var(--ease-out), box-shadow 0.35s ease;
}
body .pf-theme:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-md); }
body .pf-theme.selected { box-shadow: 0 0 0 3px var(--accent), 0 14px 34px -12px var(--accent); }
body .pf-theme.achete { box-shadow: 0 0 0 1px rgba(241, 196, 15, 0.6); }
body .pf-theme.achete.selected { box-shadow: 0 0 0 3px var(--accent), 0 14px 34px -12px var(--accent); }
body .pf-theme-name { font-weight: 600; letter-spacing: -0.01em; }
body .pf-theme-sceau { border-radius: 999px; }

/* Champs */
body .pf-field { margin-bottom: 1.1rem; }
body .pf-label { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-tertiary); }
body .pf-input, body .pf-textarea, body .pf-select {
    border: 0; border-radius: 18px; padding: 0.9rem 1rem;
    background: var(--background-card); color: var(--text-primary);
    transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
body .pf-input:focus, body .pf-textarea:focus, body .pf-select:focus { box-shadow: 0 0 0 2px var(--accent); background: var(--background-card-hover); }
body .pf-tagchip, body .pf-preset { border-radius: 999px; }
body .pf-hint { color: var(--text-tertiary); }

/* Pied : actions collées en bas, sur du verre. */
body .pf-modal-actions {
    position: sticky; bottom: 0; z-index: 3;
    padding: 1rem clamp(1.2rem, 3vw, 2.2rem) clamp(1rem, 2vw, 1.4rem); margin: 0; border: 0;
    background: linear-gradient(180deg, transparent, var(--background-elevated) 38%);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body .pf-modal-actions .pf-btn { border-radius: 999px; padding: 0.8rem 1.4rem; }

/* ==========================================================================
   PROFIL : studio d'édition (navigation à gauche, aperçu à droite)
   ========================================================================== */
body .profile-page { max-width: none; width: 100%; padding-left: clamp(1rem, 3vw, 3rem); padding-right: clamp(1rem, 3vw, 3rem); }

body .pf-modal.wide { width: min(1240px, 100%); max-width: 1240px; max-height: 92vh; }
body .pf-studio {
    display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(280px, 340px);
    gap: clamp(0.8rem, 1.6vw, 1.6rem); flex: 1; min-height: 0;
    padding: 0.4rem clamp(1rem, 2vw, 1.8rem) 0;
}
body .pf-studio .pf-panes { padding: 0.4rem 0.4rem 1rem 0; min-height: 0; overflow-y: auto; }

/* Navigation verticale, avec un fond actif qui glisse. */
body .pf-nav {
    position: relative; display: flex; flex-direction: column; gap: 0.2rem; align-self: start;
    margin: 0; padding: 0.4rem; border-radius: 28px; background: var(--background-card); overflow: visible;
}
body .pf-nav-ind {
    position: absolute; left: 0.4rem; right: 0.4rem; top: 0; height: 0; border-radius: 20px;
    background: var(--background-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), height 0.4s ease;
}
body .pf-nav .pf-tab {
    position: relative; z-index: 1; justify-content: flex-start; flex: none; text-align: left;
    gap: 0.8rem; padding: 0.7rem 0.8rem; border-radius: 20px;
    background: none !important; box-shadow: none !important;
}
body .pf-nav .pf-tab > .material-symbols-outlined {
    width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 14px;
    background: var(--background-card); font-size: 1.3rem; transition: background-color 0.3s ease, color 0.3s ease;
}
body .pf-nav .pf-tab.active > .material-symbols-outlined { background: var(--accent); color: #fff; }
body .pf-tab-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
body .pf-tab-txt b { font-size: 0.93rem; font-weight: 600; }
body .pf-tab-txt i { font-style: normal; font-size: 0.74rem; color: var(--text-tertiary); font-weight: 400; }

/* Aperçu : colonne de droite, collée en haut pendant qu'on édite. */
body .pf-apercu-col { align-self: start; position: sticky; top: 0; min-width: 0; }
body .pf-apercu-col .pf-live-titre { margin-bottom: 0.7rem; }

/* Interrupteurs : un vrai composant, partout. */
body .pf-switch {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.85rem 1rem; border: 0; border-radius: 20px; background: var(--background-card);
    transition: background-color 0.3s ease;
}
body .pf-switch:hover { background: var(--background-card-hover); }
body .pf-switch label, body .pf-switch .pf-switch-txt {
    display: flex; align-items: center; gap: 0.7rem; flex: 1; cursor: pointer; font-weight: 500;
}
body .pf-switch-txt .material-symbols-outlined {
    width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent); font-size: 1.2rem;
}
body .pf-switch > input[type="checkbox"],
body .pf-interrupteur input[type="checkbox"] {
    position: absolute !important; opacity: 0; width: 0 !important; height: 0 !important; pointer-events: none;
}
body .pf-switch > input[type="checkbox"] { position: relative !important; width: 52px !important; height: 30px !important; opacity: 1; appearance: none; -webkit-appearance: none;
    border-radius: 999px; background: var(--background-card-hover); cursor: pointer; flex: none; pointer-events: auto;
    transition: background-color 0.35s ease; box-shadow: inset 0 0 0 1px var(--border-color); }
body .pf-switch > input[type="checkbox"]::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body .pf-switch > input[type="checkbox"]:checked { background: var(--accent); }
body .pf-switch > input[type="checkbox"]:checked::after { transform: translateX(22px); }
body .pf-interrupteur { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; cursor: pointer; }
body .pf-interrupteur > span {
    position: absolute; inset: 0; border-radius: 999px; background: var(--background-card-hover);
    box-shadow: inset 0 0 0 1px var(--border-color); transition: background-color 0.35s ease;
}
body .pf-interrupteur > span::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
body .pf-interrupteur input:checked + span { background: var(--accent); }
body .pf-interrupteur input:checked + span::after { transform: translateX(22px); }
body .pf-interrupteur input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px var(--accent); }

/* Blocs de la page */
body .pf-blocs { display: flex; flex-direction: column; gap: 0.5rem; }
body .pf-bloc {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 22px;
    background: var(--background-card); transition: opacity 0.35s ease, background-color 0.3s ease;
}
body .pf-bloc.eteint { opacity: 0.5; }
body .pf-bloc-ic {
    width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 15px;
    background: var(--accent-soft); color: var(--accent); font-size: 1.4rem;
}
body .pf-bloc-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
body .pf-bloc-txt b { font-weight: 600; }
body .pf-bloc-txt i { font-style: normal; font-size: 0.78rem; color: var(--text-tertiary); }
body .pf-bloc-fleches { display: flex; flex-direction: column; gap: 2px; }
body .pf-bloc-fleches button {
    width: 30px; height: 22px; border: 0; border-radius: 8px; cursor: pointer; display: grid; place-items: center;
    background: var(--background-card-hover); color: var(--text-secondary);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.3s var(--ease-out);
}
body .pf-bloc-fleches button:hover:not(:disabled) { background: var(--accent); color: #fff; transform: scale(1.1); }
body .pf-bloc-fleches button:disabled { opacity: 0.3; cursor: default; }
body .pf-bloc-fleches .material-symbols-outlined { font-size: 1.15rem; }
body .pf-label-aide { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); }

/* Paramètres du profil : choix de visibilité en grandes cartes */
body .pf-visi { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
body .pf-visi-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left;
    padding: 1.1rem; border: 0; border-radius: 26px; cursor: pointer; font: inherit; color: var(--text-primary);
    background: var(--background-card);
    box-shadow: inset 0 0 0 1px var(--border-color);
    transition: transform 0.45s var(--ease-out), box-shadow 0.35s ease, background-color 0.3s ease;
}
body .pf-visi-opt:hover { transform: translateY(-3px); background: var(--background-card-hover); }
body .pf-visi-opt .material-symbols-outlined {
    width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 0.6rem;
    background: var(--background-card-hover); transition: background-color 0.3s ease, color 0.3s ease; font-size: 1.4rem;
}
body .pf-visi-opt b { font-size: 1.02rem; font-weight: 600; }
body .pf-visi-opt i { font-style: normal; font-size: 0.8rem; color: var(--text-tertiary); }
body .pf-visi-opt.actif { box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -14px var(--accent); background: var(--accent-soft); }
body .pf-visi-opt.actif .material-symbols-outlined { background: var(--accent); color: #fff; }

body #settingsOverlay .pf-modal { max-width: 620px; padding: clamp(1.4rem, 3vw, 2rem); border-radius: 36px; }
body #settingsOverlay h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.04em; margin-bottom: 1.2rem; }

@media (max-width: 1080px) {
    body .pf-studio { grid-template-columns: 220px minmax(0, 1fr); }
    body .pf-apercu-col { display: none; }
}
@media (max-width: 720px) {
    body .pf-studio { grid-template-columns: 1fr; }
    body .pf-nav { flex-direction: row; overflow-x: auto; border-radius: 999px; scrollbar-width: none; }
    body .pf-nav-ind { display: none; }
    body .pf-nav .pf-tab { flex: 0 0 auto; padding: 0.5rem 0.8rem; }
    body .pf-nav .pf-tab.active { background: var(--background-secondary) !important; }
    body .pf-tab-txt i { display: none; }
    body .pf-visi { grid-template-columns: 1fr; }
}

/* ==========================================================================
   PROFIL V6 : pleine largeur, mode « modifier l'affichage », corrections
   ========================================================================== */
body .page-content, body .page-content.width-wide, body .page-content.layout-flush {
    max-width: none; width: 100%; padding-left: 0; padding-right: 0;
}
body .profile-page { max-width: none; width: 100%; padding-left: clamp(1rem, 2.4vw, 2.6rem); padding-right: clamp(1rem, 2.4vw, 2.6rem); }

/* Panneau : colonnes plus étroites, rien ne dépasse. */
body .pf-studio { grid-template-columns: 230px minmax(0, 1fr) minmax(260px, 320px); }
body .pf-panes, body .pf-pane, body .pf-field { min-width: 0; }
body .pf-themes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
@media (max-width: 1280px) { body .pf-studio { grid-template-columns: 220px minmax(0, 1fr); } body .pf-apercu-col { display: none; } }

/* Les icônes des interrupteurs doivent se voir. */
body .pf-switch-txt .material-symbols-outlined {
    background: rgba(255, 255, 255, 0.1); color: var(--text-primary);
}

/* Bouton « Modifier l'affichage » */
body .pf-nav-affichage {
    display: flex; align-items: center; gap: 0.8rem; width: 100%; margin-top: 0.5rem; padding: 0.7rem 0.8rem;
    border: 0; border-radius: 20px; cursor: pointer; text-align: left; color: var(--text-primary); font: inherit;
    background: linear-gradient(135deg, rgba(76, 141, 255, 0.28), rgba(90, 200, 250, 0.12));
    box-shadow: inset 0 0 0 1px rgba(76, 141, 255, 0.4);
    transition: transform 0.4s var(--ease-out), box-shadow 0.3s ease;
}
body .pf-nav-affichage:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent), 0 12px 26px -14px var(--accent); }
body .pf-nav-affichage > .material-symbols-outlined {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: var(--accent); color: #fff; flex: none;
}

/* Mode édition de l'affichage, sur le vrai profil. */
body.pf-mode-affichage .pf-hero { opacity: 0.55; }
body .pf-grid-edition { gap: 1.2rem; }
body .pf-bloc-edit {
    position: relative; grid-column: span 6; border-radius: 40px; padding-top: 2.8rem;
    outline: 2px dashed var(--border-strong); outline-offset: 4px;
    transition: opacity 0.35s ease, outline-color 0.3s ease;
}
body .pf-bloc-edit[data-bloc="stats"], body .pf-bloc-edit[data-bloc="cartes"] { grid-column: 1 / -1; }
body .pf-bloc-edit[data-bloc="bio"] { grid-column: span 7; }
body .pf-bloc-edit[data-bloc="jeux"] { grid-column: span 5; }
body .pf-bloc-edit > .pf-card { grid-column: auto !important; width: 100%; }
body .pf-bloc-edit.off > .pf-card { opacity: 0.35; filter: grayscale(0.7); }
body .pf-bloc-edit.en-deplacement { opacity: 0.3; outline-color: var(--accent); }
body .pf-bloc-edit:hover { outline-color: var(--accent); }
body .pf-bloc-outils {
    position: absolute; top: 0.4rem; left: 0.4rem; right: 0.4rem; z-index: 3;
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
body .pf-bloc-poignee {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem 0.35rem 0.4rem; border-radius: 999px;
    cursor: grab; user-select: none; touch-action: none; font-weight: 600; font-size: 0.82rem;
    background: var(--accent); color: #fff;
    box-shadow: 0 8px 20px -8px var(--accent);
}
body .pf-bloc-poignee:active { cursor: grabbing; }
body .pf-bloc-poignee .material-symbols-outlined { font-size: 1.2rem; }
body .pf-bloc-oeil {
    width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: var(--background-secondary); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-strong);
    transition: transform 0.35s var(--ease-out), background-color 0.25s ease;
}
body .pf-bloc-oeil:hover { transform: scale(1.1); background: var(--background-card-hover); }
body .pf-bloc-copie { opacity: 0.92; transform: rotate(-1deg) scale(1.02); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7); border-radius: 40px; outline: 2px solid var(--accent); }

/* Barre flottante du mode édition. */
.pf-barre-aff {
    position: fixed; left: 50%; bottom: 1.2rem; z-index: 2600; width: min(760px, calc(100vw - 1.5rem));
    display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.7rem 0.8rem 0.7rem 1rem;
    border-radius: 999px; border: 1px solid var(--border-strong);
    background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
    transform: translate(-50%, 140%); opacity: 0;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.pf-barre-aff.visible { transform: translate(-50%, 0); opacity: 1; }
.pf-barre-txt { display: flex; align-items: center; gap: 0.7rem; flex: 1 1 220px; min-width: 0; }
.pf-barre-txt > .material-symbols-outlined {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; flex: none;
    background: var(--accent); color: #fff;
}
.pf-barre-txt span:not(.material-symbols-outlined) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pf-barre-txt b { font-weight: 600; }
.pf-barre-txt i { font-style: normal; font-size: 0.78rem; color: var(--text-tertiary); }
.pf-barre-aff .pf-btn { border-radius: 999px; }
@media (max-width: 640px) { .pf-barre-aff { border-radius: 28px; } }

/* Pendant un glissement, rien d'autre ne réagit : ni boutons, ni survols. */
body.pf-glisse .pf-bloc-edit button, body.pf-glisse .pf-bloc-edit a, body.pf-glisse #pfBarreAff { pointer-events: none; }
body.pf-glisse { user-select: none; cursor: grabbing; }

/* Réglages de confidentialité : pied statique, simple rangée de boutons. */
body #settingsOverlay .pf-modal-actions {
    position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    padding: 0; margin-top: 1.4rem; justify-content: flex-end;
}
body #settingsOverlay .pf-switch { cursor: pointer; }

/* Largeur choisie par le membre : l'enveloppe porte la colonne, la carte la remplit. */
body .pf-bloc-pos { display: flex; flex-direction: column; min-width: 0; }
body .pf-bloc-pos > * { grid-column: auto !important; width: 100%; flex: 1; }
body .pf-tailles {
    display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px;
    background: var(--background-secondary); box-shadow: inset 0 0 0 1px var(--border-strong);
}
body .pf-taille {
    border: 0; border-radius: 999px; min-width: 34px; height: 30px; padding: 0 0.55rem; cursor: pointer;
    background: transparent; color: var(--text-secondary); font: inherit; font-size: 0.8rem; font-weight: 700;
    transition: background 0.3s var(--ease-out), color 0.3s;
}
body .pf-taille:hover { color: var(--text-primary); }
body .pf-taille.actif { background: var(--accent); color: #fff; }
@media (max-width: 980px) {
    body .pf-bloc-pos, body .pf-bloc-edit { grid-column: 1 / -1 !important; }
    body .pf-tailles { display: none; }
}

/* Réglages de confidentialité : l'interrupteur garde sa taille, il ne s'étire pas avec la rangée. */
body .pf-switch label.pf-interrupteur { flex: none !important; width: 52px; height: 30px; padding: 0 !important; margin: 0; display: inline-block; }
