/* --- RESET & FONTS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --red: #ff0000;
    --dark-red: #5c0000;
    --black: #050505;
    --gray: #1a1a1a;
    --text: #e0e0e0;
    --font-main: 'Chakra Petch', sans-serif;
}

body {
    background-color: var(--black);
    color: var(--text);
    font-family: var(--font-main);
    
    /* --- CORRECTION DU TREMBLEMENT --- */
    overflow-x: hidden;      /* Empêche le débordement horizontal */
    overflow-y: scroll;      /* Force la barre de scroll verticale (évite le saut gauche/droite) */
    min-height: 100vh;       /* Utilise min-height au lieu de height pour laisser la page grandir */
    /* -------------------------------- */

    display: flex;
    flex-direction: column;
}

/* --- NAVIGATION --- */
.navbar {
    height: 80px;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--dark-red);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0; width: 100%;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

/* LOGO */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-box {
    width: 50px; height: 50px;
    border: 2px solid var(--red);
    box-shadow: 0 0 10px var(--red);
    overflow: hidden;
}

.logo-img { width: 100%; height: 100%; object-fit: cover; }

.logo-text {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 2px;
}

/* LIENS */
.nav-links { display: flex; gap: 3rem; }

.nav-item {
    color: #888;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 1px;
    transition: 0.3s;
    font-size: 0.9rem;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    color: var(--red);
    text-shadow: 0 0 8px var(--red);
}

.nav-actions { display: flex; align-items: center; gap: 1rem; }

.btn-play {
    background: var(--red);
    color: black;
    padding: 0.5rem 1.5rem;
    font-weight: 700;
    text-decoration: none;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%);
    transition: 0.3s;
}

.btn-play:hover {
    background: #fff;
    box-shadow: 0 0 15px #fff;
}

.mobile-toggle {
    background: none; border: none;
    color: white; font-size: 1.5rem;
    cursor: pointer; display: none;
}

/* --- HERO SECTION --- */
.hero-wrapper {
    flex: 1; /* Prend toute la place restante */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(circle at center, #150000 0%, #000000 80%);
    margin-top: 80px; /* Compensation navbar */
}

#particles {
    position: absolute; inset: 0;
    z-index: 0; pointer-events: none;
}

.hero-content {
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

/* TITRE GLITCH */
.hero-title {
    font-size: 5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 5px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    position: relative;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--red);
    letter-spacing: 8px;
    margin-bottom: 3rem;
    font-weight: 600;
}

/* BOUTONS */
.cta-group {
    display: flex; gap: 1.5rem; justify-content: center;
}

.btn-primary {
    background: transparent;
    border: 2px solid var(--red);
    color: var(--red);
    padding: 1rem 3rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
    box-shadow: 0 0 10px rgba(255,0,0,0.2);
}

.btn-primary:hover {
    background: var(--red);
    color: black;
    box-shadow: 0 0 30px var(--red);
}

.btn-outline {
    color: #888;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.btn-outline:hover { color: white; border-bottom: 1px solid white; }

/* --- INFO STRIP (Status Bar) --- */
.server-status-strip {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 0, 0, 0.05);
    border-top: 1px solid var(--dark-red);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    z-index: 2;
}

.status-item {
    color: #fff;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

.status-item i { color: var(--red); }
.status-separator { color: var(--dark-red); }

/* --- FOOTER --- */
.main-footer {
    background: #000000;
    border-top: 1px solid #1a1a1a;
    padding: 1.5rem;
    z-index: 10;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.socials { display: flex; gap: 1.5rem; }
.socials a { color: #555; font-size: 1.2rem; transition: 0.3s; }
.socials a:hover { color: var(--red); transform: translateY(-3px); }

.copyright { color: #444; font-size: 0.8rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links { display: none; } /* Burger menu needed via JS */
    .mobile-toggle { display: block; }
    .hero-title { font-size: 2.5rem; letter-spacing: 2px; }
    .server-status-strip { position: relative; flex-direction: column; height: auto; padding: 1rem; gap: 1rem; background: transparent; }
    .status-separator { display: none; }
    .cta-group { flex-direction: column; }
    .footer-content { flex-direction: column; gap: 1rem; }
}

/* Animation Glitch Simple */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}
.hero-title:hover { animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite; cursor: default; }
/* --- AJOUTS POUR L'AUTHENTIFICATION ET CLASSEMENT --- */

/* Page de login */
.login-page {
    background: radial-gradient(circle at center, #150000 0%, #000000 80%);
    min-height: 100vh;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem;
    margin-top: 80px;
}

.login-box {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--dark-red);
    padding: 3rem;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.1);
}

.login-title {
    color: var(--red);
    font-size: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.login-info {
    background: rgba(255, 0, 0, 0.05);
    border-left: 3px solid var(--red);
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.login-info p {
    margin-bottom: 1rem;
    color: #aaa;
}

.rank-examples {
    margin-top: 1.5rem;
}

.rank-examples h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.rank-examples ul {
    list-style: none;
    padding-left: 0;
}

.rank-examples li {
    margin-bottom: 0.8rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rank-badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 80px;
}

.rank-badge.owner {
    background: linear-gradient(45deg, #ff6b00, #ff0000);
    color: black;
}

.rank-badge.admin {
    background: linear-gradient(45deg, #ff0000, #ff4d4d);
    color: black;
}

.rank-badge.mod {
    background: linear-gradient(45deg, #4d4dff, #6666ff);
    color: white;
}

.rank-badge.player {
    background: linear-gradient(45deg, #333, #666);
    color: white;
}

.discord-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #5865F2;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 700;
    border-radius: 5px;
    transition: 0.3s;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.discord-login-btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(88, 101, 242, 0.3);
}

.login-footer {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.login-footer p {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Profil utilisateur */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid var(--dark-red);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--red);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-rank {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-rank.rank-owner {
    background: linear-gradient(45deg, #ff6b00, #ff0000);
    color: black;
}

.user-rank.rank-admin {
    background: linear-gradient(45deg, #ff0000, #ff4d4d);
    color: black;
}

.user-rank.rank-mod {
    background: linear-gradient(45deg, #4d4dff, #6666ff);
    color: white;
}

.user-rank.rank-player {
    background: linear-gradient(45deg, #333, #666);
    color: white;
}

.logout-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    padding: 0.5rem;
}

.logout-btn:hover {
    color: #ff0000;
    transform: scale(1.1);
}

/* Page classement */
.ranking-container {
    max-width: 1200px;
    margin: 100px auto 0;
    padding: 2rem;
}

.ranking-header {
    text-align: center;
    margin-bottom: 3rem;
}

.ranking-header h1 {
    color: var(--red);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.subtitle {
    color: #888;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.ranking-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 0, 0, 0.05);
    padding: 1rem 2rem;
    border-radius: 5px;
    border: 1px solid var(--dark-red);
}

.refresh-btn {
    background: var(--red);
    color: black;
    border: none;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--red);
}

.last-update {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sections du classement */
.ranking-section {
    margin-bottom: 3rem;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--dark-red);
    border-radius: 10px;
    padding: 2rem;
}

.ranking-section h2 {
    color: #fff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-info {
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Tables de classement */
.ranking-table-container {
    overflow-x: auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.ranking-table th {
    background: rgba(255, 0, 0, 0.2);
    color: var(--red);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--red);
}

.ranking-table td {
    padding: 1rem;
    border-bottom: 1px solid #333;
    color: #ddd;
}

.ranking-table tr:hover {
    background: rgba(255, 0, 0, 0.05);
}

.rank-cell {
    font-weight: 700;
    font-size: 1.2rem;
    text-align: center;
    width: 80px;
}

.nation-cell {
    font-weight: 600;
}

.players-cell {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.status-cell {
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.status-high {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.status-indicator.status-medium {
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

.status-indicator.status-low {
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444;
}

/* Contrôles admin */
.admin-controls {
    background: rgba(255, 0, 0, 0.1);
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.nation-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.nation-selector select,
.nation-selector input {
    padding: 0.8rem;
    background: #111;
    border: 1px solid #333;
    color: white;
    border-radius: 5px;
    min-width: 200px;
}

.nation-selector select:focus,
.nation-selector input:focus {
    outline: none;
    border-color: var(--red);
}

.btn-set-rank {
    background: var(--red);
    color: black;
    border: none;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-set-rank:hover {
    background: #fff;
    box-shadow: 0 0 15px var(--red);
}

.btn-reset {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reset:hover {
    background: #444;
    border-color: var(--red);
}

/* Actions dans le tableau */
.actions-cell {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-move-up,
.btn-move-down,
.btn-remove {
    background: none;
    border: 1px solid #333;
    color: #aaa;
    width: 35px;
    height: 35px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-move-up:hover {
    border-color: #00ff00;
    color: #00ff00;
}

.btn-move-down:hover {
    border-color: #ffff00;
    color: #ffff00;
}

.btn-remove:hover {
    border-color: #ff0000;
    color: #ff0000;
}

.btn-move-up:disabled,
.btn-move-down:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Message non-admin */
.admin-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid var(--dark-red);
    padding: 2rem;
    text-align: center;
    border-radius: 5px;
    margin-top: 2rem;
}

.admin-message p {
    margin-bottom: 1rem;
    color: #aaa;
}

.admin-message i {
    color: var(--red);
    margin-right: 0.5rem;
}

/* Chargement */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--dark-red);
    border-top: 3px solid var(--red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: #ff4444;
    text-align: center;
    padding: 2rem;
}

.error-message i {
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .login-box {
        padding: 2rem 1rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .ranking-container {
        padding: 1rem;
        margin-top: 80px;
    }
    
    .ranking-header h1 {
        font-size: 1.8rem;
    }
    
    .ranking-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nation-selector {
        flex-direction: column;
    }
    
    .nation-selector select,
    .nation-selector input {
        min-width: 100%;
    }
    
    .user-profile {
        padding: 0.5rem;
    }
    
    .username {
        display: none;
    }
    
    .user-info {
        flex-direction: row;
        gap: 0.5rem;
    }
}
/* --- RESET & FONTS --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --red: #ff0000;
    --dark-red: #5c0000;
    --black: #050505;
    --gray: #1a1a1a;
    --text: #e0e0e0;
    --font-main: 'Chakra Petch', sans-serif;
    
    /* Couleurs Podium */
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
}

body {
    background-color: var(--black);
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- NAVIGATION --- */
.navbar {
    height: 80px;
    background: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--dark-red);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0; width: 100%;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.logo-wrapper { display: flex; align-items: center; gap: 1rem; text-decoration: none; }
.logo-box { width: 50px; height: 50px; border: 2px solid var(--red); box-shadow: 0 0 10px var(--red); overflow: hidden; }
.logo-img { width: 100%; height: 100%; object-fit: cover; }
.logo-text { font-weight: 700; font-size: 1.5rem; color: #fff; letter-spacing: 2px; }

.nav-links { display: flex; gap: 3rem; }
.nav-item { color: #888; text-decoration: none; font-weight: 600; letter-spacing: 1px; transition: 0.3s; font-size: 0.9rem; }
.nav-item:hover, .nav-item.active { color: var(--red); text-shadow: 0 0 8px var(--red); }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.btn-play {
    background: var(--red); color: black; padding: 0.5rem 1.5rem; font-weight: 700; text-decoration: none;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%); transition: 0.3s;
}
.btn-play:hover { background: #fff; box-shadow: 0 0 15px #fff; }
.mobile-toggle { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; display: none; }

/* --- HERO & GENERAL --- */
.hero-wrapper {
    flex: 1; display: flex; flex-direction: column; align-items: center; position: relative;
    background: radial-gradient(circle at center, #150000 0%, #000000 80%);
    margin-top: 80px; padding: 2rem;
}
#particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-content { z-index: 2; text-align: center; width: 100%; max-width: 1200px; }
.hero-title { font-size: 5rem; font-weight: 700; color: white; letter-spacing: 5px; margin-bottom: 1rem; text-transform: uppercase; }
.hero-subtitle { font-size: 1.2rem; color: var(--red); letter-spacing: 8px; margin-bottom: 3rem; font-weight: 600; }

/* --- FOOTER --- */
.main-footer { background: #000000; border-top: 1px solid #1a1a1a; padding: 1.5rem; z-index: 10; }
.footer-content { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.copyright { color: #444; font-size: 0.8rem; }

/* --- CLASSEMENT STYLE PODIUM --- */
.ranking-container { width: 100%; margin: 2rem 0; }

/* PODIUM TOP 3 */
.classement-top3 {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
    align-items: flex-end;
}

.classement-top3-card {
    background: linear-gradient(135deg, rgba(20,20,20,0.9) 0%, rgba(5,5,5,0.9) 100%);
    border: 2px solid #333;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: 0.4s;
    clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}
.classement-top3-card:hover { transform: translateY(-10px); border-color: var(--red); box-shadow: 0 10px 30px rgba(255,0,0,0.1); }

/* Couleurs spécifiques pour le podium */
.rank-1 .classement-top3-card { border-color: var(--gold); box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); transform: scale(1.05); z-index: 2; }
.rank-2 .classement-top3-card { border-color: var(--silver); box-shadow: 0 0 15px rgba(192, 192, 192, 0.1); }
.rank-3 .classement-top3-card { border-color: var(--bronze); box-shadow: 0 0 15px rgba(205, 127, 50, 0.1); }

.rank-title { font-size: 3rem; font-weight: 900; margin-bottom: 0.5rem; line-height: 1; }
.rank-1 .rank-title { color: var(--gold); text-shadow: 0 0 10px var(--gold); }
.rank-2 .rank-title { color: var(--silver); text-shadow: 0 0 10px var(--silver); }
.rank-3 .rank-title { color: var(--bronze); text-shadow: 0 0 10px var(--bronze); }

.nation-name { font-size: 1.5rem; font-weight: 700; color: white; margin: 10px 0; text-transform: uppercase; letter-spacing: 2px; }
.total-score { font-size: 2rem; font-weight: 900; color: var(--red); margin: 0.5rem 0; }
.pop-info { color: #888; font-size: 0.9rem; margin-bottom: 15px; }

/* Indicateurs de catégories (Top 3) */
.score-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.score-badge { background: rgba(255,0,0,0.1); padding: 5px; font-size: 0.8rem; border: 1px solid #333; color: #ccc; }
.score-badge i { color: var(--red); margin-right: 5px; }

/* LISTE RESTE DU CLASSEMENT */
.classement-liste { display: flex; flex-direction: column; gap: 1rem; width: 100%; max-width: 900px; margin: 0 auto; }
.classement-row {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(10,10,10,0.8); border-left: 5px solid #333;
    padding: 1.5rem; transition: 0.3s;
}
.classement-row:hover { background: rgba(20,20,20,1); border-left-color: var(--red); transform: translateX(5px); }

.row-rank { font-size: 1.5rem; font-weight: 900; color: #666; width: 50px; }
.row-info { flex: 1; display: flex; flex-direction: column; }
.row-name { font-size: 1.2rem; font-weight: 700; color: white; }
.row-stats { display: flex; gap: 15px; font-size: 0.8rem; color: #888; margin-top: 5px; }
.row-total { font-size: 1.8rem; font-weight: 900; color: var(--red); text-align: right; margin-left: 20px; }

/* ADMIN CONTROLS */
.admin-actions-btn { margin-top: 10px; display: flex; gap: 10px; justify-content: center; }
.btn-edit { background: transparent; border: 1px solid #fff; color: white; padding: 5px 10px; cursor: pointer; font-size: 0.8rem; }
.btn-edit:hover { background: white; color: black; }
.btn-blacklist { background: transparent; border: 1px solid #333; color: #555; padding: 5px 10px; cursor: pointer; font-size: 0.8rem; }
.btn-blacklist:hover { border-color: var(--red); color: var(--red); }
.is-blacklisted { opacity: 0.5; filter: grayscale(1); border: 1px dashed red; }

/* MODAL ADMIN */
#admin-modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 2000; align-items: center; justify-content: center;
}
.modal-box {
    background: #111; border: 1px solid var(--red); padding: 2rem; width: 90%; max-width: 500px;
    box-shadow: 0 0 30px rgba(255,0,0,0.2);
}
.modal-form label { display: block; margin-top: 10px; color: #888; }
.modal-form input { width: 100%; background: #000; border: 1px solid #333; color: white; padding: 10px; margin-top: 5px; }
.modal-buttons { display: flex; justify-content: space-between; margin-top: 20px; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .classement-top3 { grid-template-columns: 1fr; gap: 2rem; }
    .rank-1 .classement-top3-card { transform: none; order: -1; } /* Le 1er en haut */
}
/* --- MODALE CARTE D'IDENTITÉ --- */
#profile-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.id-card-wrapper {
    perspective: 1000px;
}

.id-card {
    width: 450px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-top: 4px solid var(--red);
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px rgba(255,0,0,0.1);
    clip-path: polygon(0 0, 100% 0, 100% 90%, 95% 100%, 0 100%);
    padding: 20px;
}

.id-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

.id-card-title {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: #666;
    font-weight: bold;
}

.close-id-btn {
    background: none; border: none; color: #444; font-size: 1.5rem; cursor: pointer;
}

.id-card-body {
    display: flex;
    gap: 20px;
}

.id-photo-frame {
    width: 120px;
    height: 120px;
    border: 2px solid #222;
    padding: 5px;
    background: #111;
}

.id-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.5) contrast(1.2);
}

.id-serial {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #444;
    margin-top: 10px;
    text-align: center;
}

.id-info-section {
    flex: 1;
}

.info-group {
    margin-bottom: 12px;
}

.info-group label {
    display: block;
    font-size: 0.65rem;
    color: #ff0000;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #eee;
    text-transform: uppercase;
}

.grade-owner { color: #ff0000; text-shadow: 0 0 10px rgba(255,0,0,0.3); }
.grade-admin { color: #ffaa00; }

.id-barcode {
    margin-top: 15px;
    font-family: 'Courier New', monospace;
    color: #333;
    letter-spacing: -2px;
    font-size: 1.2rem;
}

.id-card-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #222;
    padding-top: 15px;
}

.footer-tag {
    font-size: 0.6rem;
    color: #333;
}

.id-logout-btn {
    text-decoration: none;
    font-size: 0.75rem;
    color: #666;
    border: 1px solid #222;
    padding: 5px 10px;
    transition: 0.3s;
}

.id-logout-btn:hover {
    color: white;
    background: #ff0000;
    border-color: #ff0000;
}
.admin-maintenance-zone {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 0, 0, 0.05);
    border: 1px dashed rgba(255, 0, 0, 0.3);
}

.btn-maint {
    width: 100%;
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    padding: 8px;
    font-family: 'Chakra Petch';
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 5px;
}

.btn-maint:hover {
    background: var(--red);
    color: white;
    box-shadow: 0 0 15px var(--red);
}

.btn-maint.active {
    background: var(--red);
    color: white;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}


/*test*/
body {
    background-color: var(--black);
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    overflow-y: scroll; /* On garde ça pour éviter le saut de page */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Ajoute cette ligne pour lisser le rendu */
    -webkit-font-smoothing: antialiased;
}

/* 2. Ajoute une marge de sécurité en bas de ton main container */
/* Cela évite que l'animation de la dernière ligne de cartes ne fasse bouger le scroll */
main {
    flex: 1;
    padding-bottom: 50px; /* Espace de sécurité en bas */
}

/* 3. OPTIONNEL : Si tu veux une barre de scroll plus "propre" qui ne saute pas */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505; 
}

::-webkit-scrollbar-thumb {
    background: #333; /* Gris foncé statique */
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0000; /* Devient rouge au survol */
}