/* =========================================
   REPRODUCTOR AMBIENTAL — DEMONIOS CAÍDOS
========================================= */

#music-player {
    position: relative;
    z-index: 10000;
}

.reproductor_ambiente {
    --oro: #c5a66b;
    --fondo: rgba(13, 13, 15, 0.96);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    width: min(100%, 490px);
    padding: 14px 18px;

    color: #e9e3d8;
    background:
        linear-gradient(120deg,
            rgba(197, 166, 107, 0.08),
            transparent 45%),
        var(--fondo);

    border: 1px solid rgba(197, 166, 107, 0.38);
    border-radius: 4px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.35),
        inset 0 0 18px rgba(197, 166, 107, 0.025);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.reproductor_ambiente:hover {
    border-color: rgba(197, 166, 107, 0.75);

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(197, 166, 107, 0.08);
}

/* Controles de navegación entre pistas */

#music-player .ambiente_controles-pista {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

#music-player .ambiente_anterior,
#music-player .ambiente_siguiente {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 34px;
    padding: 0;

    color: #c5a66b;
    background: transparent;
    border: 0;
    border-radius: 50%;

    font-size: 12px;
    cursor: pointer;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

#music-player .ambiente_anterior:hover {
    color: #fff;
    transform: translateX(-2px);
}

#music-player .ambiente_siguiente:hover {
    color: #fff;
    transform: translateX(2px);
}

#music-player .ambiente_anterior:focus-visible,
#music-player .ambiente_siguiente:focus-visible {
    outline: 1px solid #c5a66b;
    outline-offset: 2px;
}

@media (max-width: 977px) {
    .todo_base {
        margin-top: 80px!important;
    }

}



@media (max-width: 575.98px) {
    #music-player {
        right: 10px !important;
        left: 10px;
    }

    #music-player .reproductor_ambiente {
        width: 100%;
        gap: 8px;
    }

    #music-player .ambiente_visualizador {
        display: none;
    }

    #music-player .ambiente_controles-pista {
        gap: 2px;
    }

    #music-player .ambiente_anterior,
    #music-player .ambiente_siguiente {
        width: 22px;
    }
}

.universo .imagen_saga{
    width: 100%;
    max-width: 150px;
    padding-left: 20px;
}
.universo .imagen_saga img{
    width: 100%;
}

/* IDENTIDAD */

.ambiente_identidad {
    display: flex;
    align-items: center;
    gap: 11px;

    min-width: 0;
}

.ambiente_sello {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    width: 39px;
    height: 39px;

    color: var(--oro);
    font-size: 16px;

    border: 1px solid rgba(197, 166, 107, 0.5);
    border-radius: 50%;

    box-shadow: inset 0 0 12px rgba(197, 166, 107, 0.08);
}

.ambiente_textos {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ambiente_etiqueta {
    color: var(--oro);
    font-size: 8px;
    font-weight: 700;
}

.ambiente_titulo {
    color: #f1ede6;
    font-size: 12px;
    font-weight: 600;
}

.ambiente_estado {
    color: #817c72;
    font-size: 8px;
}

/* VISUALIZADOR DE ONDAS */

.ambiente_visualizador {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;

    height: 35px;
    flex: 1;
    min-width: 28px;
}

.ambiente_visualizador span {
    display: block;
    width: 2px;
    height: 5px;

    background: var(--oro);
    opacity: 0.65;

    transform-origin: center;
    border-radius: 2px;
}

/* Solo anima cuando el audio está reproduciéndose */

#music-player.reproduciendo .ambiente_visualizador span {
    animation: ondas_ambiente 0.85s ease-in-out infinite alternate;
}

#music-player.reproduciendo .ambiente_visualizador span:nth-child(3n) {
    animation-duration: 0.6s;
}

#music-player.reproduciendo .ambiente_visualizador span:nth-child(3n + 1) {
    animation-duration: 1.1s;
}

#music-player.reproduciendo .ambiente_visualizador span:nth-child(4n + 2) {
    animation-delay: -0.4s;
}

@keyframes ondas_ambiente {
    0% {
        height: 4px;
        opacity: 0.35;
    }

    100% {
        height: 25px;
        opacity: 1;
    }
}

/* BOTÓN PLAY / PAUSA */

.ambiente_play {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    width: 39px;
    height: 39px;

    color: #15130f;
    background: var(--oro);

    border: 1px solid var(--oro);
    border-radius: 50%;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.ambiente_play i {
    font-size: 12px;
}

.ambiente_play:hover {
    transform: scale(1.08);
    background: #e0c58e;

    box-shadow: 0 0 18px rgba(197, 166, 107, 0.25);
}

.ambiente_play:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* CONTROL DE VOLUMEN */

.ambiente_volumen {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--oro);
}

.ambiente_volumen > i {
    font-size: 12px;
}

.ambiente_volumen input {
    width: 65px;
    height: 3px;

    accent-color: var(--oro);
    cursor: pointer;
}

/* ESTADO PAUSADO */

#music-player:not(.reproduciendo) .ambiente_visualizador span {
    animation: none;
    height: 3px;
    opacity: 0.35;
}

/* MÓVILES */

@media (max-width: 575.98px) {
    .reproductor_ambiente {
        gap: 10px;
        padding: 11px;
    }

    .ambiente_sello {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .ambiente_etiqueta {
        font-size: 7px;
        letter-spacing: 1px;
    }

    .ambiente_titulo {
        font-size: 11px;
    }

    .ambiente_estado {
        font-size: 7px;
    }

    .ambiente_play {
        width: 34px;
        height: 34px;
    }

    .ambiente_volumen {
        gap: 5px;
    }

    .ambiente_volumen input {
        width: 42px;
    }
}

/* ACCESIBILIDAD */

@media (prefers-reduced-motion: reduce) {
    #music-player *,
    #music-player *::before,
    #music-player *::after {
        animation: none !important;
        transition: none !important;
    }
}




/* =====================================
           CONFIGURACIÓN GENERAL
        ===================================== */

        :root {
            --negro: #08080a;
            --blanco: #e9e5e2;
            --gris: #aaa3a2;
            --rojo: #852b38;
            --transicion: cubic-bezier(.22, .68, 0, 1);
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            background: var(--negro);
            scroll-behavior: smooth;
        }

        body {
            min-height: 100vh;
            overflow-x: hidden;
            background: var(--negro);
            color: var(--blanco);
        }

        button, a {
            font: inherit;
        }

        button {
            color: inherit;
        }

        button:focus-visible,
        a:focus-visible {
            outline: 2px solid #c5a66b;
            outline-offset: 5px;
        }

        .universo {
            position: relative;
            min-height: 100svh;
            isolation: isolate;
            overflow: hidden;
        }

        /* =====================================
           PANTALLAS Y TRANSICIONES
        ===================================== */

        .pantalla {
            position: absolute;
            inset: 0;
            min-height: 100svh;
            visibility: hidden;
            opacity: 0;
            pointer-events: none;
            transform: scale(1.025);
            transition:
                opacity .65s ease,
                transform 1s var(--transicion),
                visibility .65s;
        }

        .pantalla.visible {
            position: relative;
            visibility: visible;
            opacity: 1;
            pointer-events: auto;
            transform: scale(1);
        }

        .pantalla-inicio {
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 75px 6%;
        }

        /* =====================================
           FONDO DE LA GALERÍA INICIAL
        ===================================== */

        .pantalla-inicio::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -2;

            background:
                linear-gradient(
                    90deg,
                    rgba(5,5,7,.96),
                    rgba(5,5,7,.68) 55%,
                    rgba(5,5,7,.88)
                ),
                url("https://www.demonioscaidos.editorialfurtivos.cl/imagenes/fondo.jpg")
                center / cover no-repeat;

            transform: scale(1.04);
        }

        .pantalla-inicio::after {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -1;
            pointer-events: none;

            background:
                linear-gradient(
                    0deg,
                    rgba(0,0,0,.7),
                    transparent 45%,
                    rgba(0,0,0,.3)
                );
        }

        /* =====================================
           CABECERA
        ===================================== */

        .cabecera {
            width: 100%;
            max-width: 1450px;
            margin: 0 auto 55px;
        }

        .sobrelinea {
            display: flex;
            align-items: center;
            gap: 12px;
            text-transform: uppercase;
        }
        .sobrelinea p{
            margin-top: 18px;
            font-size: 10px!important;
        }

        .sobrelinea::before {
            content: "";
            width: 30px;
            height: 1px;
            background: #c5a66b;
        }

        .cabecera h1 {
            margin-top: 22px;
            font-family: 'Volkhov', serif;
            font-weight: 400;
            font-size: clamp(27px, 4vw, 52px);
            letter-spacing: 3px;
            line-height: 1.15;
        }

        .cabecera p {
            font-size: 14px;
            color: #b2a5a5;
            letter-spacing: 1px;
            font-family: 'Quicksand', sans-serif;
            font-weight: 400;
        }

        /* =====================================
           TRES CONCEPTOS
        ===================================== */

        .galeria {
            display: flex;
            gap: 15px;
            width: 100%;
            max-width: 1450px;
            min-height: 440px;
            margin: 0 auto;
        }

        .concepto {
            position: relative;
            flex: 1 1 0;
            min-width: 0;
            min-height: 440px;
            overflow: hidden;
            isolation: isolate;

            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-start;
            padding: 24px;

            border: 1px solid rgba(255,255,255,.13);
            background: #141215;
            text-align: left;
            cursor: pointer;

            opacity: .62;
            filter: grayscale(75%) brightness(.7);

            transition:
                flex .8s var(--transicion),
                opacity .6s ease,
                filter .6s ease,
                border-color .6s ease;
        }

        .concepto::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -2;

            background-image: var(--imagen);
            background-position: center;
            background-size: cover;

            transform: scale(1.02);
            transition: transform 1.2s var(--transicion);
        }

        .concepto::after {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -1;

            background:
                linear-gradient(
                    0deg,
                    rgba(0,0,0,.97) 0%,
                    rgba(0,0,0,.35) 52%,
                    rgba(0,0,0,.2) 100%
                );

            transition: background .5s ease;
        }

        .concepto:hover,
        .concepto:focus-visible {
            flex: 2.1 1 0;
            opacity: 1;
            filter: grayscale(0%) brightness(1);
            border-color: rgba(210,178,182,.7);
        }

        .concepto:hover::before,
        .concepto:focus-visible::before {
            transform: scale(1.1);
        }

        .concepto-numero {
            font-family: 'Quicksand', sans-serif;
            font-size: 16px;
            color: #d2bfc0;
        }

        .concepto-contenido {
            width: 100%;
        }

        .concepto-etiqueta {
            display: block;
            margin-bottom: 13px;
            color: #c2b4b4;
            font-size: 9px;
            text-transform: uppercase;
        }

        .concepto h2 {
            font-family: 'Volkhov', serif;
            font-size: clamp(24px, 3vw, 43px);
            font-weight: 400;
            line-height: 1.1;
            overflow-wrap: anywhere;
        }

        .concepto-descripcion {
            font-family: 'Quicksand', sans-serif;
            max-width: 350px;
            max-height: 0;
            margin-top: 0;
            overflow: hidden;

            color: #d0c8c8;
            font-size: 12px;

            opacity: 0;
            transform: translateY(12px);

            transition:
                max-height .6s ease,
                margin .5s ease,
                opacity .5s ease,
                transform .5s ease;
        }

        .concepto:hover .concepto-descripcion,
        .concepto:focus-visible .concepto-descripcion {
            max-height: 130px;
            margin-top: 18px;
            opacity: 1;
            transform: translateY(0);
        }

        .concepto-entrar {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            margin-top: 20px;

            color: #e6d6d6;
            font-size: 9px;
            text-transform: uppercase;
        }

        .concepto-entrar span {
            display: inline-block;
            transition: transform .4s ease;
        }

        .concepto:hover .concepto-entrar span,
        .concepto:focus-visible .concepto-entrar span {
            transform: translateX(7px);
        }

        /* Imágenes de los tres conceptos */

        .castigo {
            --imagen: url("https://www.demonioscaidos.editorialfurtivos.cl/imagenes/fondo_hitos.jpg");
        }

        .expiacion {
            --imagen: url("https://www.demonioscaidos.editorialfurtivos.cl/imagenes/preludio/montana_vhim.jpg");
        }

        .resurgir {
            --imagen: url("https://www.demonioscaidos.editorialfurtivos.cl/imagenes/preludio/aparece_aaron.jpg");
        }

        /* =====================================
           PANTALLA DE LOS TRES LIBROS
        ===================================== */

        .pantalla-libros {
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 100px 6% 65px;
            isolation: isolate;
            background: #09090b;
        }

        .fondo-libros {
            pointer-events: none;
            position: absolute;
            inset: 0;
            z-index: -2;

            background-position: center;
            background-size: cover;
            background-repeat: no-repeat;

            transform: scale(1.06);
            transition:
                background-image .4s ease,
                transform 1.2s var(--transicion);
        }

        .pantalla-libros.visible .fondo-libros {
            transform: scale(1);
        }

        .fondo-libros::after {
            content: "";
            position: absolute;
            inset: 0;

            background:
                linear-gradient(
                    90deg,
                    rgba(5,5,7,.88),
                    rgba(5,5,7,.48) 50%,
                    rgba(5,5,7,.78)
                ),
                linear-gradient(
                    0deg,
                    rgba(5,5,7,.8),
                    transparent 60%,
                    rgba(5,5,7,.45)
                );
        }

        /* Botón volver */

        .volver {
            position: absolute;
            top: 30px;
            left: 6%;
            z-index: 5;

            display: inline-flex;
            align-items: center;
            gap: 12px;

            padding: 12px 0;
            border: 0;
            background: transparent;

            color: #ded5d4;
            font-size: 10px;
            letter-spacing: 2px;
            text-transform: uppercase;
            cursor: pointer;
        }

        .volver-flecha {
            font-size: 20px;
            transition: transform .35s ease;
        }

        .volver:hover .volver-flecha {
            transform: translateX(-6px);
        }

        .libros-contenido {
            width: 100%;
            max-width: 1450px;
            margin: 0 auto;
        }

        .libros-cabecera {
            max-width: 720px;
            margin-bottom: 48px;
        }

        .libros-cabecera .sobrelinea {
            color: #c5b5b5;
        }

        .libros-cabecera h2 {
            margin-top: 20px;
            font-family: 'Volkhov', serif;
            font-size: clamp(38px, 6vw, 78px);
            font-weight: 400;
            line-height: 1.04;
        }

        .libros-cabecera p {
            max-width: 570px;
            margin-top: 20px;
            font-family: 'Quicksand', sans-serif;
            color: #c0b7b7;
            font-size: 12px;
            line-height: 1.9;
        }

        /* =====================================
           LOS TRES MÓDULOS
        ===================================== */

        .libros-galeria {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 15px;
        }

        .modulo-libro {
            position: relative;
            min-width: 0;
            min-height: 290px;
            overflow: hidden;
            isolation: isolate;

            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: flex-start;

            padding: 25px;

            border: 1px solid rgba(255,255,255,.22);
            background: rgba(7,7,9,.25);
            text-align: left;
            cursor: pointer;

            transition:
                background .5s ease,
                border-color .5s ease,
                transform .6s var(--transicion);
        }

        .modulo-libro::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -1;

            background:
                linear-gradient(
                    0deg,
                    rgba(0,0,0,.88),
                    rgba(0,0,0,.08)
                );

            opacity: .6;
            transition: opacity .5s ease;
        }

        .modulo-libro:hover,
        .modulo-libro:focus-visible,
        .modulo-libro.seleccionado {
            border-color: rgba(220,184,189,.85);
            background: rgba(22,14,19,.76);
            transform: translateY(-5px);
        }

        .modulo-libro:hover::before,
        .modulo-libro:focus-visible::before,
        .modulo-libro.seleccionado::before {
            opacity: 1;
        }

        .libro-numero {
            color: #c8b5b7;
            font-family: 'Quicksand', sans-serif;
            font-size: 14px;
        }

        .libro-info {
            width: 100%;
        }

        .libro-tipo {
            display: block;
            margin-bottom: 12px;
            font-family: 'Quicksand', sans-serif;
            color: #c6b6b6;
            font-size: 9px;
            text-transform: uppercase;
        }

        .libro-info h3 {
            font-family: 'Volkhov', serif;
            font-size: clamp(22px, 2.6vw, 35px);
            font-weight: 400;
            line-height: 1.2;
            white-space: pre-line;
        }

        .libro-descripcion {
            max-height: 0;
            margin-top: 0;
            overflow: hidden;
            font-family: 'Quicksand', sans-serif;
            color: #c8c0c0;
            font-size: 12px;

            opacity: 0;
            transform: translateY(10px);

            transition:
                max-height .55s ease,
                margin .4s ease,
                opacity .4s ease,
                transform .4s ease;
        }

        /* El texto se revela SOLO al activar el módulo */

        .modulo-libro:hover .libro-descripcion,
        .modulo-libro:focus-visible .libro-descripcion,
        .modulo-libro.seleccionado .libro-descripcion {
            max-height: 150px;
            margin-top: 15px;
            opacity: 1;
            transform: translateY(0);
        }

        .libro-accion {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 24px;

            color: #e6d8d9;
            font-size: 9px;
            text-transform: uppercase;
            font-family: 'Quicksand', sans-serif;
        }

        .libro-accion span {
            transition: transform .35s ease;
        }

        .modulo-libro:hover .libro-accion span,
        .modulo-libro.seleccionado .libro-accion span {
            transform: translateX(6px);
        }

        /* =====================================
           RESPONSIVE: TABLETS
        ===================================== */

        @media (max-width: 900px) {
            .pantalla-inicio {
                padding: 65px 4%;
            }

            .galeria {
                min-height: 380px;
                gap: 10px;
            }

            .concepto {
                min-height: 380px;
                padding: 17px;
            }

            .concepto:hover,
            .concepto:focus-visible {
                flex: 1.6 1 0;
            }

            .pantalla-libros {
                padding: 100px 4% 45px;
            }

            .libros-galeria {
                gap: 10px;
            }

            .modulo-libro {
                min-height: 260px;
                padding: 17px;
            }
        }

        /* =====================================
           RESPONSIVE: MÓVILES
        ===================================== */

        @media (max-width: 600px) {
            .pantalla-inicio {
                padding: 70px 20px 35px;
            }

            .cabecera {
                margin-bottom: 30px;
            }

            .sobrelinea {
                font-size: 8px;
                letter-spacing: 2px;
            }

            .cabecera h1 {
                font-size: 30px;
                letter-spacing: 1px;
            }

            .cabecera p {
                font-size: 11px;
            }

            .galeria {
                display: flex;
                flex-direction: column;
                gap: 12px;
                min-height: 0;
            }

            .concepto,
            .concepto:hover,
            .concepto:focus-visible {
                flex: none;
                width: 100%;
                min-height: 135px;
                padding: 17px;

                opacity: 1;
                filter: none;
            }

            .concepto::before {
                transform: scale(1.02);
            }

            .concepto h2 {
                font-size: 27px;
            }

            .concepto-descripcion {
                display: none;
            }

            .concepto-entrar {
                margin-top: 10px;
                font-size: 8px;
            }

            .pantalla-libros {
                padding: 100px 20px 35px;
            }

            .volver {
                top: 22px;
                left: 20px;
                font-size: 9px;
            }

            .libros-cabecera {
                margin-bottom: 28px;
            }

            .libros-cabecera h2 {
                font-size: 43px;
            }

            .libros-cabecera p {
                font-size: 11px;
            }

            .libros-galeria {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .modulo-libro {
                min-height: 170px;
                padding: 19px;
                transform: none;
            }

            .modulo-libro:hover,
            .modulo-libro.seleccionado {
                transform: none;
            }

            .libro-info h3 {
                font-size: 27px;
            }

            .libro-descripcion {
                font-size: 11px;
            }
        }

        /* =====================================
           MOVIMIENTO REDUCIDO
        ===================================== */

        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                scroll-behavior: auto !important;
                transition-duration: .01ms !important;
                animation-duration: .01ms !important;
            }
        }