


/* Fondo general del Quiz */
.quiz-portada {
    min-height: 100vh;
    min-height: 100svh;
    padding: 30px 18px 60px;

    background-image:
        linear-gradient(
            rgba(0, 0, 0, 0.50),
            rgba(0, 0, 0, 0.70)
        ),
        url("imagenes/portada1.jpg");

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

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Contenedor principal */
.contenedor-quiz {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

/* Cabecera */
.cabecera-quiz {
    color: white;
    text-align: center;
    padding: 10px 0 25px;
    text-shadow: 0 3px 8px black;
}

.cabecera-quiz .volver-inicio {
    display: inline-block;
    color: white;
    text-decoration: none;
    margin-bottom: 20px;
}

.cabecera-quiz .volver-inicio:hover {
    text-decoration: underline;
}

.cabecera-quiz .marca {
    color: #f5cb55;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.cabecera-quiz h1 {
    font-size: clamp(28px, 5vw, 46px);
    margin-bottom: 12px;
}

.cabecera-quiz > p:last-child {
    font-size: 16px;
    line-height: 1.5;
}

/* Tarjeta del Quiz */
.panel-quiz {
    background: rgba(255, 250, 241, 0.98);
    color: #29231c;

    padding: clamp(22px, 4vw, 40px);

    border: 2px solid #c6a56a;
    border-radius: 12px;

    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

/* Respetar las pantallas ocultas */
[hidden] {
    display: none !important;
}

/* Títulos y textos */
.panel-quiz h2 {
    font-size: clamp(22px, 4vw, 30px);
    line-height: 1.3;
    margin-bottom: 18px;
}

.panel-quiz p {
    line-height: 1.6;
    margin-bottom: 18px;
}

/* Opciones de respuesta */
#opciones-quiz {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.opcion-quiz {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 55px;
    padding: 14px;

    background: #fffdf9;
    border: 1px solid #d9cdbb;
    border-radius: 8px;

    cursor: pointer;
    line-height: 1.4;
    overflow-wrap: anywhere;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.opcion-quiz:hover {
    border-color: #b58a35;
}

.opcion-quiz:has(input:checked) {
    background: #fff0d2;
    border: 2px solid #b52e22;
    padding: 13px;
}

.opcion-quiz input {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    accent-color: #b52e22;
}

/* Botones */
.panel-quiz button {
    min-height: 46px;
    padding: 12px 22px;

    border: 2px solid #b52e22;
    border-radius: 30px;

    background: #b52e22;
    color: white;

    font: inherit;
    font-weight: bold;
    cursor: pointer;

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.panel-quiz button:hover:not(:disabled) {
    background: #8f2119;
    transform: translateY(-2px);
}

.panel-quiz button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#siguiente-quiz {
    display: block;
    margin-left: auto;
}

/* Progreso y dificultad */
#progreso-quiz {
    color: #a52b20;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

#dificultad-quiz {
    display: none;
    padding: 5px 12px;

    background: #eee2c9;
    border-radius: 20px;

    color: #59472b;
    font-size: 13px;
    font-weight: bold;
}

/* Mensaje después de responder */
#feedback-quiz {
    min-height: 24px;
    font-weight: bold;
}

#feedback-quiz:empty {
    display: none;
}

/* Resultado final */
#pantalla-resultado-quiz {
    text-align: center;
}

#nivel-asignado-quiz {
    color: #a52b20;
    font-size: 20px;
    font-weight: bold;
}

#pantalla-resultado-quiz a {
    display: block;
    margin-top: 20px;
    color: #a52b20;
}

/* Adaptación a móviles */
@media (max-width: 520px) {
    .quiz-portada {
        padding: 18px 12px 35px;
    }

    .panel-quiz {
        padding: 22px 16px;
    }

    #opciones-quiz {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel-quiz button {
        max-width: 100%;
    }
}

/* Revisión de las preguntas al finalizar */

.revision-quiz {
    display: grid;
    gap: 14px;
    margin-top: 30px;
    text-align: left;
}

.revision-item {
    padding: 16px;
    border-radius: 8px;
    background: #fffdf9;
    border: 1px solid #d9cdbb;
}

.revision-item h3 {
    font-size: 16px;
    margin-bottom: 10px;
}

.revision-item p {
    margin-bottom: 6px;
}

.revision-acertada {
    border-left: 5px solid #27845b;
}

.revision-fallada {
    border-left: 5px solid #b52e22;
}
