/* =========================================
   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;
    /* On laisse de la place pour ton header fixe */
    padding-top: 80px; 
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 35, 68, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 193, 7, 0.05) 0%, transparent 20%);
}

/* =========================================
   2. TON HEADER ORIGINAL (Intouché)
   ========================================= */
.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. POSTERS EN HTML/CSS (MJ & BR)
   ========================================= */
.posters-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
}

.poster-card {
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.poster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8);
    border-color: #555;
}

.mj-poster .poster-header {
    background: linear-gradient(135deg, #FF2344 0%, #CC0000 100%);
}

.br-poster .poster-header {
    background: linear-gradient(135deg, #FFC107 0%, #FFD700 100%);
}

.poster-header {
    padding: 20px;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.poster-emoji {
    font-size: 2.5rem;
}

.poster-header h2 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.mj-poster .poster-header h2 { color: white; }
.br-poster .poster-header h2 { color: black; }

.poster-content {
    padding: 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.top3-section, .date-section {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid var(--codm-yellow);
}

.top3-label, .date-label {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.podium {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: stretch;
}

.podium-slot {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    padding: 12px 8px;
    border-radius: 4px;
    text-align: center;
    border: 1px solid #444;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
}

.podium-slot:hover {
    border-color: var(--codm-yellow);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.2);
}

.podium-slot .rank {
    margin: 0 0 8px 0;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

.podium-slot .player-name {
    margin: 0;
    font-size: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    color: #e0e0e0;
    font-weight: 600;
    min-height: 3em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
    padding: 0 4px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.podium-slot .player-score {
    margin: 8px 0 0 0;
    font-size: 1.4rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--codm-yellow);
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.score-label, .date-label {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.best-score {
    margin: 0;
    font-size: 1.8rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--codm-yellow);
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.tournament-date {
    margin: 0;
    font-size: 1.3rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: #e0e0e0;
}

@media (max-width: 768px) {
    .posters-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px auto;
    }

    .poster-header {
        flex-direction: column;
        gap: 10px;
    }

    .poster-header h2 {
        font-size: 1.1rem;
    }

    .poster-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }

    .podium-slot {
        min-height: 130px;
        padding: 10px 8px;
    }

    .podium-slot .rank {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .podium-slot .player-name {
        font-size: 0.7rem;
        min-height: 2.8em;
        line-height: 1.3;
    }

    .podium-slot .player-score {
        font-size: 1.2rem;
        margin-top: 6px;
    }
}

@media (max-width: 600px) {
    .posters-container {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 15px auto;
        padding: 0 10px;
    }

    .poster-content {
        padding: 15px;
        gap: 12px;
    }

    .podium {
        gap: 6px;
    }

    .podium-slot {
        min-height: 120px;
        padding: 8px 6px;
    }

    .podium-slot .rank {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }

    .podium-slot .player-name {
        font-size: 0.65rem;
        min-height: 2.6em;
        padding: 0 3px;
        line-height: 1.25;
    }

    .podium-slot .player-score {
        font-size: 1rem;
        margin-top: 4px;
    }

    .poster-header {
        padding: 12px;
        gap: 8px;
    }

    .poster-emoji {
        font-size: 1.8rem;
    }

    .poster-header h2 {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .top3-section, .date-section {
        padding: 10px;
        border-left: 2px solid var(--codm-yellow);
    }

    .top3-label, .date-label {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .tournament-date {
        font-size: 1rem;
    }
}

/* =========================================
   4. BOUTONS RÈGLES (Nouveau Style)
   ========================================= */
.rules-actions {
    display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;
    margin: 20px auto; max-width: 800px; padding: 0 10px;
}
.rules-btn {
    flex: 1; min-width: 280px; padding: 15px;
    font-family: 'Orbitron', sans-serif; font-weight: bold; text-transform: uppercase;
    cursor: pointer; color: white; text-align: center;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: 0.3s; border: 1px solid transparent;
}
.btn-red { background: linear-gradient(45deg, #FF2344, #800000); border-color: #FF2344; }
.btn-yellow { background: linear-gradient(45deg, #FFC107, #B38600); color: black; border-color: #FFC107; }
.rules-btn:hover { transform: scale(1.02); filter: brightness(1.2); }

/* =========================================
   5. FORMULAIRE FUTURISTE
   ========================================= */
.form-container {
    max-width: 600px; margin: 0 auto 40px auto; padding: 30px;
    background: linear-gradient(145deg, #1a1a1a, #111);
    border: 1px solid #333; border-left: 4px solid var(--codm-yellow);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.form-container h2 { margin-top: 0; color: white; font-family: 'Orbitron'; border-bottom: 1px dashed #444; padding-bottom: 10px; }
.form-container label { color: #aaa; font-size: 0.9rem; margin-top: 15px; display: block; }
.form-container input, .form-container select, .form-container textarea {
    width: 100%; background: #080808; border: 1px solid #333; color: white;
    padding: 12px; margin-top: 5px; font-family: 'Rajdhani', sans-serif; font-size: 1rem;
    box-sizing: border-box; transition: 0.3s;
}
.form-container input:focus, .form-container select:focus, .form-container textarea:focus {
    outline: none; border-color: var(--codm-yellow); box-shadow: 0 0 10px rgba(255,193,7,0.2);
}
.cta-submit {
    width: 100%; margin-top: 20px; padding: 15px; background: var(--codm-yellow); color: black;
    font-family: 'Orbitron'; font-weight: bold; border: none; cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 95% 100%, 0 100%); transition: 0.2s;
}
.cta-submit:hover { background: white; }

/* =========================================
   6. NOUVEAU : POP-UP SUCCÈS (Remplacement Alert)
   ========================================= */
.custom-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.85);
    backdrop-filter: blur(5px);
    align-items: center; justify-content: center;
}
.success-box {
    background: #1a1a1a; border: 2px solid #4CAF50; 
    width: 90%; max-width: 400px; padding: 25px; text-align: center;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.3);
    position: relative; animation: popIn 0.3s ease-out;
}
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.success-icon { font-size: 3rem; margin-bottom: 10px; display: block; }
.success-title { font-family: 'Orbitron'; color: #4CAF50; font-size: 1.5rem; margin: 10px 0; }
.success-msg { font-size: 1rem; color: #ddd; line-height: 1.5; margin-bottom: 20px; }
.btn-success-close {
    background: #4CAF50; color: black; font-weight: bold; padding: 10px 20px;
    border: none; cursor: pointer; font-family: 'Orbitron'; text-transform: uppercase;
    width: 100%; transition: 0.3s;
}
.btn-success-close:hover { background: white; }

/* =========================================
   7. LISTE DES INSCRITS
   ========================================= */
#inscrits { max-width: 900px; margin: 0 auto 50px auto; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 0 10px; }
.mode-card { background: rgba(20,20,20,0.8); border: 1px solid #333; padding: 0; }
.mode-header { background: #1a1a1a; padding: 15px; border-bottom: 1px solid var(--codm-yellow); display: flex; justify-content: space-between; align-items: center; }
.mode-header h4 { margin: 0; font-family: 'Orbitron'; color: white; }
.mode-header .count { background: var(--codm-yellow); color: black; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; }
.inscrits-list { list-style: none; padding: 10px; margin: 0; max-height: 300px; overflow-y: auto; }
.inscrits-list li { padding: 10px; margin-bottom: 5px; background: rgba(255,255,255,0.03); border-left: 2px solid #444; color: #ccc; transition: 0.2s; display: flex; align-items: center; }
.inscrits-list li:hover { background: rgba(255,255,255,0.08); border-left-color: var(--codm-yellow); padding-left: 15px; color: white; }

/* =========================================
   8. MODALES RÈGLES (Images)
   ========================================= */
.rules-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95); padding-top: 20px; overflow: auto;
}
.modal-content-rules { position: relative; margin: 5% auto; width: 90%; max-width: 800px; border: 1px solid var(--codm-yellow); }
.modal-content-rules img { width: 100%; display: block; }
.rules-close { position: absolute; top: -40px; right: 0; color: white; font-size: 40px; font-weight: bold; cursor: pointer; }

/* Mobile responsive */
@media (max-width: 768px) {
    #inscrits { grid-template-columns: 1fr; }
    .rules-actions { flex-direction: column; }
    .rules-btn { width: 100%; }
}