:root {
    --stroop-ink: #193634;
    --stroop-muted: #627286;
    --stroop-green: #237a5e;
    --stroop-green-dark: #155d46;
    --stroop-stage: #eef7f2;
    --stroop-surface: #ffffff;
    --stroop-red: #ff0000;
    --stroop-blue: #0000ff;
    --stroop-color-green: #00ff00;
    --stroop-yellow: #ffff00;
    --stroop-background-red: #ff0000;
    --stroop-background-blue: #0000ff;
    --stroop-background-green: #00ff00;
    --stroop-background-yellow: #ffff00;
    --stroop-page-space: 64px;
    --stroop-panel-space: 32px;
    --stroop-control-inset: 16px;
}

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

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

.stroop-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;
}

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

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

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

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

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

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

.stroop-mode-picker::before {
    width: calc((100% - 12px) / 2);
    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);
}

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

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

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

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

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

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

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

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

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

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

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

.stroop-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;
}

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

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

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

.stroop-stage[data-state="active"] .stroop-stage-title {
    color: #42685d;
}

.stroop-stage-title {
    max-width: 100%;
    color: var(--stroop-ink);
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 720;
    line-height: 1.12;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
    transition: color 180ms ease-out;
}

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

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

.stroop-surface {
    position: relative;
    width: min(100%, 820px);
    min-height: 296px;
    padding: 32px;
    border-radius: 28px;
    background: radial-gradient(circle, #ffffff 8%, transparent 100%);
    display: grid;
    place-items: center;
}

.stroop-play {
    width: 100%;
    min-width: 0;
    display: grid;
    gap: 22px;
}

.stroop-stimulus {
    position: relative;
    width: min(100%, 600px);
    min-height: 148px;
    margin-inline: auto;
    padding: 24px;
    overflow: hidden;
    border-radius: 26px;
    background: transparent;
    isolation: isolate;
    display: grid;
    place-items: center;
}

.stroop-stimulus:not([data-background="neutral"]) {
    --stroop-background-color: transparent;

    width: min(100%, 520px);
    padding: 48px clamp(28px, 8vw, 48px) 14px;
}

.stroop-stimulus:not([data-background="neutral"])::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 8px 24px;
    background: var(--stroop-background-color);
    clip-path: polygon(
            8% 3%,
            26% 0,
            78% 2%,
            94% 10%,
            100% 35%,
            97% 73%,
            86% 94%,
            63% 100%,
            24% 97%,
            6% 86%,
            0 60%,
            2% 25%
    );
    -webkit-mask-image: radial-gradient(
            ellipse at center,
            #000000 64%,
            rgb(0 0 0 / 90%) 78%,
            transparent 100%
    );
    mask-image: radial-gradient(
            ellipse at center,
            #000000 64%,
            rgb(0 0 0 / 90%) 78%,
            transparent 100%
    );
    transform: rotate(-0.2deg);
}

.stroop-stimulus[data-background="red"] {
    --stroop-background-color: var(--stroop-background-red);
}

.stroop-stimulus[data-background="blue"] {
    --stroop-background-color: var(--stroop-background-blue);
}

.stroop-stimulus[data-background="green"] {
    --stroop-background-color: var(--stroop-background-green);
}

.stroop-stimulus[data-background="yellow"] {
    --stroop-background-color: var(--stroop-background-yellow);
}

.stroop-rule-cue {
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgb(255 255 255 / 78%);
    color: #47655d;
    position: absolute;
    z-index: 2;
    top: 18px;
    left: 50%;
    display: flex;
    align-items: center;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.stroop-word {
    position: relative;
    z-index: 1;
    max-width: 100%;
    font-size: clamp(60px, 8vw, 86px);
    font-weight: 780;
    line-height: 1;
    letter-spacing: -0.04em;
    text-align: center;
    text-transform: uppercase;
    -webkit-font-smoothing: antialiased;
    forced-color-adjust: none;
}

.stroop-word[data-color="red"] {
    color: var(--stroop-red);
}

.stroop-word[data-color="blue"] {
    color: var(--stroop-blue);
}

.stroop-word[data-color="green"] {
    color: var(--stroop-color-green);
}

.stroop-word[data-color="yellow"] {
    color: var(--stroop-yellow);
}

.stroop-answers {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(4, clamp(56px, 6.2vw, 68px));
    gap: clamp(12px, 1.6vw, 18px);
}

.stroop-answers button {
    --stroop-answer-color: transparent;

    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    outline: 0;
    background: var(--stroop-answer-color);
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    forced-color-adjust: none;
    touch-action: manipulation;
    transition: opacity 150ms ease-out;
}

.stroop-answers button[data-color="red"] {
    --stroop-answer-color: var(--stroop-red);
}

.stroop-answers button[data-color="blue"] {
    --stroop-answer-color: var(--stroop-blue);
}

.stroop-answers button[data-color="green"] {
    --stroop-answer-color: var(--stroop-color-green);
}

.stroop-answers button[data-color="yellow"] {
    --stroop-answer-color: var(--stroop-yellow);
}

.stroop-answers button:disabled {
    cursor: default;
}

.stroop-answers button:not(:disabled):active {
    outline: 4px solid rgb(25 54 52 / 18%);
    outline-offset: 4px;
}

.stroop-answers button[data-answer-feedback="correct"]::after {
    content: "";
    position: absolute;
    inset: -7px;
    border: 3px solid rgb(25 54 52 / 42%);
    border-radius: 50%;
    opacity: 0.58;
    pointer-events: none;
    animation: stroop-answer-ring 260ms ease-out both;
}

.stroop-answers button[data-answer-feedback="wrong"] {
    background: transparent;
}

.stroop-answers button[data-answer-feedback="wrong"]::before,
.stroop-answers button[data-answer-feedback="wrong"]::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--stroop-answer-color);
    pointer-events: none;
}

.stroop-answers button[data-answer-feedback="wrong"]::before {
    clip-path: polygon(0 0, 58% 0, 47% 100%, 0 100%);
    animation: stroop-answer-break-left 420ms ease-out both;
}

.stroop-answers button[data-answer-feedback="wrong"]::after {
    clip-path: polygon(58% 0, 100% 0, 100% 100%, 47% 100%);
    animation: stroop-answer-break-right 420ms ease-out both;
}

.stroop-stage[data-feedback="correct"] .stroop-word {
    opacity: 0.82;
}

.stroop-stage[data-feedback="wrong"] .stroop-word {
    opacity: 0.58;
}

@keyframes stroop-answer-ring {
    0% {
        opacity: 0;
        transform: scale(0.72);
    }

    45% {
        opacity: 1;
    }

    100% {
        opacity: 0.58;
        transform: scale(1);
    }
}

@keyframes stroop-answer-break-left {
    0% {
        opacity: 1;
        transform: translate(0) rotate(0);
    }

    100% {
        opacity: 0.3;
        transform: translate(-3px, 2px) rotate(-2deg);
    }
}

@keyframes stroop-answer-break-right {
    0% {
        opacity: 1;
        transform: translate(0) rotate(0);
    }

    100% {
        opacity: 0.3;
        transform: translate(3px, -2px) rotate(2deg);
    }
}

.stroop-result {
    width: min(100%, 520px);
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 32px;
}

.stroop-result > div {
    min-width: 0;
    text-align: center;
}

.stroop-result span {
    color: var(--stroop-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.stroop-result strong {
    margin-top: 8px;
    color: var(--stroop-ink);
    display: block;
    font-size: clamp(28px, 4vw, 42px);
    font-variant-numeric: tabular-nums;
    font-weight: 740;
    line-height: 1.1;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

.stroop-result > div:first-child strong {
    color: var(--stroop-green);
}

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

.stroop-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(--stroop-green);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: color 180ms ease-out;
}

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

.stroop-sound,
.stroop-fullscreen,
.stroop-stats-toggle {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 92%);
    color: var(--stroop-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;
}

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

.stroop-sound-off,
.stroop-fullscreen-exit {
    display: none;
}

.stroop-sound[aria-pressed="false"] .stroop-sound-on {
    display: none;
}

.stroop-sound[aria-pressed="false"] .stroop-sound-off {
    display: block;
}

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

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

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

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

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

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

.stroop-stage-shell:fullscreen .stroop-stage,
.stroop-stage-shell:-webkit-full-screen .stroop-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;
}

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

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

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

.stroop-stage-shell[data-fullscreen="true"] .stroop-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;
}

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

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

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

.stroop-progress-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: end;
    gap: clamp(18px, 4vw, 48px);
}

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

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

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

.stroop-progress-latest > strong {
    margin-top: 4px;
    color: var(--stroop-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;
}

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

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

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

.stroop-progress-best dd {
    margin: 5px 0 0;
    color: var(--stroop-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;
}

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

.stroop-history summary {
    min-height: 48px;
    padding: 4px 0;
    color: var(--stroop-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;
}

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

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

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

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

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

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

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

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

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

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

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

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

.stroop-history-item strong {
    color: var(--stroop-ink);
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.stroop-history-metric,
.stroop-history-time {
    color: var(--stroop-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.stroop-history-time {
    text-align: right;
}

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

.stroop-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;
}

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

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

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

.stroop-answers button:focus-visible {
    outline-color: var(--stroop-ink);
    outline-offset: 4px;
}

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

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

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

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

    .stroop-stage-shell:hover .stroop-sound,
    .stroop-sound:focus-visible,
    .stroop-stage-shell:hover .stroop-fullscreen,
    .stroop-fullscreen:focus-visible,
    .stroop-stage-shell:hover .stroop-stats-toggle,
    .stroop-stats-toggle:focus-visible,
    .stroop-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);
    }

    .stroop-stats:hover .stroop-clear-data:not(:disabled),
    .stroop-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);
    }

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

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

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

    .stroop-answers button:not(:disabled):hover {
        outline: 3px solid rgb(25 54 52 / 10%);
        outline-offset: 4px;
    }

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

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

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

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

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

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

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

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

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

    .stroop-stage-copy {
        min-height: 78px;
    }

    .stroop-stage-title {
        font-size: clamp(26px, 7.5vw, 34px);
    }

    .stroop-surface {
        min-height: 284px;
        padding: 24px;
    }

    .stroop-play {
        gap: 22px;
    }

    .stroop-stimulus {
        min-height: 132px;
        padding: 20px 14px;
    }

    .stroop-stimulus:not([data-background="neutral"]) {
        padding-block: 44px 14px;
    }

    .stroop-rule-cue {
        top: 14px;
    }

    .stroop-word {
        font-size: clamp(52px, 14vw, 72px);
    }

    .stroop-answers {
        grid-template-columns: repeat(4, clamp(52px, 13vw, 60px));
        gap: 10px;
    }

    .stroop-answers button {
        min-height: 0;
    }

    .stroop-stage-shell[data-fullscreen="false"] .stroop-stage[data-action-visible="false"] {
        grid-template-rows: auto auto;
    }

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

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

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

    .stroop-stage-shell:fullscreen .stroop-stage,
    .stroop-stage-shell:-webkit-full-screen .stroop-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));
    }

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

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

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

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

    .stroop-progress-best > div {
        min-height: 68px;
    }

    .stroop-history-item {
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) auto;
        align-items: baseline;
        gap: 8px;
    }

    .stroop-history-metric {
        min-width: 0;
        white-space: nowrap;
    }

    .stroop-history-time {
        grid-column: auto;
        text-align: right;
        white-space: nowrap;
    }
}

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

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

    .stroop-stage {
        padding: 16px;
    }

    .stroop-stage-copy {
        min-height: 72px;
    }

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

    .stroop-surface {
        padding: 20px 16px;
    }

    .stroop-stimulus:not([data-background="neutral"]) {
        padding-inline: 18px;
    }

    .stroop-stimulus:not([data-background="neutral"])::before {
        inset: 6px 8px;
        -webkit-mask-image: radial-gradient(
                ellipse at center,
                #000000 74%,
                rgb(0 0 0 / 94%) 86%,
                transparent 100%
        );
        mask-image: radial-gradient(
                ellipse at center,
                #000000 74%,
                rgb(0 0 0 / 94%) 86%,
                transparent 100%
        );
    }

    .stroop-rule-cue {
        min-height: 24px;
        padding-inline: 10px;
        font-size: 10px;
    }

    .stroop-word {
        font-size: clamp(46px, 14vw, 58px);
    }

    .stroop-answers {
        width: min(100%, 248px);
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .stroop-result {
        gap: 16px 8px;
    }

    .stroop-result strong {
        font-size: clamp(24px, 8vw, 34px);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .stroop-result span {
        font-size: 11px;
    }

    .stroop-history-item {
        grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) auto;
        gap-inline: 8px;
    }
}

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

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

    .stroop-stage-shell[data-fullscreen="true"] .stroop-core {
        gap: 10px;
    }

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

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

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

    .stroop-stage-shell[data-fullscreen="true"] .stroop-surface {
        width: min(78vw, 760px);
        min-height: 250px;
        padding-block: 20px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-stimulus {
        min-height: 76px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-word {
        font-size: clamp(42px, 10vh, 66px);
    }
}

@media (max-height: 430px) and (orientation: landscape) {
    .stroop-stage-shell[data-fullscreen="true"] .stroop-stage-copy {
        display: none;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-surface {
        min-height: 220px;
        padding-block: 16px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-play {
        gap: 14px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-stimulus {
        padding: 28px 16px 14px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-rule-cue {
        min-height: 24px;
        top: 7px;
        font-size: 10px;
    }

    .stroop-stage-shell[data-fullscreen="true"] .stroop-answers button {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stroop-stage-title,
    .stroop-mode-picker::before,
    .stroop-mode-picker span,
    .stroop-word,
    .stroop-answers button,
    .stroop-stage-action,
    .stroop-sound,
    .stroop-fullscreen,
    .stroop-stats-toggle,
    .stroop-stats-toggle svg,
    .stroop-history-summary-icon,
    .stroop-clear-data {
        transition: none;
    }

    .stroop-answers button[data-answer-feedback="correct"]::after {
        animation: none;
    }

    .stroop-answers button[data-answer-feedback="wrong"] {
        background: var(--stroop-answer-color);
        opacity: 0.34;
    }

    .stroop-answers button[data-answer-feedback="wrong"]::before,
    .stroop-answers button[data-answer-feedback="wrong"]::after {
        display: none;
    }
}

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

    .stroop-word {
        forced-color-adjust: none;
    }

}
