@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- 1. CONFIGURATION GÉNÉRALE --- */
:root {
    --primary-color: #5e35b1; 
    --primary-hover: #4527a0;
    --dark-bg: #0f0a1a; 
    --card-bg: #1f1435; 
    --input-bg: #2d1f4b;
    --text-color: #e6e6e6; 
    --border-color: rgba(94, 53, 177, 0.3);
    --gold: #ffea00;
    
    /* Couleurs boutons auth */
    --btn-register: #00e676; 
    --btn-login: #2979ff;
    
    /* Couleur BAN */
    --btn-ban-grad: linear-gradient(135deg, #ff5252 0%, #d50000 100%);
}

* { box-sizing: border-box; }

body, html { 
    margin: 0; 
    height: 100%; 
    font-family: 'Poppins', sans-serif; 
    background: var(--dark-bg); 
    color: var(--text-color); 
    overflow: hidden; 
    
    /* SÉCURITÉ : Empêche la sélection de texte (sauf inputs) */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
input, textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* --- 2. LAYOUT PRINCIPAL --- */
#app-container { 
    display: flex; 
    flex-direction: column; 
    height: 100vh; 
    width: 100%; 
    position: relative; 
}

/* --- 3. HEADER --- */
header {
    background-color: var(--card-bg); 
    height: 65px; 
    padding: 0 20px;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color); 
    flex-shrink: 0; 
    position: relative;
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 225px; /* Espace entre Logo et Musique */
}

.header-left h1 { font-size: 1.3rem; margin: 0; color: white; display: flex; gap: 10px; align-items: center; }
.header-left i { color: var(--primary-color); font-size: 1.4rem; } 
.header-right { display: flex; gap: 10px; }

/* NIVEAU AU CENTRE */
#level-container {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    width: 150px;
}
.level-badge { font-size: 0.8rem; font-weight: 700; letter-spacing: 1px; color: var(--primary-color); }
.level-badge span { color: rgb(110, 22, 22); font-size: 1rem; }
.xp-bar-bg { width: 100%; height: 4px; background: #333; border-radius: 2px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: #00e676; transition: width 0.5s; }

/* BOUTONS ICONES */
.icon-btn {
    background: var(--input-bg); border: 1px solid var(--border-color);
    color: var(--text-color); width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.icon-btn:hover { background: var(--primary-color); color: white; border-color: white; }
.icon-btn.logout:hover { background: #d32f2f; border-color: #d32f2f; }

/* --- 4. STYLE DU LECTEUR MUSIQUE --- */
#music-player {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 5px 15px;
    gap: 10px;
    height: 40px;
    box-shadow: 0 0 10px rgba(94, 53, 177, 0.1);
    transition: 0.3s;
    position: relative;
}

#music-player:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(94, 53, 177, 0.3);
}

.player-controls { display: flex; gap: 5px; }

.player-controls button {
    background: none; border: none; color: var(--text-color); cursor: pointer;
    font-size: 0.9rem; padding: 0 5px; transition: color 0.2s;
}

.player-controls button:hover { color: var(--gold); transform: scale(1.1); }

.track-info {
    font-size: 0.8rem; color: var(--primary-color); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}

.playing .track-info { color: #00e676; text-shadow: 0 0 5px #00e676; }

#toggle-playlist { font-size: 0.85rem; }

#playlist-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    width: 280px;
    z-index: 1000;
    overflow-y: auto;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#playlist-dropdown.hidden {
    display: none;
}

.playlist-content {
    padding: 8px 0;
}

.playlist-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.playlist-item:hover {
    background: rgba(94, 53, 177, 0.3);
}

.playlist-item.active {
    background: var(--primary-color);
    color: var(--gold);
    font-weight: 600;
}

.playlist-item .track-duration {
    font-size: 0.75rem;
    opacity: 0.7;
}

.track-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 10px;
}

@media (max-width: 600px) { .track-info { display: none; } #music-player { padding: 5px; } }

/* =========================================
   BARRE CATÉGORIES - VERSION AMÉLIORÉE ET CORRIGÉE
   ========================================= */

#category-controls { 
    display: flex; 
    gap: 12px; 
    padding: 15px 20px; 
    background: rgba(15, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(94, 53, 177, 0.4);
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Effet de lumière animée subtile */
#category-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(94, 53, 177, 0.08) 50%, 
        transparent 100%
    );
    animation: light-sweep 10s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes light-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Sélecteur de catégorie - Fond sombre corrigé */
#category-selector { 
    flex: 1; 
    height: 45px;
    padding: 0 20px; 
    border-radius: 25px;
    background: linear-gradient(145deg, #2d1f4b, #1f1435);
    border: 2px solid rgba(94, 53, 177, 0.5);
    color: #ffffff; 
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    
    /* Flèche personnalisée */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b39ddb' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 50px;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#category-selector:hover {
    border-color: var(--primary-color);
    background: linear-gradient(145deg, #3d2f5b, #2d1f4b);
    box-shadow: 
        0 6px 20px rgba(94, 53, 177, 0.5), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(94, 53, 177, 0.3);
    transform: translateY(-2px);
}

#category-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    background: linear-gradient(145deg, #3d2f5b, #2d1f4b);
    box-shadow: 
        0 0 0 4px rgba(94, 53, 177, 0.3),
        0 6px 20px rgba(94, 53, 177, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#category-selector:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(94, 53, 177, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Options du menu déroulant - FOND SOMBRE CORRIGÉ */
#category-selector option {
    background-color: #1f1435;
    color: #ffffff;
    padding: 12px 15px;
    font-weight: 500;
    border: none;
}

#category-selector option:checked,
#category-selector option:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* Support pour Firefox */
@-moz-document url-prefix() {
    #category-selector option {
        background-color: #1f1435 !important;
        color: #ffffff !important;
    }
    
    #category-selector option:checked {
        background-color: var(--primary-color) !important;
    }
}

/* Input nouvelle catégorie - Design amélioré */
#new-category { 
    flex: 1; 
    padding: 12px 20px; 
    border-radius: 25px;
    background: linear-gradient(145deg, #2d1f4b, #1f1435);
    border: 2px solid rgba(94, 53, 177, 0.5);
    color: #ffffff; 
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

#new-category::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

#new-category:hover {
    border-color: rgba(94, 53, 177, 0.8);
    background: linear-gradient(145deg, #3d2f5b, #2d1f4b);
    box-shadow: 
        0 6px 20px rgba(94, 53, 177, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

#new-category:focus {
    border-color: var(--primary-color);
    background: linear-gradient(145deg, #3d2f5b, #2d1f4b);
    box-shadow: 
        0 0 0 4px rgba(94, 53, 177, 0.3),
        0 6px 20px rgba(94, 53, 177, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Effet visuel quand du texte est saisi */
#new-category:not(:placeholder-shown) {
    border-color: #00e676;
    box-shadow: 
        0 6px 20px rgba(0, 230, 118, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Animation de pulsation douce au focus */
@keyframes input-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 0 0 rgba(94, 53, 177, 0.6),
            0 6px 20px rgba(94, 53, 177, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 0 8px rgba(94, 53, 177, 0),
            0 6px 20px rgba(94, 53, 177, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

#new-category:focus {
    animation: input-pulse 2.5s infinite;
}

/* Bouton "Ajouter" (optionnel) */
#add-category-btn {
    height: 45px;
    padding: 0 25px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: 2px solid transparent;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(94, 53, 177, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Effet d'onde au survol */
#add-category-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#add-category-btn:hover::before {
    width: 300px;
    height: 300px;
}

#add-category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(94, 53, 177, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

#add-category-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 4px 15px rgba(94, 53, 177, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Icône dans le bouton */
#add-category-btn i {
    margin-right: 8px;
    font-size: 1.1rem;
    vertical-align: middle;
    position: relative;
    z-index: 2;
}

/* Texte du bouton */
#add-category-btn span {
    position: relative;
    z-index: 2;
}

/* Particules d'ambiance légères */
#category-controls::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 15% 40%, rgba(94, 53, 177, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 85% 70%, rgba(94, 53, 177, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 50% 20%, rgba(94, 53, 177, 0.04) 1px, transparent 1px);
    background-size: 60px 60px, 90px 90px, 70px 70px;
    background-position: 0 0, 45px 60px, 25px 35px;
    pointer-events: none;
    z-index: 0;
}

/* Design responsive */
@media (max-width: 768px) {
    #category-controls {
        flex-direction: column;
        padding: 12px 15px;
        gap: 10px;
    }
    
    #category-selector,
    #new-category,
    #add-category-btn {
        width: 100%;
    }
}

#main-container { 
    flex: 1; 
    display: flex; 
    overflow: hidden; 
}

/* =========================================
   BARRE LATÉRALE UTILISATEURS - AMÉLIORÉE
   ========================================= */
#users-container { 
    width: 250px; 
    background: var(--card-bg); 
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
}

#users-container h2 { 
    font-size: 0.95rem; 
    padding: 18px; 
    margin: 0; 
    color: var(--primary-color); 
    border-bottom: 1px solid var(--border-color); 
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

#user-list { 
    list-style: none; 
    padding: 8px 0; 
    margin: 0; 
    overflow-y: auto; 
    flex: 1; 
}

#user-list li { 
    padding: 12px 15px; 
    font-size: 0.9rem; 
    border-bottom: 1px solid rgba(255,255,255,0.03); 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
}

#user-list li:hover {
    background: rgba(94, 53, 177, 0.1);
    border-left: 3px solid var(--primary-color);
    padding-left: 12px;
}

/* Conteneur gauche : point + nom */
.user-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0; /* Permet l'ellipsis si nom trop long */
}

.user-info-left .status-dot {
    flex-shrink: 0; /* Le point ne rétrécit jamais */
}

.user-info-left .username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* =========================================
   BOUTON BAN - VERSION MODERNE
   ========================================= */
.ban-btn {
    background: var(--btn-ban-grad);
    color: white;
    border: none;
    padding: 5px 12px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(213, 0, 0, 0.3);
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ban-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.ban-btn:hover::before {
    left: 100%;
}

.ban-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 52, 82, 0.6);
}

.ban-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Zone Chat */
#chat-container { flex: 1; display: flex; flex-direction: column; background: var(--dark-bg); position: relative; }
#messages-container { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; }

/* --- 6. MESSAGES --- */
.message { background: var(--card-bg); padding: 10px 15px; border-radius: 12px 12px 12px 0; max-width: 75%; font-size: 0.95rem; width: fit-content; word-wrap: break-word; }
.own-message { background: #311b92; border-radius: 12px 12px 0 12px; align-self: flex-end; }

.msg-header { font-size: 0.85rem; margin-bottom: 4px; color: #b39ddb; display: flex; align-items: center; }
.user-badge { margin-right: 4px; font-size: 1.1rem; }
.user-lvl { font-size: 0.65rem; background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 4px; color: #888; margin-left: 8px; }
.msg-time { font-size: 0.7rem; opacity: 0.5; text-align: right; margin-top: 5px; }
.msg-image { max-width: 100%; max-height: 250px; border-radius: 8px; margin-top: 5px; border: 1px solid #444; }

/* --- 7. INPUT ZONE --- */
#input-container { background: var(--card-bg); padding: 15px 20px; display: flex; gap: 10px; border-top: 1px solid var(--border-color); z-index: 10; }
#message-input { flex: 1; padding: 12px 20px; border-radius: 30px; background: var(--input-bg); border: 1px solid transparent; color: white; outline: none; }
#message-input:focus { border-color: var(--primary-color); }
#upload-btn { color: #aaa; font-size: 1.2rem; cursor: pointer; padding: 5px; }
#upload-btn:hover { color: var(--primary-color); }
button { padding: 0 20px; border-radius: 30px; border: none; background: var(--primary-color); color: white; font-weight: 600; cursor: pointer; }
#preview-container { background: var(--input-bg); padding: 5px 20px; font-size: 0.8rem; border-top: 1px solid var(--primary-color); }

/* --- 8. MODALS & POPUPS --- */

/* Authentification */
#auth-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #151020; padding: 30px; border-radius: 15px; width: 340px; border: 2px solid var(--primary-color); text-align: center; z-index: 2000; box-shadow: 0 0 80px rgba(0,0,0,0.9); }
#authForm input { width: 100%; margin-bottom: 15px; padding: 12px; background: #000; border: 1px solid #555; color: white; border-radius: 5px; font-size: 0.95rem; }
.auth-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
#creer { background-color: var(--btn-register); color: #000; font-weight: bold; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; flex: 1; }
#connexion { background-color: var(--btn-login); color: #fff; font-weight: bold; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; flex: 1; }
#creer:hover, #connexion:hover { opacity: 0.9; transform: scale(1.02); }

/* =========================================
   BOUTIQUE - COSMÉTIQUES AMÉLIORÉS
   ========================================= */
#shop-modal { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    z-index: 5000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(8px); 
}

#shop-modal.hidden { display: none; }

.shop-content { 
    background: linear-gradient(145deg, #1f1435 0%, #0f0a1a 100%);
    width: 500px; 
    max-height: 90vh;
    padding: 30px; 
    border-radius: 20px; 
    border: 2px solid var(--primary-color); 
    box-shadow: 0 0 60px rgba(94, 53, 177, 0.6), inset 0 0 30px rgba(94, 53, 177, 0.1);
    text-align: center; 
    overflow: hidden;
}

.shop-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--border-color); 
    padding-bottom: 20px; 
    margin-bottom: 20px; 
}

.shop-header h2 { 
    margin: 0; 
    font-size: 1.6rem; 
    background: linear-gradient(135deg, #b39ddb, #5e35b1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 1px;
}

.shop-money { 
    font-size: 1.2rem; 
    color: var(--gold); 
    font-weight: bold; 
    background: linear-gradient(135deg, rgba(255, 234, 0, 0.15), rgba(255, 234, 0, 0.05));
    padding: 8px 18px; 
    border-radius: 25px; 
    border: 2px solid var(--gold); 
    box-shadow: 0 0 15px rgba(255, 234, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-items { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
    max-height: 400px; 
    overflow-y: auto; 
    margin-bottom: 25px; 
    padding: 5px;
}

/* Items Boutique - Style Premium */
.shop-item { 
    background: linear-gradient(145deg, var(--input-bg), #1a0f2e);
    padding: 20px; 
    border-radius: 15px; 
    border: 2px solid var(--border-color); 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 8px; 
    position: relative;
    overflow: hidden;
}

.shop-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.shop-item:hover::before {
    left: 100%;
}

.shop-item:hover { 
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary-color); 
    box-shadow: 0 8px 25px rgba(94, 53, 177, 0.4);
}

/* États spéciaux */
.shop-item.owned { 
    background: linear-gradient(145deg, #1b5e20, #0d3d10) !important;
    border-color: #66bb6a !important;
    box-shadow: 0 0 20px rgba(102, 187, 106, 0.3);
} 

.shop-item.equipped { 
    background: linear-gradient(145deg, #1565c0, #0d47a1) !important;
    border: 3px solid #2979ff !important;
    box-shadow: 0 0 25px rgba(41, 121, 255, 0.6), inset 0 0 20px rgba(41, 121, 255, 0.2);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 25px rgba(41, 121, 255, 0.6), inset 0 0 20px rgba(41, 121, 255, 0.2); }
    50% { box-shadow: 0 0 35px rgba(41, 121, 255, 0.8), inset 0 0 25px rgba(41, 121, 255, 0.3); }
}

.status-text { 
    font-size: 0.7rem; 
    font-weight: bold; 
    padding: 4px 10px; 
    border-radius: 6px; 
    background: rgba(0,0,0,0.5); 
    margin-top: 5px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-text.owned { 
    color: #a5d6a7; 
    background: rgba(102, 187, 106, 0.2);
    border: 1px solid #66bb6a;
}

.status-text.equipped { 
    color: #fff; 
    background: linear-gradient(135deg, #2979ff, #1565c0);
    border: 1px solid #64b5f6;
    box-shadow: 0 0 10px rgba(41, 121, 255, 0.5);
}

.badge-icon { 
    font-size: 2.5rem; 
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.shop-item:hover .badge-icon {
    transform: scale(1.1) rotate(5deg);
}

.badge-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #b39ddb;
    margin-top: 5px;
}

.badge-price { 
    color: var(--gold); 
    font-size: 1rem; 
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
}

.close-btn { 
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    width: 100%; 
    padding: 12px; 
    margin-top: 15px; 
    color: white; 
    border: none; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.close-btn:hover {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(211, 47, 47, 0.4);
}

/* Scrollbar personnalisée pour la boutique */
.shop-items::-webkit-scrollbar {
    width: 8px;
}

.shop-items::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}

.shop-items::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.shop-items::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Overlay Hors Ligne */
#offline-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 10, 26, 0.9); backdrop-filter: blur(8px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s ease;
}
#offline-overlay.hidden { opacity: 0; pointer-events: none; }
.offline-content { text-align: center; color: #ff5252; }
.offline-content i { font-size: 4rem; margin-bottom: 20px; animation: pulse-red 2s infinite; }
.loader-dots span { display: inline-block; width: 8px; height: 8px; background: var(--primary-color); border-radius: 50%; margin: 0 3px; animation: bounce 1.4s infinite ease-in-out both; }
.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes pulse-red { 0% { transform: scale(1); text-shadow: 0 0 0 rgba(255, 82, 82, 0.7); } 70% { transform: scale(1.1); text-shadow: 0 0 20px rgba(255, 82, 82, 0); } 100% { transform: scale(1); text-shadow: 0 0 0 rgba(255, 82, 82, 0); } }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* --- 9. NOUVEAUTÉS : BOUTONS SPÉCIAUX --- */

/* BOUTON SCROLL INTELLIGENT */
#scroll-down-btn { 
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); 
    background-color: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 20px; 
    font-size: 0.9rem; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.5); cursor: pointer; z-index: 100; 
    transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; 
}
#scroll-down-btn:hover { background-color: var(--btn-login); transform: translateX(-50%) scale(1.05); }
#scroll-down-btn.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }

/* ECRAN BANNI */
#banned-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.banned-content { background: #222; padding: 30px; border-radius: 10px; border: 2px solid red; text-align: center; color: white; width: 400px; }
.ticket-form textarea { width: 100%; height: 100px; margin: 10px 0; background: #111; color: white; border: 1px solid #555; padding: 10px; }
#banned-overlay.hidden { display: none; }

/* UTILS */
.status-dot { 
    display: inline-block; 
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    transition: all 0.3s;
}
.online { 
    background: #00e676; 
    box-shadow: 0 0 8px #00e676, 0 0 12px #00e676; 
    animation: pulse-online 2s infinite;
}
.offline { 
    background: #666; 
    box-shadow: none;
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 8px #00e676; }
    50% { box-shadow: 0 0 15px #00e676, 0 0 20px #00e676; }
}

::-webkit-scrollbar { width: 6px; } 
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }

@media (max-width: 768px) { 
    #users-container { display: none; } 
    #auth-container { width: 90%; } 
    .shop-content { width: 95%; padding: 20px; }
    .shop-items { grid-template-columns: 1fr; }
    #category-controls {
        flex-direction: column;
        padding: 12px 15px;
        gap: 10px;
    }
    #category-selector,
    #new-category,
    #add-category-btn {
        width: 100%;
    }
}


/* --- STYLE PING --- */
.message.mentioned {
    background-color: rgba(255, 152, 0, 0.2) !important;
    border-left: 4px solid #ff9800;
    animation: flash 1s;
}
.mention-tag {
    background-color: #ff9800;
    color: black;
    font-weight: bold;
    padding: 0 4px;
    border-radius: 4px;
}
@keyframes flash {
    0% { background-color: rgba(255, 152, 0, 0.6); }
    100% { background-color: rgba(255, 152, 0, 0.2); }
}

/* --- BOOST VIOLET --- */
.message.boost-violet {
    background: linear-gradient(180deg, #240b36 0%, #510e61 100%) !important;
    border: 2px solid #d500f9 !important;
    box-shadow: 0 0 15px rgba(213, 0, 249, 0.5) !important;
    color: white !important;
}

/* --- BOOST ROUGE --- */
.message.boost-red {
    background: linear-gradient(180deg, #360b0b 0%, #610e0e 100%) !important;
    border: 2px solid #ff3333 !important;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.5) !important;
    color: white !important;
}

/* SÉCURITÉ TEXTE (Obligatoire) */
.message.boost-violet *, 
.message.boost-red * {
    color: #ffffff !important;
    z-index: 999;
    position: relative;
    text-shadow: 1px 1px 1px black;
}

/* MENU CONTEXTUEL */
#user-context-menu {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: #1f1435; border: 2px solid #5e35b1; padding: 20px;
    border-radius: 10px; display: flex; flex-direction: column; gap: 10px;
    z-index: 9999; box-shadow: 0 0 50px rgba(0,0,0,0.8); width: 250px;
}
#user-context-menu button { width: 100%; padding: 10px; cursor: pointer; }
#user-context-menu.hidden { display: none; }

/* BANNIERE MODE PRIVÉ */
#private-banner {
    background: #311b92; color: white; padding: 10px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #00e676;
}
#private-banner.hidden { display: none; }
#private-banner button { background: #d32f2f; padding: 5px 15px; font-size: 0.8rem; height: 30px; }


/* =========================================
   EFFETS DE NOM (ACHETABLES) - AMÉLIORÉS
   ========================================= */

/* 1. Rainbow (Arc-en-ciel animé) */
.effect-rainbow {
    background-image: linear-gradient(to left, violet, indigo, blue, green, yellow, orange, red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: rainbow-move 3s linear infinite;
    font-weight: bold;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}
@keyframes rainbow-move { 
    100% { background-position: -200% 0; } 
}

/* 2. Gold (Brillant doré) */
.effect-gold {
    color: #FFD700 !important;
    text-shadow: 0 0 8px #B8860B, 0 0 15px #FFD700, 0 0 20px #FFD700;
    font-weight: bold;
    animation: gold-shine 2s infinite;
}
@keyframes gold-shine {
    0%, 100% { text-shadow: 0 0 8px #B8860B, 0 0 15px #FFD700; }
    50% { text-shadow: 0 0 15px #FFD700, 0 0 25px #FFD700, 0 0 30px #FFED4E; }
}

/* 3. Glitch (Tremblement + couleur) */
.effect-glitch {
    color: #00ff00 !important;
    text-shadow: 2px 0 #ff00de, -2px 0 #00f0ff;
    animation: glitch-anim 0.3s infinite;
}
@keyframes glitch-anim {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); text-shadow: 2px 0 #00f0ff, -2px 0 #ff00de; }
    40% { transform: translate(-2px, -2px); text-shadow: -2px 0 #ff00de, 2px 0 #00f0ff; }
    60% { transform: translate(2px, 2px); text-shadow: 2px 2px #00f0ff, -2px -2px #ff00de; }
    80% { transform: translate(2px, -2px); text-shadow: -2px 2px #ff00de, 2px -2px #00f0ff; }
    100% { transform: translate(0); }
}

/* 4. Fire (Feu) */
.effect-fire {
    color: #ff3d00 !important;
    text-shadow: 
        0 -2px 4px #ffeb3b, 
        0 -4px 6px #ff5722,
        0 -6px 10px #ff3d00;
    animation: fire-flicker 0.15s infinite alternate;
}
@keyframes fire-flicker {
    0% { text-shadow: 0 -2px 4px #ffeb3b, 0 -4px 6px #ff5722, 0 -6px 10px #ff3d00; }
    100% { text-shadow: 0 -3px 6px #ffeb3b, 0 -5px 8px #ff5722, 0 -8px 12px #ff6d00; }
}

/* 5. Neon (Bleu électrique) */
.effect-neon {
    color: #fff !important;
    text-shadow: 
        0 0 5px #fff, 
        0 0 10px #fff, 
        0 0 20px #00e676, 
        0 0 30px #00e676,
        0 0 40px #00e676;
    animation: neon-flicker 1.5s infinite alternate;
}
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px #fff, 
            0 0 10px #fff, 
            0 0 20px #00e676, 
            0 0 30px #00e676,
            0 0 40px #00e676;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* 6. Ghost (Translucide) */
.effect-ghost {
    color: rgba(255, 255, 255, 0.5) !important;
    text-shadow: 0 0 15px rgba(255,255,255,0.8);
    font-style: italic;
    animation: ghost-float 3s infinite ease-in-out;
}
@keyframes ghost-float {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(-2px); }
}

/* --- CADRES AVATAR (Pour les images) --- */
.frame-gold { 
    border: 3px solid #FFD700; 
    box-shadow: 0 0 15px #FFD700, inset 0 0 10px rgba(255, 215, 0, 0.3);
}
.frame-cyber { 
    border: 3px dashed #00e676; 
    box-shadow: 0 0 10px #00e676;
    animation: cyber-rotate 10s linear infinite;
}
@keyframes cyber-rotate {
    0% { border-color: #00e676; }
    33% { border-color: #00bcd4; }
    66% { border-color: #ff00ff; }
    100% { border-color: #00e676; }
}
.frame-blood { 
    border: 3px solid #d32f2f; 
    box-shadow: 0 0 8px #d32f2f, inset 0 0 8px rgba(211, 47, 47, 0.3);
    animation: blood-pulse 2s infinite;
}
@keyframes blood-pulse {
    0%, 100% { box-shadow: 0 0 8px #d32f2f, inset 0 0 8px rgba(211, 47, 47, 0.3); }
    50% { box-shadow: 0 0 15px #ff5252, inset 0 0 15px rgba(255, 82, 82, 0.5); }
}