:root {
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #172033;
    --muted: #677289;
    --primary: #315efb;
    --primary-dark: #2347c7;
    --success: #16845b;
    --success-soft: #e9f8f1;
    --danger: #c43d4b;
    --danger-soft: #fff0f2;
    --border: #dfe5ef;
    --shadow: 0 18px 45px rgba(33, 48, 86, 0.10);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(49, 94, 251, 0.10), transparent 32rem),
        var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid rgba(223, 229, 239, 0.85);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
}

.site-header .container {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.header-note,
.header-link {
    color: var(--muted);
    font-size: 0.95rem;
}

.header-link {
    text-decoration: none;
}

.header-link:hover {
    color: var(--primary);
}

.page-content {
    padding: 72px 0 90px;
}

.hero {
    max-width: 760px;
    margin-bottom: 42px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0 0 18px;
    font-size: clamp(2.2rem, 6vw, 4.4rem);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.hero p:not(.eyebrow),
.lead {
    color: var(--muted);
    font-size: 1.08rem;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 22px;
}

.quiz-card,
.quiz-shell,
.empty-state,
.error-card {
    border: 1px solid rgba(223, 229, 239, 0.9);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.quiz-card {
    min-height: 285px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
}

.quiz-card h2 {
    margin: 12px 0 8px;
    font-size: 1.55rem;
    line-height: 1.2;
}

.quiz-card p {
    margin: 0;
    color: var(--muted);
}

.quiz-count {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--primary);
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 750;
}

.button {
    min-height: 48px;
    padding: 12px 20px;
    border: 0;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 24px rgba(49, 94, 251, 0.22);
    transform: translateY(-1px);
}

.button:focus-visible,
.answer-button:focus-visible {
    outline: 4px solid rgba(49, 94, 251, 0.22);
    outline-offset: 3px;
}

.button-large {
    min-height: 56px;
    padding-inline: 28px;
    font-size: 1.03rem;
}

.button-secondary {
    color: var(--text);
    background: #edf1f7;
}

.button-secondary:hover {
    color: var(--text);
    background: #e1e7f0;
    box-shadow: none;
}

.quiz-page {
    padding-top: 42px;
    padding-bottom: 80px;
}

.quiz-shell {
    padding: clamp(24px, 4vw, 48px);
}

.intro-shell,
.result-shell {
    max-width: 900px;
    margin: 0 auto;
}

.quiz-meta,
.result-actions,
.progress-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.quiz-meta {
    margin: 28px 0;
}

.quiz-meta span {
    padding: 8px 12px;
    border-radius: 999px;
    background: #f0f3f8;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.progress-row {
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 750;
}

.progress-track {
    height: 9px;
    margin: 12px 0 30px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf5;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 260ms ease;
}

.question-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.2fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.question-layout.no-image {
    grid-template-columns: minmax(0, 1fr);
}

.question-layout.no-image .question-content {
    max-width: 940px;
    margin: 0 auto;
    width: 100%;
}

.question-media {
    margin: 0;
    position: sticky;
    top: 28px;
}

.question-image {
    width: 100%;
    max-height: min(64vh, 620px);
    border-radius: 18px;
    display: block;
    object-fit: contain;
    background: #e9edf4;
}

.image-caption {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.image-copyright {
    font-weight: 750;
}

.question-title {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 3vw, 2.8rem);
}

.question-points {
    margin-top: 0;
    color: var(--muted);
}

.answer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
    margin: 28px 0;
}

.answer-button {
    width: 100%;
    min-height: 62px;
    padding: 15px 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    color: var(--text);
    background: #fff;
    font-weight: 720;
    transition: border 150ms ease, background 150ms ease, transform 150ms ease;
}

.answer-button:hover:not(:disabled) {
    border-color: #aebcf4;
    background: #f7f9ff;
    transform: translateY(-1px);
}

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

.answer-letter {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--primary);
    background: var(--surface-soft);
    font-size: 0.82rem;
    font-weight: 850;
}

.answer-button.correct {
    border-color: rgba(22, 132, 91, 0.4);
    background: var(--success-soft);
}

.answer-button.correct .answer-letter {
    color: #fff;
    background: var(--success);
}

.answer-button.wrong {
    border-color: rgba(196, 61, 75, 0.38);
    background: var(--danger-soft);
}

.answer-button.wrong .answer-letter {
    color: #fff;
    background: var(--danger);
}

.feedback {
    margin: 0 0 24px;
    padding: 18px;
    border-radius: 15px;
    background: #f0f3f8;
}

.feedback.success {
    background: var(--success-soft);
}

.feedback.error {
    background: var(--danger-soft);
}

.feedback p {
    margin: 5px 0 0;
}

.result-score {
    margin: 30px 0;
}

.result-score strong {
    display: block;
    font-size: clamp(2.7rem, 8vw, 5.5rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.result-score span {
    color: var(--muted);
    font-weight: 750;
}

.result-stats {
    margin: 32px 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.result-stats div {
    padding: 18px;
    border-radius: 16px;
    text-align: center;
    background: #f3f6fa;
}

.result-stats strong,
.result-stats span {
    display: block;
}

.result-stats strong {
    font-size: 1.45rem;
}

.result-stats span {
    color: var(--muted);
    font-size: 0.84rem;
}

.empty-state,
.error-card {
    padding: 36px;
}

.error-card {
    max-width: 700px;
    margin: 40px auto;
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #edf1f7;
}

.site-footer {
    padding: 28px 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .question-layout {
        grid-template-columns: 1fr;
    }

    .question-media {
        position: static;
    }

    .question-image {
        max-height: 480px;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(100% - 22px, 1280px);
    }

    .header-note {
        display: none;
    }

    .page-content {
        padding-top: 48px;
    }

    .quiz-page {
        padding-top: 18px;
    }

    .quiz-shell {
        padding: 22px;
        border-radius: 18px;
    }

    .answer-list {
        grid-template-columns: 1fr;
    }

    .result-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-actions .button {
        width: 100%;
    }
}

@media (min-width: 1400px) {
    .container {
        width: min(1420px, calc(100% - 64px));
    }

    .question-shell {
        padding: 52px 60px;
    }
}


.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.question-images {
    display: grid;
    gap: 12px;
}

.question-images.multi-image {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quiz-image-frame {
    margin: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #e9edf4;
}

.question-images.multi-image .question-image {
    height: 260px;
    object-fit: cover;
}

.question-images.single-image .question-image {
    max-height: min(64vh, 620px);
    object-fit: contain;
}

.gallery-hero {
    max-width: 850px;
}

.copyright-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 24px;
}

.copyright-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.copyright-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    background: #e9edf4;
}

.copyright-card-body {
    padding: 20px;
}

.copyright-card h2 {
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.copyright-owner {
    margin: 0;
    font-weight: 800;
}

.copyright-missing {
    color: var(--danger);
}

.image-filename {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    .header-nav {
        gap: 10px;
    }

    .header-nav .header-link:first-child {
        display: none;
    }

    .question-images.multi-image {
        grid-template-columns: 1fr;
    }

    .question-images.multi-image .question-image {
        height: auto;
        max-height: 420px;
    }
}
