@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;900&display=swap');

body {
    background: radial-gradient(circle at center, #2b0b3f 0%, #0a0a1a 100%);
    color: white;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    margin: 0;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.escenario {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    border: 2px solid rgba(255, 0, 255, 0.3);
    max-width: 400px;
    width: 90%;
}

.titulo {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #ff00ff;
    font-size: 28px;
    margin-top: 0;
}

.estado-contenedor {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: #ffbaff;
}

/* LA MAGIA CSS (ANIMACIONES) */
.personaje-area {
    position: relative;
    height: 250px;
    margin-bottom: 20px;
}

#derpy-img {
    height: 100%;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
    transition: all 0.3s;
}

/* AnimaciÃ³n: Respirar (Stanby) */
.animacion-respirar {
    animation: respirar 3s infinite ease-in-out;
}
@keyframes respirar {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-5px) scaleY(1.03); }
}

/* AnimaciÃ³n: Comer */
.animacion-comer {
    animation: comer 0.5s 3 ease-in-out;
}
@keyframes comer {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.1) translateY(-20px); }
}

/* AnimaciÃ³n: Fiesta K-Pop */
.animacion-fiesta {
    animation: fiesta 0.8s infinite;
    filter: drop-shadow(0 0 20px #ff00ff) drop-shadow(0 0 40px #00ffff) !important;
}
@keyframes fiesta {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-15deg); }
    50% { transform: scale(1) rotate(0deg); }
    75% { transform: scale(1.1) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* AnimaciÃ³n: Dormir */
.animacion-dormir {
    animation: respirar-lento 5s infinite ease-in-out;
    filter: brightness(0.5) !important;
}
@keyframes respirar-lento {
    0%, 100% { transform: scaleY(1) rotate(5deg); }
    50% { transform: scaleY(1.05) rotate(5deg); }
}

/* El Globo de Texto */
#bocadillo {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #333;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10;
    max-width: 80%;
}
#bocadillo::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    margin-left: -10px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
}
.oculto { display: none; }

/* Botones */
button {
    background: linear-gradient(45deg, #ff00ff, #8a2be2);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.4);
    transition: 0.2s;
}
button:active { transform: scale(0.9); }

.btn-fiesta {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.6);
    font-size: 16px;
    width: 90%;
    margin-top: 10px;
}

/* Zona de Chat y Micr¨®fono */
.chat-area { 
    margin-top: 20px; 
    display: flex; 
    align-items: center;
}
#btn-micro {
    background: linear-gradient(45deg, #ff5e62, #ff9966);
    border-radius: 20px 0 0 20px;
    margin: 0;
    padding: 10px 15px;
    font-size: 18px;
}
#mensaje-input {
    flex-grow: 1;
    border-radius: 0;
    border: none;
    padding: 12px;
    outline: none;
    font-family: 'Nunito', sans-serif;
}
#btn-enviar {
    border-radius: 0 20px 20px 0;
    margin: 0;
}

/* Animaci¨®n: Jugar (Saltos) */
.animacion-jugar {
    animation: saltar 0.6s 2 ease-in-out;
}
@keyframes saltar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-40px) scaleX(0.95) scaleY(1.05); }
}

/* Animaci¨®n: Dormir (M¨¢s realista) */
.animacion-dormir {
    animation: respirar-dormido 4s infinite ease-in-out;
    filter: brightness(0.6) saturate(0.8) !important;
}
@keyframes respirar-dormido {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.03) translateY(5px); }
}



/* --- MINIJUEGO EL ESCONDITE --- */
.btn-escondite {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    box-shadow: 0 4px 15px rgba(0, 100, 255, 0.4);
    width: 90%;
    margin-top: 5px;
}

/* Animaci¨®n de hundirse en el suelo estilo portal azul (MEJORADA) */
.animacion-hundirse {
    animation: derretirSombra 1.5s forwards ease-in-out !important;
    transform-origin: bottom center;
}

@keyframes derretirSombra {
    0% { 
        transform: scaleY(1) translateY(0); 
        filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5)); 
        opacity: 1; 
    }
    40% { 
        transform: scaleY(0.6) translateY(30px); 
        filter: drop-shadow(0 0 30px #00ffff) brightness(1.5); 
        opacity: 1; 
    }
    100% { 
        transform: scaleY(0) translateY(100px); 
        filter: drop-shadow(0 -50px 50px #00ffff) brightness(2); 
        opacity: 0; 
    }
}

/* Clase para cuando Derpy est¨¢ escondido por la pantalla */
.derpy-modo-juego {
    position: fixed !important;
    width: 150px !important; /* Un pel¨ªn m¨¢s grande para poder tocarlo en m¨®vil */
    height: auto !important;
    cursor: pointer;
    z-index: 9999;
    transition: opacity 0.2s; /* Desaparece suavemente */
}