/* Core Web Vitals: preconnect + font-display handled via <link> in <head> per page */
/* Fallback for pages using global.css only — non-blocking async load */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:ital,wght@0,400;0,600;0,800;0,900;1,800&display=swap&font-display=swap');


:root {
    --bg: #0b0b0b;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --green: #00b388;
    --green-glow: rgba(0, 179, 136, 0.4);
    --red: #ef4444;
    --text: #ffffff;
    --muted: #d1d5db;
    --radius: 8px;
    --glass-border: 1px solid #2a2a2a;
    --amber: #00b388;
}


* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

/* Autoriser la sélection dans les champs texte */
input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

body {
    margin: 0;
    background-color: #f3f4f6;
    /* Neutral background for desktop */
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100dvh;
    /* NOTE: display:flex here was blocking vertical scroll on all lobby/index pages.
       Centering is now handled by .app-container { margin: 0 auto } instead. */
    overflow-x: hidden;
}

/* App Constraint Container */
.app-container {
    width: 100%;
    max-width: 680px;
    /* Mobile width constraint — centered via margin */
    margin: 0 auto;
    background: var(--bg);
    min-height: 100dvh;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Hide scrollbars but keep functionality */
.scrollbar-hide::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
#main-content::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide,
.page-content,
#main-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
.montserrat {
    font-family: 'Montserrat', sans-serif;
}

.scrollOK {
    overflow: auto !important;
    position: relative !important;
}

/* MARQUE LA STEV' ORIGINAL - SUPPRIMÉ CAR DOUBLON EN BAS */


@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.admin-section textarea,
.admin-section input {
    color: #fff;
}

/* BOUTONS GENERIQUES */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
}

.btn:active {
    transform: scale(0.95);
}

.btn:hover {
    transform: scale(1.02);
}

.btn-primary {
    background: var(--green);
    color: #ffffff;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--green-glow);
    background: #00d4a5;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

/* LE BUZZER (JOUEUR) */
.buzzer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
}

#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: 100dvh;
}

.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);
}

a {
    text-decoration: none;
}

#mini-qrcode {
    background: white;
    padding: 5px;
    border-radius: 5px;
}

/* ADMIN LAYOUT */
.admin-layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 120px auto 40px;
    /* adjusted margin top to clear fixed header */
    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: 1200px;
    margin: 100px auto 20px;
    /* clear header */
    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) {

    body.no-scroll {
        /* Empêche le rebond et le scroll inutile sur mobile (page joueur uniquement) */
        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;
    }
}

/* ================================= */
/* GLOBAL CONTAINER                  */
/* ================================= */
.app-container {
    max-width: 680px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

@media (min-width: 481px) {
    body {
        background-color: #111 !important;
        display: flex;
        justify-content: center;
        align-items: flex-start;
    }
}

/* ================================= */
/* APP-LIKE COMPONENTS               */
/* ================================= */

/* Bottom Navigation */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
}

.app-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    gap: 4px;
    transition: 0.2s;
}

.app-nav-item i {
    font-size: 1.4rem;
}

.app-nav-item.active {
    color: var(--green);
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 680px;
    margin: 0 auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-overlay.open {
    display: block;
    opacity: 1;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: -12px auto 20px;
}

/* Touch Targets */
.btn,
.input-code,
.app-nav-item,
.video-item {
    min-height: 44px;
}

/* Zero Clutter Utils */
.whitespace-extra {
    padding: 40px 20px;
}

.card-simple {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (min-width: 481px) {
    .app-nav {
        left: 50%;
        transform: translateX(-50%) !important;
    }
}

/* ================================= */
/* HEADER FIXED & BURGER MENU        */
/* ================================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(11, 11, 11, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: var(--glass-border);
    z-index: 9999;
    transition: background 0.3s;
}

/* Fix for fixed header overlap */
.app-container.has-fixed-header main,
.app-container.has-fixed-header .view-content {
    padding-top: 70px !important;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 0px;
    width: 100%;
}

.logo-link img {
    transition: transform 0.3s;
}

.logo-link:hover img {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
    font-weight: bold;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu a {
    padding: 10px;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--green);
    transition: width 0.3s;
}

.nav-menu a:hover {
    color: var(--green);
    text-shadow: 0 0 10px var(--green-glow);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* DROPDOWN STYLES */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dropdown-trigger .chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform 0.3s;
}

.dropdown:hover .dropdown-trigger .chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 200px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.dropdown-content a::after {
    display: none;
    /* No underline for dropdown items */
}

.dropdown-content a:hover {
    background: rgba(0, 179, 136, 0.1);
    color: var(--green);
}

/* MOBILE DROPDOWN ADJUSTMENTS */
@media (max-width: 992px) {
    .dropdown {
        width: 100%;
        text-align: center;
    }

    .dropdown-trigger {
        justify-content: center;
        font-size: 1.5rem;
        margin: 15px 0;
    }

    .dropdown-content {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .dropdown.active .dropdown-content {
        max-height: 500px;
    }

    .dropdown.active .dropdown-trigger .chevron {
        transform: rotate(-135deg);
    }

    .dropdown-content a {
        font-size: 1.2rem;
        padding: 10px;
        opacity: 0.7;
    }
}

/* Header Buttons override */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
}



.header-actions .btn-outline {
    background: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 0.85rem;
    transition: 0.2s;
}

.header-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-actions .btn-primary {
    padding: 10px 15px;
    text-decoration: none;
    font-size: 0.85rem;
}

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 10000;
}



.burger-menu .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.mobile-only {
    display: none;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 40%, var(--green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.1;
}

/* RESPONSIVE NAV (<= 992px) */
@media (max-width: 992px) {
    .header-container {
        padding: 15px 20px;
    }

    .page-hero h1 {
        font-size: 2.2em !important;
    }

    .hero h1 {
        font-size: 2.7em !important;
    }

    .burger-menu {
        display: flex;
    }

    .desktop-only {
        display: none !important;
    }

    .hero .btn.btn-primary {
        font-size: 1.1rem !important;
        padding: 10px 10px !important;
    }

    .mobile-only {
        display: flex;
    }

    .nav-menu.mobile-only {
        flex-direction: column;
        width: 100%;
        margin-top: 0;
    }

    .mobile-credits {
        display: flex !important;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        padding: 5px 12px;
        border-radius: 15px;
        border: var(--glass-border);
        margin-left: auto;
        margin-right: 15px;
        min-width: 80px;
        justify-content: center;
        margin-top: 0;
    }

    .mobile-only .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
        padding: 15px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100dvh;
        background: var(--surface);
        border-left: var(--glass-border);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
        padding: 40px;
        z-index: 9999;
        margin-top: 0;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu a {
        font-size: 1.5rem;
        margin: 15px 0;
    }

    .burger-menu.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
        background-color: var(--green);
    }

    .burger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
        background-color: var(--green);
    }
}

/* 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 0.6s infinite alternate !important;
    border: 4px solid #f59e0b !important;
    position: relative;
    z-index: 10;
}

.on-fire::before {
    content: "🔥";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    animation: floating 1s infinite ease-in-out;
}

@keyframes floating {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -10px);
    }
}

/* Buzzer States */
.buzzer-false {
    background: #440000 !important;
    border: 5px solid #ff0000 !important;
    box-shadow: 0 0 30px #ff0000 !important;
    animation: shake 0.2s 3;
}

.buzzer-buzzing {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 0 50px #fff !important;
    transform: scale(1.1);
}

/* Auto Mode Timer Bar */
#auto-timer-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

#auto-timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #10b981, #f59e0b, #ef4444);
    background-size: 200% 100%;
    transition: width 0.1s linear;
}

#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;
    }
}

/* --- BUZZ SPECIFIC OVERHAUL --- */

/* TV DASHBOARD */
.dashboard-layout {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--bg);
}

.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: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5);
}

.dash-label {
    font-size: 1.2rem;
    letter-spacing: 8px;
    font-weight: 700;
    margin-bottom: 30px;
    text-transform: uppercase;
    color: var(--muted);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.dash-win-name {
    font-size: 4vw;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    line-height: 1;
    color: var(--text);
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.vinyl {
    width: 35vw;
    max-width: 450px;
    filter: drop-shadow(0 0 60px rgba(0, 0, 0, 0.9));
    transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.vinyl.spinning {
    animation: spin 3s linear infinite;
}

/* CLASSEMENT TV */
.score-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.4s ease-out forwards;
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.score-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--muted);
    margin-right: 15px;
}

.score-avatar {
    font-size: 1.5rem;
    margin-right: 15px;
}

.score-info {
    flex: 1;
}

.score-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
}

.score-name small {
    font-size: 0.6rem;
    color: var(--green);
    margin-left: 5px;
}

.score-pts {
    font-size: 1.2rem;
    font-weight: 950;
    color: var(--green);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* PLAYER BUZZER */
#btn-buzz {
    width: 70vw;
    height: 70vw;
    max-width: 320px;
    max-height: 320px;
    border-radius: 50%;
    transition: 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    border: none;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#btn-buzz.btn-danger {
    background: radial-gradient(circle, #ff4d4d 0%, #ef4444 100%);
    color: white !important;
    border: 4px solid #b91c1c;
}

#btn-buzz:active:not(:disabled) {
    transform: scale(0.92) translateY(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* BUZZ ADMIN & PLAYLIST */
.playlist-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--green) rgba(0, 0, 0, 0.2);
}

.playlist-container::-webkit-scrollbar {
    width: 6px;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: var(--green);
    border-radius: 10px;
}

/* BRAND BADGE / LOGO FIXED */
.brand-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: 0.3s;
    background: rgba(26, 26, 26, 0.5);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-badge:hover {
    background: rgba(40, 40, 40, 0.8);
    border-color: var(--green);
}

.brand-badge img {
    height: 35px;
    width: auto;
}

@media (max-width: 768px) {
    .brand-badge {
        top: 15px;
        left: 15px;
        padding: 5px 15px;
    }

    .brand-badge img {
        height: 25px;
    }
}

.index-actions {
    display: flex;
    gap: 15px;
    width: 100%;
}

@media (max-width: 600px) {
    .index-actions {
        flex-direction: column;
    }
}


/* JS TRIGGERED STATES */
.buzz-win-bg {
    background: linear-gradient(135deg, var(--green), #064e3b) !important;
}

.buzz-pop-text {
    position: fixed;
    top: 10%;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 4vw;
    font-weight: 900;
    color: var(--green);
    text-shadow: 0 0 40px var(--green-glow);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.5s;
}

.confetti {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
}

.buzzer-locked {
    background: #450a0a !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

.buzzer-paused {
    background: var(--surface-hover) !important;
    color: var(--muted) !important;
}

/* ================================================ */
/* MOBILE UNIVERSAL FIXES — LA STEV' APP            */
/* Ajouté pour conformité App/PWA (mars 2026)       */
/* ================================================ */

/* 1. Prevent horizontal overflow on ALL pages */
html {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    overflow-x: hidden;
    align-items: center;
}



/* Pour les layouts full-screen (play.php, scorer) */
.fullscreen-layout {
    height: 100dvh;
    overflow: hidden;
}

/* 3. Text overflow — empêche les pseudos/titres longs de déborder */
.player-name,
.pseudo,
.studio-code,
.game-code,
.hero h1,
.mode-title,
.nav-item span {
    white-space: normal;
    text-wrap: balance;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 4. Touch targets — minimum 48px pour accessibilité App Store */
button,
.btn,
.btn-cta,
.nav-item,
.mode-card,
.studio-btn {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Exception : petits boutons secondaires */
.studio-btn,
.btn-sm {
    min-height: 36px;
}

/* 5. iPhone SE et petits écrans (< 375px) */
@media (max-width: 375px) {
    .nav-item {
        font-size: 0.55rem !important;
        padding: 10px 4px !important;
        gap: 4px !important;
    }

    .nav-item i {
        font-size: 1.2rem !important;
    }

    .btn-cta {
        padding: 16px 12px !important;
        font-size: 0.9rem !important;
    }

    .hero h1 {
        font-size: 2rem !important;
    }

    .hero p {
        font-size: 0.75rem !important;
    }

    .code-input {
        font-size: 2rem !important;
        letter-spacing: 6px !important;
        padding: 16px !important;
    }

    .section-label {
        font-size: 0.6rem !important;
    }

    .mode-card {
        padding: 14px 12px !important;
        gap: 10px !important;
    }

    .mode-icon {
        font-size: 1.5rem !important;
    }

    .app-header,
    #header {
        height: 50px !important;
    }

    .page-content {
        padding-top: 50px !important;
    }
}

/* 6. Safe area (notch iPhone, Dynamic Island) */
.bottom-nav,
.app-nav,
.nav {
    padding-bottom: max(env(safe-area-inset-bottom), 8px);
}

.app-header,
#header {
    padding-top: env(safe-area-inset-top, 0px);
}

/* 7. Scrollable lists sans barre de défilement visible */
.studio-list,
.score-list,
.player-list,
.results-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.studio-list::-webkit-scrollbar,
.score-list::-webkit-scrollbar,
.player-list::-webkit-scrollbar,
.results-list::-webkit-scrollbar {
    display: none;
}

/* 8. Empêche le zoom sur focus des inputs (iOS) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    font-size: max(16px, 1rem);
}

/* 9. Performance : GPU compositing sur les éléments animés */
.bottom-nav,
.app-nav,
.app-header,
#header,
.tab-view,
.modal-overlay,
.swal2-popup {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.app-nav {
    /* TranslateX(-50%) must accompany left: 50% */
    transform: translateZ(0) translateX(-50%) !important;
    left: 50% !important;
}

/* 10. Désactive les animations sur préférence système (accessibilité) */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ====== MOBILE ANTI-ZOOM & RESPONSIVE SCALING ====== */
/* html, body anti-zoom rules removed to allow scrolling */

/* For devices with very small vertical height (e.g., iPhone SE in landscape or small phones), zoom out slightly */
@media screen and (max-height: 650px) {
    body {
        zoom: 0.9;
        /* Non-standard but widely supported for scaling down the entire interface */
    }
}

@media screen and (max-height: 550px) {
    body {
        zoom: 0.8;
    }
}

/* ── Navigation icons — taille uniforme sur toutes les pages de jeu ── */
.nav-item i,
.app-nav-item i {
    font-size: 1.2rem !important;
}

/* ── Mascots Interactive Animation (Floating + Click) ── */
@keyframes mascotBreathe {

    0%,
    100% {
        translate: 0px 0px;
        scale: 1;
        filter: brightness(1);
    }

    50% {
        translate: 0px -8px;
        scale: 1.04;
        filter: brightness(1.1);
    }
}

img[src*="_ui.png"] {
    /* Randomize animation delay using a neat trick if possible, or just default */
    animation: mascotBreathe 4s ease-in-out infinite alternate;
    cursor: pointer;
    will-change: translate, scale;
    /* Use a bouncy transition for clicks */
    transition: scale 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;

    /* Disable all default mobile interactions/frames when tapped */
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -webkit-user-drag: none !important;
    user-select: none !important;
    outline: none !important;
}

img[src*="_ui.png"]:active {
    scale: 0.8 !important;
    filter: drop-shadow(0 0 30px rgba(0, 179, 136, 0.7)) brightness(1.2) !important;
    transition: scale 1s ease, filter 1s ease;
}

/* SWAL FORCING OVERLAY Z-INDEX */
div:where(.swal2-container) { z-index: 10000 !important; }