:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --codm-yellow: #ffc107;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-green: #00e676; /* Pour les tendances en hausse */
    --accent-red: #ff1744;   /* Pour les tendances en baisse */
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    height: 100vh; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    margin: 0;
}

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--codm-yellow);
    margin-bottom: 20px;
    flex-wrap: wrap; 
    gap: 10px;
    position: relative;
    padding-right: 60px;
}

.header h1 {
    color: var(--codm-yellow);
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
    font-size: 2rem;
}

.mvp-badge {
    background: linear-gradient(45deg, #ff8f00, #ffc107);
    color: #000;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.mvp-badge span { font-size: 1rem; opacity: 0.9; font-weight: 600; }
.mvp-badge strong { font-size: 1.4rem; font-family: 'Orbitron'; margin-top: 5px; }

/* EXPORT BUTTON */
.export-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.export-btn {
    background: #333;
    color: var(--codm-yellow);
    font-size: 0.8rem;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    transition: background 0.2s;
}
.export-btn:hover { background: #444; }


/* LAYOUT PRINCIPAL (Version PC) */
.container {
    display: grid;
    grid-template-columns: 280px 1fr; 
    gap: 20px;
    flex-grow: 1;
    min-height: 0; 
}

/* SIDEBAR - LEADERBOARD */
.sidebar {
    background: var(--bg-panel);
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 15px;
    background: #252525;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto; 
    flex-grow: 1;
}

.player-card {
    display: grid;
    grid-template-columns: 30px 1fr 40px; /* Rank | Info | Badges */
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.2s;
}

.player-card:hover { background: #2a2a2a; }
.player-card.active { background: #333; border-left: 4px solid var(--codm-yellow); }
.player-card.inactive { opacity: 0.5; }

.rank-num {
    font-family: 'Orbitron';
    color: var(--text-muted);
    font-weight: bold;
}
.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.player-info { display: flex; flex-direction: column; }
.player-name { font-weight: bold; font-size: 0.95rem; }
.player-avg { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; } 

/* STYLES DES BADGES ET TENDANCES */
.player-badges {
    text-align: right;
    font-size: 0.85rem; /* Réduit un peu la taille pour le 🔥N */
    line-height: 1;
}
.trend-up { color: var(--accent-green); margin-left: 5px; }
.trend-down { color: var(--accent-red); margin-left: 5px; }

.controls {
    padding: 10px;
    display: flex;
    gap: 5px;
    justify-content: center;
    border-top: 1px solid #333;
    background: #252525; 
}
.btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 4px;
    text-transform: uppercase;
    flex-grow: 1; 
}
.btn:hover { background: #444; color: var(--codm-yellow); }

/* MAIN CONTENT */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0; 
}

.chart-wrapper {
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 10px;
    flex-grow: 1;
    position: relative;
    border: 1px solid #333;
    min-height: 300px; 
}

/* VERSUS PANEL */
.versus-panel {
    background: linear-gradient(90deg, #1e1e1e 0%, #252525 50%, #1e1e1e 100%);
    border: 1px solid var(--codm-yellow);
    border-radius: 8px;
    padding: 15px;
    display: none;
    justify-content: space-around;
    align-items: center;
    animation: fadeIn 0.5s;
}

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

.vs-player { text-align: center; width: 40%; }
.vs-name { font-family: 'Orbitron'; font-size: 1.2rem; margin-bottom: 5px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
.vs-stat { font-size: 0.9rem; color: var(--text-muted); }
.vs-score { font-size: 1.5rem; font-weight: bold; color: white; }
.vs-icon { font-family: 'Orbitron'; font-size: 1.5rem; color: var(--codm-yellow); font-style: italic; }


/* NOUVEAU: LÉGENDE DES BADGES */
.legend-panel {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
}

.legend-panel h4 {
    color: var(--codm-yellow);
    margin-bottom: 10px;
    font-size: 1rem;
    font-family: 'Orbitron';
    text-transform: uppercase;
}

.badges-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px; 
}

.badges-list span {
    display: flex;
    align-items: center;
    color: var(--text-main);
    font-size: 0.85rem;
}


/* =========================================
   🎯 VERSION MOBILE (Responsive)
   ========================================= */
@media (max-width: 768px) {
    body {
        height: auto; 
        overflow-y: auto;
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header h1 { font-size: 1.5rem; }
    
    .export-container { width: 100%; justify-content: space-between; }
    
    .mvp-badge {
        width: 48%; 
        flex-direction: column;
    }
    .export-btn { width: 48%; }

    .container {
        display: flex; 
        flex-direction: column-reverse; 
        gap: 20px;
    }

    .main-content { order: 1; }
    .sidebar { 
        order: 2; 
        max-height: 400px;
    }

    .chart-wrapper {
        height: 300px; 
        min-height: 300px;
    }
    
    .versus-panel {
        flex-direction: row; 
    }
    .vs-name { font-size: 0.9rem; }
    .vs-score { font-size: 1.2rem; }
    .vs-icon { font-size: 1.2rem; }
    
    .badges-list {
        flex-direction: column;
        gap: 10px;
    }
}
.main-header {
    background-color: #0d0d0d;
    color: white;
    padding: 15px 30px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--codm-yellow);
    
    /* --- MODIFICATIONS CLÉS POUR LE HEADER FIXE ET PLEINE LARGEUR --- */
    position: fixed; /* Remplacer 'sticky' par 'fixed' */
    top: 0;
    left: 0; /* Assure qu'il commence au bord gauche */
    width: 95%; /* Assure qu'il couvre toute la largeur */
    /* ----------------------------------------------------------------- */

    z-index: 1000;
}

.logo-container a {
    text-decoration: none;
    color: white;
}

.main-header h1 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
}

.main-header .tag {
    font-size: 0.6em;
    color: var(--codm-yellow);
    vertical-align: middle;
    border: 1px solid var(--codm-yellow);
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

/* Menu Desktop */
/* Desktop/mobile navigation and hamburger removed per request */

/* =======================================
   FOOTER COMMUN
   ======================================= */
.main-footer {
    background-color: #0d0d0d;
    color: #888;
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid #222;
    margin-top: 40px;
}

.footer-links a {
    color: var(--codm-yellow);
    text-decoration: none;
    margin: 0 5px;
}

/* =======================================
   MEDIA QUERIES (Mobile View)
   ======================================= */
@media (max-width: 768px) {
    /* Desktop/mobile navigation and hamburger removed */
    .main-header {
        padding: 10px 20px;
    }
    .main-header h1 {
        font-size: 1.2rem;
    }
}
main {
    padding-top: 105px; /* Ajustez cette valeur (75px est généralement suffisant pour un header standard) */
}
/* Définition des variables */
        :root {
            --codm-yellow: #FFC107;
            --accent-red: #FF2344;
            --text-muted: #888;
        }

        /* CSS Spécifique pour la Modale d'Annonce */
        .announcement-modal {
            display: none; /* Masquée par défaut */
            position: fixed;
            z-index: 1001; /* Doit être au-dessus de tout */
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.85); /* Fond sombre */
        }

        .modal-content-announcement {
            background-color: #1e1e1e;
            margin: 10% auto; /* Marge supérieure/inférieure par défaut */
            padding: 30px;
            border: 3px solid var(--codm-yellow);
            width: 90%;
            max-width: 500px;
            border-radius: 12px;
            box-shadow: 0 0 25px rgba(255, 193, 7, 0.5);
            position: relative;
            text-align: center;
            color: white;
        }

        .modal-content-announcement h2 {
            color: var(--accent-red);
            font-family: 'Orbitron', sans-serif;
            margin-bottom: 15px;
            font-size: 1.8rem;
        }

        .modal-content-announcement p, .modal-content-announcement li {
            color: #ccc;
            line-height: 1.6;
            margin-bottom: 10px;
            text-align: left;
            list-style-type: none;
        }
        
        .modal-content-announcement ul {
            padding-left: 0;
            margin-top: 15px;
        }
        
        .modal-content-announcement li::before {
            content: "•";
            color: var(--codm-yellow);
            font-weight: bold;
            display: inline-block; 
            width: 1em;
            margin-left: -1em;
        }

        .modal-content-announcement .close-btn {
            color: #aaa;
            float: right;
            font-size: 36px;
            font-weight: bold;
            cursor: pointer;
            position: absolute;
            top: 10px;
            right: 20px;
        }

        .modal-content-announcement .cta-button {
             background-color: var(--codm-yellow);
             color: #1e1e1e;
             font-weight: bold;
             padding: 10px 20px;
             border: none;
             border-radius: 5px;
             cursor: pointer;
        }
        .update-message {
            margin-top: 25px;
            border-top: 1px solid #333;
            padding-top: 15px;
            color: var(--codm-yellow);
            font-style: italic;
            text-align: center;
        }
        .update-message p {
            text-align: center;
            font-style: normal;
        }

        /* ===================================== */
        /* SECTION RESPONSIVE (MOBILE)           */
        /* ===================================== */
        @media (max-width: 600px) {
            .modal-content-announcement {
                width: 95%; /* Utiliser presque toute la largeur */
                margin: 5% auto; /* Réduire la marge supérieure/inférieure */
                padding: 20px; /* Réduire le padding */
            }

            .modal-content-announcement h2 {
                font-size: 1.5rem; /* Réduire la taille du titre */
            }
            
            .modal-content-announcement p {
                 font-size: 0.95rem; /* Taille de police légèrement plus petite */
            }

            /* MVP Badge responsive */
            .mvp-badge {
                padding: 6px 10px;
                font-size: 0.75rem;
                min-width: auto;
            }
            .mvp-badge span { 
                font-size: 0.6rem; 
            }
            .mvp-badge strong { 
                font-size: 0.85rem;
                word-break: break-word;
                line-height: 1.2;
            }

            /* Header responsive */
            .header {
                flex-direction: column;
                gap: 12px;
            }

            .export-container {
                flex-direction: column;
                width: 100%;
                gap: 10px;
            }

            .export-btn {
                width: 100%;
            }
        }