:root {
    --bg: #f5f6f8;
    --panel: #fff;
    --text: #19202a;
    --muted: #657080;
    --line: #dfe3e8;
    --accent: #2357d8;
    --accent2: #1745b7;
    --good: #147a42;
    --bad: #b3261e;
    --shadow: 0 12px 35px rgba(31, 45, 65, .08)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    line-height: 1.75
}

.wrap {
    width: min(1000px, calc(100% - 32px));
    margin: auto
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line)
}

.header-inner {
    height: 64px;
    display: flex;
    align-items: center;
    gap: 18px
}

.brand {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none
}

.tagline {
    font-size: 13px;
    color: var(--muted)
}

.hero {
    text-align: center;
    padding: 24px 0
}

.eyebrow {
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .18em;
    color: var(--accent)
}

h1 {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.2;
    margin: 8px 0 18px
}

.hero>p:not(.eyebrow) {
    max-width: 760px;
    margin: 0 auto;
    color: var(--muted)
}

.difficulty {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 30px auto 18px;
    max-width: 760px
}

.difficulty button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer
}

.difficulty button span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500
}

.difficulty button.active {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: #f5f8ff
}

.primary,
.secondary {
    border: 0;
    border-radius: 10px;
    padding: 13px 22px;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer
}

.primary {
    background: var(--accent);
    color: #fff
}

.primary:hover {
    background: var(--accent2)
}

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

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow)
}

.passage-card {
    padding: 32px
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px
}

.meta span {
    background: #eef2f8;
    border-radius: 999px;
    padding: 3px 10px;
    color: #526072;
    font-size: 12px
}

.passage-card h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    margin: 10px 0 20px
}

.passage {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 2.05;
    white-space: pre-wrap
}

.blank {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: var(--accent);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .72em;
    font-weight: 800;
    margin: 0 3px
}

.blank-box {
    display: inline-block;
    min-width: 48px;
    border-bottom: 3px solid currentColor;
    margin-left: 4px;
    height: 1.25em
}

.answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 18px
}

.answer-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px
}

.answer-card h3 {
    margin: 0 0 10px;
    font-size: 15px
}

.choice {
    display: block;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer
}

.choice:hover {
    background: #f5f7fa
}

.choice input {
    margin-right: 8px
}

.answer-card.correct {
    border-color: #7bc99b;
    background: #f5fff8
}

.answer-card.wrong {
    border-color: #e5a6a1;
    background: #fff8f7
}

.correct-answer {
    font-size: 13px;
    color: var(--good);
    font-weight: 700;
    margin-top: 8px
}

.actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 24px 0
}

.result,
.completed,
.about {
    padding: 25px;
    margin: 0 0 22px
}

.score {
    font-size: 28px;
    font-weight: 850;
    margin: 0
}

.score.good {
    color: var(--good)
}

.completed p {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    white-space: pre-wrap
}

.about {
    margin-top: 45px;
    margin-bottom: 60px
}

.about h2,
.completed h3 {
    margin-top: 0
}

.loading {
    padding: 35px;
    text-align: center;
    margin-bottom: 30px
}

.spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #dde4f2;
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: auto;
    animation: spin .8s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.hidden {
    display: none !important
}

@media(max-width:720px) {
    .difficulty {
        grid-template-columns: repeat(2, 1fr)
    }

    .answers {
        grid-template-columns: 1fr
    }

    .passage-card {
        padding: 22px 18px
    }

    .passage {
        font-size: 18px
    }

    .hero {
        padding-top: 42px
    }

    .tagline {
        display: none
    }
}

.translation {
    border-top: 1px solid var(--line);
    margin-top: 24px;
    padding-top: 24px
}

.translation p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    font-size: 16px;
    white-space: pre-wrap;
    margin-bottom: 0
}

.site-footer {
    background: #151c27;
    color: #aeb7c4;
    border-top: 1px solid #273142;
    padding: 30px 0
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.footer-brand {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none
}

.footer-brand:hover,
.copyright a:hover {
    text-decoration: underline
}

.footer-inner p {
    margin: 2px 0 0;
    font-size: 13px
}

.copyright {
    white-space: nowrap
}

.copyright a {
    color: #dce7ff;
    font-weight: 700;
    text-decoration: none
}

@media(max-width:520px) {
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px
    }
}