/* =================================================================== */
/* --- 1. CONFIGURATION GLOBALE & VARIABLES --- */
/* =================================================================== */
:root {
    /* Couleurs fixes */
    --primary-color: #ff4655; /* Rouge Valorant */
    --win-color: #4CAF50; /* Vert Victoire */
    --lose-color: #F44336; /* Rouge Défaite */
    --stats-score-light-blue: #00c0ff; /* Bleu Score */

    /* Couleurs Leaderboard */
    --radiant-color: #FFFF99;
    --immo3-color: #B22222;
    --immo2-color: #cd4242;
    --immo1-color: #e76666;
}

/* THÈME SOMBRE (DÉFAUT) */
body[data-theme="dark"] {
    --bg-color: #101010;
    --text-color: #f0f0f0;
    --text-muted: #aaaaaa;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 30, 30, 0.4);
    --card-bg-solid: #1c1c1c;
    --splash-gradient: radial-gradient(ellipse at top center, #2a2a2a 0%, #111111 70%);
}

/* NOUVEAU: THÈME CLAIR */
body[data-theme="light"] {
    --bg-color: #f4f7f6;
    --text-color: #1a1a1a;
    --text-muted: #555555;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.6);
    --card-bg-solid: #ffffff;
    --splash-gradient: radial-gradient(ellipse at top center, #ffffff 0%, #e9e9e9 70%);
}

/* Reset moderne */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    background-image: var(--splash-gradient);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    padding: 80px 1rem 2rem 1rem;
    min-height: 100vh;
    overflow-x: hidden; 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Images et listes responsives par défaut */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}
ul, ol {
    list-style: none;
}
p {
    line-height: 1.6;
    color: var(--text-muted);
}
span.tag {
    color: var(--text-muted);
}

/* Typographie de base */
h1, h2, h3, h4 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-color);
}
h1 { font-size: 3.5rem; }
h2 { font-size: 2rem; }
h3 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 20px;
    font-weight: 400; 
    letter-spacing: 0.5px;
}
h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    font-size: 12px;
}

/* Transitions globales pour une sensation "moderne" */
a, button, .clickable, .level-item, .chroma-swatch, .match-item-header, .follow-button, .armory-cat-button, .stat-card {
    transition: all 0.25s ease-in-out;
}
button, .update-button {
    font-family: inherit;
    cursor: pointer;
}

/* =================================================================== */
/* --- 2. LAYOUT & STRUCTURE --- */
/* =================================================================== */
.container { 
    max-width: 900px; 
    margin: 20px auto; 
    padding: 0; 
    position: relative; 
}

/* Arrière-plans Art */
.background-art {
    position: fixed;
    top: 0;
    height: 100vh;
    width: 60%;
    background-size: cover;
    z-index: -2;
    opacity: 0; 
    transition: opacity 1s ease-in-out;
}
#agentBackgroundArt {
    left: -10%; 
    background-position: left center;
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 80%);
}
#mapBackgroundArt {
    right: -10%; 
    background-position: right center;
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 40%, rgba(0,0,0,0) 80%);
}
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    z-index: -1;
}
body[data-theme="light"]::before { background: none; } /* Pas de vignette sombre en mode clair */

/* Scrollbar */
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--card-bg-solid); }
body::-webkit-scrollbar-thumb { background: #444; border-radius: 5px; }
body[data-theme="light"]::-webkit-scrollbar-thumb { background: #ccc; }
body[data-theme="light"]::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* =================================================================== */
/* --- 3. STYLES DES COMPOSANTS --- */
/* =================================================================== */

/* --- Navbar --- */
.navbar {
    display: flex; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem; 
    height: 60px;
    background: var(--card-bg); /* S'adapte au thème */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}
.nav-brand { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
.nav-links {
    display: flex;
    align-items: center;
}
.nav-links .nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
}
.nav-links .nav-link:hover { color: var(--text-color); background-color: var(--border-color); }
.nav-links .nav-link.active { color: var(--text-color); background-color: var(--primary-color); }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}
.theme-toggle-btn svg {
    stroke: currentColor;
}

/* --- Style pour l'état de connexion --- */
.auth-container {
    position: fixed;
    bottom: 1rem; 
    right: 1rem;  
    z-index: 1001;
    display: flex;
    flex-direction: column; 
    align-items: flex-end; 
    gap: 10px;
}
.discord-login-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #5865F2; /* Bleu Discord */
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.discord-login-button svg {
    width: 20px; 
    height: 20px;
    fill: white;
}
.discord-login-button:hover {
    background-color: #4752C4; /* Bleu plus foncé */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}
.auth-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    background: var(--card-bg-solid);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.auth-user-info img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}
.auth-logout-button {
    text-decoration: none;
    color: var(--text-muted);
    background: var(--card-bg-solid);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.auth-logout-button:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
/* --- FIN Style pour l'état de connexion --- */


/* --- Card (Glassmorphism) --- */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); 
}
body[data-theme="light"] .card {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1); /* Ombre plus claire */
}
.card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
}
body[data-theme="light"] .card.clickable:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}


/* --- Page d'accueil (Splash) --- */
.splash-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}
#splashLogo {
    width: 100%;
    max-width: 450px; 
    height: auto;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 15px rgba(255, 70, 85, 0.3));
}
body[data-theme="light"] #splashLogo {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}
.splash-container .search-box {
    width: 100%;
    max-width: 600px;
}
.splash-nav-links {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.splash-nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}
.splash-nav-links a:hover {
    color: var(--text-color);
    background-color: var(--border-color);
    border-color: var(--text-muted);
    transform: translateY(-3px); 
}

/* --- Search Box --- */
.search-box { display: flex; position: relative; }
.search-input-with-history {
    flex-grow: 1; padding: 15px; font-size: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color); 
    border-radius: 12px 0 0 12px; 
    outline: none;
}
.search-input-with-history:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.3);
}
#searchButton {
    padding: 0; 
    width: 50px; 
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
#searchButton:hover { 
    background-color: #E63E4D;
    transform: scale(1.05); /* Effet "Pop" */
}

/* Loader dans le bouton */
.loader-small {
    width: 20px; 
    height: 20px; 
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
#searchButton .search-icon { transition: opacity 0.2s ease; }
#searchButton .search-loader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
#searchButton.loading .search-icon { opacity: 0; }
#searchButton.loading .search-loader { display: block !important; }
#searchButton.loading {
    pointer-events: none;
    background-color: #E63E4D;
}

.update-button {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0 15px;
    height: 40px; 
    line-height: 40px;
    margin-left: 10px;
    border-radius: 12px;
    font-size: 0.9rem;
}
.update-button:hover { 
    color: var(--text-color); 
    border-color: var(--primary-color);
    transform: scale(1.05); /* Effet "Pop" */
    background-color: var(--card-bg-solid);
}

/* --- Page Comparer --- */
.compare-search-box {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}
.compare-search-box .search-input-with-history { border-radius: 12px; }
.vs-text { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }
#compareSearchButton {
    grid-column: 1 / -1; 
    height: 40px;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1rem;
}
#compareSearchButton:hover { 
    background-color: #E63E4D;
    transform: scale(1.02); /* Effet "Pop" */
}
.compare-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Historique de recherche --- */
.history-dropdown {
    display: none;
    position: absolute;
    top: 60px; 
    left: 0;
    width: 100%; 
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px; 
}
.history-dropdown.visible { display: block; }
.history-dropdown h3 { margin-top: 0; font-size: 1rem; }
#searchHistoryList { padding: 0; }
#searchHistoryList li {
    padding: 10px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-muted);
}
#searchHistoryList li:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* =================================================================== */
/* --- 4. PROFIL JOUEUR --- */
/* =================================================================== */

.profile-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.profile-header { display: flex; align-items: center; gap: 20px; }
.playerAvatar { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--border-color); }
.playerName { margin: 0; font-size: 1.75rem; font-weight: 700; word-break: break-all; }
.tag { font-size: 0.75rem; padding: 4px 8px; border-radius: 6px; margin-top: 5px; display: inline-block; }

/* Stats Score Révélation */
.stats-score-reveal-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}
.stats-score-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background-color: var(--card-bg-solid);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
}
.stats-score-value .icon-eye-slash { width: 14px; height: 14px; color: var(--text-muted); }
.stats-score-value .score-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--stats-score-light-blue);
    transition: color 0.3s ease;
}
.stats-score-value.blurred { filter: blur(4px); opacity: 0.7; }
.stats-score-value.blurred:hover { filter: blur(2px); opacity: 1; }
.score-label { font-size: 0.75rem; color: var(--text-muted); }

/* Carte de Rang */
.rank-card { display: flex; align-items: center; justify-content: center; gap: 15px; }
.rank-card:hover { /* C'est une .card.clickable, donc elle se lève déjà */
    border-color: var(--primary-color); /* Ajoute un highlight de couleur */
}
.rr-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) var(--rr-percent, 0deg), 
        rgba(0,0,0,0.3) 0deg
    );
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.rr-circle-inner {
    width: 65px; height: 65px;
    background-color: var(--card-bg-solid);
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center; overflow: hidden;
}
.rankImage { width: 100%; height: 100%; transform: scale(1.1); }
.rank-details { text-align: center; }
.rank-details h3 { margin: 0 0 5px 0; font-size: 1.1rem; border: none; padding: 0; }
.rank-details p { margin: 0; color: var(--primary-color); font-weight: 700; }
.rrChange {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    margin-top: 5px;
}
.rrChange.positive {
    color: var(--win-color);
    background-color: rgba(160, 232, 160, 0.1);
    border: 1px solid rgba(160, 232, 160, 0.2);
}
.rrChange.negative {
    color: var(--lose-color);
    background-color: rgba(232, 160, 160, 0.1);
    border: 1px solid rgba(232, 160, 160, 0.2);
}

/* Grille de Stats (Widgets) */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 15px; 
}
.stat-card { 
    text-align: center; 
    padding: 15px; 
    cursor: default; 
}
.stat-card:hover {
    transform: translateY(-5px);
    background-color: rgba(40, 40, 40, 0.6); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 70, 85, 0.2); 
    border-color: rgba(255, 70, 85, 0.5); 
}
body[data-theme="light"] .stat-card:hover {
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}
.stat-card:hover h4 {
    color: var(--text-color); 
}
.stat-card:hover p {
    color: var(--primary-color); 
    transform: scale(1.05); 
}
.stat-card:hover .sparkline-path {
    stroke: var(--win-color); 
    stroke-width: 3;
}
.stat-card h4 { 
    margin: 0 0 10px 0; 
    transition: color 0.25s ease; 
}
.stat-card p { 
    margin: 0; 
    font-size: 1.75rem; 
    font-weight: 700; 
    color: var(--text-color);
    transition: color 0.25s ease, transform 0.25s ease; 
}
.stat-card p.highlight { color: var(--primary-color); font-size: 1.25rem; }
.stat-card span { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 5px;}

/* Graphiques "Sparkline" */
.sparkline-container { width: 100%; height: 40px; margin-top: 10px; }
.sparkline-svg { width: 100%; height: 100%; overflow: visible; }
.sparkline-path {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.25s ease, stroke-width 0.25s ease; 
}

/* Section Analyse (utilise .stat-card, donc hérite des effets) */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.agent-map-card img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin: 0 auto 10px auto; 
    background-color: rgba(0,0,0,0.2);
    object-fit: cover;
}
body[data-theme="light"] .agent-map-card img {
    background-color: rgba(0,0,0,0.05);
}
.history-panel { margin-top: 20px; width: 100%; }
.full-width { grid-column: 1 / -1; }

/* =================================================================== */
/* --- 5. HISTORIQUE MATCHS & SCOREBOARD --- */
/* =================================================================== */

.scroll-container { max-height: 500px; overflow-y: auto; }
.matchHistory { display: flex; flex-direction: column; gap: 10px; }
.match-dropdown-wrapper {
    border-radius: 12px; 
    overflow: hidden; 
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-solid);
}
.match-item-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-size: cover;
    background-position: center 30%;
    position: relative;
}
.match-item-header:hover { 
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.match-item-header:hover::before { 
    background-color: rgba(0,0,0,0.4); 
}
.match-item-header::before { 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(to right, 
        rgba(30, 30, 30, 0.4) 0%, 
        rgba(30, 30, 30, 0.8) 50%, 
        rgba(30, 30, 30, 0.98) 70%
    );
    z-index: 1;
    transition: background-color 0.2s ease;
}
.match-item-content, .match-stats, .match-expand-icon {
    position: relative;
    z-index: 2; 
    display: flex;
    align-items: center;
}
.match-expand-icon {
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
    padding: 0 10px;
}
.match-dropdown-wrapper.expanded .match-expand-icon { transform: rotate(45deg); }
.match-agent-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid var(--border-color);
}
.match-info { display: flex; flex-direction: column; }
.match-info strong { font-size: 1.1rem; color: var(--text-color); }
.match-info span.win { color: var(--win-color); font-weight: 700; }
.match-info span.loss { color: var(--lose-color); font-weight: 700; }
.match-stats { display: flex; gap: 20px; }
.match-stat-item { text-align: right; }
.match-stat-item span { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
.match-stat-item strong { font-size: 1.1rem; color: var(--text-color); display: block; }
.match-dropdown-content {
    display: none; 
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
}
body[data-theme="light"] .match-dropdown-content {
    background-color: rgba(0,0,0,0.02);
}
.match-dropdown-wrapper.expanded .match-dropdown-content { display: block; }

/* --- Scoreboard (dans le dropdown) --- */
.scoreboard-table { 
    width: 100%; 
    border-radius: 8px;
    overflow: hidden;
    border-collapse: collapse;
}
.scoreboard-table th, .scoreboard-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle; 
    transition: background-color 0.25s ease-in-out; 
}
.scoreboard-table th { font-size: 0.75rem; color: var(--text-muted); }
.scoreboard-table.team-win {
    background: rgba(160, 232, 160, 0.05);
    border: 1px solid rgba(160, 232, 160, 0.2);
}
.scoreboard-table.team-loss {
    background: rgba(232, 160, 160, 0.05);
    border: 1px solid rgba(232, 160, 160, 0.2);
}
.scoreboard-table.team-win th { background-color: rgba(160, 232, 160, 0.1); }
.scoreboard-table.team-loss th { background-color: rgba(232, 160, 160, 0.1); }

body[data-theme="light"] .scoreboard-table.team-win {
    background: #f0fff0;
    border-color: #d0e0d0;
}
body[data-theme="light"] .scoreboard-table.team-loss {
    background: #fff0f0;
    border-color: #e0d0d0;
}
body[data-theme="light"] .scoreboard-table.team-win th { background-color: #e8f8e8; }
body[data-theme="light"] .scoreboard-table.team-loss th { background-color: #f8e8e8; }


/* --- Animations Scoreboard --- */
.scoreboard-table tbody tr {
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}
.scoreboard-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.scoreboard-table tbody tr:hover td {
    background-color: var(--card-bg-solid);
}
.scoreboard-table tbody tr:hover .leaderboard-player-name {
    color: var(--primary-color);
}
body[data-theme="light"] .scoreboard-table tbody tr:hover td {
    background-color: #f5f5f5;
}

.scoreboard-player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.scoreboard-agent-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0; 
}
.scoreboard-rank-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px; 
}

/* =================================================================== */
/* --- 6. AUTRES PAGES (LEADERBOARD, ARMURERIE, SUIVIS) --- */
/* =================================================================== */

/* --- Leaderboard --- */
.leaderboard-container { 
    width: 100%; 
    padding: 20px; 
    border-radius: 12px;
}
#leaderboardSearchInput {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-solid);
    color: var(--text-color);
    border-radius: 8px;
    outline: none;
    margin-bottom: 20px; 
}
#leaderboardSearchInput:focus { border-color: var(--primary-color); }
#leaderboardList { padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 70vh; }
.leaderboard-player-card {
    display: grid;
    grid-template-columns: 50px 1fr 100px 100px;
    align-items: center;
    padding: 15px;
    gap: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid transparent; 
}
body[data-theme="light"] .leaderboard-player-card {
    background-color: rgba(0,0,0,0.02);
}
.lb-rank { font-size: 1.25rem; font-weight: 700; color: var(--text-muted); }
.lb-player-info { display: flex; align-items: center; gap: 15px; }
.lb-player-name { font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.lb-player-name:hover { color: var(--primary-color); }
.lb-stat { text-align: right; }
.lb-stat p { font-size: 1.1rem; font-weight: 700; margin: 0; }
.lb-stat span { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; }
/* Couleurs Leaderboard */
.rank-Radiant .lb-rank { color: var(--radiant-color); }
.rank-Immortal-3 .lb-rank { color: var(--immo3-color); }
.rank-Immortal-2 .lb-rank { color: var(--immo2-color); }
.rank-Immortal-1 .lb-rank { color: var(--immo1-color); }

/* --- Graphique RR --- */
#rrGraphContainer, .rrGraphContainer { width: 100%; height: 300px; padding: 10px; }
.rr-graph-svg { width: 100%; height: 100%; overflow: visible; }
.rr-graph-path { fill: none; stroke: var(--primary-color); stroke-width: 2; }
.rr-graph-grid { stroke: var(--border-color); stroke-width: 1; stroke-dasharray: 2, 4; }
.rr-graph-text { font-size: 10px; fill: var(--text-muted); }
.rr-graph-point { fill: var(--primary-color); stroke: var(--bg-color); stroke-width: 2; }
.rr-rank-image { transition: transform 0.2s ease; }
.rr-rank-image:hover { transform: scale(1.2); }
.rr-rank-up-icon { filter: drop-shadow(0 0 5px var(--win-color)); }
.rr-rank-down-icon { filter: drop-shadow(0 0 5px var(--lose-color)); }

/* --- Page Suivis --- */
.follow-button {
    margin-left: 0;
    margin-top: 10px;
    font-size: 0.9rem;
    padding: 5px 12px;
    height: auto; 
    line-height: normal;
}
.follow-button.followed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}
.followed-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.followed-player-item {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-solid);
}
.followed-player-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.followed-player-header:hover { background-color: var(--border-color); }
.followed-player-header h4 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.followed-player-header .expand-icon {
    font-size: 1.5rem;
    font-weight: 700;
    transition: transform 0.3s ease;
}
.followed-player-item.expanded .expand-icon { transform: rotate(45deg); }
.followed-player-stats-content {
    display: none;
    padding: 0;
    background-color: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border-color);
}
body[data-theme="light"] .followed-player-stats-content {
    background-color: rgba(0,0,0,0.02);
}
.followed-player-item.expanded .followed-player-stats-content { display: block; }
.followed-player-stats-content .results-wrapper { padding: 20px; }
.followed-player-stats-content .follow-button { display: none !important; }


/* --- Armurerie --- */
.armory-controls {
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#armorySearchInput {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-solid);
    color: var(--text-color);
    border-radius: 8px;
    outline: none;
}
#armorySearchInput:focus { border-color: var(--primary-color); }
.armory-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.armory-cat-button {
    background-color: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.armory-cat-button:hover { 
    color: var(--text-color); 
    border-color: var(--text-color);
    transform: translateY(-2px); 
}
.armory-cat-button.active {
    color: var(--text-color);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.5); 
}
.armory-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.armory-category-title {
    grid-column: 1 / -1;
    margin-top: 30px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    font-size: 1.8rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}
.armory-weapon-title {
    grid-column: 1 / -1;
    margin-top: 15px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}
.armory-no-skins {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-style: italic;
}
.armory-skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.armory-skin-card {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 180px;
}
.armory-skin-card img { max-height: 80px; object-fit: contain; margin-bottom: 15px; }
.armory-skin-card h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);
}
.armory-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.armory-back-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1rem;
}
.armory-back-button:hover { color: var(--text-color); border-color: var(--primary-color); }
.armory-detail-header h2 { margin: 0; font-size: 2rem; color: var(--primary-color); }
.skin-detail-container {
    width: 100%;
    margin: 0 auto;
    border-radius: 12px;
    background-color: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    overflow: hidden;
    padding: 20px;
}
.skin-carousel-image-wrapper {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0) 70%);
    border-radius: 8px;
    overflow: hidden;
}
body[data-theme="light"] .skin-carousel-image-wrapper {
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0) 70%);
}
.skin-carousel-image-wrapper img { max-width: 90%; max-height: 250px; object-fit: contain; }
.skin-carousel-image-wrapper video { max-width: 90%; max-height: 250px; border-radius: 8px; }
.skin-info h4 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    min-height: 2.5rem;
}
.skin-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.skin-levels, .skin-chromas { display: flex; flex-direction: column; gap: 10px; }
.skin-selectors h5 {
    margin: 0 0 5px 0;
    color: var(--text-muted);
    font-weight: 400;
}
.skin-chroma-list, .skin-level-list { display: flex; flex-wrap: wrap; gap: 10px; }
.chroma-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border-color);
}
.chroma-swatch:hover, .level-item:hover { border-color: var(--text-color); }
.chroma-swatch.active, .level-item.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--primary-color);
}
.chroma-swatch img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.level-item {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* =================================================================== */
/* --- 7. ÉLÉMENTS UTILITAIRES & ANIMATIONS --- */
/* =================================================================== */

.loader {
    width: 40px; height: 40px; border: 4px solid var(--border-color);
    border-top-color: var(--primary-color); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-message {
    text-align: center; color: var(--lose-color);
    background-color: rgba(232, 160, 160, 0.1);
    padding: 15px; border-radius: 8px; border: 1px solid var(--lose-color);
}
body[data-theme="light"] .error-message {
    background-color: #ffe8e8;
    border-color: #f7caca;
}

/* --- Animations de Page --- */
.page {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes slideInFromRight {
  from { transform: translateX(50px); }
  to { transform: translateX(0); }
}
@keyframes slideOutToLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-50px); }
}
@keyframes slideInFromLeft {
  from { transform: translateX(-50px); }
  to { transform: translateX(0); }
}
@keyframes slideOutToRight {
  from { transform: translateX(0); }
  to { transform: translateX(50px); }
}
.page-enter-right {
    animation: slideInFromRight 0.4s ease-out, fadeIn 0.4s ease-out;
}
.page-exit-left {
    animation: slideOutToLeft 0.4s ease-in, fadeOut 0.4s ease-in;
}
.page-enter-left {
    animation: slideInFromLeft 0.4s ease-out, fadeIn 0.4s ease-out;
}
.page-exit-right {
    animation: slideOutToRight 0.4s ease-in, fadeOut 0.4s ease-in;
}

/* =================================================================== */
/* --- 8. MEDIA QUERIES (RESPONSIVE) --- */
/* =================================================================== */

@media (max-width: 768px) {
    /* --- Tablette --- */
    body { padding-top: 70px; } 
    .profile-grid { grid-template-columns: 1fr; }
    .analysis-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .nav-brand { display: none; }
    
    .nav-links { 
        width: 100%; 
        display: flex; 
        justify-content: center; 
        overflow-x: auto; /* Permet de scroller les liens sur mobile */
    }
    
    .match-stats {
        gap: 10px;
        flex-wrap: wrap; 
        justify-content: flex-end;
    }
    .match-stat-item { text-align: right; }
    .match-stat-item strong { font-size: 1rem; }
    .background-art { display: none; } 

    .compare-search-box { grid-template-columns: 1fr; }
    .compare-results-grid { grid-template-columns: 1fr; }
    .vs-text { display: none; }
    
    .leaderboard-player-card {
        grid-template-columns: 40px 1fr 80px;
        gap: 10px;
    }
    .leaderboard-player-card .lb-stat:last-of-type { display: none; }

    /* Auth container sur tablette */
    .auth-container {
        bottom: 1.5rem;
        right: 1rem;
        left: auto; /* Annuler left: 1rem de la règle mobile */
    }
    .auth-user-info span {
        display: none; /* Cacher le nom */
    }
}

@media (max-width: 480px) {
    /* --- Mobile --- */
    body {
        padding: 70px 0.5rem 1rem 0.5rem; 
    }
    
    .nav-links .nav-link {
        padding: 8px 10px; 
        font-size: 0.9rem;
    }
    
    .splash-nav-links {
        flex-direction: column; 
        align-items: center;
        width: 100%;
    }
    .splash-nav-links a {
        width: 90%; 
        text-align: center;
    }
    
    /* Auth container sur mobile */
    .auth-container {
        bottom: 0.5rem;
        right: 0.5rem;
        left: auto;
    }
    .discord-login-button span { display: none; } /* Cacher le texte, garder l'icône */
    .discord-login-button { width: 44px; height: 44px; justify-content: center; }

    .card {
        padding: 15px; 
    }
    .stats-grid, .analysis-grid { grid-template-columns: 1fr; }

    .match-item-content { flex-direction: column; align-items: flex-start; }
    .match-stats { flex-direction: column; align-items: flex-end; }
    .match-agent-icon { margin-bottom: 10px; }
    
    .lb-stat { display: none; } 
    .leaderboard-player-card { grid-template-columns: 40px 1fr; }

    /* Ajustement du scoreboard pour mobile */
    .scoreboard-table th, .scoreboard-table td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }
    .scoreboard-table th:nth-child(2),
    .scoreboard-table td:nth-child(2) {
        display: none;
    }
    .scoreboard-table th:nth-child(3),
    .scoreboard-table td:nth-child(3) {
        display: none;
    }
    .scoreboard-player-cell {
        gap: 8px;
    }
    .scoreboard-agent-icon {
        width: 24px;
        height: 24px;
    }
}

/* =================================================================== */
/* --- 9. STYLES DES COMMENTAIRES & PROFIL UTILISATEUR --- */
/* =================================================================== */
.comments-section-wrapper {
    margin-top: 20px; 
}
.comments-section-wrapper h3 {
    margin-bottom: 20px;
}
.comment-login-prompt {
    text-align: center;
    padding: 20px;
    background: var(--card-bg-solid);
    border-radius: 8px;
}
.comment-login-prompt a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
}
.comment-login-prompt a:hover {
    text-decoration: underline;
}

/* --- Widget: Dernier commentaire --- */
.latest-comment-display {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.no-comment-placeholder {
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
}
.comment-widget-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}
.comment-item {
    display: flex;
    gap: 15px;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}
.comment-body {
    width: 100%;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.comment-author {
    font-weight: 700;
    color: var(--text-color);
}
.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.comment-text {
    color: var(--text-color);
    line-height: 1.5;
    white-space: pre-wrap; 
    word-break: break-word;
}

/* Actions sur le commentaire (Modifier/Supprimer) */
.comment-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.comment-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}
.comment-action-btn:hover {
    text-decoration: underline;
}
.comment-action-btn.delete { color: var(--lose-color); }
.comment-action-btn.edit { color: var(--stats-score-light-blue); }
.comment-action-btn:disabled {
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: none;
}
.comment-edit-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.comment-edit-area textarea {
    width: 100%;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-color);
    font-family: inherit;
}
.comment-edit-area button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    align-self: flex-end;
}
.comment-edit-area button:hover {
    background: #E63E4D;
}


/* --- Formulaire de commentaire --- */
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comment-form textarea {
    width: 100%;
    min-height: 80px;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}
.comment-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 10px rgba(255, 70, 85, 0.3);
}
.comment-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#publishCommentBtn {
    height: auto;
    line-height: normal;
    padding: 10px 20px;
    background-color: var(--primary-color);
    border: none;
    color: white;
}
#publishCommentBtn:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}
#publishCommentBtn:hover:not(:disabled) {
    background-color: #E63E4D;
    transform: none; 
}

/* --- Menu déroulant (Tous les commentaires) --- */
.view-all-comments-btn {
    width: 100%;
    background-color: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px;
    margin-top: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.view-all-comments-btn:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}
.comments-dropdown-content {
    margin-top: 20px;
    display: none; 
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.comments-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}
.pagination-btn {
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 35px;
    height: 35px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.pagination-btn:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}
.pagination-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Page Mon Profil --- */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}
.user-profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}
.user-profile-info h2 {
    font-size: 2.5rem;
    margin: 0;
}
.user-profile-info p {
    font-size: 1rem;
    color: var(--text-muted);
}
.user-profile-section {
    margin-bottom: 30px;
}
.user-profile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-profile-list .list-item {
    padding: 15px;
    background: var(--card-bg-solid);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--text-color);
    cursor: pointer;
}
.user-profile-list .list-item:hover {
    border-color: var(--primary-color);
}
.user-profile-list .comment-item {
    background: var(--card-bg-solid);
    padding: 15px;
    border-radius: 8px;
}