/* --- MUSICHIERE - CONTAINER PRINCIPALE (SFONDO ANIMATO) --- */

@keyframes bg-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#musichiere-container {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #4b0082, #240b36);
    background-size: 400% 400%;
    animation: bg-animation 10s ease infinite;
    width: 100%;
    height: 100%;
    background-color: transparent !important; 
}


/* --- SPETTRO AUDIO (SCHERMO) --- */

#musichiere-spectrum-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 40vh;
    width: 90%;
    margin: 0 auto;
    padding-bottom: 20px;
}

.spectrum-bar {
    width: 3vw;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(to top, #00c6ff, #0072ff); 
    box-shadow: 0 0 20px rgba(0, 198, 255, 0.8); 
    height: 10%; 
    animation: bounce 0.8s infinite ease-in-out alternate;
    animation-play-state: paused; 
    transition: height 0.2s;
}

.spectrum-bar.animate {
    animation-play-state: running;
}

@keyframes bounce {
    0% { height: 10%; filter: hue-rotate(0deg); }
    50% { height: 80%; } 
    100% { height: 100%; filter: hue-rotate(45deg); }
}

.bar-color-1 { background: linear-gradient(to top, #ff00cc, #333399); box-shadow: 0 0 25px #ff00cc; }
.bar-color-2 { background: linear-gradient(to top, #00ff00, #009933); box-shadow: 0 0 25px #00ff00; }
.bar-color-3 { background: linear-gradient(to top, #ffcc00, #ff6600); box-shadow: 0 0 25px #ffcc00; }


/* --- CARD VINCITORE "GLASSMORPHISM" --- */

.musichiere-winner-card {
    background: rgba(15, 15, 25, 0.4); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.musichiere-cover {
    width: 40vh;
    height: 40vh;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
    margin-bottom: 4vh;
    animation: cover-pulse 3s infinite alternate;
}

@keyframes cover-pulse {
    from { box-shadow: 0 0 30px rgba(255, 215, 0, 0.2); transform: scale(1); }
    to { box-shadow: 0 0 60px rgba(255, 215, 0, 0.5); transform: scale(1.02); }
}

.musichiere-details {
    font-size: 5vh;
    line-height: 1.2;
    margin-bottom: 2vh;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    text-align: center;
}

.musichiere-details strong {
    font-size: 9vh; 
    display: block;
    margin-bottom: 1vh;
    color: #fff;
    font-weight: 800;
    letter-spacing: -2px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.4);
}

.musichiere-winner-name {
    font-size: 7vh;
    font-weight: bold;
    color: #FFD700; 
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    margin-top: 2vh;
}


/* --- PLAYER PULSANTONE (IL BLOCCO CRITICO) --- */

/* Stile base del pulsante (NON PREMUTO) */
#btn-musichiere-buzz {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, #e74c3c 0%, #c0392b 100%); /* Rosso */
    border: 8px solid #fff;
    box-shadow: 0 10px 30px rgba(192, 57, 43, 0.6);
    color: white;
    font-size: 2.5rem;
    font-weight: 900;
    cursor: pointer;
    margin: 40px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    text-transform: uppercase;
}

#btn-musichiere-buzz:active {
    transform: scale(0.95);
    box-shadow: 0 5px 15px rgba(192, 57, 43, 0.8);
}

/* --- STATO VINCITORE (Il più veloce) --- */
#btn-musichiere-buzz.winner {
    background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%); /* Verde */
    box-shadow: 0 0 50px #2ecc71;
    border-color: #fff;
    transform: scale(1.1);
    pointer-events: none; 
}

/* --- STATO BLOCCATO (Gli altri) - Effetto Divieto --- */
#btn-musichiere-buzz.locked {
    background-color: #222; 
    border: 8px solid #e74c3c; 
    
    /* Barra inclinata rossa al centro */
    background-image: linear-gradient(
        45deg, 
        transparent 43%, 
        #e74c3c 43%, 
        #e74c3c 57%, 
        transparent 57%
    );
    
    color: #888; 
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.9;
}


/* --- POPUP GIUDICE HOST --- */
#musichiere-judge-panel {
    position: fixed;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 9999; 
    background: rgba(20, 20, 30, 0.95);
    border: 3px solid #e056fd; 
    box-shadow: 0 0 100px rgba(0,0,0,0.9);
    width: 550px; /* Aumentato per far stare i pulsanti */
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column; gap: 15px; /* Layout a colonna con gap */
}

/* Stile pulsanti Giudice ingranditi */
#musichiere-judge-panel .btn {
    font-size: 18px;
    padding: 15px;
    font-weight: 800;
    width: 100%;
    text-transform: uppercase;
}

/* --- TIMER / FEEDBACK SCREEN --- */
#musichiere-timer-overlay {
    position: fixed; /* CAMBIATO DA absolute A fixed */
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%);
    width: 70%; /* Leggermente più largo */
    text-align: center; 
    z-index: 10000; /* Z-Index altissimo per stare sopra a tutto */
    display: none; 
    flex-direction: column; 
    align-items: center;
    background: rgba(0, 0, 0, 0.85); /* Sfondo più scuro per contrasto */
    padding: 40px; 
    border: 4px solid #f39c12; /* Bordo colorato per vederlo bene */
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(0,0,0,1);
}
.musichiere-timer-text {
    font-size: 5vw; color: #fff; font-weight: bold; margin-bottom: 10px;
    text-shadow: 0 0 10px black;
}
.musichiere-timer-bar-container {
    width: 100%; height: 20px; background: #333; border: 2px solid #fff; border-radius: 10px; overflow: hidden;
}
.musichiere-timer-bar-fill {
    height: 100%; width: 100%; background: #e74c3c;
    transition: width 1s linear;
}

@keyframes popIn {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
/* --- NUOVO OVERLAY DEDICATO TIMER/FEEDBACK --- */
#musichiere-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000; /* Sopra a tutto */
    background: rgba(0, 0, 0, 0.7); /* Sfondo scuro per risaltare */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Non blocca click */
}

#mf-text {
    font-family: 'Teko', sans-serif;
    font-size: 8vw; /* Molto grande */
    color: #FFD700; /* Giallo */
    text-shadow: 0 0 20px black, 0 0 10px #f39c12;
    margin-bottom: 2vh;
    text-align: center;
    width: 90%;
}

#mf-bar-container {
    width: 60%;
    height: 4vh;
    background: #333;
    border: 3px solid #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

#mf-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    transition: width 1s linear;
}