* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --gradient-fire: linear-gradient(135deg, #FF7A00 0%, #FF004D 50%, #7000FF 100%);
    --gold: #FFD700;
    --card: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.12);
    --muted: #907d9e;
}
body {
    font-family: 'Fredoka', system-ui, sans-serif;
    background: #07030f;
    background-image:
        radial-gradient(circle at 20% 8%, rgba(178, 0, 255, 0.22), transparent 50%),
        radial-gradient(circle at 80% 92%, rgba(255, 0, 77, 0.20), transparent 50%),
        linear-gradient(180deg, #14082a 0%, #07030f 100%);
    color: #f5f0ff;
    min-height: 100dvh;
    padding: 20px;
}
#app { max-width: 460px; margin: 0 auto; }

/* ---------- Header ---------- */
header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 0 22px;
}
.btn-back {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: #fff; font-size: 1.3rem; text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.btn-back:active { transform: scale(0.92); background: rgba(255,255,255,0.14); }
.titles h1 { font-size: 1.7rem; font-weight: 900; text-transform: uppercase; line-height: 1; }
.titles .highlight {
    background: var(--gradient-fire);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.titles p { color: #cab5e6; font-size: 0.92rem; margin-top: 4px; }

.account-main { display: flex; flex-direction: column; gap: 16px; }
#loggedOut, #loggedIn { display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }

/* ---------- Carte de connexion ---------- */
.auth-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.intro { color: #cab5e6; line-height: 1.5; font-size: 0.96rem; text-align: center; }
.intro strong { color: #fff; }

.login-buttons { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.google-slot { min-height: 44px; display: flex; justify-content: center; }

.btn-apple {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #000; color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    padding: 13px 20px;
    font-family: inherit; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: transform 0.1s, background 0.15s;
}
.btn-apple:active { transform: scale(0.97); }
.btn-apple .fa-apple { font-size: 1.1rem; }

/* ---------- Séparateur ---------- */
.divider {
    display: flex; align-items: center; gap: 12px;
    color: #6f5f86; font-size: 0.76rem;
    text-transform: uppercase; letter-spacing: 1px;
}
.divider::before, .divider::after {
    content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.12);
}

/* ---------- Formulaire email ---------- */
.email-form { display: flex; flex-direction: column; gap: 10px; }
.field-wrap { position: relative; }
.field-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: #7d6e9a; font-size: 0.9rem; pointer-events: none;
}
.email-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 13px 14px 13px 40px;
    color: #fff; font-family: inherit; font-size: 1rem;
    transition: border-color 0.15s, background 0.15s;
}
.email-field::placeholder { color: #7d6e9a; }
.email-field:focus {
    outline: none; border-color: #B200FF; background: rgba(178, 0, 255, 0.10);
}
#passwordInput { padding-right: 44px; }
.toggle-password {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 34px; height: 34px; border: none; background: transparent;
    color: #907d9e; cursor: pointer; font-size: 0.95rem;
}
.btn-email-submit {
    margin-top: 4px;
    background: var(--gradient-fire); color: #fff;
    border: none; border-radius: 14px; padding: 14px;
    font-family: inherit; font-weight: 800; font-size: 1.02rem; letter-spacing: 0.3px;
    cursor: pointer; transition: transform 0.1s, filter 0.15s;
}
.btn-email-submit:active { transform: scale(0.98); }
.btn-email-submit:disabled { opacity: 0.6; cursor: default; }
.switch-mode { text-align: center; font-size: 0.88rem; color: var(--muted); }
.switch-mode a { color: #fff; font-weight: 700; text-decoration: underline; cursor: pointer; }

.config-notice {
    padding: 12px 14px;
    background: rgba(255, 200, 0, 0.08);
    border: 1px solid rgba(255, 200, 0, 0.3);
    border-radius: 12px; color: #ffd98a; font-size: 0.85rem; line-height: 1.4;
}
.config-notice code { background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 4px; }

/* ---------- Profil connecté ---------- */
.profile-hero {
    position: relative; overflow: hidden;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 30px 20px 26px;
}
.avatar-wrap {
    position: relative;
    width: 92px;
    margin: 0 auto 16px;
}
.avatar {
    width: 92px; height: 92px;
    border-radius: 50%;
    background: var(--gradient-fire); background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 2rem; color: #fff;
    border: 3px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(178, 0, 255, 0.40);
}
.avatar-upload-btn {
    position: absolute;
    bottom: 0; right: -2px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FF8A00);
    color: #1a0e00;
    border: 2px solid #14082a;
    cursor: pointer;
    font-size: 0.78rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: transform 0.1s;
}
.avatar-upload-btn:active { transform: scale(0.92); }
.profile-name { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.profile-email { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.premium-badge, .free-badge, .admin-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 14px; padding: 5px 14px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 900; letter-spacing: 1px;
}
.premium-badge {
    background: linear-gradient(135deg, #FFD700, #FF8A00);
    color: #1a0e00;
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.4);
}
.free-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #cab5e6; font-weight: 700; letter-spacing: 0.5px;
}
.admin-badge {
    background: linear-gradient(135deg, #00E5FF 0%, #7000FF 60%, #FF004D 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 229, 255, 0.4), 0 0 0 2px rgba(255, 255, 255, 0.18) inset;
}

/* ============================================================
   Stats chips (sous le profile hero)
   ============================================================ */
.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}
.profile-badges > * { margin-top: 0 !important; }

.profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 16px 0 18px;
}
.stat-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.1s, background 0.15s;
}
.stat-chip:active { transform: scale(0.96); }
.stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    background: var(--gradient-fire);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.stat-chip-action {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(255, 0, 77, 0.10));
    border-color: rgba(255, 0, 77, 0.4);
}
.stat-chip-action i {
    font-size: 1.4rem;
    color: #FFD700;
    line-height: 1;
}
.stat-chip-action .stat-label { color: #FFD700; }

/* ============================================================
   Section header (replaces <details> for flat sections)
   ============================================================ */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0;
}
.section-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    display: flex; align-items: center; gap: 8px;
}
.section-head h3 i {
    color: #FFD700;
    font-size: 0.95rem;
}

/* ============================================================
   Formulaire inline de création de groupe
   ============================================================ */
.new-group-form {
    background: rgba(255, 122, 0, 0.06);
    border: 1px dashed rgba(255, 122, 0, 0.4);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    animation: slideDown 0.22s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.new-group-actions {
    display: flex; gap: 8px;
    justify-content: flex-end;
}

/* ============================================================
   Groupes d'amis
   ============================================================ */
.groups-intro {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
}
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.group-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.group-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--group-color, var(--gold));
    border-radius: 4px 0 0 4px;
}
.group-card-head {
    display: flex; align-items: center; gap: 10px;
}
.group-name {
    flex: 1; min-width: 0;
    font-weight: 800; font-size: 1.02rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.group-count {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
    flex-shrink: 0;
}
.group-avatars {
    display: flex;
    align-items: center;
}
.group-avatars > .group-avatar + .group-avatar { margin-left: -8px; }
.group-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gradient-fire);
    border: 2px solid #07030f;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.group-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.group-avatar.more { background: rgba(255, 255, 255, 0.14); color: var(--muted); font-size: 0.66rem; }
.group-actions {
    display: flex; gap: 8px;
}
.group-actions > button, .group-actions > a {
    flex: 1;
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: background 0.15s;
}
.group-actions .group-launch {
    background: var(--gradient-fire);
}
.group-actions .group-edit { background: rgba(0, 229, 255, 0.12); color: #00E5FF; }
.group-actions > button:active, .group-actions > a:active { transform: scale(0.97); }
.groups-empty {
    color: var(--muted);
    font-style: italic;
    font-size: 0.85rem;
    text-align: center;
    padding: 18px 8px;
}

/* ============================================================
   Modal de création/édition d'un groupe
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: modal-fade 0.18s ease;
}
.modal-overlay.hidden { display: none !important; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
    background: linear-gradient(160deg, #1c1326 0%, #14082a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    width: 100%;
    max-width: 420px;
    max-height: 90dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modal-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1.05);
}
@keyframes modal-pop {
    from { transform: translateY(20px) scale(0.94); opacity: 0; }
    to   { transform: translateY(0) scale(1);    opacity: 1; }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-title { margin: 0; font-size: 1.1rem; font-weight: 800; }
.modal-close {
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: none; color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:active { transform: scale(0.92); }
.modal-body {
    padding: 16px 20px;
    display: flex; flex-direction: column;
    gap: 14px;
}
.modal-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
}
.modal-input:focus { outline: 2px solid var(--gold); }
.color-picker {
    display: flex; gap: 8px;
    flex-wrap: wrap;
}
.color-swatch {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}
.color-swatch:active { transform: scale(0.92); }
.color-swatch.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.group-members {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    gap: 6px;
}
.group-members li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}
.group-members .member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; font-weight: 600; }
.group-members .member-remove {
    background: rgba(255, 0, 77, 0.12);
    color: #ff6b6b;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
}
.group-members .member-remove:active { transform: scale(0.9); }
.group-members .member-owner-tag {
    background: rgba(255, 215, 0, 0.18);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}
.modal-footer {
    display: flex; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.modal-footer > button { flex: 1; }
.btn-mini-primary {
    background: var(--gradient-fire);
    color: #fff;
    border: none;
}
.btn-mini-danger {
    background: rgba(255, 0, 77, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 77, 0.4);
}

/* ============================================================
   Bouton rond Infos (header) + lien discret en bas
   ============================================================ */
.account-info-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #cab5e6;
    font-size: 1.05rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.12s, background 0.15s, color 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.account-info-btn:active { transform: scale(0.92); }
.account-info-btn:hover { background: rgba(255, 215, 0, 0.1); color: var(--gold); }

.btn-info-link {
    margin: 8px auto 0;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    transition: color 0.15s, background 0.15s;
}
.btn-info-link:hover { background: rgba(255, 255, 255, 0.04); color: #cab5e6; }
.btn-info-link i { font-size: 0.74rem; }

/* ============================================================
   Modal Infos (mentions, légal, premium, crédits regroupés)
   ============================================================ */
.info-modal-content { max-width: 460px; }
.info-modal-body { padding: 16px 18px 20px; gap: 6px; }
.info-section-title {
    margin: 14px 4px 6px;
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}
.info-tile-group {
    display: flex; flex-direction: column;
    gap: 6px;
}
.info-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.1s, background 0.15s, border-color 0.15s;
}
.info-tile:active { transform: scale(0.98); }
.info-tile:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 215, 0, 0.3); }
.info-tile-icon {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
    color: #FFD700;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.info-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.info-tile-text strong { font-weight: 800; font-size: 0.95rem; }
.info-tile-text small { font-size: 0.74rem; color: var(--muted); }
.info-tile-arrow { color: var(--muted); font-size: 0.78rem; flex-shrink: 0; }

.info-tile-premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 122, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.15);
}
.info-tile-premium .info-tile-icon {
    background: linear-gradient(135deg, #FFD700, #FF8A00);
    color: #1a0e00;
}
.info-tile-premium .info-tile-arrow { color: #FFD700; }

.info-version {
    margin: 16px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* ============================================================
   Boutons OAuth en pause (Google / Apple bientôt dispo)
   ============================================================ */
.btn-oauth-paused {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: not-allowed;
    font-family: inherit;
    text-align: left;
    opacity: 0.7;
    position: relative;
    transition: opacity 0.15s;
}
.btn-oauth-paused:hover { opacity: 0.85; }
.btn-oauth-paused::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.025) 10px,
        rgba(255, 255, 255, 0.025) 20px
    );
    pointer-events: none;
    border-radius: 14px;
}
.btn-oauth-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    color: #cab5e6;
}
.btn-oauth-text {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    gap: 2px;
}
.btn-oauth-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}
.btn-oauth-tag {
    font-size: 0.7rem;
    color: #FFD700;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-oauth-tag i { font-size: 0.65rem; }

/* ============================================================
   Bouton chat (icone) sur les rangées d'amis
   ============================================================ */
.friend-btn.chat {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2), rgba(112, 0, 255, 0.15));
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #00E5FF;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s, box-shadow 0.15s;
    position: relative;
}
.friend-btn.chat:active { transform: scale(0.92); }
.friend-btn.chat.is-online {
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
}
.friend-avatar.has-image { background-size: cover; background-position: center; color: transparent; }

/* Pastille présence sur l'avatar d'ami */
.friend-avatar {
    position: relative;
}
.friend-avatar.is-online::after {
    content: '';
    position: absolute;
    bottom: -2px; right: -2px;
    width: 12px; height: 12px;
    background: #22c55e;
    border: 2px solid var(--bg, #14082a);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* Badge unread (notification +N) sur bouton chat */
.friend-unread-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #FF004D;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 0, 77, 0.5), 0 0 0 2px #14082a;
    line-height: 1;
    animation: badge-pop 0.25s ease;
}
@keyframes badge-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Status dans la sheet DM (En ligne / Hors-ligne) */
.dm-peer-status::before {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #6b7280;
    margin-right: 5px;
    vertical-align: middle;
    box-shadow: 0 0 4px rgba(107, 114, 128, 0.5);
}
.dm-peer-status.is-online {
    color: #22c55e;
}
.dm-peer-status.is-online::before {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
    animation: dm-pulse 2s ease-in-out infinite;
}
@keyframes dm-pulse { 50% { transform: scale(1.2); } }

/* ============================================================
   Sheet DM (chat 1-1 avec un ami)
   ============================================================ */
body.dm-open { overflow: hidden; }
.dm-sheet {
    position: fixed; inset: 0;
    z-index: 9700;
    display: flex; align-items: flex-end; justify-content: center;
}
.dm-sheet.hidden { display: none !important; }
.dm-sheet-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: dm-fade .18s ease;
}
@keyframes dm-fade { from { opacity: 0; } to { opacity: 1; } }
.dm-sheet-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    height: 90dvh;
    background: linear-gradient(180deg, #1c1326 0%, #14082a 100%);
    border-radius: 26px 26px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
    animation: dm-slide .26s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}
@keyframes dm-slide { from { transform: translateY(100%); } to { transform: translateY(0); } }
.dm-sheet-handle {
    width: 40px; height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    margin: 10px auto 0;
    flex-shrink: 0;
}
.dm-sheet-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dm-sheet-peer { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.dm-peer-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gradient-fire);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dm-peer-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.dm-peer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dm-peer-info strong { font-size: 0.95rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-peer-status { font-size: 0.7rem; color: var(--muted); }
.dm-sheet-icon {
    width: 34px; height: 34px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 0.1s, background 0.15s;
    font-family: inherit;
}
.dm-sheet-icon:active { transform: scale(0.9); }
.dm-sheet-icon:hover { background: rgba(255, 255, 255, 0.12); }

.dm-messages {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 12px 16px;
    display: flex; flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
}
.dm-empty {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    font-size: 0.88rem;
    padding: 28px 12px;
}
.dm-msg {
    display: flex;
    max-width: 85%;
}
.dm-msg.is-me { align-self: flex-end; }
.dm-bubble {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px 14px 14px 4px;
    padding: 8px 12px;
    display: flex; flex-direction: column;
    gap: 2px;
}
.dm-msg.is-me .dm-bubble {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(255, 0, 77, 0.12));
    border-radius: 14px 14px 4px 14px;
}
.dm-content { font-size: 0.92rem; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; }
.dm-time { font-size: 0.66rem; color: var(--muted); align-self: flex-end; }
.dm-report-btn {
    position: absolute; top: 4px; right: -28px;
    background: transparent; border: none; color: var(--muted);
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
    font-size: 0.72rem;
}
.dm-bubble { position: relative; }
.dm-msg:hover .dm-report-btn,
.dm-report-btn:focus { opacity: 1; }
.dm-report-btn:hover { color: #ff7a93; background: rgba(255, 122, 147, 0.12); }
/* Sur mobile, garder le bouton visible — pas de hover dispo */
@media (hover: none) {
    .dm-report-btn { opacity: 0.55; right: 4px; top: 4px; position: absolute; }
    .dm-bubble { padding-right: 28px; }
}
.dm-sys {
    align-self: center;
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold);
    border: 1px dashed rgba(255, 215, 0, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    max-width: 90%;
}

.dm-form {
    display: flex; gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(to top, #1c1326 85%, rgba(28, 19, 38, 0));
}
.dm-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 11px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
}
.dm-input:focus { outline: 2px solid var(--gold); }
.dm-send {
    width: 44px;
    background: var(--gradient-fire);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #3a0052;
}
.dm-send:active { transform: translateY(4px); box-shadow: 0 0 0 #3a0052; }

/* Sous-modal : picker de groupe pour invitation */
.dm-group-picker {
    position: absolute;
    inset: auto 16px calc(76px + env(safe-area-inset-bottom)) 16px;
    background: var(--card-bg, #1c1326);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 5;
    max-height: 320px;
    display: flex; flex-direction: column;
    animation: dm-fade .15s ease;
}
.dm-group-picker.hidden { display: none !important; }
.dm-picker-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dm-picker-head h4 { margin: 0; font-size: 0.92rem; font-weight: 800; }
.dm-group-picker-list {
    list-style: none; margin: 0; padding: 8px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px;
}
.dm-group-picker-list li button {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.dm-group-picker-list li button:active { transform: scale(0.98); }
.dm-picker-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.dm-picker-name { flex: 1; font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-picker-count { font-size: 0.7rem; color: var(--muted); }
.dm-picker-empty { padding: 14px; text-align: center; color: var(--muted); font-style: italic; font-size: 0.85rem; }

/* Traitement doré quand l'utilisateur est Premium */
.profile-hero.is-premium {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(160deg, rgba(255, 215, 0, 0.12), rgba(255, 255, 255, 0.04));
    box-shadow: 0 0 34px rgba(255, 215, 0, 0.18);
}
.profile-hero.is-premium .avatar {
    border-color: rgba(255, 215, 0, 0.55);
    box-shadow: 0 10px 28px rgba(255, 215, 0, 0.45);
}

/* Traitement spécial admin : halo cyan/violet + ring animé sur l'avatar */
.profile-hero.is-admin {
    border-color: rgba(0, 229, 255, 0.55);
    background: linear-gradient(160deg, rgba(0, 229, 255, 0.10), rgba(112, 0, 255, 0.06));
    box-shadow: 0 0 34px rgba(0, 229, 255, 0.22), 0 0 60px rgba(112, 0, 255, 0.12);
}
.profile-hero.is-admin .avatar {
    border-color: rgba(0, 229, 255, 0.65);
    box-shadow: 0 10px 28px rgba(0, 229, 255, 0.5), 0 0 0 3px rgba(112, 0, 255, 0.35) inset;
    position: relative;
}
.profile-hero.is-admin .avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #00E5FF, #7000FF, #FF004D, #FFD700, #00E5FF);
    z-index: -1;
    filter: blur(8px);
    opacity: 0.55;
    animation: admin-ring-spin 6s linear infinite;
}
@keyframes admin-ring-spin {
    to { transform: rotate(360deg); }
}

.btn-premium {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none;
    background: var(--gradient-fire); color: #fff;
    border-radius: 16px; padding: 16px;
    font-weight: 900; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.5px;
    box-shadow: 0 6px 0 #3a0052;
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn-premium:active { transform: translateY(4px); box-shadow: 0 2px 0 #3a0052; }

/* Bouton ADMIN — visible uniquement pour is_premium = 2 */
/* Bloc séparé du reste (Premium / Déconnexion) par un trait + marge généreuse,
   pour qu'il ne soit pas "collé" aux autres boutons. */
.btn-admin {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none;
    background: linear-gradient(135deg, #FF004D 0%, #7000FF 100%);
    color: #fff;
    border-radius: 16px; padding: 14px;
    font-weight: 900; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.6px;
    box-shadow: 0 6px 0 #2a0033, 0 0 22px rgba(178, 0, 255, 0.25);
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative; overflow: hidden;
    margin-top: 18px;
    margin-bottom: 18px;
}
.btn-admin::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: translateX(-100%);
    animation: btnAdminShine 3.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes btnAdminShine {
    0% { transform: translateX(-100%); }
    50%, 100% { transform: translateX(120%); }
}
.btn-admin:active { transform: translateY(4px); box-shadow: 0 2px 0 #2a0033, 0 0 12px rgba(178, 0, 255, 0.4); }
.btn-admin i { font-size: 1.05rem; }

.btn-logout {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent; color: var(--muted);
    border: 1px solid rgba(144, 125, 158, 0.4); border-radius: 14px;
    padding: 12px; font-family: inherit; font-size: 0.95rem; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.btn-logout:active { color: #fff; border-color: rgba(255,255,255,0.4); }

.feedback { text-align: center; font-size: 0.9rem; color: #cab5e6; min-height: 1.2em; }
.feedback.error { color: #ff7a93; }
.feedback.ok { color: #7be07b; }
.feedback.info { color: var(--gold); }

/* Consentement légal sous le formulaire de création */
.legal-consent {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
    margin-top: 4px;
}
.legal-consent a { color: #fff; text-decoration: underline; }

/* Mini-footer légal en bas de la page compte */
.legal-mini-footer {
    display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
    margin-top: 18px; padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.legal-mini-footer a {
    color: var(--muted); text-decoration: none; font-size: 0.82rem;
}
.legal-mini-footer a:hover { color: #fff; }

/* ---------- Réglages du compte ---------- */
.settings-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.settings-title { font-size: 0.98rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.setting-row { display: flex; flex-direction: column; gap: 8px; }
.toggle-row { flex-direction: row; align-items: center; justify-content: space-between; }
.setting-label { font-size: 0.9rem; color: #cab5e6; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.name-edit { display: flex; gap: 8px; }
.name-edit .email-field, .friend-add .email-field { padding-left: 14px; }
.btn-mini {
    flex-shrink: 0; border: none; border-radius: 12px;
    background: var(--gradient-fire); color: #fff;
    font-family: inherit; font-weight: 800; font-size: 0.9rem;
    padding: 0 16px; cursor: pointer; transition: transform 0.1s;
}
.btn-mini:active { transform: scale(0.96); }
.mini-feedback { font-size: 0.82rem; color: #cab5e6; min-height: 1em; }
.mini-feedback.ok { color: #7be07b; }
.mini-feedback.error { color: #ff7a93; }

/* Switch on/off */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute; inset: 0; cursor: pointer;
    background: rgba(255, 255, 255, 0.15); border-radius: 999px; transition: 0.2s;
}
.switch-slider::before {
    content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .switch-slider { background: linear-gradient(135deg, #7000FF, #00D4FF); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* Amis */
.friend-add { display: flex; gap: 8px; }
.friends-lists { display: flex; flex-direction: column; gap: 14px; }
.friends-group-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.friend-row {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px; padding: 8px 10px; margin-bottom: 6px;
}
.friend-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--gradient-fire); background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; color: #fff;
}
.friend-name { flex: 1; font-size: 0.92rem; font-weight: 600; }
.friend-actions { display: flex; gap: 6px; }
.friend-btn { border: none; border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.friend-btn.accept { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.friend-btn.remove { background: rgba(255, 255, 255, 0.1); color: #cab5e6; }
.friends-empty { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 4px 0; }

/* Code ami dans le hero */
.friend-code-wrap {
    margin-top: 18px;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}
.friend-code-label {
    font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
    display: inline-flex; align-items: center; gap: 5px;
}
.friend-code {
    font-family: 'Fredoka', monospace;
    font-size: 1.15rem; font-weight: 900; letter-spacing: 4px; color: #fff;
}
.btn-mini-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cab5e6; border-radius: 8px;
    width: 28px; height: 28px;
    cursor: pointer; font-size: 0.78rem;
    transition: background 0.15s, color 0.15s;
}
.btn-mini-icon:active { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Sections collapsibles <details> */
details.settings-card { padding: 0; }
.settings-summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 16px;
    font-size: 0.98rem; font-weight: 800;
    display: flex; align-items: center; gap: 10px;
    border-radius: 18px;
    transition: background 0.15s;
}
.settings-summary::-webkit-details-marker { display: none; }
.settings-summary::after {
    content: "\f078"; /* fa-chevron-down */
    font-family: "Font Awesome 6 Free"; font-weight: 900;
    margin-left: auto; font-size: 0.8rem;
    color: var(--muted);
    transition: transform 0.2s;
}
details[open] .settings-summary::after { transform: rotate(180deg); }
details.settings-card > .setting-row,
details.settings-card > .friend-add,
details.settings-card > .mini-feedback,
details.settings-card > .friends-lists {
    margin: 0 16px;
}
details.settings-card > :last-child { margin-bottom: 14px; }
details.settings-card > .setting-row + .setting-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.self-start { align-self: flex-start; }

/* ---------- Form fields avec icône (email / mot de passe) ---------- */
.form-field-wrap {
    position: relative;
    width: 100%;
}
.form-field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #B200FF;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 0 8px rgba(178, 0, 255, 0.4);
}
.email-field.has-icon {
    padding-left: 40px !important;
}

/* ---------- Bouton "Mettre à jour" redesign ---------- */
.btn-update {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 13px 18px;
    background: linear-gradient(135deg, #7000FF 0%, #B200FF 50%, #FF004D 100%);
    background-size: 200% 200%;
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(178, 0, 255, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.12s, box-shadow 0.2s, background-position 0.4s;
}
.btn-update i { font-size: 0.95rem; }
.btn-update:hover {
    background-position: 100% 100%;
    box-shadow: 0 10px 26px rgba(255, 0, 77, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-update:active { transform: scale(0.97); }
.btn-update:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
