* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Georgia', serif;
    background: #0a1f44;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ PORTADA ============ */
.portada {
    position: relative;
    width: 100%;
    background: #0a1f44;
}

.portada picture {
    display: block;
    width: 100%;
    line-height: 0;
}

.portada img {
    width: 100%;
    height: auto;
    display: block;
}

/* Aura de resplandor sobre el título */
.aura-titulo {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    height: 26%;
    background: radial-gradient(ellipse at center,
        rgba(255,255,255,0.6) 0%,
        rgba(255,215,0,0.4) 40%,
        transparent 75%);
    border-radius: 50%;
    pointer-events: none;
    animation: auraTitulo 3s ease-in-out infinite;
    z-index: 2;
}

@keyframes auraTitulo {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50%      { opacity: 0.8; transform: translateX(-50%) scale(1.05); }
}

.botones-portada {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ESTILO DE LOS BOTONES CON BRILLO PARPADEANTE */
.btn-portada {
    position: absolute;
    display: block;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    border: 3px solid rgba(255, 255, 200, 0.9);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(255, 215, 0, 0.6);
    animation: brilloParpadeante 1.5s infinite alternate ease-in-out;
    z-index: 3;
}

/* Animación del brillo pulsante */
@keyframes brilloParpadeante {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.2);
        border-color: rgba(255, 215, 0, 0.6);
    }
    100% {
        box-shadow: 0 0 40px rgba(255, 255, 200, 1), inset 0 0 35px rgba(255, 215, 0, 0.9);
        border-color: rgba(255, 255, 255, 1);
    }
}

/* Botón "decorar árbol" sobre la portada vertical */
.btn-arbol {
    top: 57%;
    left: 1%;
    width: 47%;
    height: 32%;
}

/* Botón "armar Belén" sobre la portada vertical */
.btn-belen {
    top: 57%;
    left: 52%;
    width: 47%;
    height: 32%;
}

/* Ajuste de botones para la portada horizontal */
@media (min-width: 768px) {
    .btn-arbol {
        top: 52%;
        left: 22%;
        width: 26%;
        height: 36%;
    }
    .btn-belen {
        top: 52%;
        left: 52%;
        width: 26%;
        height: 36%;
    }
    .aura-titulo {
        top: 15%;
        height: 22%;
    }
}

.btn-portada:active {
    animation: none;
    box-shadow: 0 0 50px rgba(255, 255, 255, 1), inset 0 0 50px rgba(255, 255, 255, 0.9);
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

/* ============ ESTILOS GENERALES PARA LAS ESCENAS ============ */
header {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #8b0000, #006400);
    border-bottom: 3px solid #ffd700;
}

header h1 {
    font-size: 1.8em;
    color: #ffd700;
    margin-bottom: 10px;
}

.menu-botones {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.menu-botones button {
    padding: 10px 20px;
    font-size: 1em;
    border: 2px solid #ffd700;
    border-radius: 10px;
    background: #b22222;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.menu-botones button:last-child {
    background: #228b22;
}

.escena {
    position: relative;
    min-height: calc(100vh - 120px);
}

/* ============ SALA ============ */
.sala {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.pared {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(180deg, #8b4513 0%, #a0522d 100%);
}

.piso {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(180deg, #654321 0%, #3e2723 100%);
}

.ventana {
    position: absolute;
    top: 10%;
    width: 22%;
    height: 35%;
    background: #87ceeb;
    border: 4px solid #4a2c17;
    border-radius: 5px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 5px;
}

.ventana-izq { left: 5%; }
.ventana-der { right: 5%; }

.luz-larga {
    width: 8px;
    height: 80%;
    background: repeating-linear-gradient(
        180deg,
        #ff0000 0px,
        #ff0000 10px,
        #00ff00 10px,
        #00ff00 20px,
        #ffd700 20px,
        #ffd700 30px
    );
    border-radius: 3px;
}

.cuadro {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 20%;
    height: 25%;
    background: #228b22;
    border: 5px solid #8b4513;
    border-radius: 3px;
}

.mesa {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 15%;
    background: #8b4513;
    border-radius: 5px;
    border: 2px solid #4a2c17;
}

.sofa {
    position: absolute;
    bottom: 5%;
    left: 5%;
    width: 35%;
    height: 20%;
    background: #8b0000;
    border-radius: 10px;
    border: 3px solid #4a0000;
}

.mascota {
    position: absolute;
    bottom: 8%;
    right: 10%;
    font-size: 2em;
}

/* ============ ARBOLITO ============ */
.arbol-base {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 55%;
}

.tronco {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15%;
    height: 20%;
    background: #4a2c17;
    border-radius: 3px;
}

.rama {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: solid transparent;
    border-right: solid transparent;
    border-bottom: solid #006400;
}

.rama-1 {
    bottom: 15%;
    border-left-width: 50px;
    border-right-width: 50px;
    border-bottom-width: 70px;
}

.rama-2 {
    bottom: 35%;
    border-left-width: 40px;
    border-right-width: 40px;
    border-bottom-width: 60px;
}

.rama-3 {
    bottom: 55%;
    border-left-width: 30px;
    border-right-width: 30px;
    border-bottom-width: 50px;
}

.zona-soltar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============ PANEL DE ADORNOS ============ */
.panel-adornos {
    background: #2c1810;
    border-top: 3px solid #ffd700;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.panel-adornos h3 {
    width: 100%;
    text-align: center;
    color: #ffd700;
    font-size: 1em;
}

.adorno {
    font-size: 2em;
    padding: 8px;
    background: #4a2c17;
    border: 2px solid #ffd700;
    border-radius: 8px;
    cursor: grab;
    touch-action: none;
    transition: transform 0.2s;
}

.adorno:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.adorno.colocado {
    position: absolute;
    font-size: 1.5em;
    z-index: 10;
    pointer-events: auto;
}

/* ============ BELÉN ============ */
.terreno-belen {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.cielo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #1a1a4e 0%, #4a4a8e 100%);
}

.terreno-belen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #c2b280 0%, #8b7355 100%);
}

.estrella-guia {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3em;
    animation: brillar 2s infinite;
}

@keyframes brillar {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.2); }
}

.pesebre {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 25%;
    height: 20%;
    background: #8b4513;
    border: 3px solid #4a2c17;
    border-radius: 5px;
}

.roca {
    position: absolute;
    background: #696969;
    border-radius: 50%;
}

.roca-1 {
    bottom: 15%;
    left: 10%;
    width: 40px;
    height: 30px;
}

.roca-2 {
    bottom: 10%;
    right: 15%;
    width: 50px;
    height: 35px;
}

.arbolito-belen {
    position: absolute;
    font-size: 2.5em;
}

.arbolito-belen { bottom: 25%; left: 15%; }
.belen-2 { bottom: 30%; right: 10%; }

/* ============ NIEVE ============ */
.nieve {
    position: fixed;
    top: -10px;
    color: #fff;
    font-size: 1.5em;
    pointer-events: none;
    animation: caer 10s linear infinite;
    z-index: 1000;
}

@keyframes caer {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(50px);
        opacity: 0.3;
    }
}

/* ============ BOTÓN VOLVER ============ */
.btn-volver {
    position: fixed;
    top: 15px;
    left: 15px;
    padding: 10px 15px;
    background: #8b0000;
    color: #fff;
    border: 2px solid #ffd700;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    text-decoration: none;
}

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

/* ========================================================== */
/* ============ NUEVO: BOTÓN DE IDIOMA (bandera) ============ */
/* ========================================================== */
.btn-idioma {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 2px solid #ffd700;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0;
}

.btn-idioma:hover {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
}

.btn-idioma:active {
    transform: scale(0.92);
}

.btn-idioma .bandera {
    font-size: 1.6rem;
    line-height: 1;
    pointer-events: none;
}

/* En pantallas muy pequeñas, el botón se achica un poco */
@media (max-width: 400px) {
    .btn-idioma {
        width: 2.8rem;
        height: 2.8rem;
    }
    .btn-idioma .bandera {
        font-size: 1.4rem;
    }
}

/* ========================================================== */
/* ============ NUEVO: BOTÓN DE MÚSICA (parlante) =========== */
/* ========================================================== */
.btn-musica {
    position: fixed;
    top: 1rem;
    left: 1rem; /* Esquina izquierda */
    z-index: 1000;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 2px solid #ffd700;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0;
}

.btn-musica:hover {
    transform: scale(1.08);
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
}

.btn-musica:active {
    transform: scale(0.92);
}

.btn-musica .icono-musica {
    font-size: 1.6rem;
    line-height: 1;
    pointer-events: none;
}

/* Cuando la música está sonando, le damos un brillo verde para indicarlo */
.btn-musica.activa {
    border-color: #44ff44;
    box-shadow: 0 0 15px rgba(68, 255, 68, 0.6);
}

/* En pantallas muy pequeñas, el botón se achica un poco */
@media (max-width: 400px) {
    .btn-musica {
        width: 2.8rem;
        height: 2.8rem;
    }
    .btn-musica .icono-musica {
        font-size: 1.4rem;
    }
}
