/* History Quiz Game — Семенівщина */

.quiz-game {
    padding: 40px 0 60px;
    min-height: 70vh;
    font-family: CoreSansC, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === QUIZ CARD (event display) === */
.quiz-card {
    background: #fff;
    border: 2px solid var(--gray-brand-color, #D7D7D7);
    border-radius: var(--bs-radius, 10px);
    padding: 28px 24px;
    margin-bottom: 28px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    position: relative;
}

.quiz-card--correct {
    border-color: #4CAF50;
    background: #f0faf0;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.15);
}

.quiz-card--wrong {
    border-color: #E53935;
    background: #fef0f0;
    animation: quiz-shake 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.15);
}

@keyframes quiz-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.quiz-card__scope {
    margin-bottom: 10px;
}

.quiz-card__title {
    font-size: 1.25rem;
    line-height: 1.45;
    color: var(--black-color, #000);
    margin-bottom: 8px;
    font-weight: 600;
}

.quiz-card__desc {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--inactive-color, #666);
    margin-bottom: 10px;
    font-weight: 400;
    min-height: 3em; /* reserve 2 lines on desktop */
}

.quiz-card__category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--timestamp-color, #8B9699);
    margin-top: 4px;
}

/* === YEAR OPTIONS (4 buttons) === */
.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 560px;
    margin: 0 auto;
}

.quiz-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: #fff;
    border: 3px solid var(--gray-brand-color, #D7D7D7);
    border-radius: var(--bs-radius, 10px);
    cursor: pointer;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    font-family: inherit;
    min-height: 90px;
    position: relative;
    overflow: hidden;
    outline: none;
}

.quiz-option:focus {
    outline: none;
}

.quiz-option:hover {
    border-color: var(--primary-color, #CE5B4A);
    background: rgba(206, 91, 74, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.quiz-option:active {
    transform: scale(0.97);
}

.quiz-option__year {
    font-size: 2rem;
    font-weight: 900;
    color: var(--black-color, #000);
    line-height: 1;
    margin-bottom: 4px;
    transition: color 0.3s;
}

.quiz-option__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--timestamp-color, #8B9699);
    font-weight: 600;
}

/* All buttons after answer — disable interaction */
.quiz-option--answered {
    cursor: default;
    pointer-events: none;
}

/* Correct answer — green border glow, smooth fade in */
.quiz-option--correct {
    border-color: #4CAF50;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25), 0 4px 16px rgba(76, 175, 80, 0.15);
    animation: quiz-correctGlow 0.6s ease-out;
}

.quiz-option--correct .quiz-option__year {
    color: #4CAF50;
}

.quiz-option--correct .quiz-option__label {
    color: #4CAF50;
}

.quiz-option--correct::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.25rem;
    font-weight: 900;
    color: #4CAF50;
    animation: quiz-checkFade 0.4s ease-out;
}

@keyframes quiz-correctGlow {
    0% { border-color: var(--gray-brand-color, #D7D7D7); box-shadow: none; }
    40% { border-color: #4CAF50; box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.3), 0 4px 20px rgba(76, 175, 80, 0.2); }
    100% { border-color: #4CAF50; box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.25), 0 4px 16px rgba(76, 175, 80, 0.15); }
}

@keyframes quiz-checkFade {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Wrong answer (user selected) — red fill */
.quiz-option--wrong {
    border-color: #E53935;
    background: #E53935;
    animation: quiz-wrongShake 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(229, 57, 53, 0.3);
}

.quiz-option--wrong .quiz-option__year {
    color: #fff;
}

.quiz-option--wrong .quiz-option__label {
    color: rgba(255, 255, 255, 0.8);
}

.quiz-option--wrong::after {
    content: '\2717';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
}

@keyframes quiz-wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Dimmed (other wrong options after answer) */
.quiz-option--dimmed {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .quiz-game {
        padding: 24px 0 40px;
    }

    .quiz-card {
        padding: 20px 16px;
        margin-bottom: 20px;
    }

    .quiz-card__title {
        font-size: 1.0625rem;
    }

    .quiz-card__desc {
        font-size: 0.8125rem;
        min-height: 4.5em; /* reserve 3 lines on mobile */
    }

    .quiz-options {
        gap: 12px;
    }

    .quiz-option {
        padding: 20px 12px;
        min-height: 80px;
    }

    .quiz-option__year {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .quiz-card__title {
        font-size: 1rem;
    }

    .quiz-option {
        padding: 18px 10px;
        min-height: 72px;
    }

    .quiz-option__year {
        font-size: 1.5rem;
    }
}
