/* --- RESET Y CONFIGURACIÓN GLOBAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primario: #6C63FF;
    --color-secundario: #FF6B6B;
    --color-terciario: #4ECDC4;
    --color-cuarto: #FFD93D;
    --color-quinto: #FF8A5C;
    --fondo-claro: #f8f9ff;
    --texto-oscuro: #2d2d3f;
    --sombra: 0 10px 40px rgba(108, 99, 255, 0.15);
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--fondo-claro);
    color: var(--texto-oscuro);
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8e9ff 100%);
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* --- ENCABEZADO --- */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.titulo-principal {
    font-family: 'Fredoka One', cursive;
    font-size: 3.5rem;
    color: var(--color-primario);
    text-shadow: 3px 3px 0 rgba(108, 99, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.emoji {
    font-size: 3rem;
}

.subtitulo {
    font-size: 1.3rem;
    color: #6b6b8a;
    font-weight: 600;
    margin-top: 0.5rem;
}

.linea-decorativa {
    width: 200px;
    height: 4px;
    margin: 1.5rem auto 0;
    background: linear-gradient(90deg, var(--color-primario), var(--color-secundario), var(--color-terciario), var(--color-cuarto));
    border-radius: 10px;
}

/* --- SECCIÓN DEL MUÑECO Y PREGUNTAS --- */
.seccion-muñeco {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 3rem;
    background: white;
    border-radius: 30px;
    padding: 2rem;
    box-shadow: var(--sombra);
}

@media (max-width: 900px) {
    .seccion-muñeco {
        grid-template-columns: 1fr;
    }
}

/* --- MUÑECO ANIMADO --- */
.contenedor-muñeco {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
}

.muñeco {
    width: 200px;
    height: 300px;
    position: relative;
    animation: flotar 3s ease-in-out infinite;
}

@keyframes flotar {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Cabeza */
.cabeza {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle at 30% 30%, #ffd93d, #f5a623);
    border-radius: 50%;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(245, 166, 35, 0.3);
    z-index: 2;
}

.cara {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Ojos */
.ojos {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 35px;
}

.ojo {
    width: 30px;
    height: 35px;
    background: white;
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.pupila {
    width: 14px;
    height: 14px;
    background: #2d2d3f;
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.muñeco:hover .pupila {
    transform: translateX(-50%) scale(1.2);
}

/* Boca */
.boca {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    overflow: hidden;
}

.sonrisa {
    width: 100%;
    height: 100%;
    border-bottom: 5px solid #8B4513;
    border-radius: 0 0 50% 50%;
    transition: all 0.3s ease;
}

.boca.feliz .sonrisa {
    height: 30px;
    border-bottom-width: 6px;
}

.boca.triste .sonrisa {
    border-bottom: none;
    border-top: 5px solid #8B4513;
    border-radius: 50% 50% 0 0;
    height: 15px;
}

/* Mejillas */
.mejillas {
    position: absolute;
    bottom: 40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
}

.mejilla {
    width: 25px;
    height: 15px;
    background: rgba(255, 107, 107, 0.3);
    border-radius: 50%;
}

/* Orejas */
.orejas {
    position: absolute;
    top: 30px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 -10px;
}

.oreja {
    width: 25px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ffd93d, #f5a623);
    border-radius: 50%;
    position: relative;
}

.oreja.izquierda {
    left: -15px;
}

.oreja.derecha {
    right: -15px;
}

/* Cuerpo */
.cuerpo {
    width: 140px;
    height: 120px;
    background: radial-gradient(circle at 30% 30%, #6C63FF, #5a52d5);
    border-radius: 30px 30px 20px 20px;
    margin: -20px auto 0;
    position: relative;
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.3);
}

.barriga {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 25px;
}

.boton {
    width: 15px;
    height: 15px;
    background: #ffd93d;
    border-radius: 50%;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
    animation: brillar 2s ease-in-out infinite;
}

.boton:nth-child(2) {
    animation-delay: 0.5s;
}

.boton:nth-child(3) {
    animation-delay: 1s;
}

@keyframes brillar {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 20px rgba(255, 217, 61, 0.5); }
}

/* Brazos */
.brazo {
    width: 25px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #6C63FF, #5a52d5);
    border-radius: 20px;
    position: absolute;
    top: 10px;
}

.brazo.izquierdo {
    left: -15px;
    transform: rotate(15deg);
    animation: moverBrazo 2s ease-in-out infinite;
}

.brazo.derecho {
    right: -15px;
    transform: rotate(-15deg);
    animation: moverBrazo 2s ease-in-out infinite reverse;
}

@keyframes moverBrazo {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(25deg); }
}

/* Piernas */
.piernas {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: -5px;
}

.pierna {
    width: 30px;
    height: 50px;
    background: radial-gradient(circle at 30% 30%, #5a52d5, #4a42b5);
    border-radius: 0 0 20px 20px;
    animation: moverPierna 1.5s ease-in-out infinite;
}

.pierna.derecha {
    animation-delay: 0.75s;
}

@keyframes moverPierna {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Burbuja de diálogo */
.burbuja-dialogo {
    background: white;
    padding: 1.2rem 1.8rem;
    border-radius: 20px;
    max-width: 280px;
    position: relative;
    margin-top: 1rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border: 2px solid var(--color-primario);
    min-height: 70px;
    display: flex;
    align-items: center;
}

.burbuja-dialogo .triangulo {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid white;
    filter: drop-shadow(0 -5px 10px rgba(0,0,0,0.05));
}

.burbuja-dialogo p {
    font-weight: 600;
    font-size: 1rem;
    color: var(--texto-oscuro);
    margin: 0;
    width: 100%;
}

/* --- PANEL DE PREGUNTAS --- */
.panel-preguntas {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-jugador {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: linear-gradient(135deg, var(--color-primario), #8b83ff);
    border-radius: 15px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.info-jugador strong {
    font-size: 1.3rem;
}

.caja-pregunta {
    background: #f0f0ff;
    padding: 1.5rem;
    border-radius: 15px;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.caja-pregunta h3 {
    font-size: 1.2rem;
    color: var(--texto-oscuro);
    font-weight: 700;
}

.opciones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.opcion {
    padding: 1rem;
    border: 2px solid #d1d1e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.opcion:hover:not(.deshabilitado) {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(108, 99, 255, 0.15);
    border-color: var(--color-primario);
}

.opcion.correcta {
    border-color: var(--color-terciario);
    background: #d4f5f0;
    color: #1a7a72;
}

.opcion.incorrecta {
    border-color: var(--color-secundario);
    background: #ffe0e0;
    color: #b33a3a;
}

.opcion.deshabilitado {
    cursor: not-allowed;
    opacity: 0.6;
}

.opcion.seleccionada {
    border-color: var(--color-primario);
    background: #e8e6ff;
}

.controles {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-principal {
    padding: 0.8rem 2rem;
    background: var(--color-primario);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    flex: 1;
    min-width: 150px;
}

.btn-principal:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(108, 99, 255, 0.4);
}

.btn-principal:active {
    transform: translateY(0);
}

.btn-secundario {
    padding: 0.8rem 2rem;
    background: var(--color-secundario);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    flex: 1;
    min-width: 150px;
}

.btn-secundario:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(255, 107, 107, 0.4);
}

.feedback {
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.feedback.correcto {
    background: #d4f5f0;
    color: #1a7a72;
}

.feedback.incorrecto {
    background: #ffe0e0;
    color: #b33a3a;
}

.feedback.info {
    background: #e8e6ff;
    color: var(--color-primario);
}

/* --- SECCIÓN MINIJUEGO --- */
.seccion-minijuego {
    background: white;
    border-radius: 30px;
    padding: 2rem;
    box-shadow: var(--sombra);
    margin-bottom: 3rem;
}

.titulo-seccion {
    font-family: 'Fredoka One', cursive;
    font-size: 2.5rem;
    text-align: center;
    color: var(--color-secundario);
    margin-bottom: 0.5rem;
}

.descripcion-juego {
    text-align: center;
    color: #6b6b8a;
    font-weight: 600;
    margin-bottom: 2rem;
}

.contenedor-minijuego {
    max-width: 600px;
    margin: 0 auto;
}

.display-numero {
    display: flex;
    justify-content: space-between;
    background: #f0f0ff;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.entrada-numero {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.entrada-numero input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 2px solid #d1d1e0;
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s ease;
}

.entrada-numero input:focus {
    outline: none;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.btn-adivinar {
    padding: 0.8rem 2rem;
    background: var(--color-terciario);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.btn-adivinar:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(78, 205, 196, 0.4);
}

.pistas {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    min-height: 80px;
}

.pistas p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.pistas .pista-alta {
    color: var(--color-secundario);
}

.pistas .pista-baja {
    color: var(--color-primario);
}

.pistas .pista-correcta {
    color: var(--color-terciario);
    font-size: 1.3rem;
}

.historial {
    background: #f8f9ff;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.historial h4 {
    color: #6b6b8a;
    margin-bottom: 0.5rem;
}

#listaIntentos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.intento-item {
    background: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 2px solid #d1d1e0;
    font-weight: 600;
    font-size: 0.9rem;
}

.intento-item.menor {
    border-color: var(--color-primario);
    color: var(--color-primario);
}

.intento-item.mayor {
    border-color: var(--color-secundario);
    color: var(--color-secundario);
}

.intento-item.acierto {
    border-color: var(--color-terciario);
    color: var(--color-terciario);
    background: #d4f5f0;
}

.btn-reiniciar-juego {
    padding: 0.8rem 2rem;
    background: var(--color-cuarto);
    color: var(--texto-oscuro);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    width: 100%;
}

.btn-reiniciar-juego:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(255, 217, 61, 0.4);
}

/* --- PIE DE PÁGINA --- */
.footer {
    text-align: center;
    padding: 2rem 0;
    color: #6b6b8a;
}

.footer-pequeño {
    font-size: 0.9rem;
    margin-top: 0.3rem;
    opacity: 0.7;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .titulo-principal {
        font-size: 2.2rem;
    }
    
    .opciones {
        grid-template-columns: 1fr;
    }
    
    .entrada-numero {
        flex-direction: column;
    }
    
    .muñeco {
        width: 150px;
        height: 230px;
    }
    
    .cabeza {
        width: 120px;
        height: 120px;
    }
    
    .cuerpo {
        width: 100px;
        height: 90px;
    }
    
    .info-jugador {
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
    }
    
    .burbuja-dialogo {
        max-width: 200px;
        font-size: 0.9rem;
    }
}

/* Animaciones adicionales */
@keyframes aparecer {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.opcion {
    animation: aparecer 0.3s ease backwards;
}

.opcion:nth-child(1) { animation-delay: 0.05s; }
.opcion:nth-child(2) { animation-delay: 0.1s; }
.opcion:nth-child(3) { animation-delay: 0.15s; }
.opcion:nth-child(4) { animation-delay: 0.2s; }