/* CSS para la Caverna Interactiva */

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #05030a;
    font-family: 'Inter', sans-serif;
}

.cave-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* El letrero flotante brillante sobre el viewport, no sobre la imagen */
.floating-sign {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: min(5vw, 60px);
    color: #fff;
    text-shadow: 0 0 10px #d4af37, 0 0 20px #d4af37, 0 0 40px #8e62d4;
    animation: float 4s ease-in-out infinite;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    letter-spacing: 0.2em;
    white-space: nowrap;
}

@keyframes float {
    0% { transform: translate(-50%, 0px); }
    50% { transform: translate(-50%, -15px); }
    100% { transform: translate(-50%, 0px); }
}

.back-home-btn {
    position: fixed;
    top: 25px;
    left: 30px;
    padding: 12px 25px;
    background: rgba(22, 14, 38, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #d4af37;
    text-decoration: none;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    letter-spacing: 1px;
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.back-home-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
    color: #fff;
}

/* Contenedor que mantiene las proporciones de la imagen generada (asumimos 1:1 o la proporción de DALL-E) 
   Para asegurarnos de que cubra la pantalla, usaremos max() */
.image-container {
    position: relative;
    width: max(100vw, 100vh);
    height: max(100vw, 100vh);
    flex-shrink: 0;
}

.cave-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none; 
}

/* Áreas de las Puertas (Coordenadas calibradas) */
.cave-door {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.door-label {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 15px #000, 0 0 30px #d4af37;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background: rgba(0,0,0,0.4);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #d4af37;
}

.cave-door:hover {
    /* Efecto de iluminación mágica interior */
    box-shadow: inset 0 0 60px rgba(212, 175, 55, 0.9), 0 0 50px rgba(212, 175, 55, 0.6);
    background: rgba(255, 215, 0, 0.2);
    backdrop-filter: brightness(1.3);
}

.cave-door:hover .door-label {
    opacity: 1;
}

/* Puerta 1: Tarot (Arco Gótico Izquierdo) */
.door-tarot {
    left: 6%;
    top: 32%;
    width: 25%;
    height: 48%;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
}

/* Puerta 2: Runas (Puerta Rectangular de Madera Centro) */
.door-runes {
    left: 39%;
    top: 39%;
    width: 25%;
    height: 45%;
    border-radius: 5px;
}

/* Puerta 3: Numerología (Puerta Dorada Derecha) */
.door-numerology {
    left: 73%;
    top: 33%;
    width: 25%;
    height: 50%;
    border-radius: 50% 50% 0 0 / 20% 20% 0 0;
}

/* ========================================= */
/* Ajustes para Móvil (Responsive)           */
/* ========================================= */
@media (max-width: 768px) {
    .image-container {
        /* En pantallas verticales, obligamos a que el portal encaje en el ancho,
           para que las 3 puertas sean visibles sin quedar fuera de la pantalla. */
        width: 100vw;
        height: 100vw;
    }
    
    .floating-sign {
        font-size: 8vw; /* Escala dinámicamente con el ancho de la pantalla */
        top: 12%; /* Bajar un poco para no chocar con el botón volver */
        letter-spacing: 0.1em; /* Reducir el espaciado para que ocupe menos */
        white-space: normal; /* Permitir que salte de línea si es necesario */
        width: 90vw; /* Asegurar que nunca se salga de la pantalla */
        line-height: 1.2;
    }
    
    .door-label {
        font-size: 1rem;
        padding: 5px 10px;
    }
}
