/* Page-level typography and box model tuning. Core theme tokens remain the source of truth. */
    .tf-game-page {
        font-size: 15px;
        line-height: 1.6;
    }

    .tf-game-page main {
        overflow: hidden;
    }

    .tf-game-page h1 {
        font-size: clamp(2rem, 3vw, 3rem);
        line-height: 1.12;
    }

    .tf-game-page h2.section-title {
        font-size: clamp(1.75rem, 2.5vw, 2.3rem);
        line-height: 1.18;
    }

    .tf-game-page h2:not(.section-title) {
        font-size: clamp(1.65rem, 2.3vw, 2.15rem);
        line-height: 1.2;
    }

    .tf-game-page .text-base {
        font-size: .98rem;
        line-height: 1.7;
    }

    .tf-game-page .text-lg {
        font-size: 1rem;
        line-height: 1.75;
    }

    .tf-game-page .section-inner {
        padding-block: 5.5rem;
    }

    .tf-game-page .kbd-tag {
        font-size: .7rem;
        letter-spacing: .16em;
    }

    .tf-game-page #frjTool {
        max-width: 960px;
        margin-inline: auto;
        padding: 1.15rem;
        background: color-mix(in srgb, var(--surface) 92%, white);
        backdrop-filter: blur(10px);
    }

    .tf-game-page .tf-test-header {
        margin-bottom: .85rem;
        padding-bottom: .85rem;
    }

    .tf-game-page .tf-test-tools {
        flex: 1 1 auto;
    }

    .tf-game-page .tf-control-label {
        color: var(--muted);
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .tf-game-page .tf-test-icon {
        display: grid;
        place-items: center;
        width: 2.65rem;
        height: 2.65rem;
        flex: none;
        border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
        border-radius: .75rem;
        background: color-mix(in srgb, var(--primary) 10%, white);
        box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 16%, transparent);
        color: var(--primary);
        font-size: 1.35rem;
    }

    .tf-game-page .tf-test-stats {
        margin-top: .85rem;
        gap: .55rem;
    }

    .tf-game-page .tf-stat-card {
        min-height: 4.25rem;
        padding: .6rem .75rem;
        border: 1px solid transparent;
        border-radius: .8rem;
        background: var(--surface2);
    }

    .tf-game-page .tf-stat-card .text-2xl {
        font-size: 1.35rem;
        line-height: 1.08;
    }

    .tf-game-page .tf-stat-card .text-\[11px\] {
        margin-top: .28rem;
        font-size: .58rem;
        letter-spacing: .09em;
    }

    .tf-game-page .tf-stat-speed {
        border-color: color-mix(in srgb, var(--primary) 10%, var(--border));
        background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    }

    .tf-game-page .tf-stat-accuracy {
        border-color: color-mix(in srgb, var(--green) 10%, var(--border));
        background: color-mix(in srgb, var(--green) 7%, var(--surface));
    }

    .tf-game-page .tf-stat-time {
        border-color: color-mix(in srgb, var(--purple) 10%, var(--border));
        background: color-mix(in srgb, var(--purple) 7%, var(--surface));
    }

    .tf-game-page .tf-stat-combo {
        border-color: color-mix(in srgb, var(--orange) 10%, var(--border));
        background: color-mix(in srgb, var(--orange) 7%, var(--surface));
    }

    .tf-game-page .tf-test-progress {
        height: .35rem;
        margin-top: .8rem;
        margin-bottom: .15rem;
        background: color-mix(in srgb, var(--border) 72%, transparent);
    }

    .tf-game-page #tfgProgressBar {
        background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 62%, var(--purple)));
    }

    .tf-game-page .frj-seg {
        min-height: 2.45rem;
        padding: .55rem .95rem;
        font-size: .875rem;
    }

    .tf-game-page #miniBlindSwitch .frj-seg {
        padding-inline: .75rem;
    }

    .tf-game-page #tfgWPM,
    .tf-game-page #tfgAcc,
    .tf-game-page #tfgTime {
        font-size: 1.35rem;
        line-height: 1.15;
    }

    .tf-game-page #tfgWordsViewport {
        min-height: 0;
        margin-top: .8rem;
        padding: .55rem .7rem .45rem;
        border: 1px solid var(--border);
        border-radius: .75rem;
        background: color-mix(in srgb, var(--surface) 82%, var(--surface3));
        font-size: 1.18rem;
        line-height: 1.8;
    }

    .tf-game-page #tfgInput {
        min-height: 3rem;
        margin-top: .7rem;
        padding: .68rem .85rem;
        border-width: 2px;
        border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
        font-size: .98rem;
    }

    .tf-game-page #tfgHint,
    .tf-game-page #tfgRestart {
        font-size: .78rem;
    }

    .tf-game-page #tfgContent>.mt-3 {
        margin-top: .55rem;
    }

    .tf-game-page section[aria-labelledby="why-heading"] .text-body,
    .tf-game-page section[aria-labelledby="related-heading"] .text-body {
        font-size: 1rem;
        line-height: 1.8;
    }

    .tf-game-page section[aria-labelledby="why-heading"] .section-inner {
        padding-block: 6.25rem;
    }

    .tf-game-page section[aria-labelledby="related-heading"] .section-inner,
    .tf-game-page section[aria-labelledby="faq-heading"] .section-inner {
        padding-block: 5.75rem;
    }

    .tf-game-page section[aria-labelledby="related-heading"] .group {
        min-height: 8.5rem;
        padding: 1.5rem;
    }

    .tf-game-page section[aria-labelledby="faq-heading"] details summary {
        min-height: 3.45rem;
        font-size: .95rem;
    }

    .tf-game-page section[aria-labelledby="faq-heading"] details>div {
        font-size: .95rem;
        line-height: 1.75;
    }

    .tf-game-page footer {
        font-size: .9rem;
    }

    .tf-game-page .tf-hero {
        isolation: isolate;
        background-image:
            linear-gradient(180deg, rgba(247, 250, 255, .48) 0%, rgba(255, 255, 255, .72) 44%, var(--bg) 88%),
            url('/assets/hero-france.webp');
        background-position: center top;
        background-repeat: no-repeat;
        background-size: cover;
    }

    .tf-game-page .typing-hero-art {
        display: none;
        position: absolute;
        z-index: -1;
        left: 50%;
        top: 9rem;
        width: min(58rem, 88vw);
        transform: translateX(-50%) perspective(900px) rotateX(48deg) rotateZ(-4deg);
        opacity: .24;
        filter: blur(.15px);
        pointer-events: none;
    }

    .tf-game-page .typing-key-row {
        display: flex;
        justify-content: center;
        gap: .55rem;
        margin-bottom: .55rem;
    }

    .tf-game-page .typing-key-row.offset {
        transform: translateX(-1.1rem);
    }

    .tf-game-page .typing-key-row.offset-wide {
        transform: translateX(1.1rem);
    }

    .tf-game-page .typing-key-row i {
        display: grid;
        place-items: center;
        width: 3.3rem;
        height: 3.3rem;
        border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
        border-radius: .65rem;
        background: color-mix(in srgb, var(--surface) 74%, var(--primary));
        box-shadow: 0 5px 0 color-mix(in srgb, var(--primary) 18%, transparent), 0 12px 25px rgba(15, 124, 255, .06);
        color: color-mix(in srgb, var(--primary) 70%, var(--text));
        font-family: var(--font-mono);
        font-size: 1rem;
        font-style: normal;
        font-weight: 700;
    }

    .tf-game-page .typing-key-row i:nth-child(3n) {
        background: color-mix(in srgb, var(--surface3) 72%, var(--primary));
    }

    @media (max-width: 640px) {
        .tf-game-page {
            font-size: 14px;
        }

        .tf-game-page #frjTool {
            padding: .85rem;
        }

        .tf-game-page #tfgDurations {
            width: 100%;
            overflow-x: auto;
            padding-bottom: .2rem;
        }

        .tf-game-page .tf-test-header {
            align-items: flex-start;
        }

        .tf-game-page .tf-test-tools {
            width: 100%;
            justify-content: space-between;
        }

        .tf-game-page .tf-blind-control {
            margin-left: auto;
        }

        .tf-game-page #tfgWordsViewport {
            min-height: 0;
            padding: .45rem .55rem .35rem;
            font-size: 1rem;
        }

        .tf-game-page #tfgHint {
            max-width: 75%;
        }

        .tf-game-page .typing-hero-art {
            top: 11rem;
            width: 48rem;
            opacity: .16;
        }

        .tf-game-page .typing-key-row {
            gap: .3rem;
        }

        .tf-game-page .typing-key-row i {
            width: 2.35rem;
            height: 2.35rem;
            font-size: .75rem;
        }

        .tf-game-page section[aria-labelledby="why-heading"] .section-inner,
        .tf-game-page section[aria-labelledby="related-heading"] .section-inner,
        .tf-game-page section[aria-labelledby="faq-heading"] .section-inner {
            padding-block: 4rem;
        }
    }

    .frj-seg {
        padding: .4rem .8rem;
        border-radius: .55rem;
        border: 1px solid var(--border);
        background: var(--surface);
        font-size: .8rem;
        font-weight: 600;
        color: var(--muted);
        cursor: pointer;
        transition: all .12s ease;
    }

    .frj-seg:hover {
        color: var(--text);
        border-color: var(--primary);
    }

    .frj-seg.is-active {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

    #tfgWords .tf-word {
        margin-inline-end: .6rem;
        padding: 0 .15rem;
        border-radius: .3rem;
        display: inline-block;
    }

    #tfgWords .tf-word.is-current {
        background: var(--surface3, #eef2ff);
        box-shadow: inset 0 -2px 0 var(--primary-500, #2f5dff);
    }

    #tfgWords .tf-word.is-done-ok {
        color: var(--success, #16a34a);
    }

    #tfgWords .tf-word.is-done-err {
        color: #dc2626;
        text-decoration: underline wavy #dc2626;
    }

    #tfgWords .tf-char.ok {
        color: var(--success, #16a34a);
    }

    #tfgWords .tf-char.err {
        color: #dc2626;
        background: #fee2e2;
        border-radius: .2rem;
    }
