
.deco{
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  pointer-events: none;
}

.deco_a{
 z-index: 3;
    min-width: 2300px; 
    mix-blend-mode: lighten; 
    z-index: 3;
    opacity: 0.6;
    filter: blur(2px);
    filter: drop-shadow(0 0 25px rgb(24, 143, 255))   
}


.codex-icon {
    position: absolute;
    top: 72%; 
    left: 50%;
    transform: translate(-50%, -50%); 
    z-index: 3; 
    width: 160px; 
    
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0));
    transition: filter 0.3s ease-in-out; 
}

.codex-title {
    position: absolute;
    bottom: 180px; 
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
     pointer-events: none;
  
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 4;
}


.codex-icon-container:hover {
    cursor: pointer;
    opacity: 1;
}

.open-button{
    opacity:0;
    z-index: 10;
    display:none;
    left: 50%;
    transform: translateX(-50%);
}


.codex-icon-container:hover .codex-title {
    opacity: 1;
}


.codex-icon-container:hover .codex-icon {
    filter: drop-shadow(0 0 5px #ffdcbb) drop-shadow(0 0 15px #ffdcbb) drop-shadow(0 0 45px #ffdcbb) drop-shadow(0 0 160px #ffbd24); /* Resplandor al pasar el ratón */
}


.codex-spark {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: lighten;

    animation: sparkle-fade 1.5s ease-out forwards;
}


@keyframes sparkle-fade {
    0% {
        opacity: 0;
        transform: translate(0, 0);
    }
    50% {
        opacity: 1; 
        
    }
    100% {
        opacity: 0; 
        transform: translate(var(--dest-x), var(--dest-y)) scale(0.5);
    }
}


/*creator book*/

.creator-icon {
    position: absolute;
    top: 62%; 
    left: calc(50% + 160px);
    z-index: 3; 
    width: 150px;
   
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0)); 
    transition: filter 0.3s ease-in-out; 
}

.creator-title {
    position: absolute;
    bottom: 215px; 
    left: calc(50% + 80px);
    width: 300px; 
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 4;
    pointer-events: none;
}


.creator-icon-container:hover {
    cursor: pointer;
    opacity: 1;
}


.creator-icon-container:hover .creator-title {
    opacity: 1;
}


.creator-icon-container:hover .creator-icon {
    filter: drop-shadow(0 0 5px #3284ff) drop-shadow(0 0 15px #1d78ff) drop-shadow(0 0 45px #6ea8ff) drop-shadow(0 0 160px #387dff); /* Resplandor al pasar el ratón */
}


.creator-spark {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: multiply;

    animation: sparkle-fade 1.2s ease-out forwards;
}




/*history book*/

.history-icon {
    position: absolute;
    top: 62%; 
    left: calc(50% - 330px);
    z-index: 3;
    width: 160px; 

    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0)); 
    transition: filter 0.3s ease-in-out; 
}

.history-title {
    position: absolute;
    bottom: 215px; 
    left: calc(50% - 390px);
    width: 300px; 
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 4;
     pointer-events: none;
}


.history-icon-container:hover {
    cursor: pointer;
    opacity: 1;
}


.history-icon-container:hover .history-title {
    opacity: 1;
}

.history-icon-container:hover .history-icon {
    filter: drop-shadow(0 0 5px #a353ff) drop-shadow(0 0 15px #8a24ff) drop-shadow(0 0 45px #5c16ff) drop-shadow(0 0 160px #8426ff); /* Resplandor al pasar el ratón */
}


.history-spark {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode:screen;
  
    animation: sparkle-fade 1.5s ease-out forwards;
}

/*popup*/

.codex-popup {
    position: fixed;
    top: 5%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1000; 
    padding:100px;
    opacity: 0;
    transition: opacity 0.5s ease-in-out; 
}


.codex-popup-content {
    position: relative;
    max-width: 1440px; 
    width: 90%;
}


.popup-background {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 45px #ffdcbb) drop-shadow(0 0 80px #ffbd24); 
}


.close-btn {
    position: absolute;
    top: 46%; /* Ajusta la posición vertical */
    right: 3.55%; /* Ajusta la posición horizontal */
    width: 80px; /* Tamaño de la cruz */
    cursor: pointer;
    font-size: 45px;
    background-color: rgba(0, 0, 0, 0.438);
    padding-top: 12px;;
    font-weight: bold;
    border-radius: 100%;
    z-index: 4; /* Asegura que esté por encima del fondo del popup */
    transition: transform 0.2s ease-in-out;
    
}

/* Efecto al pasar el mouse por el botón de cerrar */
.close-btn:hover {
    transform: scale(1.1);
}

/* Clase para mostrar el popup con el fade-in */
.is-visible {
    display: flex;
    opacity: 1;
}



/* Contenedor de la grilla de scrolls */
.scroll-grid-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 75%;
    height: 70%;
    
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0rem;
    
    justify-items: center;
    align-items: center;
}

/* Contenedor de cada item de la grilla */
.scroll-item{
    position: relative; /* Clave para posicionar el texto con `absolute` */
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    
}

.scroll-item2{
    position: relative; /* Clave para posicionar el texto con `absolute` */
    cursor: pointer;
    text-align: center;
    transition: transform 0.3s ease-in-out;
    
}



/* Imagen del gráfico */
.scroll-graphic {
    max-width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); /* Sombra inicial transparente */
    transition: filter 0.3s ease-in-out;
}

/* Contenedor del Título y Subtítulo */
.scroll-text {
    position: absolute;
    bottom: -100px; /* Posición del texto debajo del sello */
    left: 50%;
    transform: translateX(-50%);
 /* Evita que el texto salte de línea */
    opacity: 0;
    color:#fcfcfc;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
    width: 100%;
    line-height:25px;
     filter:  drop-shadow(0 0 3px #221405);
}

.scroll-title{
    font-weight: bold;
    font-size: 20px;
}

/* Efectos al pasar el mouse */
.scroll-item:hover .scroll-graphic {
    /* Resplandor (glow) al pasar el mouse */
    filter: drop-shadow(0 0 10px #ffefcd) drop-shadow(0 0 20px #ffe1a8);
}

.scroll-item2:hover .scroll-graphic {
    /* Resplandor (glow) al pasar el mouse */
    filter: drop-shadow(0 0 10px #2873ff) drop-shadow(0 0 20px #329cff);
}

.scroll-item:hover .scroll-text {
    /* El texto aparece */
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.scroll-item2:hover .scroll-text {
    /* El texto aparece */
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

@media (max-width: 1023px) {

    .codex-icon {
        position: absolute;
        top: 62%; /* Ajusta este valor para subir o bajar el ícono */
        width:180px;
    }

    .creator-icon {
    position: absolute;
    top: 55.5%; /* Ajusta este valor para subir o bajar el ícono */
    width: 160px; /* Ajusta el tamaño del ícono si es necesario */
    left: calc(50% + 140px);
    }

    .history-icon {

    top: 55.5%; /* Ajusta este valor para subir o bajar el ícono */
    left: calc(50% - 300px);

    }

    .codex-title {
        top: Calc(63% + 150px);
        left: Calc(50%);
        width: 90%; /* Ajusta el ancho para que se vea bien */
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

        .creator-title {
        top: Calc(63% + 150px);
        left: 50%;
         transform: translateX(-50%);
        width: 90%; /* Ajusta el ancho para que se vea bien */
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

        .history-title {
        top: Calc(63% + 150px);
        left: 50%;
         transform: translateX(-50%);
        width: 90%; /* Ajusta el ancho para que se vea bien */
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    

    .open-button{
    width:60%;
    justify-content: center;
    position:absolute;
    top:20%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    }

    .codex-icon-container:hover .open-button {
    display:flex;
    opacity: 1;
    }

    /* --- AJUSTES CRÍTICOS DEL POPUP CODEX --- */

    .codex-popup {
        /* Aseguramos que el popup se centre en la pantalla */
        align-items: center; 
    }

    .codex-popup-content {
        position: relative;
        /* Limitar el ancho y alto en móvil */
        width: 90vw !important;
        max-width: 100%; /* Tamaño razonable para móvil */
        height: 90vh !important; /* Ahora el alto se basa en la altura del viewport */
        /* Eliminamos min-width: 200% y otros ajustes que rompen el layout */
        
    }

    /* La imagen de fondo del pergamino */
    .popup-background {
      
        position:absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 250% !important;
        height: auto;
        margin:auto;
    }
    

    .scroll-grid-container {


        
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Centrado vertical y horizontal */
        width: 100%; /* Ancho dentro del pergamino */
        height:100% ; /* Altura máxima para el scroll */
        

        overflow-y: scroll; 
        

        grid-template-columns: 1fr !important;
        grid-template-rows: auto; /* Dejar que las filas se ajusten automáticamente */
        gap: 2rem; /* Espacio vertical entre sellos */
        
        /* Asegura que el contenido quede arriba del gradiente */
        padding: 20vh 0; 
        
        /* Para el gradiente (ver punto 2) */
        position: relative;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
        mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    }


    .scroll-item {

        transform: none !important;
        width: 90%;
        height: auto;

        .scroll-text {
            bottom: -5px; 
            left: 50%;
            transform: translateX(-50%);
            white-space: wrap; 
            width: auto;
        }
    }
    
    .scroll-item:hover .scroll-text {
        opacity: 1;
        visibility: visible;
        
        z-index: 10; 
    }

    .close-btn {
    position: absolute;
    top: 70%; 
    right: 1%; 
    width: 140px;
    height:140px;
    cursor: pointer;
    font-size: 70px;
    background-color: rgba(0, 0, 0, 0.438);
    padding-top: 23px;;
    font-weight: bold;
    border-radius: 100%;
    z-index: 4; /* Asegura que esté por encima del fondo del popup */
    transition: transform 0.2s ease-in-out;
    
    }

    .scroll-text {
    position: relative;
    top:10px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap; /* Evita que el texto salte de línea */
    opacity: 1;
    visibility: visible;
    color:#fcfcfc;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
    width: 100%;
    line-height:55px;
    }

    .scroll-title{
    font-weight: bold;
    font-size: 60px;
    }
    .scroll-subtitle{
    font-weight: bold;
    font-size: 45px;
    }

}

