:root {
    --background: #eef3ef;
    --surface: #fffefa;
    --surface-raised: #ffffff;
    --text: #20332e;
    --muted: #60726c;
    --primary: #2e6258;
    --primary-dark: #214a43;
    --accent: #d99b3d;
    --success: #267153;
    --success-soft: #e4f3ec;
    --neutral-soft: #f5eee2;
    --border: #d4dfda;
    --border-strong: #becdc7;
    --shadow: 0 2px 3px rgba(35, 67, 59, 0.04), 0 18px 48px rgba(35, 67, 59, 0.09);
    --shadow-small: 0 8px 22px rgba(35, 67, 59, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 12%, rgba(218, 232, 222, 0.8) 0 8rem, transparent 8.1rem),
        radial-gradient(circle at 94% 82%, rgba(236, 220, 185, 0.42) 0 11rem, transparent 11.1rem),
        linear-gradient(135deg, transparent 0 48%, rgba(49, 95, 87, 0.025) 48% 52%, transparent 52% 100%),
        var(--background);
    background-attachment: fixed;
    color: var(--text);
    font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
}

button,
a {
    font: inherit;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100% - 2rem, 72rem);
    margin: 0 auto;
    padding: 1.15rem 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border: 1px solid rgba(49, 95, 87, 0.09);
    border-radius: 999px;
    background: rgba(255, 254, 250, 0.78);
    box-shadow: 0 5px 18px rgba(35, 67, 59, 0.05);
    color: var(--muted);
    font-size: 0.92rem;
}

.site-nav a,
.auth-switch a,
.guest-note a {
    color: var(--primary);
    font-weight: 700;
}

.site-nav a,
.site-nav span,
.site-nav button {
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
}

.site-nav a {
    text-decoration: none;
}

.site-nav a:hover,
.site-nav button:hover {
    background: #edf4f1;
}

.site-nav form {
    margin: 0;
}
.site-nav button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid var(--primary);
    border-radius: 0.7rem 0.7rem 0.7rem 0.2rem;
    background: var(--surface);
    color: var(--accent);
    font-size: 1.25rem;
    transform: rotate(-4deg);
    box-shadow: 3px 3px 0 rgba(49, 95, 87, 0.12);
    place-items: center;
}

.brand-mark + span {
    letter-spacing: 0.02em;
}

.page-shell {
    display: grid;
    width: min(100% - 2rem, 72rem);
    min-height: calc(100vh - 6rem);
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 3.5rem) 0 4rem;
    place-items: start stretch;
}

.welcome-card,
.mission-card,
.result-card,
.auth-card,
.progress-card {
    width: 100%;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border: 1px solid rgba(49, 95, 87, 0.12);
    border-radius: 1.75rem 1.75rem 1.75rem 0.55rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.collection-card {
    width: 100%;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border: 1px solid rgba(49, 95, 87, 0.12);
    border-radius: 1.75rem 1.75rem 1.75rem 0.55rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.welcome-card,
.result-card,
.auth-card,
.progress-card {
    max-width: 42rem;
    margin: 5vh auto 0;
    text-align: center;
}

.welcome-card-wide {
    max-width: 52rem;
}

.guest-note {
    margin: -0.8rem auto 1.6rem;
    color: var(--muted);
}

.auth-card {
    max-width: 34rem;
}

.auth-form {
    display: grid;
    gap: 0.7rem;
    text-align: left;
}

.auth-form label {
    margin-top: 0.4rem;
    font-weight: 750;
}
.auth-form input {
    min-height: 3.4rem;
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 0.8rem;
    color: var(--text);
    font: inherit;
}
.auth-form input:focus {
    border-color: var(--primary);
    outline: none;
}

.auth-form .primary-button {
    margin-top: 0.8rem;
}

.form-error {
    margin-bottom: 1rem;
    padding: 0.9rem;
    border-radius: 0.8rem;
    background: var(--neutral-soft);
    color: #655438;
}

.auth-switch {
    margin: 1.5rem 0 0;
    color: var(--muted);
}

.progress-card { max-width: 52rem; text-align: left; }
.progress-grid { display: grid; gap: 1rem; }
.progress-item { padding: clamp(1.1rem, 4vw, 1.6rem); border: 1px solid var(--border); border-left: 0.35rem solid #8eb6aa; border-radius: 1rem 1rem 1rem 0.35rem; background: #fbfdfc; box-shadow: var(--shadow-small); }
.progress-topic-heading { display: flex; align-items: center; gap: 0.7rem; }
.progress-topic-heading h2 { margin: 0; font-size: 1.45rem; }
.progress-topic-heading .topic-symbol { font-size: 1.7rem; }
.progress-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.65rem; margin: 1.2rem 0; }
.progress-stats div { padding: 0.8rem; border: 1px solid #e0e9e5; border-radius: 0.75rem 0.75rem 0.75rem 0.25rem; background: #f3f7f6; }
.progress-stats dt { color: var(--muted); font-size: 0.78rem; }
.progress-stats dd { margin: 0.2rem 0 0; font-size: 1.05rem; font-weight: 800; }
.learning-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.learning-notes section { padding: 1rem; border: 1px dashed var(--border-strong); border-radius: 0.8rem 0.8rem 0.8rem 0.25rem; background: var(--surface); }
.learning-notes h3,
.mission-history h3 { margin: 0 0 0.7rem; font-size: 1rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.skill-list li { padding: 0.35rem 0.65rem; border-radius: 999px; font-weight: 750; }
.skill-list-strength li { background: var(--success-soft); color: var(--success); }
.skill-list-practice li { background: var(--neutral-soft); color: #655438; }
.quiet-message { margin: 0; color: var(--muted); font-size: 0.9rem; }
.mission-history { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.mission-history ol { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.mission-history li div { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.25rem; font-size: 0.82rem; }
.mission-history li span { color: var(--muted); }
.mission-history progress { display: block; width: 100%; height: 0.65rem; overflow: hidden; border: 0; border-radius: 999px; background: #e3e9e7; accent-color: var(--primary); }
.mission-history progress::-webkit-progress-bar { border-radius: 999px; background: #e3e9e7; }
.mission-history progress::-webkit-progress-value { border-radius: 999px; background: var(--primary); }
.mission-history progress::-moz-progress-bar { border-radius: 999px; background: var(--primary); }

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

h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.25rem);
    line-height: 1.15;
}

.intro,
.result-message {
    margin: 1rem auto 2rem;
    color: var(--muted);
    font-size: 1.12rem;
}

.primary-button {
    min-height: 3.5rem;
    padding: 0.85rem 1.5rem;
    border: 0;
    border-radius: 0.85rem 0.85rem 0.85rem 0.3rem;
    background: var(--primary);
    box-shadow: 0 4px 0 var(--primary-dark), 0 8px 18px rgba(35, 67, 59, 0.14);
    color: #fff;
    cursor: pointer;
    font-weight: 750;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.primary-button:active {
    box-shadow: 0 2px 0 var(--primary-dark), 0 4px 10px rgba(35, 67, 59, 0.12);
    transform: translateY(2px);
}

.primary-button:focus-visible,
.answer-button:focus-visible,
.topic-choice:focus-visible,
.brand:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    text-align: left;
}

.topic-grid form {
    display: flex;
}

.topic-mixed {
    grid-column: 1 / -1;
}

.topic-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    width: 100%;
    min-height: 6rem;
    padding: 1rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: 1rem 1rem 1rem 0.35rem;
    background: var(--surface-raised);
    box-shadow: 0 4px 0 #e2e9e6;
    color: var(--text);
    cursor: pointer;
    column-gap: 0.9rem;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.topic-choice:hover {
    border-color: var(--primary);
    background: #f7faf9;
    box-shadow: 0 4px 0 #bfd0ca;
    transform: translateY(-1px);
}

.topic-symbol {
    grid-row: 1 / 3;
    align-self: center;
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.topic-choice .topic-symbol {
    display: grid;
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 1rem 1rem 1rem 0.3rem;
    background: #e9f2ef;
    font-size: 1.75rem;
    place-items: center;
}

.topic-choice strong {
    align-self: end;
    font-size: 1.05rem;
}

.mission-paths {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.mission-path {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem;
    border: 1px solid var(--path-border, var(--border));
    border-radius: 1.15rem 1.15rem 1.15rem 0.4rem;
    box-shadow: var(--shadow-small);
}

.mission-path::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 0.35rem;
    height: 100%;
    background: var(--path-accent, var(--primary));
    content: "";
}

.path-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.path-heading .topic-symbol {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    border: 1px solid var(--path-border, var(--border));
    border-radius: 0.85rem 0.85rem 0.85rem 0.25rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--path-accent, var(--primary));
    font-size: 1.4rem;
    box-shadow: 2px 3px 0 color-mix(in srgb, var(--path-accent, var(--primary)) 18%, transparent);
    place-items: center;
}

.path-heading h2,
.mixed-practice h2 {
    margin: 0;
    font-size: 1.2rem;
}

.path-heading p {
    margin: 0.1rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.mission-path-expedition {
    background: var(--path-background, #fffdf8);
}

.path-topic-addition {
    --path-accent: #3c7b71;
    --path-border: #b8d3ca;
    --path-background: #f4faf7;
}

.path-topic-subtraction {
    --path-accent: #a36d3e;
    --path-border: #dcc4aa;
    --path-background: #fcf7ef;
}

.path-topic-multiplication {
    --path-accent: #687a45;
    --path-border: #cbd4b5;
    --path-background: #f7f9f1;
}

.path-topic-division {
    --path-accent: #58728d;
    --path-border: #c2d0dc;
    --path-background: #f4f8fb;
}

.path-map {
    position: relative;
    height: 13.5rem;
    margin: -0.35rem -0.15rem -0.5rem;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--path-border, var(--border)) 55%, transparent);
    border-radius: 1rem 1rem 1rem 0.3rem;
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--path-accent) 9%, transparent) 0 0.22rem, transparent 0.25rem),
        radial-gradient(ellipse at 62% 45%, transparent 0 2.8rem, color-mix(in srgb, var(--path-accent) 7%, transparent) 2.85rem 3rem, transparent 3.05rem),
        rgba(255, 255, 255, 0.34);
}

.path-landmark {
    position: absolute;
    z-index: 0;
    top: var(--landmark-y);
    left: var(--landmark-x);
    color: color-mix(in srgb, var(--path-accent) 30%, var(--muted));
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.45;
    transform: translate(-50%, -50%) rotate(-6deg);
}

.path-route {
    position: absolute;
    z-index: 0;
    inset: 0.35rem 0.5rem 0.8rem;
    width: calc(100% - 1rem);
    height: calc(100% - 1.15rem);
    overflow: visible;
}

.path-route path {
    fill: none;
    stroke: color-mix(in srgb, var(--path-accent) 62%, var(--path-border));
    stroke-dasharray: 1.4 2.1;
    stroke-linecap: round;
    stroke-width: 1.3;
    vector-effect: non-scaling-stroke;
}

.path-nodes {
    position: absolute;
    z-index: 1;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.path-node {
    position: absolute;
    top: var(--node-y);
    left: var(--node-x);
    width: 6.4rem;
    text-align: center;
    transform: translate(-50%, -50%);
}

.path-node form,
.path-node button,
.path-node > div {
    position: relative;
    z-index: 1;
    margin: 0;
}

.path-node button,
.path-node > div {
    display: inline-grid;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    justify-items: center;
}

.path-node > div {
    cursor: default;
}

.node-circle {
    display: grid;
    width: 3rem;
    height: 3rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface-raised);
    box-shadow: 0 3px 0 rgba(50, 79, 70, 0.12);
    font-weight: 800;
    place-items: center;
}

.path-node-completed .node-circle {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
    box-shadow: 0 3px 0 rgba(38, 113, 83, 0.16);
}

.path-node-available .node-circle {
    border-color: var(--path-accent, var(--primary));
    border-radius: 50% 50% 50% 0.35rem;
    background: var(--path-accent, var(--primary));
    color: #fff;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--path-accent, var(--primary)) 65%, #233f38);
}

.path-node-locked .node-circle {
    color: var(--muted);
}

.node-status {
    min-height: 1.5rem;
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.2;
}

.node-title {
    max-width: 6.4rem;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.2;
}

.path-node button:hover .node-circle {
    border-color: var(--accent);
}

.path-node button:focus-visible {
    border-radius: 0.35rem;
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.mixed-practice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border: 1px dashed #aac0b9;
    border-radius: 1rem 1rem 1rem 0.35rem;
    background: linear-gradient(105deg, #eef6f3, #f7faf8);
    text-align: left;
}

.mixed-practice p:last-child {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.mixed-reward-summary {
    margin-top: 0.75rem;
}

.mixed-reward-summary p {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
}

.mixed-badges {
    display: flex;
    gap: 0.4rem;
}

.mixed-badge {
    display: grid;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    font-weight: 800;
    place-items: center;
}

.mixed-badge-unlocked {
    border-color: var(--accent);
    background: #fffaf0;
    color: #6d562c;
}

.card-discovery {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 2px solid #d9bd83;
    border-radius: 1rem;
    background: #fffaf0;
}

.mixed-reward-card {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 2px solid #d9bd83;
    border-radius: 1rem;
    background: #fffaf0;
}

.mixed-reward-card h2,
.mixed-reward-card p {
    margin: 0.35rem 0 0;
}

.mixed-reward-symbol {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin: 0.5rem auto;
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: #6d562c;
    font-size: 1.5rem;
    place-items: center;
}

.card-discovery h2,
.card-discovery p:last-child {
    margin: 0.35rem 0 0;
}

.quiet-link {
    display: block;
    width: max-content;
    margin: 1rem auto 0;
    color: var(--primary);
    font-weight: 700;
}

.collection-card {
    max-width: 52rem;
    margin: 2vh auto 0;
    text-align: left;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.knowledge-card {
    position: relative;
    overflow: hidden;
    min-height: 12rem;
    padding: 1.3rem;
    border: 1px solid #d9bd83;
    border-radius: 1rem 1rem 1rem 0.35rem;
    background: linear-gradient(145deg, #fffdf7, #fff8e9);
    box-shadow: 0 5px 0 #ead9b7, var(--shadow-small);
}

.knowledge-card::after {
    position: absolute;
    right: -1.5rem;
    bottom: -1.5rem;
    width: 5rem;
    height: 5rem;
    border: 0.8rem double rgba(169, 121, 49, 0.08);
    border-radius: 50%;
    content: "";
}

.knowledge-card h2 {
    margin: 1.2rem 0 0.5rem;
    font-size: 1.25rem;
}

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

.card-topic {
    color: #6d562c;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.knowledge-card-locked {
    border-color: var(--border);
    background: #f7f9f8;
    color: var(--muted);
    box-shadow: 0 4px 0 #e2e8e5;
}

.knowledge-card-locked::after {
    border-color: rgba(74, 101, 93, 0.05);
}

.card-placeholder {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-weight: 800;
    place-items: center;
}

.topic-action {
    align-self: start;
    color: var(--muted);
    font-size: 0.82rem;
}

.mission-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.mission-card {
    position: relative;
    overflow: hidden;
}

.mission-card::after {
    position: absolute;
    z-index: 0;
    top: -5.5rem;
    right: -4rem;
    width: 13rem;
    height: 13rem;
    border: 1.6rem solid rgba(49, 95, 87, 0.035);
    border-radius: 46% 54% 42% 58%;
    content: "";
    pointer-events: none;
    transform: rotate(18deg);
}

.mission-card > * {
    position: relative;
    z-index: 1;
}

.mission-topic {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
}

.progress-label {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.progress-track {
    height: 0.65rem;
    margin-top: 1.3rem;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid #d9e3df;
    background: #edf2f0;
    box-shadow: inset 0 1px 2px rgba(35, 67, 59, 0.08);
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d99b3d, #e6b760);
    transition: width 220ms ease;
}

.expedition-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.2rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d8c08b;
    border-radius: 1rem 1rem 1rem 0.35rem;
    background:
        linear-gradient(90deg, rgba(217, 155, 61, 0.08) 1px, transparent 1px) 0 0 / 2rem 2rem,
        linear-gradient(rgba(217, 155, 61, 0.08) 1px, transparent 1px) 0 0 / 2rem 2rem,
        #fffaf0;
    box-shadow: 0 5px 16px rgba(104, 81, 40, 0.06);
}

.expedition-marker {
    display: grid;
    width: 2.7rem;
    height: 2.7rem;
    border: 2px solid #c79a4e;
    border-radius: 50% 50% 50% 0.35rem;
    background: #fffef9;
    color: #8a632a;
    font-size: 1.25rem;
    transform: rotate(-4deg);
    box-shadow: 3px 3px 0 rgba(138, 99, 42, 0.13);
    place-items: center;
}

.expedition-copy p {
    margin: 0;
}

.expedition-copy #expedition-goal {
    font-size: 1.02rem;
    line-height: 1.45;
}

.expedition-copy .story-progress {
    margin-top: 0.55rem;
    color: #6d562c;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.expedition-copy .expedition-story {
    margin-top: 0.16rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.45;
}

.expedition-chapter {
    color: #6d562c;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.trail-progress {
    min-width: 12rem;
    text-align: right;
}

.trail-progress > strong {
    color: #6d562c;
    font-size: 0.84rem;
}

.trail-signs {
    position: relative;
    display: flex;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.trail-signs::before {
    position: absolute;
    z-index: 0;
    top: 50%;
    right: 0.2rem;
    left: 0.2rem;
    height: 1px;
    background: #d7c69e;
    content: "";
}

.trail-sign {
    position: relative;
    z-index: 1;
    display: grid;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid #d7c69e;
    border-radius: 50%;
    background: var(--surface);
    color: #9a8055;
    font-size: 0.72rem;
    place-items: center;
}

.trail-sign-found {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.question {
    position: relative;
    z-index: 0;
    isolation: isolate;
    margin: clamp(3rem, 10vw, 6rem) 0;
    font-size: clamp(3.3rem, 12vw, 6.5rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
}

.question::before {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: min(90%, 36rem);
    height: 145%;
    border: 1px solid rgba(49, 95, 87, 0.07);
    border-radius: 48% 52% 46% 54% / 55% 46% 54% 45%;
    background: #f4f8f5;
    content: "";
    transform: translate(-50%, -50%) rotate(-1deg);
}

.format-label {
    width: max-content;
    margin: 1.4rem auto -2rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: #f3f7f6;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.25;
}

.question-story {
    max-width: 42rem;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(1.8rem, 6vw, 3rem);
    line-height: 1.25;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.answer-button {
    display: grid;
    width: 100%;
    min-height: 4.6rem;
    border: 2px solid var(--border);
    border-radius: 1rem 1rem 1rem 0.35rem;
    background: var(--surface-raised);
    box-shadow: 0 4px 0 #dce5e1, 0 8px 18px rgba(35, 67, 59, 0.05);
    color: var(--text);
    cursor: pointer;
    font-size: clamp(1.45rem, 5vw, 2rem);
    font-weight: 750;
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    place-content: center;
}

.answer-button:hover:not(:disabled) {
    border-color: var(--primary);
    background: #f7faf9;
    box-shadow: 0 4px 0 #a9c4bb, 0 9px 20px rgba(35, 67, 59, 0.08);
    transform: translateY(-1px);
}

.answer-button:active:not(:disabled) {
    box-shadow: 0 2px 0 #a9c4bb;
    transform: translateY(2px);
}

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

.answer-button.answer-correct,
.answer-button.answer-selected-correct {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
    opacity: 1;
    box-shadow: 0 4px 0 #b7d8c9;
}

.answer-button.answer-selected-wrong {
    border-color: #9a8055;
    background: var(--neutral-soft);
    color: #655438;
    opacity: 1;
    box-shadow: 0 4px 0 #dfd2bc;
}

.answer-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.number-answer-form {
    max-width: 28rem;
    margin: 0 auto;
}

.number-answer-form > label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 800;
}

.number-answer-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.number-answer-form input {
    min-width: 0;
    min-height: 3.6rem;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.85rem;
    color: var(--text);
    font: inherit;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
}

.number-answer-form input:focus {
    border-color: var(--primary);
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.number-answer-form input:disabled {
    background: #f3f7f6;
    color: var(--muted);
}

.feedback {
    margin-top: 1.4rem;
    padding: 1rem 1.2rem;
    border-radius: 0.9rem;
    text-align: center;
}

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

.feedback-neutral {
    background: var(--neutral-soft);
    color: #655438;
}

.trail-discovery {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    border: 1px solid #d9bd83;
    border-radius: 0.9rem;
    background: #fffaf0;
    color: #6d562c;
}

.trail-discovery span {
    font-size: 1.4rem;
}

.next-form {
    margin-top: 1rem;
    text-align: right;
}

.result-mark {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.3rem;
    border: 2px solid #a9d1bf;
    border-radius: 50% 50% 50% 0.8rem;
    background: var(--success-soft);
    color: var(--success);
    font-size: 2.5rem;
    font-weight: 800;
    box-shadow: 5px 5px 0 rgba(38, 113, 83, 0.12);
    place-items: center;
}

.score {
    margin: 2rem 0 0;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
}

.score strong {
    color: var(--primary);
    font-size: 1.35em;
}

.expedition-result {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border: 1px solid #dfc891;
    border-radius: 1rem 1rem 1rem 0.35rem;
    background:
        linear-gradient(90deg, rgba(217, 155, 61, 0.07) 1px, transparent 1px) 0 0 / 2rem 2rem,
        linear-gradient(rgba(217, 155, 61, 0.07) 1px, transparent 1px) 0 0 / 2rem 2rem,
        #fffaf0;
}

.expedition-result h2,
.expedition-result p {
    margin: 0.35rem 0 0;
}

.next-teaser {
    color: var(--primary);
}

.continue-expedition {
    display: grid;
    gap: 1rem;
}

.research-station {
    margin: 1.2rem 0;
    padding: 1.1rem;
    border: 2px solid #aebfba;
    border-radius: 1rem 1rem 1rem 0.35rem;
    background: linear-gradient(145deg, #f7faf9, #edf4f1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
    text-align: left;
}

.station-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.station-heading h2 {
    margin: 0;
    font-size: 1.25rem;
}

.station-heading > strong {
    color: var(--muted);
    font-size: 0.82rem;
}

.station-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.station-module {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    min-height: 7.5rem;
    padding: 0.85rem;
    border: 2px solid var(--border);
    border-radius: 0.8rem 0.8rem 0.8rem 0.25rem;
    background: #edf1f0;
    color: var(--muted);
}

.station-module-active {
    border-color: var(--primary);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 0 #c9d8d3;
}

.station-module-new {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.station-symbol {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 1.35rem;
    font-weight: 800;
    place-items: center;
}

.station-module-active .station-symbol {
    color: var(--primary);
}

.station-module h3,
.station-module p {
    margin: 0;
}

.station-module h3 {
    font-size: 1rem;
}

.station-module p {
    margin-top: 0.2rem;
    font-size: 0.82rem;
}

.station-module details {
    margin-top: 0.55rem;
    font-size: 0.82rem;
}

.station-module summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.station-new-label {
    grid-column: 1 / -1;
    color: #6d562c;
    font-size: 0.75rem;
}

.expedition-log {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.expedition-log > summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.expedition-log ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

.expedition-log li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
}

.expedition-log li > span {
    color: var(--primary);
    font-size: 1.3rem;
}

.expedition-log small,
.expedition-log strong,
.expedition-log p {
    display: block;
}

.expedition-log small {
    color: var(--muted);
    font-size: 0.7rem;
}

.expedition-log p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.expedition-log li > b {
    color: #6d562c;
    font-size: 0.7rem;
}

.expedition-event-new {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.finding-archive {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.finding-archive > summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 800;
}

.finding-archive ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

.finding-archive li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
}

.finding-archive li > span {
    color: var(--primary);
    font-size: 1.15rem;
}

.finding-archive strong,
.finding-archive p {
    display: block;
}

.finding-archive p {
    margin: 0.15rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.finding-archive li > b {
    color: #6d562c;
    font-size: 0.7rem;
}

.station-decision {
    margin: 1.4rem 0;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.station-decision h2,
.station-decision > p:last-of-type {
    margin: 0.35rem 0 0;
}

.station-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.station-choice-grid form {
    display: flex;
}

.station-choice {
    display: grid;
    width: 100%;
    min-height: 7rem;
    padding: 0.9rem;
    border: 2px solid var(--primary);
    border-radius: 0.9rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    gap: 0.25rem;
    place-items: center;
}

.station-choice > span {
    color: var(--primary);
    font-size: 1.7rem;
}

.station-choice small {
    color: var(--muted);
}

.station-choice:hover {
    background: #f3f7f6;
}

.station-choice:focus-visible,
.station-module summary:focus-visible,
.expedition-log > summary:focus-visible,
.finding-archive > summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (min-width: 70rem) {
    .site-header,
    .page-shell {
        width: min(100% - 3rem, 112rem);
    }

    .page-shell {
        padding: 1rem 0 2rem;
    }

    .welcome-card-wide,
    .collection-card,
    .progress-card {
        max-width: none;
        margin-top: 0;
    }

    .welcome-card-wide {
        display: grid;
        grid-template-columns: minmax(38rem, 1.45fr) minmax(24rem, 0.75fr);
        grid-template-rows: auto auto auto 1fr auto;
        align-items: start;
        gap: 0 1.25rem;
        padding: 1.75rem;
        text-align: left;
    }

    .welcome-card-wide > .eyebrow,
    .welcome-card-wide > h1,
    .welcome-card-wide > .intro {
        grid-column: 1 / -1;
    }

    .welcome-card-wide > .intro {
        width: 100%;
        margin: 0.65rem 0 1.25rem;
    }

    .welcome-card-wide > .research-station {
        grid-column: 2;
        grid-row: 4 / span 2;
        margin: 0;
    }

    .welcome-card-wide > .mission-paths {
        grid-column: 1;
        grid-row: 4;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-card-wide > .mixed-practice {
        grid-column: 1;
        grid-row: 5;
    }

    .welcome-card-wide .mission-path {
        padding: 0.9rem;
    }

    .welcome-card-wide .path-heading {
        margin-bottom: 0.7rem;
    }

    .welcome-card-wide .node-circle {
        width: 2.7rem;
        height: 2.7rem;
    }

    .welcome-card-wide .path-node:not(:last-child)::after {
        top: 1.3rem;
    }

    .welcome-card-wide .node-title {
        font-size: 0.64rem;
    }

    .welcome-card-wide .station-modules {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .welcome-card-wide .station-module {
        min-height: 0;
    }

    .welcome-card-wide .expedition-log ol,
    .welcome-card-wide .finding-archive ul {
        grid-template-columns: 1fr;
    }

    .mission-card {
        max-width: 96rem;
        margin: 0 auto;
        padding: 2rem clamp(2rem, 4vw, 4rem);
    }

    .mission-card .question {
        margin: clamp(2.25rem, 6vh, 4rem) 0;
        font-size: clamp(4rem, 7vw, 6.5rem);
    }

    .mission-card .question-story {
        margin-right: auto;
        margin-left: auto;
        font-size: clamp(2rem, 3.2vw, 3rem);
    }

    .mission-card .answer-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mission-card .answer-button {
        min-height: 5.2rem;
        font-size: clamp(1.55rem, 2.4vw, 2rem);
    }

    .result-card {
        max-width: 96rem;
        margin-top: 0;
        padding: 2rem clamp(2rem, 4vw, 4rem);
    }

    .result-card .station-modules {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .result-card .expedition-log ol,
    .result-card .finding-archive ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .collection-card,
    .progress-card {
        padding: 2rem;
    }

    .knowledge-grid {
        grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    }

    .knowledge-card {
        min-height: 10.5rem;
    }

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

    .progress-item {
        padding: 1.25rem;
    }
}

@media (max-width: 34rem) {
    .page-shell {
        width: min(100% - 1rem, 52rem);
        padding-top: 0.25rem;
    }

    .welcome-card,
    .mission-card,
    .result-card,
    .auth-card,
    .progress-card {
        border-radius: 1.1rem;
    }

    .collection-card {
        border-radius: 1.1rem;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        flex-wrap: wrap;
        gap: 0.65rem 1rem;
    }

    .profile-name {
        display: none;
    }

    .progress-grid {
        grid-template-columns: 1fr;
    }

    .progress-stats {
        grid-template-columns: 1fr 1fr;
    }

    .learning-notes {
        grid-template-columns: 1fr;
    }

    .mission-history li div {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .mission-header {
        align-items: start;
        flex-direction: column;
        gap: 0.65rem;
    }

    .expedition-status {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.7rem;
    }

    .trail-progress {
        grid-column: 1 / -1;
        min-width: 0;
        text-align: left;
    }

    .trail-signs {
        justify-content: flex-start;
    }

    .answer-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .number-answer-form > div {
        grid-template-columns: 1fr;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .topic-mixed {
        grid-column: auto;
    }

    .mission-path {
        overflow-x: auto;
    }

    .path-map {
        min-width: 31rem;
    }

    .mixed-practice {
        align-items: stretch;
        flex-direction: column;
    }

    .mixed-practice .primary-button {
        width: 100%;
    }

    .knowledge-grid {
        grid-template-columns: 1fr;
    }

    .question {
        margin: 2.7rem 0;
    }

    .next-form .primary-button {
        width: 100%;
    }

    .station-heading {
        align-items: start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .station-modules,
    .station-choice-grid,
    .expedition-log ol,
    .finding-archive ul {
        grid-template-columns: 1fr;
    }

    .continue-expedition .primary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
