*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    background: #f0f2f9;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

header {
    background: #2d3a8c;
    color: white;
    padding: 1rem 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: .03em;
}

main {
    max-width: 640px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ── Cards / Screens ──────────────────────────────── */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.screen h2 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

/* ── Form fields ──────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-bottom: 1rem;
}

.field label {
    font-size: .85rem;
    font-weight: 600;
    color: #555;
}

.field select {
    padding: .5rem .75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
}

.field select:focus {
    outline: 2px solid #2d3a8c;
    outline-offset: 1px;
}

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
    display: block;
    width: 100%;
    padding: .7rem 1.5rem;
    background: #2d3a8c;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #3d4fba;
}

/* ── Loading ──────────────────────────────────────── */
.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem 0;
}

/* ── Question screen ──────────────────────────────── */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: .5rem;
}

.progress-text {
    font-size: .85rem;
    color: #666;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0 0 1.5rem;
}

/* ── Answer grid ──────────────────────────────────── */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: 1rem;
}

.answer-btn {
    padding: .75rem 1rem;
    background: #f0f2f9;
    border: 2px solid #dde0f0;
    border-radius: 8px;
    font-size: .95rem;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}

.answer-btn:hover:not(:disabled) {
    background: #e4e8f8;
    border-color: #2d3a8c;
}

.answer-btn:disabled {
    cursor: default;
}

.answer-btn.correct {
    background: #e6f4ea;
    border-color: #2d7a3a;
    color: #1a4d24;
    font-weight: 600;
}

.answer-btn.incorrect {
    background: #fce8e8;
    border-color: #a00;
    color: #7a0000;
}

/* ── Badges ───────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: .75rem;
    padding: .2rem .6rem;
    background: #e8eaf6;
    color: #2d3a8c;
    border-radius: 999px;
    font-weight: 600;
}

.badge--highlight {
    background: #fff3cd;
    color: #7a5000;
}

/* ── Result screen ────────────────────────────────── */
.final-score {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3a8c;
    margin: .5rem 0;
}

.high-score-display {
    font-size: .9rem;
    color: #666;
    margin: .75rem 0 0;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    .answers-grid {
        grid-template-columns: 1fr;
    }
}
