:root {
    --bg: #050505;
    --surface: #0a0a0b;
    --surface-light: #151516;
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.2);
    --red: #ef4444;
    --text: #fafafa;
    --muted: #444;
    --radius: 16px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { 
    margin: 0; background: var(--bg); color: var(--text); 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    min-height: 100vh; overflow-x: hidden;
}
.scrollOK{
    overflow: auto !important;
    position: relative !important;
}
/* MARQUE LA STEV' ORIGINAL */
.brand-badge { 
    position: absolute; top: 20px; left: 20px; 
    font-weight: 900; letter-spacing: 2px; text-transform: uppercase; font-size: 0.85rem; 
    display: flex; align-items: center; gap: 10px; 
    background: var(--surface-light); padding: 10px 20px; border-radius: 50px; 
    border: var(--glass-border); z-index: 100; color: var(--text);
}
.brand-badge img { width: 18px; height: 18px; animation: spin 4s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* BOUTONS GENERIQUES */
.btn { 
    padding: 12px 24px; border: none; border-radius: 50px; 
    font-weight: 800; cursor: pointer; transition: 0.2s; 
    text-transform: uppercase; letter-spacing: 1px;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: var(--green); color: #000; }
.btn-danger { background: var(--red); color: #fff; }

/* LE BUZZER (JOUEUR) */
.buzzer-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; }
#btn-buzz {
    width: 70vw; height: 70vw; max-width: 300px; max-height: 300px; border-radius: 50%;
    transition: all 0.1s ease; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 900; letter-spacing: 4px; border: none;
}
#btn-buzz.btn-danger {
    background: #1a0505; color: var(--red);
    box-shadow: 0 0 0 10px var(--bg), 0 0 0 12px var(--surface-light), inset 0 0 30px rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
#btn-buzz.btn-primary {
    background: #051a10; color: var(--green);
    box-shadow: 0 0 50px var(--green-glow); border: 1px solid var(--green);
}
#btn-buzz:disabled:not(.btn-primary) { background: #080808; color: #222; border: 1px solid #111; }

/* DASHBOARD TV LAYOUT */
.dashboard-layout { display: flex; height: 100vh; }
.dash-buzz { flex: 1.6; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 40px; }
.dash-scores { flex: 1; background: var(--surface); border-left: var(--glass-border); padding: 60px 40px; display: flex; flex-direction: column; }
.dash-label { font-size: 1.2rem; letter-spacing: 8px; font-weight: 700; margin-bottom: 30px; text-transform: uppercase; color: var(--muted); }
.dash-win-name { font-size: 8vw; font-weight: 900; text-transform: uppercase; text-align: center; line-height: 1; }
.vinyl { width: 30vw; max-width: 400px; filter: drop-shadow(0 0 50px rgba(0,0,0,0.8)); }
.vinyl.spinning { animation: spin 3s linear infinite; }

/* CLASSEMENT TV */
#leaderboard { flex-grow: 1; overflow-y: auto; }
.score-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.03); 
}
.score-item .name { font-size: 2.2vw; font-weight: 800; text-transform: uppercase; }
.score-item .pts { color: var(--green); font-weight: 900; font-size: 2.5vw; text-shadow: 0 0 20px var(--green-glow); }
.score-item .rank { color: var(--muted); margin-right: 15px; font-size: 1.2vw; }

/* QR CODE TV */
.qr-container { position: absolute; bottom: 30px; left: 30px; display: flex; align-items: center; gap: 15px; background: rgba(0,0,0,0.4); padding: 10px; border-radius: 12px; border: var(--glass-border); }
#mini-qrcode { background: white; padding: 5px; border-radius: 5px; }

/* ADMIN LAYOUT */
.admin-layout { display: flex; gap: 30px; max-width: 1400px; margin: 80px auto 40px; padding: 0 20px; height: 600px; }
.admin-player-side { flex: 2; display: flex; flex-direction: column; gap: 20px; }
.admin-search-side { flex: 1; background: var(--surface); border-radius: var(--radius); border: var(--glass-border); padding: 20px; display: flex; flex-direction: column; }

/* VIDEO PLAYER ADMIN */
#player-container { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; border: var(--glass-border); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
#player { width: 100%; height: 100%; }

/* SEARCH RESULTS ADMIN */
#search-input { width: 100%; padding: 15px 20px; border-radius: 50px; border: var(--glass-border); background: var(--bg); color: white; font-size: 1rem; outline: none; margin-bottom: 20px; }
#search-results { flex-grow: 1; overflow-y: auto; padding-right: 5px; }
.video-item { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; border-radius: 10px; transition: 0.2s; font-size: 0.9rem; margin-bottom: 8px; }
.video-item:hover { background: var(--surface-light); }
.video-item img { width: 80px; border-radius: 6px; }

/* GESTION JOUEURS ADMIN */
.admin-panel-players { max-width: 1400px; margin: 20px auto; padding: 30px; background: var(--surface); border-radius: var(--radius); border: var(--glass-border); }
.player-admin-row { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: var(--bg); border-radius: 12px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.02); }
.player-admin-row .name { font-weight: 800; font-size: 1.2rem; }
.admin-controls { display: flex; gap: 10px; }
.btn-sm { padding: 8px 15px; font-weight: 900; border-radius: 8px; border: none; cursor: pointer; }
.btn-sm.plus { background: var(--green); color: #000; }
.btn-sm.minus { background: var(--red); color: #fff; }
.btn-sm.bonus { background: #f59e0b; color: #000; }

/* SCROLLBARS */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-light); border-radius: 10px; }

/* UTILS */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--muted); }

/* Ajoute ou modifie ces lignes dans global.css */

.admin-score-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 20px; 
    background: rgba(255,255,255,0.02); 
    border-radius: 12px; 
    margin-bottom: 10px; 
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}

.admin-score-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

.admin-score-actions { 
    display: flex; 
    gap: 8px; 
}

/* On pimp les petits boutons d'action de l'admin */
.btn-sm { 
    padding: 8px 15px; 
    font-weight: 900; 
    border-radius: 8px; 
    border: none; 
    cursor: pointer; 
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: 0.1s;
}

.btn-sm.plus { background: var(--green); color: #000; }
.btn-sm.minus { background: var(--red); color: #fff; }
.btn-sm.bonus { background: #f59e0b; color: #000; }

.btn-sm:active { transform: scale(0.9); }

/* OPTIMISATION MOBILE - LA STEV' */
@media (max-width: 768px) {
    html, body {
        /* Empêche le rebond et le scroll inutile sur mobile */
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* On réduit la taille du badge pour laisser de la place au buzzer */
    .brand-badge {
        top: 15px;
        left: 15px;
        padding: 8px 15px;
        font-size: 0.7rem;
    }

    #score-badge {
        top: 18px !important;
        right: 15px !important;
        font-size: 0.9rem !important;
    }

    /* Le buzzer doit être le plus gros possible sans sortir de l'écran */
    #btn-buzz {
        width: 85vw;
        height: 85vw;
        max-width: 320px;
        max-height: 320px;
        font-size: 2.2rem; /* Texte "BUZZ" plus lisible */
    }

    #info {
        font-size: 1.1rem !important;
        margin-bottom: 20px !important;
        padding: 0 20px;
    }

    /* Layout Admin Mobile (si tu gères depuis ton tel) */
    .admin-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        padding-top: 60px;
    }
    
    .admin-player-side, .admin-search-side {
        flex: none;
        width: 100%;
    }
}

/* Supprime le délai de clic sur mobile (vitesse max) */
button {
    touch-action: manipulation;
}
#btn-buzz:active:not(:disabled) {
    transform: scale(0.95);
    background: #2d0a0a; /* Le rouge s'assombrit direct */
}
#btn-buzz {
    transition: background 0.2s, transform 0.1s, color 0.2s;
}
#btn-buzz:disabled {
    opacity: 0.8;
}
/* ADMIN MOBILE OPTIMISATION */
@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column; /* On empile au lieu de mettre côte à côte */
        height: auto;
        margin-top: 0px; /* Espace pour le badge La Stev' */
        gap: 20px;
    }
    .mobileBouton{
        padding: 20px;
        margin-top: 46px;
        justify-content: center;
    }
    .admin-player-side {
        width: 100%;
    }
    .admin-layout{
        flex-wrap: wrap;
        height: auto;
    }

    /* Le lecteur prend toute la largeur mais garde son ratio */
    #player-container {
        border-radius: 0; /* Plus immersif sur petit écran */
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }

    .admin-search-side {
        width: 100%;
        height: 500px; /* On fixe une hauteur pour la recherche */
    }

    /* On agrandit les boutons de contrôle pour les gros doigts */
    .admin-player-side .btn {
        padding: 20px 10px;
        font-size: 0.8rem;
    }

    /* Adaptation du leaderboard admin */
    .admin-score-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-score-actions {
        width: 100%;
        justify-content: space-between;
    }

    .admin-score-actions .btn-sm {
        flex: 1;
        padding: 12px;
        font-size: 0.9rem;
    }
    #winner-display{
        font-size:2rem !important;
    }
}
/* Animation de feu pour les streaks */
.streak-fire {
    position: relative;
    color: #ff9d00 !important;
    text-shadow: 0 0 10px #ff4500, 0 0 20px #ffae00;
    animation: flame-pulse 1.5s infinite alternate;
}

.streak-fire::after {
    content: ' 🔥';
    font-size: 1.2rem;
    vertical-align: middle;
}

@keyframes flame-pulse {
    0% { text-shadow: 0 0 10px #ff4500, 0 0 20px #ffae00; transform: scale(1); }
    100% { text-shadow: 0 0 15px #ff4500, 0 0 30px #ffae00, 0 0 40px #ff0000; transform: scale(1.05); }
}

