/* Archivos estilos.css */
@font-face {
    font-family: 'Dilo World';
    src: url('fonts/DiloWorld.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'CarbonaTest-Semibold';
    src: url('fonts/CarbonaTest-Bold.otf') format('opentype');
    font-weight: 600;
}

@font-face {
    font-family: 'CarbonaTest-Bold';
    src: url('fonts/CarbonaTest-Bold.otf') format('opentype');
    font-weight: bold;
}

@font-face {
    font-family: 'CarbonaTest-Black';
    src: url('fonts/CarbonaTest-Black.otf') format('opentype');
    font-weight: 900;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #ffe500;
    color: #2a0050;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}


/* Círculos decorativos */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(243, 12, 158, 0.1);
    z-index: 0;
}

body::before {
    width: 100px;
    height: 100px;
    background: #ff2b93;
    top: -20px;
    left: -50px;
    animation: moverCirculo1 8s ease-in-out infinite;
}

body::after {
    width: 60px;
    height: 60px;
    background: #ff2b93;
    bottom: 30px;
    right: 40px;
    animation: moverCirculo2 10s ease-in-out infinite;
}

@keyframes moverCirculo1 {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 20px);
    }

    100% {
        transform: translate(0, 0);
    }
}

@keyframes moverCirculo2 {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-20px, -25px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Círculos decorativos */

.pantalla {
    display: none;
    padding: 1rem 1rem;
    z-index: 1;
    position: relative;
    animation: fadeInContainer 1.2s ease forwards;
}

h1:nth-of-type(1) {
    animation-delay: 0.2s;
}

h2 {
    animation-delay: 0.5s;
}

h1:nth-of-type(2) {
    animation-delay: 0.8s;
}


/* ANIMACIÓN CAMBIO DE PAGINAS */
/* Animación individual de cada texto */
@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Efecto de "respiración" */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }
}

/* Opcional: aparición del contenedor completo */
@keyframes fadeInContainer {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ANIMACIÓN CAMBIO DE PAGINAS */

.pantalla.activa {
    display: block;
}

.ante-titulo {
    font-family: 'Dilo World', 'Comic Sans MS', sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: white;
    margin: 0 0 .25rem 0;
    font-weight: 700;
    text-transform: uppercase;
    opacity: .7;
    letter-spacing: .04em;
}

.triangulo-degradado {
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
    clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
    pointer-events: none;
    /* para que no interfiera con clicks */
}

h1,
h2 {
    font-family: 'Dilo World', 'Comic Sans MS', sans-serif;
}

h1 {
    font-size: 4.4rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    max-width: 800px;
}

h2 {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 9%;
}

.boton {
    background-color: #ff2b93;
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-family: 'Dilo World', 'Comic Sans MS', sans-serif;
    font-size: 1.7rem;
    font-weight: bold;
    border-radius: 0.7rem;
    cursor: pointer;
    margin: 1rem auto;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.11);
    transition: transform 0.2s, background-color 0.3s;
    text-transform: uppercase;
}

.boton:hover {
    transform: scale(1.05);
    background-color: #d01a6c;
}

.respuesta {
    display: inline-block;
    margin: 1rem 0.5rem;
    min-width: 160px;
}

/* PANTALLA RESULTADO */
#resultado h1 {
    font-size: 5cap;
    background-color: #ff2b93;
    color: white;
    padding: 1rem 2rem;
    display: inline-block;
    border-radius: 2rem;
    margin-bottom: 2rem;
}

#resultado {
    text-align: center;
    margin: 4rem auto;
    padding: 2rem;
}

#resultado h2 {
    font-size: 2.4rem;
    text-transform: uppercase;
    font-family: 'Dilo World', sans-serif;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.resultado-puntuacion {
    font-size: 7rem;
    font-weight: bold;
    background-color: #ff2b93;
    color: white;
    padding: 1rem 3rem;
    display: inline-block;
    border-radius: 2rem;
    font-family: 'Dilo World', sans-serif;
    margin: 1rem auto;
    animation: pulse 2s infinite ease-in-out;
}

.subtitulo-puntuacion {
    font-family: 'Dilo World', sans-serif;
    font-size: 1.6rem;
    text-transform: uppercase;
    color: #2a0050;
    margin-bottom: 1.5rem;
}

#mensajeFinal {
    font-family: "CarbonaTest-Bold", sans-serif;
    font-size: 1.3rem;
    max-width: 700px;
    margin: 1rem auto;
    color: #2a0050;
    line-height: 1.2;
}


.boton-home-fijo {
    margin-top: 7%;
    position: fixed;
    left: 50%;
    background-color: #2a0050;
    transform: translateX(-50%);
    /* Fondo blanco */
    width: 70px;
    height: 70px;
    border-radius: 10px;
    /* Redondeado como en tu imagen */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: transform 0.2s ease;
    transform-origin: center;
}

.boton-home-fijo img {
    width: 28px;
    height: 28px;
    filter: none;
    /* El icono se mostrará tal cual esté en el SVG */
    transition: transform 0.2s ease;
}

.boton-home-fijo:hover {
    transform: translateX(-50%) scale(1.2);
}

/* PANTALLA RESULTADO */

/* INSTRUCCIONES */
/* Decoración interrogante solo en pantalla de instrucciones */
.decoracion-instrucciones {
    position: absolute;
    bottom: -30px;
    right: 35px;
    width: 100px;
    height: auto;
    z-index: 1;
}

/* Estilo visual del bloque morado */
#instrucciones {
    position: relative;
    background-color: #220172;
    border-radius: 2rem;
    padding: 2rem 12rem 4rem;
    max-width: 900px;
    margin: 3rem auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
}

/* Título de instrucciones */
#instrucciones h2 {
    font-family: 'Dilo World', sans-serif;
    font-size: 2.8rem;
    text-transform: uppercase;
    color: white;
    margin-bottom: 3rem;
}

/* Lista de instrucciones */
.lista-instrucciones {
    list-style: none;
    padding: 0;
    max-width: 600px;
    font-family: 'CarbonaTest-Bold', sans-serif;
    font-size: 1.3rem;
    text-align: left;
    color: white;
}

.lista-instrucciones li {
    position: relative;
    padding-left: 3rem;
    margin: 2rem 0;
    line-height: 1.5;
    padding-bottom: 2%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.lista-instrucciones li:last-child {
    border-bottom: none;
}

.lista-instrucciones .icono {
    position: absolute;
    left: 0;
    top: 0.4rem;
    width: 1.4rem;
    height: 1.4rem;
    background-image: url('/assets/flecha.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* INSTRUCCIONES */

/* PANTALLA DATOS */
#datosPersonales {
    background-color: #220172;
    color: white;
    border-radius: 2rem;
    padding: 3rem;
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
    font-family: 'CarbonaTest-Bold', sans-serif;
}

#datosPersonales input,
#datosPersonales select {
    padding: 0.6rem;
    font-size: 1.1rem;
    border-radius: 0.5rem;
    border: none;
    margin-top: 0.5rem;
}


#formDatos label {
    font-size: 1.6rem;
    display: block;
}

/* PANTALLA DATOS */


.pantalla.pregunta {
    background-color: #220172;
    color: white;
    border-radius: 1.5rem;
    margin: 2rem auto;
    max-width: 900px;
    padding: 2rem;
}

.pregunta .contenido-pregunta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2rem;
    flex-wrap: nowrap;
    position: relative;
    margin-right: 5%;
}

.decoracion-pregunta {
    position: absolute;
    left: -90px;
    /* Ajusta este valor para que toque el borde del fondo morado */
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    /* Ajusta según el tamaño deseado */
    height: auto;
    z-index: 2;
}

.texto-pregunta {
    margin-left: 9%;
    /* para que no tape el interrogante */
    flex: 1;
    max-width: 900px;
    text-align: center;
}

.pregunta .respuestas {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    margin-top: 1rem;
}

.boton.respuesta {
    position: relative;
    border-radius: 2rem;
    /* píldora */
    padding: 1rem 2.5rem 1rem 3.5rem;
    /* espacio para el círculo blanco */
}



/* Marcar la opción seleccionada con un círculo interior */
input[type="radio"]:checked+label::before {
    box-shadow: inset 0 0 0 0.6rem #520329;
}


/* POP UP - Fondo difuminado */
.fondo-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #06012be5;
    /* Oscurece ligeramente */
    backdrop-filter: blur(8px);
    /* 💡 Desenfoque aquí */
    -webkit-backdrop-filter: blur(10px);
    /* Para Safari */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 98;
}

.fondo-popup.activo {
    opacity: 1;
    pointer-events: auto;
}

/* Modal de explicación */
.popup-explicacion {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #23017359;
    color: white;
    padding: 3rem 2rem;
    border-radius: 1.5rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 45px rgba(255, 255, 255, 0.343);
    z-index: 99;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Efecto de borde animado */
.popup-explicacion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 1.6rem;
    background: linear-gradient(135deg, transparent, white, transparent);
    background-size: 200%;
    animation: brilloBorde 8s linear infinite;
    z-index: 1;
    pointer-events: none;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    padding: 2px;
}

@keyframes brilloBorde {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.popup-explicacion.activo {
    opacity: 1;
    pointer-events: auto;
}

.popup-explicacion h3 {
    font-family: 'Dilo World', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 1%;
}

.popup-explicacion .respuesta {
    margin-bottom: 2rem;
}

.popup-explicacion p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-family: 'CarbonaTest-Bold', sans-serif;
}

.cerrar-popup {
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    margin-top: 2%;
    transition: font-size 0.3s ease;
    /* animación suave */
}

.cerrar-popup:hover {
    font-size: 3.6rem;
}

/* Estilo botones contenedor de la respuesta */
#popupRespuesta.correcto {
    margin-top: 8%;
    background-color: #19d266;
    color: white;
    border-radius: 2rem;
    padding: 1rem 2rem;
    display: inline-block;
    font-size: 1.6rem;
}

#popupRespuesta.incorrecto {
    margin-top: 8%;
    background-color: #e42e1a;
    color: white;
    border-radius: 2rem;
    padding: 1rem 2rem;
    display: inline-block;
    font-size: 1.6rem;
}

@keyframes escala-suave {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.7);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

#popupRespuesta.animado {
    animation: escala-suave 2s ease-out;
}


/* =================== RESPONSIVE MÓVIL =================== */
@media (max-width: 768px) {

    body {
        padding: 1rem;
        height: auto;
    }

    h1 {
        font-size: 2.4rem;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .boton {
        padding: 0.8rem 1.8rem;
        font-size: 1.2rem;
        width: 100%;
        max-width: 300px;
    }

    .pantalla {
        padding: 1rem;
    }

    .pantalla.activa {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 80vh;
        padding: 1rem;
        box-sizing: border-box;
        text-align: center;
    }

    #resultado h1 {
        font-size: 2.4rem;
        padding: 1rem;
    }

    #resultado h2 {
        font-size: 1.5rem;
    }

    .resultado-puntuacion {
        font-size: 3rem;
        padding: 0.8rem 2rem;
    }

    .subtitulo-puntuacion {
        font-size: 1.1rem;
    }

    #mensajeFinal {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .boton-home-fijo {
        width: 60px;
        height: 60px;
        bottom: 20px;
        top: auto;
        margin-top: 0;
        /* anula el margin-top si estaba definido */
    }

    .boton-home-fijo img {
        width: 22px;
        height: 22px;
    }

    #instrucciones {
        padding: 2rem 1.5rem;
    }

    #instrucciones h2 {
        font-size: 2rem;
    }

    .lista-instrucciones {
        font-size: 1rem;
    }

    .lista-instrucciones li {
        padding-left: 2rem;
    }

    #datosPersonales {
        padding: 2rem 1rem;
    }

    #formDatos label {
        font-size: 1.2rem;
    }

    #datosPersonales input,
    #datosPersonales select {
        font-size: 1rem;
        width: 100%;
    }

    .pantalla.pregunta {
        padding: 1rem;
    }

    .pregunta .contenido-pregunta {
        flex-direction: column;
        align-items: center;
        margin: 0;
    }

    .decoracion-pregunta {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 80px;
        margin-bottom: 1rem;
    }

    .texto-pregunta {
        margin: 0;
        text-align: center;
    }

    .pregunta .respuestas {
        gap: 1rem;
    }

    .popup-explicacion {
        padding: 2rem 1rem;
    }

    .popup-explicacion h3 {
        font-size: 1.2rem;
    }

    .popup-explicacion p {
        font-size: 1rem;
    }

    #popupRespuesta.correcto,
    #popupRespuesta.incorrecto {
        font-size: 1.2rem;
        padding: 0.8rem 1.2rem;
        margin-top: 5%;
    }

    .triangulo-degradado {
        width: 100vw;
        height: 100vw;
        bottom: 10%;
    }
}