/* 2. PALETA DE COLORES Y EFECTOS (CSS) Y DISEÑO RESPONSIVE CENTRADO */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(rgba(5, 5, 5, 0.82), rgba(42, 8, 69, 0.88)), url('fondoHalloween.jpeg') center/cover no-repeat;
    background-color: #050505;
    font-family: 'Creepster', cursive;
    color: #ff6600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease;
    padding: 1rem;
    position: relative;
}

/* Pantalla de Inicio / Bypass de Autoplay */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
    padding: 1rem;
}

#start-btn {
    font-family: 'Creepster', cursive;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    padding: 15px 45px;
    background: #111;
    color: #ffea00;
    border: 3px solid #ff6600;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 0 25px #ff6600, inset 0 0 12px #ff6600;
    transition: all 0.3s ease;
    max-width: 90vw;
    text-align: center;
}

#start-btn:hover {
    background: #ff6600;
    color: #050505;
    box-shadow: 0 0 40px #ff6600, 0 0 70px #ffea00;
    transform: scale(1.05);
}

/* Efectos de Noche (Niebla semitransparente desplazándose y partículas flotantes) */
.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: transparent url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="f"><feTurbulence type="fractalNoise" baseFrequency="0.015" numOctaves="3"/></filter><rect width="100%" height="100%" filter="url(%23f)" opacity="0.12"/></svg>') repeat;
    animation: drift 50s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.particles-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    background: #ffea00;
    border-radius: 50%;
    opacity: 0.6;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    50% { opacity: 0.8; }
    100% { transform: translateY(-10vh) scale(1.3); opacity: 0; }
}

/* Interfaz Principal Centrada */
#ui-layer {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Título Principal (Creepster con Resplandor Neón Responsive) */
#main-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: #ffea00;
    text-shadow: 0 0 15px #ff6600, 0 0 30px #ff6600, 0 0 50px #7a0000;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    padding: 0 1rem;
}

/* Componente Calabaza usando calabaza.png con iluminación en ojos y alrededor */
.pumpkin-wrapper {
    position: relative;
    z-index: 5;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pumpkin-image-container {
    position: relative;
    width: clamp(220px, 45vmin, 320px);
    height: clamp(220px, 45vmin, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pumpkin-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: pumpkinGlow 0.18s infinite alternate;
}

/* Aura e iluminación radiante alrededor y en los ojos/boca de calabaza.png */
.pumpkin-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.65) 0%, rgba(255, 234, 0, 0.35) 40%, transparent 75%);
    mix-blend-mode: screen;
    animation: auraPulse 0.36s infinite alternate;
    pointer-events: none;
    z-index: -1;
}

@keyframes pumpkinGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(122, 0, 0, 0.9)) drop-shadow(0 15px 25px rgba(0,0,0,0.9)) brightness(0.95);
    }
    100% {
        filter: drop-shadow(0 0 30px #ff6600) drop-shadow(0 0 60px #ffea00) drop-shadow(0 15px 25px rgba(0,0,0,0.9)) brightness(1.15);
    }
}

@keyframes auraPulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.55; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

/* Contenedor de Murciélagos (Enjambre) */
#bats-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

/* Botones de Interacción Responsive */
.btn-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.btn-group button {
    font-family: 'Creepster', cursive;
    font-size: clamp(1.3rem, 4vw, 2rem);
    padding: 10px 30px;
    background: #0f0518;
    color: #ff6600;
    border: 2px solid #ff6600;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.4);
    transition: all 0.3s ease;
}

.btn-group button:hover {
    background: #ff6600;
    color: #050505;
    box-shadow: 0 0 30px #ff6600, 0 0 50px #ffea00;
    transform: translateY(-3px);
}

/* Media Queries para Pantallas Pequeñas (Móviles) */
@media (max-width: 600px) {
    .btn-group {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .btn-group button {
        width: 75%;
        max-width: 220px;
        padding: 8px 20px;
    }
}

/* Estado de Tensión (Rojo Sangre #7a0000) y Jumpscare */
.tension-bg {
    background: linear-gradient(rgba(122, 0, 0, 0.85), rgba(5, 5, 5, 0.9)), url('fondoHalloween.jpeg') center/cover no-repeat !important;
}

.shake {
    animation: shakeAnim 0.12s infinite;
}

@keyframes shakeAnim {
    0% { transform: translate(4px, 4px) rotate(0deg); }
    25% { transform: translate(-4px, -3px) rotate(-1deg); }
    50% { transform: translate(-3px, 4px) rotate(1deg); }
    75% { transform: translate(3px, -3px) rotate(0deg); }
    100% { transform: translate(3px, 4px) rotate(-1deg); }
}

.jumpscare-pumpkin {
    transform: scale(10) translateY(10px) !important;
    transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 200;
}

/* Video de Jumpscare */
#jumpscare-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 9999;
    display: none;
    background: #000;
}

/* Canvas para Explosión y Lluvia de Dulces (60 FPS en Móviles y Escritorio) */
#candy-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 4;
}

/* Estilos para Dulce Recompensa (Temática Halloween Definida) */
.sweet-reward-title {
    color: #ffea00 !important;
    text-shadow: 0 0 10px #ff6600, 0 0 25px #ff6600, 0 0 40px #7a0000, 2px 2px 0px #000 !important;
    animation: spookyPulse 0.8s infinite alternate;
}

@keyframes spookyPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.04); filter: brightness(1.15); }
}

.warning-title {
    color: #ff3b3b !important;
    text-shadow: 0 0 15px #ff0000, 0 0 30px #7a0000, 2px 2px 0px #000 !important;
    animation: shakeAnim 0.15s infinite;
}

#btn-regresar {
    font-family: 'Creepster', cursive;
    font-size: clamp(1.3rem, 4vw, 2rem);
    padding: 10px 30px;
    background: #0f0518;
    color: #ffea00;
    border: 3px solid #ff6600;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 20px #ff6600, inset 0 0 10px #ff6600;
    transition: all 0.3s ease;
    margin-top: 20px;
    z-index: 200;
}

#btn-regresar:hover {
    background: #ff6600;
    color: #050505;
    box-shadow: 0 0 35px #ff6600, 0 0 60px #ffea00;
    transform: scale(1.05);
}

@keyframes fall {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}
