: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: 2.5; 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: 3vw; 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(--surface-light); 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); }
}

/* Overlay qui floute le fond */
#pseudo-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s;
}

.pseudo-modal {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius);
    border: var(--glass-border);
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,1);
}

#pseudo-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
    text-transform: uppercase;
}
#track-title{
    max-width: 450px;
}
#pseudo-input:focus { border-color: var(--green); }
.btn-group { display: flex; gap: 8px; }
.btn-outline-red { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-outline-amber { background: transparent; border: 1px solid #f59e0b; color: #f59e0b; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.track-info { display: flex; align-items: center; gap: 15px; cursor: pointer; }
.track-info .thumb { width: 60px; height: 45px; background: #000; border-radius: 4px; background-size: cover; }
.panel-title { font-size: 0.8rem; letter-spacing: 2px; color: var(--muted); margin-bottom: 15px; text-transform: uppercase; }

#zone-titre {
    display: none; /* Caché par défaut */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999; /* Au dessus de tout */
    background: rgba(0,0,0,0.9);
    padding: 30px;
    border: 4px solid #10b981;
    border-radius: 15px;
    text-align: center;
    min-width: 50%;
}

#zone-titre .label {
    color: var(--green);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
    opacity: 0.9;
}

#revealed-title-text {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    line-height: 1.1;
    text-shadow: 2px 2px 0px var(--green), 4px 4px 20px rgba(0,0,0,0.5);
    word-wrap: break-word;
}

/* Animation d'entrée type "Pop-in" */
@keyframes revealEntry {
    0% { transform: translate(-50%, -40%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
/* Animation de Sabotage : le bouton fuit le doigt */
@keyframes shake-crazy {
    0% { transform: translate(0,0); }
    20% { transform: translate(50px, -30px) rotate(10deg); }
    40% { transform: translate(-60px, 40px) rotate(-15deg); }
    60% { transform: translate(70px, 20px) rotate(20deg); }
    80% { transform: translate(-40px, -50px) rotate(-10deg); }
    100% { transform: translate(0,0); }
}

.sabotaged {
    animation: shake-crazy 0.5s infinite !important;
    pointer-events: none; /* Optionnel : rend le buzz quasi impossible */
}

/* Animation de Feu */
@keyframes flame {
    0% { box-shadow: 0 0 20px #f59e0b, 0 0 40px #ef4444; }
    50% { box-shadow: 0 0 40px #f59e0b, 0 0 80px #ef4444; }
    100% { box-shadow: 0 0 20px #f59e0b, 0 0 40px #ef4444; }
}

.on-fire {
    animation: flame 1s infinite !important;
    border: 3px solid #f59e0b !important;
}

.on-fire::after {
    content: "🔥";
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 2rem;
}
#last-reveal-text {
    /* Centrage absolu */
    display: none; 
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: 80%;
    max-width: 900px;
    
    /* Intégration à ton style (Glassmorphism) */
    background: var(--surface);
    backdrop-filter: blur(15px);
    padding: 60px;
    border-radius: var(--radius);
    border: 2px solid var(--green); /* On utilise ton vert signature */
    
    /* Ombre portée cohérente avec ton dashboard */
    box-shadow: 0 0 0 10px var(--bg), 
                0 0 50px var(--green-glow), 
                0 30px 60px rgba(0,0,0,0.8);
    
    /* Typographie La Stev' */
    text-align: center;
    color: var(--text);
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -1px;
    
    /* Animation Pop de ton interface */
    animation: revealPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Style du Sample à l'intérieur (On utilise ton orange/amber) */
#last-reveal-text span {
    display: block;
    margin-top: 20px;
    color: #f59e0b; /* Ton orange amber */
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    opacity: 0.9;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

/* Animation de surgissement */
@keyframes revealPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Responsive : On réduit la taille sur TV si l'écran est petit */
@media (max-width: 1200px) {
    #last-reveal-text {
        font-size: 2.5rem;
        width: 90%;
        padding: 40px;
    }
}