@import url('style.css');

/* =========================================
   1. VARIABLES & GLOBAL
   ========================================= */
:root {
    --codm-yellow: #FFC107;
    --accent-red: #FF2344;
    --bg-dark: #0a0a0a;
    --bg-panel: #141414;
    --text-main: #e0e0e0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    margin: 0;
    padding-top: 80px; 
    background-image: 
        linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)),
        radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000 100%);
}

/* =========================================
   2. HEADER (Inchangé)
   ========================================= */
.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); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; box-sizing: border-box; }
.logo-container a, .logo-container h1 { 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; }
.hamburger-menu { background: transparent; border: 0; color: var(--codm-yellow); font-size: 1.8rem; cursor: pointer; position: absolute; right: 40px; top: 8px; line-height: 1; padding: 8px; border-radius: 6px; }
.hamburger-menu:focus { outline: 2px solid rgba(255,193,7,0.25); }
.mobile-hub { position: absolute; right: 12px; top: 52px; background: #1b1b1b; border: 1px solid #333; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.6); width: 86vw; max-width: 320px; transform-origin: top right; transform: scale(0.95); opacity: 0; visibility: hidden; transition: opacity 180ms ease, transform 180ms ease, visibility 180ms; z-index: 1200; }
.mobile-hub.open { transform: scale(1); opacity: 1; visibility: visible; }
.mobile-hub ul { list-style: none; margin: 0; padding: 8px 0; }
.mobile-hub li { padding: 8px 14px; }
.mobile-hub a { color: var(--text-main); text-decoration: none; display: block; font-weight: 600; }
.mobile-hub a:hover { color: var(--codm-yellow); }
.mobile-hub-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.25); opacity: 0; visibility: hidden; transition: opacity 180ms ease, visibility 180ms; z-index: 1100; }
.mobile-hub-backdrop.visible { opacity: 1; visibility: visible; }
@media (min-width: 900px) { .hamburger-menu { font-size: 1.4rem; top: 12px; right: 22px; } .mobile-hub { top: 52px; width: 260px; } }

/* =========================================
   3. AUTH, LOCK & LOGOUT
   ========================================= */
.auth-lock-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* On change justify-content: center par flex-start pour remonter le contenu */
    justify-content: flex-start; 
    /* On réduit la hauteur minimale */
    min-height: 60vh; 
    text-align: center;
    color: var(--accent-red);
    /* On ajoute un peu d'espace en haut pour que ce ne soit pas collé au header */
    padding-top: 60px; 
}

.lock-icon { 
    font-size: 4rem; 
    margin-bottom: 20px; 
    text-shadow: 0 0 20px var(--accent-red); 
}
.lock-title { font-family: 'Orbitron'; font-size: 2rem; margin-bottom: 10px; text-transform: uppercase; }
.lock-msg { color: #888; max-width: 400px; margin-bottom: 30px; }
.btn-login-redirect {
    background: transparent; border: 1px solid var(--codm-yellow); color: var(--codm-yellow);
    padding: 10px 20px; font-family: 'Orbitron'; cursor: pointer; transition: 0.3s;
    text-decoration: none; text-transform: uppercase;
}
.btn-login-redirect:hover { background: var(--codm-yellow); color: black; }

/* Bouton Déconnexion */
.btn-logout-corner {
    position: fixed; bottom: 20px; right: 20px; 
    background: #333; color: white; border: 1px solid #555;
    padding: 10px 15px; border-radius: 50px; font-family: 'Orbitron'; font-size: 0.8rem;
    cursor: pointer; z-index: 1100; transition: 0.3s;
    display: none; /* Caché si pas connecté */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.btn-logout-corner:hover { background: var(--accent-red); border-color: var(--accent-red); }

/* =========================================
   4. GRID MEMBRES
   ========================================= */
.members-container { display: none; padding: 20px; max-width: 1200px; margin: 0 auto; }
.section-title {
    font-family: 'Orbitron'; color: white; border-left: 4px solid var(--codm-yellow);
    padding-left: 15px; margin-bottom: 30px; font-size: 1.8rem;
    display: flex; justify-content: space-between; align-items: center;
}
.member-count { font-size: 0.8rem; color: #666; font-family: 'Rajdhani'; letter-spacing: 1px; }

.members-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px;
}

.member-card {
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid #333; position: relative; overflow: hidden; transition: 0.3s;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}
.member-card:hover { border-color: var(--codm-yellow); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.member-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--codm-yellow), transparent);
}

.card-header { padding: 20px; display: flex; align-items: center; gap: 15px; background: rgba(255,255,255,0.02); }
.avatar {
    width: 60px; height: 60px; background: #222; border: 1px solid #444;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Orbitron'; font-size: 1.5rem; color: var(--codm-yellow);
    border-radius: 4px; box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.identity h3 { margin: 0; font-family: 'Orbitron'; font-size: 1.2rem; color: white; letter-spacing: 1px; }
.identity .role { font-size: 0.8rem; color: #888; text-transform: uppercase; }

/* BADGES */
.badges-container { padding: 0 20px; display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 15px; }
.badge {
    font-size: 0.65rem; text-transform: uppercase; font-weight: bold;
    padding: 2px 6px; border-radius: 2px; border: 1px solid; display: inline-block;
}
/* Couleurs */
.badge-gold { border-color: #FFD700; color: #FFD700; background: rgba(255, 215, 0, 0.1); }
.badge-silver { border-color: #C0C0C0; color: #C0C0C0; background: rgba(192, 192, 192, 0.1); }
.badge-red { border-color: var(--accent-red); color: var(--accent-red); background: rgba(255, 35, 68, 0.1); }
.badge-blue { border-color: #00bcd4; color: #00bcd4; background: rgba(0, 188, 212, 0.1); }
.badge-purple { border-color: #9c27b0; color: #9c27b0; background: rgba(156, 39, 176, 0.1); }
.badge-green { border-color: #4CAF50; color: #4CAF50; background: rgba(76, 175, 80, 0.1); }
.badge-pink { border-color: #E91E63; color: #E91E63; background: rgba(233, 30, 99, 0.1); }

/* STATS */
.card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #222; }
.stat-box { padding: 15px; text-align: center; border-right: 1px solid #222; }
.stat-box:last-child { border-right: none; }
.stat-val { display: block; font-family: 'Orbitron'; font-size: 1.2rem; color: white; }
.stat-label { font-size: 0.7rem; color: #666; text-transform: uppercase; }
.status-indicator {
    position: absolute; top: 10px; right: 10px; width: 8px; height: 8px;
    background: #4CAF50; border-radius: 50%; box-shadow: 0 0 5px #4CAF50;
}

/* =========================================
   5. ADMIN PANEL (Toujours présent mais caché)
   ========================================= */
.admin-trigger {
    display: none; /* Caché par défaut */
    margin: 0 auto 30px auto; text-align: center;
}
.btn-admin-main {
    background: var(--accent-red); color: white; border: 2px solid white;
    padding: 12px 30px; font-family: 'Orbitron'; font-weight: bold; font-size: 1rem;
    cursor: pointer; box-shadow: 0 0 15px var(--accent-red);
}
.admin-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); overflow-y: auto; padding-top: 50px;
}
.admin-panel-content {
    background: #111; border: 1px solid var(--accent-red); max-width: 600px; margin: 0 auto;
    padding: 20px; border-radius: 8px;
}
.admin-player-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px; border-bottom: 1px solid #333;
}
.admin-player-row:hover { background: #1a1a1a; }
.btn-add-badge {
    background: #333; color: white; border: 1px solid #555; padding: 5px 10px; cursor: pointer;
}
.badge-form { display: none; margin-top: 10px; padding: 10px; background: #222; border: 1px dashed #555; }
.badge-form input, .badge-form select {
    padding: 8px; background: black; border: 1px solid #444; color: white; margin-right: 5px;
}
.login-modal-overlay {
    display: none; /* Caché par défaut */
    position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    align-items: center; justify-content: center;
}

.login-box {
    background: #141414;
    border: 2px solid var(--codm-yellow);
    width: 90%; max-width: 380px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 193, 7, 0.2);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.login-title {
    font-family: 'Orbitron'; color: white; font-size: 1.5rem; margin-bottom: 20px;
    border-bottom: 1px dashed #444; padding-bottom: 10px;
}

.login-input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    background: #080808; border: 1px solid #333; color: white;
    font-family: 'Rajdhani'; font-size: 1.1rem;
    box-sizing: border-box;
}
.login-input:focus { outline: none; border-color: var(--codm-yellow); }

.btn-login-submit {
    width: 100%; padding: 12px;
    background: var(--codm-yellow); color: black; font-weight: bold;
    border: none; font-family: 'Orbitron'; cursor: pointer;
    transition: 0.2s;
}
.btn-login-submit:hover { background: white; }

.btn-close-modal {
    position: absolute; top: 10px; right: 15px;
    background: transparent; border: none; color: #666; font-size: 1.5rem; cursor: pointer;
}
.btn-close-modal:hover { color: white; }

.login-error {
    color: var(--accent-red); font-size: 0.9rem; margin-bottom: 15px; display: none;
}

/* Boutons de l'écran de verrouillage */
.lock-actions { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }

.btn-lock-login {
    background: var(--codm-yellow); color: black; padding: 10px 25px;
    font-family: 'Orbitron'; font-weight: bold; cursor: pointer; border: none;
    text-decoration: none; display: inline-block;
}
.btn-lock-join {
    background: transparent; border: 1px solid #555; color: #aaa; padding: 10px 25px;
    font-family: 'Orbitron'; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-lock-join:hover { border-color: white; color: white; }

/* Fallback notice styling */
.module-error {
    position: fixed; left: 0; right: 0; top: 80px; margin: 0 auto; max-width: 720px; z-index: 3000;
    display: flex; justify-content: center; pointer-events: auto;
}
.module-error-inner {
    background: #111; border: 1px solid #333; padding: 18px; color: #eee; text-align: center; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.module-error pre { background:#0d0d0d; color:var(--codm-yellow); padding:8px; border-radius:4px; overflow:auto; }
.module-error a { color: var(--codm-yellow); text-decoration: underline; }
.module-error button { margin-top:8px; padding:6px 10px; background:#333; color:#fff; border:1px solid #444; cursor:pointer; }