:root {
    --number-ink: #193634;
    --number-muted: #627286;
    --number-green: #237a5e;
    --number-green-dark: #155d46;
    --number-stage: #f7f7f4;
    --number-surface: #ffffff;
    --number-error: #a8513d;
    --number-page-space: 64px;
    --number-panel-space: 32px;
    --number-control-inset: 16px;
}

#number-test {
    scroll-margin-top: 128px;
}

.number-page {
    width: min(1200px, 100%);
    min-width: 0;
    margin: 32px 0;
    padding: var(--number-page-space);
    border-radius: 32px;
    background: #ffffff;
}

.number-container {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

[hidden] {
    display: none !important;
}

.number-intro {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    margin: 0 auto 28px;
    text-align: center;
}

.number-intro-eyebrow,
.number-stats-kicker,
.number-features .feature-kicker {
    color: var(--number-green);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.14em;
}

.number-intro-eyebrow {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
}

.number-intro h2 {
    margin-bottom: 12px;
    color: var(--number-ink);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.number-intro > p:last-child {
    color: #475569;
    font-size: 18px;
    line-height: 1.6;
}

.number-mode-picker {
    width: min(100%, 408px);
    min-height: 52px;
    margin: 0 auto;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: #f8f8f8;
    display: flex;
    isolation: isolate;
    position: relative;
}

.number-mode-picker::before {
    width: calc((100% - 16px) / 3);
    border-radius: 999px;
    background: #ffffff;
    content: "";
    position: absolute;
    inset: 4px auto 4px 4px;
    z-index: 0;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.number-mode-picker[data-mode="reverse"]::before {
    transform: translateX(calc(100% + 4px));
}

.number-mode-picker[data-mode="one-by-one"]::before {
    transform: translateX(calc(200% + 8px));
}

.number-mode-picker label {
    min-width: 0;
    min-height: 44px;
    cursor: pointer;
    display: flex;
    flex: 1;
    position: relative;
    z-index: 1;
}

.number-mode-picker input {
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
}

.number-mode-picker span {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--number-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
    transition: color 180ms ease-out;
}

.number-mode-picker input:checked + span {
    color: var(--number-green);
}

.number-mode-picker input:focus-visible + span {
    outline: 3px solid rgb(35 122 94 / 34%);
    outline-offset: 1px;
}

.number-mode-picker:disabled label {
    cursor: not-allowed;
}

.number-mode-picker:disabled span {
    opacity: 0.58;
}

.number-mode-help {
    max-width: 560px;
    margin: 8px auto 20px;
    color: var(--number-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

.number-stage-shell {
    position: relative;
    isolation: isolate;
}

.number-stage {
    position: relative;
    min-height: 610px;
    padding: 28px;
    overflow: hidden;
    border-radius: 30px;
    background: var(--number-stage);
    color: var(--number-ink);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    justify-items: center;
    gap: 18px;
    touch-action: manipulation;
}

.number-status {
    width: 100%;
    min-height: 44px;
    color: #58766d;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.number-stage[data-state="idle"] .number-status,
.number-stage[data-state="result"] .number-status {
    visibility: hidden;
}

.number-core {
    width: 100%;
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 20px;
}

.number-stage-copy {
    width: min(100%, 660px);
    min-height: 92px;
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
}

.number-stage-title {
    max-width: 100%;
    color: var(--number-ink);
    font-size: clamp(36px, 5vw, 54px);
    font-weight: 720;
    line-height: 1.06;
    letter-spacing: -0.05em;
    overflow-wrap: anywhere;
}

.number-stage-hint {
    max-width: 540px;
    min-height: 24px;
    margin-top: 9px;
    color: var(--number-muted);
    font-size: 15px;
    line-height: 1.55;
}

.number-stage[data-state="showing"] .number-stage-title,
.number-stage[data-state="correct"] .number-stage-title {
    color: var(--number-green);
}

.number-stage[data-state="result"] .number-stage-title {
    color: var(--number-error);
}

.number-surface {
    position: relative;
    width: min(100%, 820px);
    min-height: 264px;
    border-radius: 28px;
    background: var(--number-surface);
    display: grid;
    place-items: center;
}

.number-display {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 264px;
    padding: 36px;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.number-value {
    --number-value-size: 68px;
    max-width: 100%;
    color: var(--number-ink);
    font-size: min(var(--number-value-size), 9vw);
    font-variant-numeric: tabular-nums;
    font-weight: 720;
    line-height: 1.16;
    letter-spacing: 0.035em;
    text-align: center;
    word-break: break-all;
    transition: opacity 200ms ease-in;
}

.number-value-placeholder {
    color: var(--number-green);
    opacity: 0.15;
    letter-spacing: 0.16em;
}

.number-value.is-fading {
    opacity: 0;
}

.number-timer {
    width: min(160px, calc(100% - 72px));
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe8e4;
    opacity: 0;
    position: absolute;
    bottom: 30px;
}

.number-timer::after {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #7bb49d;
    content: "";
    display: block;
    transform: scaleX(1);
    transform-origin: left;
}

.number-timer.is-running {
    opacity: 1;
}

.number-timer.is-running::after {
    animation: number-timer var(--number-display-duration, 1200ms) linear forwards;
}

@keyframes number-timer {
    to {
        transform: scaleX(0);
    }
}

.number-recall-form {
    width: min(100%, 580px);
    padding: 32px;
}

.number-recall-form label {
    margin-bottom: 8px;
    padding-inline: 6px;
    color: var(--number-ink);
    display: block;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.number-input-row {
    width: 100%;
    min-width: 0;
    padding: 6px;
    border-radius: 20px;
    background: #eef4f1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    transition: background-color 180ms ease-out;
}

.number-input-row:focus-within {
    background: #e7f0eb;
}

.number-input-row input {
    width: 100%;
    min-width: 0;
    min-height: 56px;
    border: 0;
    border-radius: 14px;
    outline: 0;
    background: #ffffff;
    padding: 0 18px;
    color: var(--number-ink);
    caret-color: var(--number-green);
    font: inherit;
    font-size: 26px;
    font-variant-numeric: tabular-nums;
    font-weight: 680;
    letter-spacing: 0.04em;
    text-align: center;
}

.number-input-row button {
    min-width: 108px;
    min-height: 56px;
    border: 0;
    border-radius: 14px;
    outline: 0;
    background: var(--number-green);
    padding: 0 20px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 720;
    transition: background-color 180ms ease-out,
    color 180ms ease-out;
}

.number-input-row button:disabled {
    cursor: default;
    background: #dfe9e4;
    color: #6c8077;
}

.number-input-row button:not(:disabled):active {
    background: var(--number-green-dark);
}

.number-recall-form > p {
    margin-top: 8px;
    padding-inline: 6px;
    color: var(--number-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
}

.number-answer-comparison {
    width: min(100%, 680px);
    padding: 28px 34px;
    display: grid;
    gap: 20px;
}

.number-answer-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: baseline;
    gap: 16px;
}

.number-answer-row > span {
    color: var(--number-muted);
    font-size: 12px;
    font-weight: 700;
}

.number-answer-row > strong {
    min-width: 0;
    color: var(--number-ink);
    font-size: clamp(22px, 3.5vw, 32px);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.number-answer-digit {
    border-radius: 5px;
    padding: 1px;
}

.number-answer-digit.is-different {
    background: #f7dfd7;
    color: var(--number-error);
}

.number-answer-empty {
    color: var(--number-error);
    font-size: 16px;
    font-weight: 650;
    letter-spacing: 0;
}

.number-stage-action-slot {
    width: 100%;
    min-height: 66px;
    display: grid;
    place-items: center;
}

.number-stage-action {
    min-width: 116px;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: radial-gradient(circle, #ffffff 8%, transparent 100%);
    padding: 0 22px;
    color: var(--number-green);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: color 180ms ease-out;
}

.number-stage-tools {
    position: absolute;
    top: var(--number-control-inset);
    right: var(--number-control-inset);
    z-index: 8;
    display: flex;
    gap: 8px;
}

.number-fullscreen,
.number-stats-toggle {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 92%);
    color: var(--number-green);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: opacity 180ms ease-out,
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease-out,
    color 180ms ease-out;
}

.number-stats-toggle {
    position: absolute;
    bottom: var(--number-control-inset);
    left: var(--number-control-inset);
    z-index: 8;
}

.number-stats-toggle svg {
    transform-origin: center;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.number-stats-toggle[aria-expanded="true"] {
    background: #ffffff;
    color: var(--number-green-dark);
}

.number-stats-toggle[aria-expanded="true"] svg {
    transform: rotate(-12deg);
}

.number-fullscreen-exit {
    display: none;
}

.number-stage-shell[data-fullscreen="true"] .number-fullscreen-enter {
    display: none;
}

.number-stage-shell[data-fullscreen="true"] .number-fullscreen-exit {
    display: block;
}

.number-stage-shell:fullscreen,
.number-stage-shell:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--number-stage);
}

.number-stage-shell:fullscreen .number-stage,
.number-stage-shell:-webkit-full-screen .number-stage {
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    border-radius: 0;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
    align-content: stretch;
    gap: 0;
}

.number-stage-shell[data-fullscreen="true"] .number-core {
    width: min(100%, 1080px);
    grid-column: 1;
    grid-row: 2;
    align-self: center;
}

.number-stage-shell[data-fullscreen="true"] .number-stage-action-slot {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    padding-top: 16px;
}

.number-stage-shell[data-fullscreen="true"] .number-stage-tools {
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
}

.number-stage-shell[data-fullscreen="true"] .number-status {
    width: auto;
    min-height: 44px;
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    z-index: 8;
}

.number-stage-shell[data-fullscreen="true"] .number-stats-toggle {
    display: none;
}

.number-stats {
    margin-top: 32px;
}

.number-stats-inner {
    position: relative;
    padding: var(--number-panel-space);
    border-radius: 28px;
    background: radial-gradient(circle, var(--number-stage) 8%, transparent 100%);
}

.number-progress-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr);
    align-items: end;
    gap: clamp(16px, 3vw, 40px);
}

.number-stats-kicker {
    margin-bottom: 10px;
}

.number-progress-label,
.number-progress-best dt {
    color: var(--number-muted);
    font-size: 12px;
    font-weight: 700;
}

.number-progress-latest {
    min-width: 0;
    min-height: 104px;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
}

.number-progress-latest > strong {
    margin-top: 4px;
    color: var(--number-green);
    display: block;
    font-size: clamp(42px, 6vw, 58px);
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    line-height: 1.1;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

.number-progress-context {
    margin-top: 6px;
    color: var(--number-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.number-progress-best {
    min-width: 0;
    margin: 0;
}

.number-progress-best > div {
    min-height: 76px;
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
}

.number-progress-best dd {
    margin: 5px 0 0;
    color: var(--number-ink);
    font-size: clamp(24px, 3vw, 34px);
    font-variant-numeric: tabular-nums;
    font-weight: 720;
    line-height: 1.2;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.number-history {
    position: relative;
    min-width: 0;
    margin-top: 24px;
}

.number-history summary {
    min-height: 48px;
    padding: 4px 0;
    color: var(--number-ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    font-weight: 700;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.number-history summary::-webkit-details-marker {
    display: none;
}

.number-history[open] .number-history-summary-copy {
    padding-right: 60px;
}

.number-history-summary-copy {
    min-width: 0;
}

.number-history-summary-copy strong {
    font-size: 15px;
    font-weight: 700;
}

.number-history-summary-icon {
    flex: none;
    color: var(--number-muted);
    transition: opacity 180ms ease-out,
    transform 180ms ease-out;
}

.number-history[open] .number-history-summary-icon {
    transform: rotate(180deg);
}

.number-history-panel {
    margin-top: 4px;
}

.number-history-actions {
    position: absolute;
    top: 4px;
    right: 34px;
    z-index: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.number-history-list {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
    list-style: none;
}

.number-history-empty {
    padding: 8px 0 0;
    color: var(--number-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.number-history-item {
    min-width: 0;
    padding: 14px 0;
    color: var(--number-muted);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 8px 24px;
    font-variant-numeric: tabular-nums;
}

.number-history-item:first-child {
    padding-top: 8px;
}

.number-history-item:last-child {
    padding-bottom: 0;
}

.number-history-score {
    color: var(--number-ink);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.number-history-time {
    color: var(--number-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    text-align: right;
    white-space: nowrap;
}

.number-history-item[aria-current="true"] .number-history-score,
.number-history-item[aria-current="true"] .number-history-time {
    color: var(--number-green);
}

.number-clear-data {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7c8985;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: opacity 180ms ease-out,
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 180ms ease-out,
    color 180ms ease-out;
}

.number-clear-data:disabled {
    cursor: default;
    opacity: 0.36;
}

.number-clear-data:not(:disabled):active {
    opacity: 0.62;
}

.number-stage-action:focus-visible,
.number-fullscreen:focus-visible,
.number-stats-toggle:focus-visible,
.number-history summary:focus-visible,
.number-clear-data:focus-visible {
    outline: 3px solid rgb(35 122 94 / 34%);
    outline-offset: 3px;
}

.number-features .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.number-features .feature-card {
    min-width: 0;
}

@media (hover: hover) and (pointer: fine) {
    .number-fullscreen,
    .number-stats-toggle,
    .number-history-summary-icon,
    .number-clear-data {
        opacity: 0;
        pointer-events: none;
        transition-duration: 480ms;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }

    .number-fullscreen,
    .number-stats-toggle,
    .number-clear-data {
        transform: translateY(3px);
    }

    .number-stage-shell:hover .number-fullscreen,
    .number-fullscreen:focus-visible,
    .number-stage-shell:hover .number-stats-toggle,
    .number-stats-toggle:focus-visible,
    .number-stats-toggle[aria-expanded="true"] {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-duration: 560ms;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }

    .number-stats:hover .number-clear-data:not(:disabled),
    .number-clear-data:focus-visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        transition-duration: 560ms;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }

    .number-stats:hover .number-history-summary-icon,
    .number-history summary:focus-visible .number-history-summary-icon {
        opacity: 1;
        pointer-events: auto;
        transition-duration: 560ms;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }

    .number-stage-action:hover,
    .number-fullscreen:hover,
    .number-stats-toggle:hover {
        color: var(--number-green-dark);
    }

    .number-input-row button:not(:disabled):hover {
        background: var(--number-green-dark);
    }

    .number-mode-picker:not(:disabled) label:hover span {
        color: var(--number-green-dark);
    }

    .number-clear-data:not(:disabled):hover {
        background: rgb(142 104 86 / 9%);
        color: #8e6856;
    }
}

@media (max-width: 1023.98px) {
    :root {
        --number-page-space: 40px;
    }

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

@media (max-width: 767.98px) {
    :root {
        --number-page-space: 24px;
        --number-panel-space: 20px;
        --number-control-inset: 12px;
    }

    .number-intro {
        margin-bottom: 24px;
    }

    .number-intro > p:last-child {
        font-size: 16px;
    }

    .number-stage {
        padding: 20px;
        border-radius: 24px;
    }

    .number-stage-shell[data-fullscreen="false"] .number-stage {
        min-height: auto;
        grid-template-rows: auto auto auto;
        align-content: start;
        gap: 0;
    }

    .number-core {
        gap: 16px;
    }

    .number-stage-shell[data-fullscreen="false"] .number-core {
        padding-top: 8px;
    }

    .number-stage-copy {
        min-height: 84px;
    }

    .number-stage-title {
        font-size: clamp(34px, 10vw, 48px);
    }

    .number-surface,
    .number-display {
        min-height: 244px;
    }

    .number-display {
        padding: 28px 22px;
    }

    .number-value {
        font-size: min(var(--number-value-size), 15vw);
    }

    .number-recall-form {
        padding: 24px;
    }

    .number-stage-shell[data-fullscreen="false"] .number-stage-action-slot {
        min-height: 0;
    }

    .number-stage-shell[data-fullscreen="false"] .number-stage-action {
        margin-top: 16px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-action-slot {
        min-height: 60px;
    }

    .number-stage-shell:fullscreen .number-stage,
    .number-stage-shell:-webkit-full-screen .number-stage {
        padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-action-slot {
        padding-top: 12px;
    }

    .number-stats {
        margin-top: 24px;
    }

    .number-stats-inner {
        border-radius: 24px;
    }

    .number-progress-overview {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .number-progress-latest {
        min-height: 88px;
    }

    .number-progress-best > div {
        min-height: 64px;
    }
}

@media (max-width: 620px) {
    .number-features .features-grid,
    .faq-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .number-input-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .number-input-row button {
        width: 100%;
        min-height: 50px;
    }

    .number-answer-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
}

@media (max-width: 420px) {
    :root {
        --number-page-space: 16px;
        --number-panel-space: 16px;
        --number-control-inset: 12px;
    }

    .number-stage {
        padding: 16px;
    }

    .number-mode-picker span {
        padding-inline: 8px;
        font-size: 13px;
    }

    .number-stage-copy {
        min-height: 76px;
    }

    .number-stage-hint {
        max-width: 290px;
        font-size: 14px;
    }

    .number-surface,
    .number-display {
        min-height: 224px;
    }

    .number-recall-form {
        padding: 20px 16px;
    }

    .number-answer-comparison {
        padding: 22px 20px;
    }

    .number-progress-latest > strong {
        font-size: clamp(38px, 12vw, 50px);
    }

    .number-history-item {
        gap: 8px 12px;
    }
}

@media (max-width: 767.98px) and (max-height: 600px) and (orientation: portrait) {
    .number-stage-shell[data-fullscreen="true"] .number-core {
        gap: 12px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-copy {
        min-height: 68px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-hint {
        margin-top: 6px;
        font-size: 13px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-surface,
    .number-stage-shell[data-fullscreen="true"] .number-display {
        min-height: 200px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-recall-form {
        padding: 16px;
    }
}

@media (max-width: 347.98px) {
    html,
    body,
    header,
    main,
    footer {
        min-width: 320px;
    }
}

@media (max-height: 640px) and (orientation: landscape) {
    .number-stage {
        min-height: 470px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage {
        padding: max(16px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
        grid-template-columns: minmax(128px, 0.72fr) minmax(0, 480px) minmax(0, 0.28fr);
        grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
        column-gap: clamp(12px, 2.5vw, 24px);
    }

    .number-stage-shell[data-fullscreen="true"] .number-core {
        display: contents;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-copy {
        width: min(100%, 280px);
        grid-column: 1;
        grid-row: 2;
        justify-self: end;
        align-self: center;
        min-height: 0;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-title {
        font-size: clamp(28px, 5vw, 42px);
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-hint {
        max-width: 250px;
        font-size: 13px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-surface,
    .number-stage-shell[data-fullscreen="true"] .number-display {
        width: min(58vw, 480px);
        min-height: min(62vh, 230px);
        grid-column: 2;
        grid-row: 2;
    }

    .number-stage-shell[data-fullscreen="true"] .number-recall-form {
        padding: 16px 20px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-answer-comparison {
        padding: 16px 20px;
    }

    .number-stage-shell[data-fullscreen="true"] .number-stage-action-slot {
        grid-column: 2;
        grid-row: 3;
        padding-top: 8px;
    }
}

@media (max-height: 420px) and (orientation: landscape) {
    .number-stage-shell[data-fullscreen="true"] .number-stage-hint,
    .number-stage-shell[data-fullscreen="true"] .number-recall-form > p {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .number-mode-picker::before,
    .number-mode-picker span,
    .number-value,
    .number-stage-action,
    .number-fullscreen,
    .number-stats-toggle,
    .number-stats-toggle svg,
    .number-input-row,
    .number-input-row button,
    .number-history-summary-icon,
    .number-clear-data {
        transition: none;
    }

    .number-timer {
        display: none;
    }
}

@media (forced-colors: active) {
    .number-mode-picker,
    .number-stage,
    .number-surface,
    .number-stage-action,
    .number-fullscreen,
    .number-stats-toggle,
    .number-input-row,
    .number-input-row input,
    .number-input-row button,
    .number-history summary,
    .number-stats-inner {
        border: 1px solid CanvasText;
    }

    .number-input-row button {
        background: Highlight;
        color: HighlightText;
    }

    .number-mode-picker input:checked + span {
        outline: 2px solid Highlight;
    }

    .number-input-row:focus-within {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }

    .number-answer-digit.is-different {
        outline: 2px solid Highlight;
    }
}
