:root {
    color-scheme: light;
    --page: #eef7f6;
    --surface: #fbfefd;
    --quiet: #dcecea;
    --ink: #17363a;
    --muted: #5f7779;
    --accent: #ec6547;
    --copy: #5f7779;
    --soft: #dcecea;
    --warm-soft: #dcecea;
    --accent-2: #1f8b88;
    --sky: #bfe8e4;
    --gate: #277f7b;
    --focus: #ad3d27;
    --max: 1200px;
    --header: 128px;
}
[data-theme="dark"] {
    color-scheme: dark;
    --page: #132326;
    --surface: #1a3033;
    --quiet: #244145;
    --ink: #eefafa;
    --muted: #a8c0c2;
    --accent: #ff8c70;
    --copy: #a8c0c2;
    --soft: #244145;
    --warm-soft: #244145;
    --accent-2: #69c6c0;
    --sky: #1e4246;
    --gate: #75c9c3;
    --focus: #ff9c83;
}
html {
    scroll-padding-top: calc(var(--header) + 28px);
}
body {
    background: var(--page);
    color: var(--ink);
    line-height: 1.6;
}
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.icon-button:hover {
    background: var(--quiet);
}
.icon-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
main {
    display: block;
    width: min(var(--max), calc(100% - (var(--page-gutter) * 2)));
    max-width: var(--max);
    margin: 128px auto 0;
    padding: 0;
}
.variant-hero,
.game-section,
.content-section {
    width: 100%;
    max-width: none;
    margin: 0 0 var(--section-gap);
    padding: clamp(36px, 6vw, 72px);
    border-radius: 32px;
    background: var(--surface);
}
.variant-hero {
    padding-block: clamp(44px, 7vw, 72px);
    text-align: center;
}
.variant-hero .hero-content {
    max-width: 860px;
}
.variant-hero .hero-subtitle {
    max-width: 760px;
}
.variant-hero .text-link {
    margin-top: 20px;
}
.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
.variant-hero h1 {
    max-width: 890px;
    margin: 0 auto 20px;
    font-size: clamp(38px, 5vw, 56px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--accent);
    font-weight: 800;
    text-underline-offset: 5px;
}
.game-section,
.content-section {
    scroll-margin-top: calc(var(--header) + 28px);
    padding-block: clamp(56px, 8vw, 96px);
}
.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.72fr);
    gap: 48px;
    align-items: end;
    margin-bottom: 40px;
}
.section-heading h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.7rem);
    line-height: 1;
    letter-spacing: -0.045em;
}
.section-heading > p {
    margin: 0;
    color: var(--muted);
}
.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(250px, 1fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: start;
}
.game-panel {
    min-width: 0;
}
.score-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 0 16px;
    padding: 0;
    background: var(--quiet);
}
.score-strip div {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 72px;
    padding: 10px;
    text-align: center;
}
.score-strip dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}
.score-strip dd {
    margin: 2px 0 0;
    font-size: 1.35rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.stage-shell {
    position: relative;
    overflow: hidden;
    background: var(--sky);
    aspect-ratio: 16/10;
    min-height: 320px;
}
.game-toolbar {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    display: flex;
    padding: 4px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}
.stage-shell:hover .game-toolbar,
.stage-shell:focus-within .game-toolbar {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: manipulation;
}
.stage-message {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 32px;
    background: color-mix(in srgb, var(--sky) 82%, transparent);
    text-align: center;
}
.stage-message[hidden] {
    display: none;
}
.stage-message h3 {
    margin-bottom: 8px;
    font-size: clamp(1.7rem, 5vw, 3rem);
    line-height: 1;
    letter-spacing: -0.04em;
}
.stage-message p:not(.eyebrow) {
    max-width: 380px;
    color: var(--muted);
}
.primary-button {
    min-height: 44px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: 0;
    font-weight: 850;
    cursor: pointer;
}
.control-hint {
    max-width: 620px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}
.run-panel {
    position: sticky;
    top: calc(var(--header) + 28px);
}
.run-tile {
    display: grid;
    place-items: center;
    width: 148px;
    aspect-ratio: 1;
    margin: 20px 0;
    background: var(--accent);
    color: white;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 950;
    letter-spacing: -0.05em;
}
.run-panel h2 {
    margin-bottom: 8px;
    font-size: 2rem;
    letter-spacing: -0.04em;
}
.run-panel > p:not(.eyebrow) {
    color: var(--muted);
}
.progress-bar {
    height: 10px;
    margin: 26px 0 10px;
    background: var(--quiet);
}
.progress-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.2s ease;
}
.number-path {
    display: grid;
    grid-template-columns: repeat(11, minmax(74px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0 0 10px;
    overflow-x: auto;
    list-style: none;
}
.number-path li {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: var(--quiet);
    color: var(--accent-2);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.guide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(28px, 4vw, 56px);
    margin-bottom: 56px;
}
.guide-grid article > span {
    display: block;
    margin-bottom: 24px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 850;
}
.guide-grid h3 {
    margin-bottom: 8px;
    font-size: 1.25rem;
}
.guide-grid p,
.faq-list p {
    color: var(--muted);
}
.faq-list {
    max-width: 820px;
}
.faq-list details {
    padding: 22px 0;
}
.faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}
.faq-list summary::-webkit-details-marker {
    display: none;
}
.faq-list summary:after {
    content: "+";
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 400;
}
.faq-list details[open] summary:after {
    content: "−";
}
.faq-list p {
    margin: 10px 0 0;
}
.sr-status {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}
@media (max-width: 820px) {
    main {
        width: min(var(--max), calc(100% - 32px));
    }
    .variant-hero,
    .game-section,
    .content-section {
        padding-inline: clamp(20px, 6vw, 40px);
    }
    .section-heading,
    .game-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .run-panel {
        position: static;
        display: grid;
        grid-template-columns: 112px 1fr;
        gap: 8px 20px;
        align-items: center;
    }
    .run-panel .eyebrow,
    .run-panel .progress-bar,
    .run-panel > p:last-child {
        grid-column: 1/-1;
    }
    .run-tile {
        grid-row: 2/4;
        width: 112px;
        margin: 0;
    }
    .run-panel h2,
    .run-panel #run-copy {
        margin: 0;
    }
    .guide-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .guide-grid article > span {
        margin-bottom: 10px;
    }
}
@media (hover: none), (max-width: 680px) {
    .game-toolbar {
        position: absolute;
        top: 6px;
        right: 6px;
        background: transparent;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
    .stage-shell {
        aspect-ratio: 4/5;
        max-height: 72dvh;
    }
    .stage-message {
        padding: 24px;
    }
}
@media (max-width: 520px) {
    .score-strip div {
        min-height: 64px;
    }
    .run-panel {
        grid-template-columns: 86px 1fr;
    }
    .run-tile {
        width: 86px;
    }
    .number-path {
        grid-template-columns: repeat(11, 70px);
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *:before,
    *:after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
