/*
Theme Name: Mundo Fantasia
Author: Tu Nombre
Description: Web interactiva para mi novela con intro cinematográfica.
Version: 1.1
*/

/* Eliminación de cuadros azules en móviles */
* { -webkit-tap-highlight-color: transparent; }

/* 1. RESET Y BASE */

/* 1. Estado inicial: Pantalla limpia de cine */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.home {
    height: 100vh;
    overflow-y: hidden;
    /* Bloqueo total durante la intro */
}

/* --- LA BARRA DORADA --- */
::-webkit-scrollbar {
    width: 0px;
    /* Empieza con ancho 0 (invisible y no ocupa espacio) */
    transition: width 1.5s ease;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #e5ac44;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(229, 172, 68, 0.3);
}

/* --- ACTIVACIÓN FINAL --- */
body.scroll-ready {
    height: auto !important;
    /* Devuelve la altura para que haya scroll */
    overflow-y: auto !important;
    /* Permite el movimiento */
}

/* Cuando el scroll está listo, la barra "crece" a sus 8px */
body.scroll-ready::-webkit-scrollbar {
    width: 8px;
}

body.home {
    overflow: hidden;
    height: 100vh;
    /* Importante: No pongas pointer-events: none aquí */
}

/* --- ACCESO COMUNIDAD (Vínculo de Alma) --- */
.acceso-comunidad {
    position: absolute; /* Cambiado de fixed a absolute para que no siga al usuario */
    top: 25px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    pointer-events: auto;

    /* Estado inicial para la animación (oculto durante la intro) */
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

/* Activación con el intro */
.acceso-comunidad.reveal-auth {
    opacity: 1;
    transform: translateY(0);
}

.link-comunidad {
    font-family: 'Cinzel', serif;
    color: #e5ac44;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 3px; /* Más espaciado estilo botón */
    border: 1px solid #e5ac44; /* Dorado sólido */
    padding: 10px 22px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    transition: all 0.4s ease;
    border-radius: 0; /* Sin redondeo para estilo sketch/box */
}

.link-comunidad:hover {
    background: rgba(229, 172, 68, 0.15);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(229, 172, 68, 0.2);
}

.user-name {
    font-family: 'Cinzel', serif;
    color: #e5ac44;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-right: 2px;
}

/* 2. OVERLAY Y SOMBRERO */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    /* Esto asegura que el click SIEMPRE funcione */
    pointer-events: all;
}

#sombrero {
    width: clamp(150px, 40vw, 250px); /* Escalado del sombrero */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(229, 172, 68, 0.5));
    animation: respirar 4s ease-in-out infinite;
}

#todo-el-contenido {
    width: 100%;
    overflow-x: hidden;
}

@keyframes respirar {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(229, 172, 68, 0.5));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 35px rgba(229, 172, 68, 0.9));
    }
}

.sombrero-volando {
    animation: salidaDirecta 1.2s forwards cubic-bezier(0.6, -0.28, 0.735, 0.045) !important;
    pointer-events: none;
}

@keyframes salidaDirecta {
    20% {
        transform: scale(1.1) translate(40px, 30px) rotate(20deg);
    }

    100% {
        transform: scale(0.4) translate(-150vw, -200px) rotate(-180deg);
        filter: blur(10px);
    }
}

/* 3. HERO SECTION (ILUSTRACIÓN) */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1.5s ease;
    /* ESTO EVITA QUE EL ZOOM DEL MUNDO-BG GENERE SCROLL */
    overflow: hidden;
}

.mundo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../images/conil1.78c24c64958e.png");
    background-size: cover;
    background-position: center;
    z-index: 1;
    transition: filter 2.5s ease, transform 2.5s ease;
}

/* 4. CONTENIDO SECUENCIAL (CARTA) */
.hero-content {
    position: relative;
    max-width: 850px;
    text-align: center;
    z-index: 10;
    padding: 20px;
}

.libro-logo {
    width: 100%;
    max-width: 600px;
    margin-bottom: 10px;
}

.divider-gold {
    width: 80px;
    height: 1px;
    background-color: #e5ac44;
    margin: 30px auto;
    box-shadow: 0 0 8px rgba(229, 172, 68, 0.5);
}

.dialogo-cita {
    color: #f3f0df;
    font-family: 'Lora', serif;
    font-size: clamp(1rem, 0.8rem + 1vw, 1.35rem); /* Cita fluida */
    line-height: 1.8;
    font-style: italic;
    font-weight: 300;
    margin: 0 auto 40px auto;
}

/* Estilo para el nombre del narrador */
.autor-cita {
    display: block;
    /* Fuerza el salto de línea si el <br> no fuera suficiente */
    margin-top: 15px;
    /* Separación con la frase */
    font-size: 0.95rem;
    /* Más pequeño que la cita */
    font-family: 'Cinzel', serif;
    /* Usamos la fuente del botón para el nombre */
    color: #e5ac44;
    /* Dorado Shofu */
    text-transform: uppercase;
    letter-spacing: 2px;
    font-style: normal;
    /* El nombre no va en cursiva, para que contraste */
    opacity: 0.8;
}

.btn-leer {
    display: inline-block;
    padding: 15px 45px;
    border: 1px solid #e5ac44;
    color: #e5ac44;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Cinzel', serif;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.4s ease, transform 0.3s ease;
}

.btn-leer:hover {
    background: rgba(229, 172, 68, 0.15);
    transform: scale(1.05);
}

/* 5. ESTADOS DE ANIMACIÓN (CONTROLADOS POR JS) */

/* Aparece la sección entera */
.hero-visible {
    opacity: 1 !important;
}

/* El fondo se desenfoca */
.blur-bg {
    filter: blur(8px) brightness(0.4) !important;
    transform: scale(1.1);
}

/* Preparación para la cascada de la carta */
.libro-logo,
.divider-gold,
.dialogo-cita,
.btn-leer {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

/* Activación de la cascada con delays */
.logo-reveal .libro-logo {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.logo-reveal .divider-gold {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.0s;
}

.logo-reveal .dialogo-cita {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.8s;
}

.logo-reveal .btn-leer {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 2.6s;
}

/* --- SKIP ANIMATIONS (FAST FORWARD) --- */
.fast-forward .libro-logo,
.fast-forward .divider-gold,
.fast-forward .dialogo-cita,
.fast-forward .btn-leer,
.fast-forward .acceso-comunidad {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0s !important;
}

.fast-forward #intro-overlay {
    display: none !important;
}

.fast-forward .hero-section {
    opacity: 1 !important;
}

.fast-forward .mundo-bg {
    filter: blur(8px) brightness(0.4) !important;
    transform: scale(1.1) !important;
}

/* --- REVELADO INSTANTÁNEO POR SCRIPT DE CABECERA --- */
.skip-intro-immediate {
    scroll-behavior: auto !important;
}
.skip-intro-immediate #intro-overlay,
.skip-intro-immediate #sombrero {
    display: none !important;
}
.skip-intro-immediate .acceso-comunidad {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}
.skip-intro-immediate .hero-section {
    opacity: 1 !important;
}

/* 6. OTROS ELEMENTOS Y SCROLL REVEAL */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.header-principal {
    background: #000;
    padding: 20px 0;
    border-bottom: 2px solid #e5ac44;
    position: relative;
    z-index: 100;
}

.seccion-manifiesto {
    min-height: 80vh;
    /* Ocupa casi toda la pantalla */
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #0a0a0a;
    /* Fondo casi negro para que no haya contraste blanco */
    background: radial-gradient(circle, #1a1a1a 0%, #050505 100%);
    /* Gradiente sutil */
    padding: 150px 20px;
    position: relative;
    overflow: hidden;
}

/* Resplandor ámbar muy sutil detrás del texto */
.foco-luz {
    position: absolute;
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 163, 115, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
}

.manifiesto-contenido {
    max-width: 900px;
    /* Ancho cómodo para lectura */
    width: 100%;
    text-align: center;
    z-index: 2;
}

.titulo-etereo {
    font-family: 'Cinzel', serif;
    /* O una fuente elegante que tengas */
    color: #d4a373;
    /* Bronce/Dorado Shofu */
    font-size: 1.8rem;
    letter-spacing: 0.6rem;
    text-transform: uppercase;
    margin-bottom: 60px;
    opacity: 0.8;
}

/* Estado inicial: Invisible y borroso */
.texto-niebla {
    font-size: clamp(1rem, 0.8rem + 1.5vw, 1.8rem); /* Aún más conservador para móviles densos */
    line-height: 1.6;
    color: #e0e0e0;
    font-weight: 300;
    font-style: italic;
    font-family: 'Merriweather', serif;

    opacity: 0;
    filter: blur(12px);
    transform: translateY(20px);
    transition: all 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado final: Lo que el JS debe activar */
.texto-niebla.revelado {
    opacity: 1;
    filter: blur(0px);
    transform: translateY(0px);
}

.letra-capitular {
    font-size: 6rem;
    color: #d4a373;
    float: left;
    line-height: 0.7;
    margin-right: 20px;
    margin-top: 10px;
    font-family: 'Cinzel', serif;
    font-style: normal;
    text-shadow: 0 0 20px rgba(212, 163, 115, 0.4);
}

.separador-místico {
    display: block;
    /* Fuerza el salto de línea */
    margin: 40px auto;
    /* Espacio arriba y abajo */
    color: #d4a373;
    /* El mismo dorado/bronce de la capitular */
    font-size: 1.4rem;
    font-style: normal;
    /* Para que no sea itálica como el resto del texto */
    opacity: 0.6;
    text-shadow: 0 0 10px rgba(212, 163, 115, 0.5);
    position: relative;
}

/* Opcional: añade unas líneas finas a los lados del símbolo */
.separador-místico::before,
.separador-místico::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4a373, transparent);
}

.separador-místico::before {
    left: -40px;
}

.separador-místico::after {
    right: -40px;
}

/* --- HEADER INTERACTIVO --- */
.header-interactivo {
    position: relative;
    width: 100%;
    height: 100vh;
    /* Usamos el mismo degradado del manifiesto para dar continuidad */
    background-color: #0a0a0a;
    background: radial-gradient(circle, #1a1a1a 0%, #050505 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#canvas-puntos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* BLOQUE CENTRAL DE TEXTO */
#info-nav {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 900px;
    padding: 0 40px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#nav-titulo {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 1.2rem + 3vw, 4rem); /* Refinado: escala más lento */
    color: #d4a373;
    margin-bottom: 25px;
    letter-spacing: clamp(3px, 1vw + 1px, 8px);
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(212, 163, 115, 0.4);
}

#nav-descripcion {
    font-family: 'Merriweather', serif;
    font-size: clamp(0.95rem, 0.9rem + 0.5vw, 1.6rem); /* Refinado: más pequeño en móvil */
    line-height: 1.8;
    color: #dcdcdc;
    font-style: italic;
    margin-bottom: 40px;
}

/* BOTONES INFERIORES (Estilo Antigravity Expandible) */
.selector-tabs {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.tab-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    /* Círculo inicial */
    height: 50px;
    padding: 0;
    /* Centra el glifo en el círculo */
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 163, 115, 0.1);
    color: #888;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 100px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.tab-btn .glifo {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 2px rgba(212, 163, 115, 0.2));
    transition: all 0.5s ease;
    flex-shrink: 0;
}

.tab-btn .texto-btn {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    white-space: nowrap;
    margin-left: 0;
    width: 0;
    /* El texto no ocupa espacio mientras está oculto */
    overflow: hidden;
    transition: all 0.5s ease;
}

/* --- ESTADOS EXPANDIDOS --- */
.tab-btn:hover,
.tab-btn.active {
    width: 170px;
    /* Ancho suficiente para Historia / Mapa / Wiki */
    justify-content: center;
    gap: 12px;
}

.tab-btn:hover .texto-btn,
.tab-btn.active .texto-btn {
    opacity: 1;
    width: auto;
    transform: translateX(0);
}

/* --- ESTADO ACTIVO --- */
.tab-btn.active {
    background: rgba(212, 163, 115, 0.1);
    color: #d4a373;
    border: 1.5px solid #d4a373;
    box-shadow: 0 0 15px rgba(212, 163, 115, 0.15);
}

.tab-btn.active .glifo {
    filter: drop-shadow(0 0 8px rgba(212, 163, 115, 0.6));
    transform: scale(1.1);
}

/* Hover para los no activos */
.tab-btn:hover:not(.active) {
    color: #eee;
    border-color: rgba(212, 163, 115, 0.4);
}

/* Glifos */
.tab-btn .glifo-historia {
    background-image: url("../images/glifo_pluma.9140cae0af0b.png");
}

.tab-btn .glifo-mapa {
    background-image: url("../images/glifo_mapa.25d7587cf663.png");
}

.tab-btn .glifo-wiki {
    background-image: url("../images/glifo_ojo.820a0bec2216.png");
}

/* BOTÓN DE ACCIÓN CENTRAL */
.boton-mistico {
    display: inline-block;
    /* Importante para que el transform funcione */
    font-size: 1.1rem;
    padding: 15px 45px;
    border: 2px solid #d4a373;
    background: transparent;
    color: #d4a373;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    /* Para que sea redondeado como en la imagen */
    transition: all 0.3s ease;
}

.boton-mistico:hover {
    background: #d4a373;
    color: #050505;
    box-shadow: 0 0 30px rgba(212, 163, 115, 0.4);
    transform: translateY(-3px);
}

.foco-luz-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    /* Un color ámbar muy, muy suave para dar profundidad */
    background: radial-gradient(circle, rgba(212, 163, 115, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    /* Por detrás del canvas y el texto */
    pointer-events: none;
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    right: 50px;
    width: 20px;
    height: 60px;
    z-index: 20;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.logo-reveal ~ .scroll-indicator {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 3.2s; /* Aparece después del último botón */
}

.flecha-vela {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 45px;
    background: #e5ac44;
    box-shadow: 0 0 8px rgba(229, 172, 68, 0.6);
    animation: parpadeoVela 2s infinite ease-in-out;
}

.flecha-vela::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #e5ac44;
    border-right: 2px solid #e5ac44;
}

@keyframes parpadeoVela {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 0 2px rgba(229, 172, 68, 0.2);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(8px);
        box-shadow: 0 0 15px rgba(229, 172, 68, 0.9);
    }
}

/* --- NEWSLETTER WIDGET --- */
.newsletter-widget {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 20;
}

.newsletter-icon {
    width: 45px;
    height: 45px;
    background-image: url("../images/glifo_sobre.49975a345e7a.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 5px rgba(212, 163, 115, 0.3));
    flex-shrink: 0;
}

.newsletter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Oculto por defecto */
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

/* Estados: Hover o Fijo (Pinned) */
.newsletter-widget:hover .newsletter-icon,
.newsletter-widget.pinned .newsletter-icon {
    transform: scale(1.15);
    background-image: url("../images/glifo_sobre_abierto.8e7e687e61bf.png");
    filter: drop-shadow(0 0 12px rgba(212, 163, 115, 0.8));
}

.newsletter-widget:hover .newsletter-form,
.newsletter-widget.pinned .newsletter-form {
    max-width: 500px;
    opacity: 1;
}

.newsletter-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 163, 115, 0.4);
    color: #e0e0e0;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    width: 240px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.newsletter-input:focus {
    border-color: #d4a373;
    box-shadow: 0 0 10px rgba(212, 163, 115, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

.newsletter-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #d4a373;
    color: #d4a373;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    color: #eee;
    border-color: rgba(212, 163, 115, 0.4);
}

/* Glifos */
.tab-btn .glifo-historia {
    background-image: url("../images/glifo_pluma.9140cae0af0b.png");
}

.tab-btn .glifo-mapa {
    background-image: url("../images/glifo_mapa.25d7587cf663.png");
}

.tab-btn .glifo-wiki {
    background-image: url("../images/glifo_ojo.820a0bec2216.png");
}

/* BOTÓN DE ACCIÓN CENTRAL */
.boton-mistico {
    display: inline-block;
    /* Importante para que el transform funcione */
    font-size: 1.1rem;
    padding: 15px 45px;
    border: 2px solid #d4a373;
    background: rgba(10, 10, 10, 0.45); /* Fondo translúcido para legibilidad */
    backdrop-filter: blur(8px); /* Efecto cristal premium */
    color: #d4a373;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    /* Para que sea redondeado como en la imagen */
    transition: all 0.3s ease;
}

.boton-mistico:hover {
    background: #d4a373;
    color: #050505;
    box-shadow: 0 0 30px rgba(212, 163, 115, 0.4);
    transform: translateY(-3px);
}

.foco-luz-header {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    /* Un color ámbar muy, muy suave para dar profundidad */
    background: radial-gradient(circle, rgba(212, 163, 115, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 1;
    /* Por detrás del canvas y el texto */
    pointer-events: none;
}

/* --- SCROLL INDICATOR --- */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    right: 50px;
    width: 20px;
    height: 60px;
    z-index: 20;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.logo-reveal ~ .scroll-indicator {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 3.2s; /* Aparece después del último botón */
}

.flecha-vela {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 45px;
    background: #e5ac44;
    box-shadow: 0 0 8px rgba(229, 172, 68, 0.6);
    animation: parpadeoVela 2s infinite ease-in-out;
}

.flecha-vela::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    border-bottom: 2px solid #e5ac44;
    border-right: 2px solid #e5ac44;
}

@keyframes parpadeoVela {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 0 2px rgba(229, 172, 68, 0.2);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(8px);
        box-shadow: 0 0 15px rgba(229, 172, 68, 0.9);
    }
}

/* --- NEWSLETTER WIDGET --- */
.newsletter-widget {
    position: absolute;
    bottom: 40px;
    left: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 20;
}

.newsletter-icon {
    width: 45px;
    height: 45px;
    background-image: url("../images/glifo_sobre.49975a345e7a.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 5px rgba(212, 163, 115, 0.3));
    flex-shrink: 0;
    
    /* Reset de estilos de botón para que no se vea blanco en PC */
    background-color: transparent;
    border: none;
    padding: 0;
    outline: none;
}

.newsletter-form {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Oculto por defecto */
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

/* Estados: Hover o Fijo (Pinned) */
.newsletter-widget:hover .newsletter-icon,
.newsletter-widget.pinned .newsletter-icon {
    transform: scale(1.15);
    background-image: url("../images/glifo_sobre_abierto.8e7e687e61bf.png");
    filter: drop-shadow(0 0 12px rgba(212, 163, 115, 0.8));
}

.newsletter-widget:hover .newsletter-form,
.newsletter-widget.pinned .newsletter-form {
    max-width: 500px;
    opacity: 1;
}

.newsletter-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(212, 163, 115, 0.4);
    color: #e0e0e0;
    padding: 12px 15px;
    border-radius: 6px;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    width: 240px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.newsletter-input:focus {
    border-color: #d4a373;
    box-shadow: 0 0 10px rgba(212, 163, 115, 0.3);
    background: rgba(0, 0, 0, 0.8);
}

.newsletter-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #d4a373;
    color: #d4a373;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(5px);
}
.newsletter-btn:hover {
    background: #d4a373;
    color: #050505;
    box-shadow: 0 0 15px rgba(212, 163, 115, 0.5);
    transform: translateY(-2px);
}

/* --- MENSAJE MAPA VACÍO (MÓVIL) Estilo Boceto Blanco Real --- */
.mensaje-mapa-vacio {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 300px;
    background: #fff;
    border: 1px solid #000;
    padding: 30px 20px;
    text-align: center;
    z-index: 9000;
    display: none; /* Se activa por JS */
    box-shadow: 8px 8px 0px rgba(0,0,0,0.1);
    border-radius: 2px;
}

.mensaje-mapa-vacio p {
    font-family: 'Handlee', cursive;
    color: #000;
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.4;
    font-weight: bold;
}

.btn-ir-leer {
    display: inline-block;
    padding: 10px 20px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- ESTILOS DE MODAL NEWSLETTER (MÓVIL) --- */
.modal-newsletter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-newsletter.show {
    display: block !important; /* Usamos block para control manual de centering si flex falla */
    opacity: 1;
}

.modal-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #0a0a0a;
    border: 2px solid #d4a373;
    padding: 30px 20px;
    border-radius: 12px;
    width: 86% !important; /* Reducido para evitar desbordes en móviles estrechos */
    max-width: 360px;
    text-align: center;
    box-shadow: 0 0 50px rgba(212, 163, 115, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: 0 !important;
    box-sizing: border-box !important; /* Vital para que el padding no ensanche el div */
}

.modal-newsletter.show .modal-card {
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #d4a373;
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    color: #d4a373;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-header p {
    font-family: 'Lora', serif;
    color: #e0e0e0;
    opacity: 0.8;
    margin-bottom: 30px;
}

.form-modal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-modal {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 163, 115, 0.3);
    color: #fff;
    padding: 15px;
    border-radius: 6px;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-modal:focus {
    border-color: #d4a373;
}

.btn-modal {
    background: #d4a373;
    color: #111;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-modal:hover {
    background: #e5ac44;
    transform: scale(1.02);
}

.modal-feedback {
    margin-top: 15px;
    font-size: 0.9rem;
    font-family: 'Lora', serif;
    padding: 10px 14px;
    border-radius: 6px;
    min-height: 20px;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.modal-feedback:empty { display: none; }

.modal-feedback.success {
    color: #4ade80; /* Verde esmeralda vibrante */
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.modal-feedback.warning {
    color: #ffa040;
    background: rgba(255, 160, 64, 0.1);
    border: 1px solid rgba(255, 160, 64, 0.3);
}
.modal-feedback.error {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
}

/* --- SOCIAL WIDGET --- */
.social-widget {
    position: absolute;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column-reverse; /* Los enlaces emergerán hacia arriba */
    align-items: center;
    z-index: 20;
}

.social-icon-main {
    width: 60px; /* Un poco más grande para el cuervo */
    height: 60px;
    background-image: url("../images/glifo_cuervo.49388be6743b.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 5px rgba(212, 163, 115, 0.3));
    z-index: 2; /* Por encima de las redes */
}

.social-widget:hover .social-icon-main,
.social-widget.pinned .social-icon-main {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px rgba(212, 163, 115, 0.8));
}

.social-links {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    position: absolute;
    bottom: 45px; /* Se acerca al cuervo para solaparse */
    gap: 22px; /* Más separación entre iconos */
    padding-bottom: 35px; /* Puente invisible para que no se pierda el hover al hacer scroll arriba */
    pointer-events: none;
}

.social-link {
    display: block;
    width: 35px;
    height: 35px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    /* Efecto de salida y giro */
    transform: translateY(40px) rotate(-180deg) scale(0.5);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 5px rgba(212, 163, 115, 0.3));
}

.social-link.social-x { background-image: url("../images/glifo_X.9c394dd510c5.png"); }
.social-link.social-w { background-image: url("../images/glifo_W.cef81f1c6dea.png"); }
.social-link.social-i { background-image: url("../images/glifo_ink.7b16eec44e68.png"); }

/* --- NEWSLETTER POPUP (Feedback Local) --- */
.newsletter-popup {
    position: absolute;
    bottom: 60px; /* Sobre el glifo */
    left: 10px;
    background: rgba(10, 10, 10, 0.95);
    color: #f3f0df;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    border: 1px solid rgba(229, 172, 68, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    z-index: 100;
}

.newsletter-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Colores por estado */
.newsletter-popup.success {
    border-color: #4ade80;
    color: #4ade80;
}

.newsletter-popup.warning, 
.newsletter-popup.error {
    border-color: #ff5555;
    color: #ff5555;
}

/* Flechita del popup */
.newsletter-popup::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: rgba(10, 10, 10, 0.95);
    border-right: 1px solid rgba(229, 172, 68, 0.4);
    border-bottom: 1px solid rgba(229, 172, 68, 0.4);
    transform: rotate(45deg);
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.social-widget:hover .social-links,
.social-widget.pinned .social-links {
    pointer-events: auto;
}

.social-widget:hover .social-link,
.social-widget.pinned .social-link {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
}

/* Stagger delay para que salgan uno a uno */
.social-widget:hover .social-link:nth-child(1),
.social-widget.pinned .social-link:nth-child(1) { transition-delay: 0.1s; }
.social-widget:hover .social-link:nth-child(2),
.social-widget.pinned .social-link:nth-child(2) { transition-delay: 0.2s; }
.social-widget:hover .social-link:nth-child(3),
.social-widget.pinned .social-link:nth-child(3) { transition-delay: 0.3s; }

/* Efecto hover sobre los botones de redes sociales individuales */
.social-link:hover {
    transform: translateY(0) rotate(0) scale(1.2) !important;
    filter: drop-shadow(0 0 10px rgba(212, 163, 115, 0.9));
    transition: all 0.2s ease !important;
}
/* Marcador de fin de archivo */

/* --- MEDIA QUERIES (REUBICADAS AL FINAL PARA PRIORIDAD) --- */

@media (max-width: 768px) {
    .acceso-comunidad {
        position: absolute !important; /* Forzado a absolute en móvil */
        top: 15px;
        right: 15px;
    }

    /* Reducción de espacio en secciones */
    .seccion-manifiesto {
        min-height: 60vh !important;
        padding: 60px 20px !important;
    }

    .titulo-etereo {
        margin-bottom: 30px !important;
        font-size: 1.4rem !important;
    }

    .header-interactivo {
        height: 80vh !important;
    }

    /* Doble transición para efecto 'Niebla' real SOLO en móviles */
    .seccion-manifiesto::after {
        content: "";
        position: absolute;
        bottom: -1px; /* Solapamiento de 1px para evitar líneas */
        left: 0;
        width: 100%;
        height: 150px;
        background: linear-gradient(to bottom, transparent, #0a0a0a);
        pointer-events: none;
        z-index: 10;
    }

    .header-interactivo::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100px;
        background: linear-gradient(to bottom, #0a0a0a, transparent);
        pointer-events: none;
        z-index: 10;
    }

    .link-comunidad {
        font-size: 0.7rem;
        padding: 8px 15px;
        letter-spacing: 1px;
    }

    .libro-logo {
        max-width: 85%;
    }

    .boton-mistico {
        font-size: 0.9rem;
        padding: 12px 30px;
    }

    .selector-tabs {
        bottom: 110px;
        gap: 8px;
    }

    .tab-btn {
        width: 42px;
        height: 42px;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important; /* Asegurar que no haya offsets */
    }


    .tab-btn.active, .tab-btn:hover {
        width: 150px; /* Un poco más de aire para que no se sienta apretado */
        gap: 10px;
        justify-content: center !important;
        padding: 0 !important;
    }

    .tab-btn .glifo {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-top: -1px;
        flex-shrink: 0;
    }

    .tab-btn.active .glifo, .tab-btn:hover .glifo {
        margin-left: 4px; /* Solo aplicamos el margen de equilibrio cuando el botón está expandido */
    }

    .tab-btn .texto-btn {
        display: flex !important;
        align-items: center;
        line-height: normal !important;
    }

    .newsletter-widget {
        bottom: 20px;
        left: 8px;
        width: 32px;
    }

    .newsletter-icon {
        width: 32px;
        height: 32px;
        background-color: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        display: block;
        outline: none;
    }

    .newsletter-widget.pinned, .newsletter-widget:hover {
        width: 32px; /* En móvil abrimos modal, no ensanchamos aquí */
    }

    .newsletter-form {
        display: none !important; /* Desactivar expansión lateral en móvil */
    }

    .social-widget {
        bottom: 20px;
        right: 8px;
    }

    .social-icon-main {
        width: 32px !important; /* Igualado al sobre como se solicitó */
        height: 32px !important;
    }

    .social-widget:hover .social-icon-main,
    .social-widget.pinned .social-icon-main {
        transform: scale(1);
    }

    .social-links {
        bottom: 25px;
    }

    .scroll-indicator {
        bottom: 100px;
        right: 15px;
    }

    .texto-niebla {
        font-size: clamp(0.9rem, 0.75rem + 1vw, 1.5rem);
    }
}

@media (max-width: 480px) {
    .letra-capitular {
        font-size: 3.5rem;
    }

    .titulo-etereo {
        font-size: 1.2rem;
    }
}


/* --- VARIABLES DE PARTÍCULAS (Leídas por JS) --- */
:root {
    --escala-particulas: 1.3;
}

@media (max-width: 1024px) {
    :root {
        --escala-particulas: 0.7; /* Aquí puedes ajustar el tamaño para móvil desde el CSS */
    }
}

/* Eliminación definitiva de cuadros azules y cierre */
* { -webkit-tap-highlight-color: transparent; }

/* --- UTILIDADES DE PRIORIDAD MÁXIMA (Al final para sobreescribir todo) --- */
.feature-hidden {
    display: none !important;
}
