:root {
    --bg-color: #f2f2f2;
    --primary-color: #46178f;
    /* Morado estilo Kahoot */
    --secondary-color: #eb670f;
    /* Naranja complemento */
    --text-color: #333333;
    --white: #ffffff;
    --correct-color: #26890c;
    /* Verde éxito */
    --incorrect-color: #e21b3c;
    /* Rojo error */
    /* Colores vibrantes para botones tipo Kahoot */
    --option-1: #e21b3c;
    /* Rojo */
    --option-2: #1368ce;
    /* Azul */
    --option-3: #d89e00;
    /* Amarillo oscuro */
    --option-4: #26890c;
    /* Verde */
    --option-5: #eb670f;
    /* Naranja */
    --font-main: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: linear-gradient(135deg, #46178f 0%, #25076b 100%);
}

#app {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

/* Pantallas y estados */
.screen {
    padding: 40px;
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.4s ease-in-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* --- Pantalla de Inicio --- */
#start-screen {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.logo-container h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.logo-container p {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

.description {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 40px;
    color: #555;
    max-width: 500px;
}

/* --- Botones Genéricos --- */
.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 18px 45px;
    font-size: 1.3rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 0 #25076b;
    transition: all 0.1s;
    font-family: var(--font-main);
}

.primary-btn:hover {
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #25076b;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

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

/* --- Pantalla del Quiz --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.progress-container {
    font-weight: 800;
    font-size: 1.1rem;
    color: #666;
}

.timer-container {
    background: #f0f0f0;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    transition: color 0.3s;
}

.question-container {
    background: var(--white);
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

#question-text {
    font-size: 1.8rem;
    line-height: 1.4;
    font-weight: 800;
    color: var(--text-color);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

/* Botones de alternativas */
.option-btn {
    color: var(--white);
    border: none;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    font-family: var(--font-main);
    word-break: break-word;
    line-height: 1.4;
}

.option-btn:active:not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.option-btn:hover:not(:disabled) {
    filter: brightness(1.1);
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.6;
    transform: none;
}

/* Colores específicos de los botones */
.opt-0 {
    background-color: var(--option-1);
    box-shadow: 0 6px 0 #b0152e;
}

.opt-1 {
    background-color: var(--option-2);
    box-shadow: 0 6px 0 #0e50a0;
}

.opt-2 {
    background-color: var(--option-3);
    box-shadow: 0 6px 0 #a37700;
}

.opt-3 {
    background-color: var(--option-4);
    box-shadow: 0 6px 0 #1b6308;
}

.opt-4 {
    background-color: var(--option-5);
    box-shadow: 0 6px 0 #b84c05;
}

.opt-0:active:not(:disabled) {
    box-shadow: 0 0 0 #b0152e;
}

.opt-1:active:not(:disabled) {
    box-shadow: 0 0 0 #0e50a0;
}

.opt-2:active:not(:disabled) {
    box-shadow: 0 0 0 #a37700;
}

.opt-3:active:not(:disabled) {
    box-shadow: 0 0 0 #1b6308;
}

.opt-4:active:not(:disabled) {
    box-shadow: 0 0 0 #b84c05;
}

/* Animaciones de aciertos y errores */
.option-btn.correct-anim {
    border: 5px solid var(--white);
    box-shadow: 0 0 15px var(--correct-color), 0 6px 0 rgba(0, 0, 0, 0.2) !important;
    opacity: 1 !important;
    z-index: 2;
    transform: scale(1.02);
}

.option-btn.wrong-anim {
    opacity: 0.3 !important;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) !important;
    transform: translateY(4px);
}

/* --- Feedback Post-Respuesta --- */
.feedback-container {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    margin-top: 10px;
    animation: slideUp 0.5s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.feedback-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eaeaea;
    text-align: center;
}

#feedback-title {
    font-size: 2rem;
    font-weight: 800;
}

#feedback-title.correct {
    color: var(--correct-color);
}

#feedback-title.incorrect {
    color: var(--incorrect-color);
}

.explanations h4 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 800;
}

.correct-explanation {
    margin-bottom: 25px;
    padding: 20px;
    background: #e8f5e9;
    border-radius: 10px;
    border-left: 6px solid var(--correct-color);
}

.incorrect-explanations {
    padding: 20px;
    background: #ffebee;
    border-radius: 10px;
    border-left: 6px solid var(--incorrect-color);
}

.incorrect-explanations ul {
    list-style-type: none;
}

.incorrect-explanations li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ffcdd2;
    line-height: 1.5;
}

.incorrect-explanations li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.incorrect-explanations strong {
    color: #c62828;
}

#correct-reason strong {
    color: #2e7d32;
}

#correct-reason {
    line-height: 1.5;
    font-size: 1.05rem;
}

#next-btn {
    margin-top: 30px;
    width: 100%;
}

/* --- Pantalla Final --- */
#result-screen {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.result-title {
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 800;
}

.score-card {
    background: #f5f5f5;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
}

.score-card p {
    font-size: 1.3rem;
    color: #555;
    margin-bottom: 25px;
    font-weight: 600;
}

.score-circle {
    width: 180px;
    height: 180px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    margin: 0 auto;
    font-size: 3.5rem;
    font-weight: 800;
    box-shadow: 0 10px 20px rgba(70, 23, 143, 0.4);
    border: 6px solid rgba(255, 255, 255, 0.8);
}

.score-divider {
    font-size: 2.5rem;
    margin: 0 5px;
    opacity: 0.7;
}

/* Responsividad */
@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }

    #app {
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .screen {
        padding: 20px;
    }

    .logo-container h1 {
        font-size: 2.5rem;
    }

    #question-text {
        font-size: 1.4rem;
    }
}