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

@font-face {
    font-family: 'Noto Sans Display';
    src: url('../fonts/NotoSansDisplay.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html,
body {
    height: 100%;
    font-family:
        'Noto Sans Display',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        'Helvetica Neue',
        Arial,
        sans-serif;
    background-color: #ffdfb5;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.header {
    background: linear-gradient(135deg, #1565c0, #2196f3, #42a5f5);
    /* border-top: 3px solid rgba(255, 255, 255, 0.5); */
    border-bottom: 3px solid rgba(255, 255, 255, 0.5);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 14px rgba(21, 101, 192, 0.45);
}

.header-content {
    text-align: center;
}

.header-title {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(55, 29, 29, 0.25);
    letter-spacing: 1px;
}

.header-subtitle {
    color: rgba(220, 220, 220, 0.85);
    font-size: 14px;
    margin-top: 5px;
}

.header-subtitle a {
    color: rgba(220, 220, 220, 0.85);
    font-weight: 500;
    text-decoration: underline;
}

.header-subtitle a:hover {
    text-decoration: underline;
}

.footer-subtitle {
    color: rgba(141, 125, 125, 0.85);
    font-size: 15px;
    /* font-weight: 500; */
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.footer-subtitle a {
    color: rgba(141, 125, 125, 0.85);
    text-decoration: none;
}

.footer-subtitle a:hover {
    text-decoration: underline;
}

/* ── Main content ── */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* ── Status messages ── */
.status-message {
    text-align: center;
    color: #333;
    font-size: 16px;
    margin-top: 40px;
}

.error-message {
    color: #c62828;
}

/* ── Quiz container ── */
.quiz-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

/* ── Shared entrance animation ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Question card ── */
.question-card {
    background: linear-gradient(160deg, #ffffff, #f9f9ff);
    border-radius: 20px;
    padding: 32px 30px;
    min-height: 180px;
    margin-bottom: 28px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.1),
        0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.4s ease both;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.question-id {
    color: #bbb;
    font-size: 12px;
    margin-bottom: 12px;
    align-self: center;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

.question-text {
    color: #000;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.6;
    text-align: center;
    width: 100%;
}

/* ── Question image ── */
.question-image {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 20px;
    object-fit: contain;
}

/* ── Answer buttons ── */
.answers-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-btn {
    background-color: #fff;
    border: 2px solid #d0d0d0;
    border-radius: 13px;
    padding: 16px 18px;
    font-size: 18px;
    color: #000;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.15s ease,
        box-shadow 0.18s ease,
        color 0.18s ease;
    line-height: 1.5;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.38s ease both;
    position: relative;
    overflow: hidden;
}

.answer-btn:nth-child(1) {
    animation-delay: 0.04s;
}
.answer-btn:nth-child(2) {
    animation-delay: 0.1s;
}
.answer-btn:nth-child(3) {
    animation-delay: 0.16s;
}
.answer-btn:nth-child(4) {
    animation-delay: 0.22s;
}

.answer-btn:hover:not(.answered):not(.correct):not(.incorrect) {
    background-color: #e8f4fd;
    border-color: #2196f3;
    color: #1565c0;
    transform: translateY(-3px);
    box-shadow:
        0 8px 20px rgba(33, 150, 243, 0.22),
        0 2px 6px rgba(33, 150, 243, 0.1);
}

.answer-btn:active:not(.answered):not(.correct):not(.incorrect) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.answer-btn.answered {
    cursor: default;
    pointer-events: none;
}

/* ── Correct ── */
@keyframes correctPulse {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.03);
        box-shadow: 0 10px 28px rgba(76, 175, 80, 0.4);
    }
    65% {
        transform: scale(1.015);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
    }
}

.answer-btn.correct {
    background: linear-gradient(135deg, #e8f5e9, #f0faf0);
    border-color: #43a047;
    color: #1b5e20;
    font-weight: 700;
    pointer-events: none;
    animation: correctPulse 0.55s ease forwards;
}

/* ── Incorrect ── */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    18% {
        transform: translateX(-7px);
    }
    36% {
        transform: translateX(7px);
    }
    54% {
        transform: translateX(-5px);
    }
    72% {
        transform: translateX(5px);
    }
    88% {
        transform: translateX(-2px);
    }
}

.answer-btn.incorrect {
    background-color: #fff0f0;
    border-color: #ef5350;
    color: #b71c1c;
    pointer-events: none;
    animation: shake 0.45s ease;
}

/* ── Next button ── */
.next-btn-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    padding-bottom: 24px;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.next-btn {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    color: #fff;
    border: none;
    border-radius: 32px;
    padding: 15px 38px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition:
        transform 0.15s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
    min-width: 220px;
    box-shadow: 0 5px 16px rgba(33, 150, 243, 0.45);
    letter-spacing: 0.3px;
    animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.next-btn:hover {
    background: linear-gradient(135deg, #1565c0, #1976d2);
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(33, 150, 243, 0.55);
}

.next-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.35);
}

/* ── Responsive ── */
@media (max-width: 420px) {
    .main-content {
        padding: 14px;
    }

    .question-card {
        padding: 22px 18px;
        min-height: 140px;
    }

    .question-text {
        font-size: 18px;
    }

    .answer-btn {
        font-size: 15px;
        padding: 14px 14px;
    }
}
