.scwf-app {
    --scwf-ink: #273247;
    --scwf-muted: #68758a;
    --scwf-line: #dce3ed;
    --scwf-panel: #f6f8fb;
    --scwf-surface: #fff;
    --scwf-surface-soft: #f8faff;
    --scwf-heading: #202b3d;
    --scwf-body: #273247;
    --scwf-notice-bg: #fff9e9;
    --scwf-notice-border: #f0d18a;
    --scwf-notice-text: #62460b;
    --scwf-overlay: rgba(246, 248, 252, .96);
    --scwf-success-bg: #f0fbf6;
    --scwf-success-border: #8dd6bd;
    --scwf-success-ink: #087555;
    --scwf-error-bg: #fff5f5;
    --scwf-error-border: #e6a4a4;
    --scwf-error-ink: #a92f36;
    --scwf-ground-bg: rgba(255, 244, 244, .92);
    --scwf-ground-border: #e49a9a;
    --scwf-ground-ink: #995353;
    --scwf-typing-correct: #087a50;
    --scwf-typing-wrong: #c42c38;
    --scwf-grid-line: rgba(77, 104, 148, .045);
    --scwf-rank-bg: #edf2ff;
    --scwf-rank-color: #315ee8;
    --scwf-blue: #315ee8;
    --scwf-teal: #0e9277;
    box-sizing: border-box;
    width: min(100% - 24px, 1040px);
    margin: 16px auto;
    color: var(--scwf-ink);
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

.scwf-app *,
.scwf-app *::before,
.scwf-app *::after { box-sizing: border-box; }

.scwf-app button,
.scwf-app input { font: inherit; }

.scwf-shell {
    overflow: hidden;
    border: 1px solid var(--scwf-line);
    border-radius: 14px;
    background: var(--scwf-surface);
    box-shadow: 0 8px 28px rgba(28, 43, 69, .08);
}

.scwf-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--scwf-line);
    background: var(--scwf-surface);
}

.scwf-brand { display: flex; align-items: center; gap: 9px; }
.scwf-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #e8efff;
    color: var(--scwf-blue);
    font-size: 18px;
    font-weight: 850;
}
.scwf-brand-copy { display: grid; line-height: 1.12; }
.scwf-brand-name { color: var(--scwf-heading); font-size: 15px; font-weight: 800; }
.scwf-brand-tagline { margin-top: 3px; color: var(--scwf-muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.scwf-top-note { color: var(--scwf-muted); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.scwf-top-actions { display: flex; align-items: center; gap: 6px; }

.scwf-intro { padding: 6px 12px; text-align: center; }
.scwf-eyebrow { color: var(--scwf-teal); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.scwf-title {
    margin-top: 4px;
    color: var(--scwf-heading);
    font-size: clamp(23px, 4vw, 34px);
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.15;
}
.scwf-copy { margin: 6px auto 0; color: var(--scwf-muted); font-size: 14px; }
.scwf-notice {
    margin: 0 12px 12px;
    padding: 6px 10px;
    border: 1px solid var(--scwf-notice-border);
    border-radius: 8px;
    background: var(--scwf-notice-bg);
    color: var(--scwf-notice-text);
}

.scwf-level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 6px 12px 10px;
}
.scwf-level-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid var(--scwf-line);
    border-radius: 11px;
    background: var(--scwf-surface);
}
.scwf-level-easy { border-top: 3px solid #159a77; }
.scwf-level-medium { border-top: 3px solid #315ee8; }
.scwf-level-hard { border-top: 3px solid #9654ca; }
.scwf-level-badge { color: var(--scwf-muted); font-size: 9px; font-weight: 850; letter-spacing: .15em; }
.scwf-level-title { color: var(--scwf-heading); font-size: 18px; font-weight: 800; }
.scwf-level-range { color: var(--scwf-muted); font-size: 12px; }
.scwf-level-best { margin: 2px 0 4px; color: var(--scwf-muted); font-size: 11px; }
.scwf-level-empty { color: #854915; font-size: 11px; }

.scwf-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.scwf-button:hover:not(:disabled) { transform: translateY(-1px); }
.scwf-button:focus-visible,
.scwf-word-input:focus-visible { outline: 3px solid rgba(49, 94, 232, .25); outline-offset: 2px; }
.scwf-button:disabled { cursor: not-allowed; opacity: .55; }
.scwf-play-button { width: 100%; margin-top: auto; background: var(--scwf-blue); color: #fff; }
.scwf-play-button:hover:not(:disabled) { background: #234bd0; }
.scwf-button-light { border-color: var(--scwf-line); background: var(--scwf-surface); color: var(--scwf-ink); }
.scwf-button-light:hover:not(:disabled) { border-color: #aebbd0; background: var(--scwf-panel); }
.scwf-button-primary { background: var(--scwf-blue); color: #fff; }
.scwf-button-primary:hover:not(:disabled) { background: #234bd0; }

.scwf-rules {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 12px;
    color: var(--scwf-muted);
    font-size: 11px;
}
.scwf-rule-divider { color: #b5bfce; }
.scwf-leaderboard-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 12px 10px;
    padding: 6px 10px;
    border: 1px solid var(--scwf-line);
    border-radius: 9px;
    background: var(--scwf-surface-soft);
    color: var(--scwf-ink);
    text-decoration: none;
}
.scwf-leaderboard-link:hover { border-color: #b7c8fb; background: #f1f5ff; }
.scwf-leaderboard-copy { display: grid; }
.scwf-leaderboard-title { color: var(--scwf-heading); font-size: 13px; font-weight: 800; }
.scwf-leaderboard-subtitle { color: var(--scwf-muted); font-size: 11px; }
.scwf-leaderboard-arrow { color: var(--scwf-blue); font-size: 12px; font-weight: 750; white-space: nowrap; }

.scwf-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 6px 12px;
}
.scwf-stat {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
    padding: 6px 10px;
    border: 1px solid var(--scwf-line);
    border-radius: 8px;
    background: var(--scwf-panel);
}
.scwf-stat-label { color: var(--scwf-muted); font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.scwf-stat strong { color: var(--scwf-heading); font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; }

.scwf-stage {
    position: relative;
    margin: 6px 12px 8px;
    padding: 6px 10px;
    border: 1px solid #d8e1ef;
    border-radius: 12px;
    background: var(--scwf-panel);
    transition: background-color .2s ease, border-color .2s ease;
}
.scwf-stage-caught { border-color: var(--scwf-success-border); background: var(--scwf-success-bg); }
.scwf-stage-miss { border-color: var(--scwf-error-border); background: var(--scwf-error-bg); }
.scwf-stage-header { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0 6px; color: var(--scwf-muted); font-size: 11px; font-weight: 700; }
.scwf-game-level { color: #3d4d68; }
.scwf-lane {
    position: relative;
    overflow: hidden;
    height: 300px;
    border: 1px solid #dce5f1;
    border-radius: 9px;
    background-color: var(--scwf-surface);
    background-image: linear-gradient(var(--scwf-grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--scwf-grid-line) 1px, transparent 1px);
    background-size: 28px 28px;
}
.scwf-fall-guide {
    position: absolute;
    top: 0;
    bottom: 12px;
    left: 50%;
    border-left: 1px dashed rgba(76, 98, 136, .12);
    pointer-events: none;
}
.scwf-falling-word {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 50%;
    max-width: calc(100% - 20px);
    overflow: hidden;
    padding: 6px 12px;
    border: 1px solid #cbd8fa;
    border-radius: 9px;
    background: #edf2ff;
    box-shadow: 0 3px 10px rgba(49, 94, 232, .12);
    color: #234bc1;
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 850;
    letter-spacing: .035em;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    will-change: transform;
}
.scwf-word-error { border-color: var(--scwf-error-border); background: var(--scwf-error-bg); color: var(--scwf-error-ink); }
.scwf-word-caught { border-color: var(--scwf-success-border); background: var(--scwf-success-bg); color: var(--scwf-success-ink); }
.scwf-ground {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-top: 2px dashed var(--scwf-ground-border);
    background: var(--scwf-ground-bg);
    color: var(--scwf-ground-ink);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .14em;
}
.scwf-round-overlay {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 6px 12px;
    border-radius: 11px;
    background: var(--scwf-overlay);
}
.scwf-round-dialog {
    width: min(100%, 480px);
    padding: 6px 12px;
    border: 1px solid var(--scwf-line);
    border-radius: 11px;
    background: var(--scwf-surface);
    box-shadow: 0 12px 32px rgba(28, 43, 69, .15);
    text-align: center;
}
.scwf-round-title { margin-top: 2px; color: var(--scwf-heading); font-size: 22px; font-weight: 850; }
.scwf-round-question { margin-top: 2px; color: var(--scwf-muted); font-size: 13px; }
.scwf-round-bonuses { max-width: 340px; margin: 8px auto; text-align: left; }
.scwf-round-bonus-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--scwf-line); color: var(--scwf-muted); font-size: 12px; }
.scwf-round-bonus-row strong { color: var(--scwf-heading); font-variant-numeric: tabular-nums; }
.scwf-round-actions { display: flex; justify-content: center; gap: 6px; }
.scwf-is-paused .scwf-lane { filter: grayscale(.45); }
.scwf-is-paused .scwf-falling-word { opacity: .55; }

.scwf-input-area { padding: 0 12px 6px; }
.scwf-input-label { display: grid; gap: 5px; color: var(--scwf-body); font-size: 12px; font-weight: 750; }
.scwf-typing-control { position: relative; }
.scwf-word-input {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid #cbd5e2;
    border-radius: 9px;
    background: var(--scwf-surface);
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    caret-color: var(--scwf-blue);
    font-size: 19px !important;
    font-weight: 700 !important;
    letter-spacing: .04em;
}
.scwf-word-input::placeholder { color: #9aa5b5; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.scwf-typed-feedback {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--scwf-body);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.2;
    pointer-events: none;
    white-space: pre;
}
.scwf-typed-correct { color: var(--scwf-typing-correct); }
.scwf-typed-wrong { color: var(--scwf-typing-wrong); text-decoration: underline wavy; text-underline-offset: 2px; }
.scwf-live-message { min-height: 22px; padding-top: 4px; color: var(--scwf-muted); font-size: 11px; }

.scwf-results { padding: 6px 12px; text-align: center; }
.scwf-final-score { margin-top: 6px; color: var(--scwf-heading); font-size: clamp(42px, 9vw, 70px); font-weight: 900; letter-spacing: -.05em; line-height: 1; }
.scwf-final-caption { margin-top: 4px; color: var(--scwf-muted); font-size: 12px; }
.scwf-result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px auto; }
.scwf-result-stat { display: grid; gap: 3px; padding: 6px 8px; border: 1px solid var(--scwf-line); border-radius: 8px; background: var(--scwf-panel); }
.scwf-result-stat span { color: var(--scwf-muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.scwf-result-stat strong { color: var(--scwf-ink); font-size: 17px; }
.scwf-result-actions { display: flex; justify-content: center; gap: 8px; }
.scwf-save-message { margin-top: 8px; color: var(--scwf-teal); font-size: 12px; font-weight: 650; }

.scwf-leaderboard-body { padding: 6px 12px; text-align: center; }
.scwf-leaderboard-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.scwf-leaderboard-tab { min-height: 34px; padding: 6px 12px; border: 1px solid var(--scwf-line); border-radius: 7px; background: var(--scwf-surface); color: var(--scwf-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.scwf-leaderboard-tab:hover:not(:disabled) { border-color: #a9bdfa; background: #f3f6ff; }
.scwf-leaderboard-tab.is-active { border-color: var(--scwf-blue); background: var(--scwf-blue); color: #fff; }
.scwf-leaderboard-tab:disabled { cursor: wait; opacity: .65; }
.scwf-leaderboard-list { display: grid; gap: 5px; margin-top: 12px; text-align: left; }
.scwf-leaderboard-loading,
.scwf-leaderboard-empty { padding: 6px 10px; border: 1px solid var(--scwf-line); border-radius: 8px; background: var(--scwf-panel); color: var(--scwf-muted); text-align: center; }
.scwf-leaderboard-row { display: grid; grid-template-columns: 30px 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--scwf-line); border-radius: 8px; background: var(--scwf-surface); }
.scwf-leaderboard-rank { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--scwf-rank-bg); color: var(--scwf-rank-color); font-size: 12px; font-weight: 850; }
.scwf-leaderboard-avatar { display: block; width: 34px; height: 34px; border: 1px solid var(--scwf-line); border-radius: 50%; background: var(--scwf-panel); object-fit: cover; }
.scwf-leaderboard-player { display: grid; min-width: 0; }
.scwf-leaderboard-player strong { overflow: hidden; color: var(--scwf-heading); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.scwf-leaderboard-player span { color: var(--scwf-muted); font-size: 10px; }
.scwf-leaderboard-score { color: var(--scwf-heading); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scwf-leaderboard-actions { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.scwf-sync-status:empty { display: none; }
.scwf-sync-status:not(:empty) { margin-top: 8px; color: #9d2929; font-size: 12px; }
.scwf-sync-error { margin: 6px 12px; padding: 6px 10px; border: 1px solid #efb4b4; border-radius: 7px; background: #fff5f5; color: #9d2929; font-size: 12px; text-align: center; }

/* Match the active SCDev day/night switch and common dark-theme classes. */
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app {
    --scwf-ink: #e7edf6;
    --scwf-muted: #aab8cb;
    --scwf-line: #35465b;
    --scwf-panel: #1a2635;
    --scwf-surface: #111a26;
    --scwf-surface-soft: #1b293a;
    --scwf-heading: #f3f6fb;
    --scwf-body: #e0e8f2;
    --scwf-notice-bg: #382c18;
    --scwf-notice-border: #80612c;
    --scwf-notice-text: #ffe2a4;
    --scwf-overlay: rgba(17, 26, 38, .96);
    --scwf-success-bg: #142d28;
    --scwf-success-border: #39896e;
    --scwf-success-ink: #7aefc5;
    --scwf-error-bg: #321e28;
    --scwf-error-border: #9d4f59;
    --scwf-error-ink: #ffabb3;
    --scwf-ground-bg: rgba(72, 31, 39, .92);
    --scwf-ground-border: #b96268;
    --scwf-ground-ink: #ffc4c8;
    --scwf-typing-correct: #59e1a9;
    --scwf-typing-wrong: #ff7884;
    --scwf-grid-line: rgba(160, 183, 216, .07);
    --scwf-rank-bg: #283857;
    --scwf-rank-color: #c2d2ff;
    --scwf-blue: #315ee8;
    --scwf-teal: #48d6ad;
    color: var(--scwf-ink) !important;
    color-scheme: dark;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-shell, .scwf-topbar, .scwf-level-card, .scwf-round-dialog, .scwf-leaderboard-row, .scwf-button-light, .scwf-leaderboard-tab) {
    border-color: var(--scwf-line) !important;
    background-color: var(--scwf-surface) !important;
    color: var(--scwf-ink) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-stat, .scwf-result-stat, .scwf-stage, .scwf-leaderboard-link, .scwf-leaderboard-empty, .scwf-leaderboard-loading) {
    border-color: var(--scwf-line) !important;
    background-color: var(--scwf-panel) !important;
    color: var(--scwf-ink) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-lane {
    border-color: var(--scwf-line);
    background-color: var(--scwf-surface);
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-title, .scwf-brand-name, .scwf-level-title, .scwf-leaderboard-title, .scwf-stat strong, .scwf-round-title, .scwf-round-bonus-row strong, .scwf-final-score, .scwf-leaderboard-player strong, .scwf-leaderboard-score) {
    color: var(--scwf-heading) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-copy, .scwf-level-range, .scwf-level-best, .scwf-top-note, .scwf-rules, .scwf-stage-header, .scwf-game-level, .scwf-input-label, .scwf-typed-feedback, .scwf-live-message, .scwf-final-caption, .scwf-leaderboard-player span, .scwf-leaderboard-subtitle) {
    color: var(--scwf-muted) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-notice {
    border-color: var(--scwf-notice-border) !important;
    background: var(--scwf-notice-bg) !important;
    color: var(--scwf-notice-text) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-sync-error, .scwf-sync-status:not(:empty)) {
    border-color: var(--scwf-error-border) !important;
    background: var(--scwf-error-bg) !important;
    color: var(--scwf-error-ink) !important;
}

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-eyebrow { color: var(--scwf-teal) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app :is(.scwf-brand-tagline, .scwf-level-badge, .scwf-stat-label, .scwf-result-stat span, .scwf-round-question, .scwf-round-bonus-row) { color: var(--scwf-muted) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-ground { color: var(--scwf-ground-ink) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-leaderboard-tab.is-active { border-color: var(--scwf-blue) !important; background: var(--scwf-blue) !important; color: #fff !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-leaderboard-rank { background: var(--scwf-rank-bg) !important; color: var(--scwf-rank-color) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-level-empty { color: #ffd09b !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-round-overlay { background: var(--scwf-overlay) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-typed-correct { color: var(--scwf-typing-correct) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-typed-wrong { color: var(--scwf-typing-wrong) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-word-error { color: var(--scwf-error-ink) !important; }
:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-word-caught { color: var(--scwf-success-ink) !important; }

:is(html.dark-mode, html.night-mode, html[data-color-scheme="dark"], body.dark-mode, body.night-mode, body.sheer-dark, body.sheer-dark-mode, body.dark, body.theme-dark, body.is-dark, body.is-dark-theme, body.wp-dark-mode-active, [data-color-scheme="dark"]) .scwf-app .scwf-word-input {
    border-color: var(--scwf-line) !important;
    background: var(--scwf-surface) !important;
}

@media (prefers-color-scheme: dark) {
    html:not([data-color-scheme="light"]):not(.light-mode) body:not(.light-mode):not(.day-mode) .scwf-app {
        --scwf-ink: #e7edf6;
        --scwf-muted: #aab8cb;
        --scwf-line: #35465b;
        --scwf-panel: #1a2635;
        --scwf-surface: #111a26;
        --scwf-surface-soft: #1b293a;
        --scwf-heading: #f3f6fb;
        --scwf-body: #e0e8f2;
        --scwf-notice-bg: #382c18;
        --scwf-notice-border: #80612c;
        --scwf-notice-text: #ffe2a4;
        --scwf-overlay: rgba(17, 26, 38, .96);
        --scwf-success-bg: #142d28;
        --scwf-success-border: #39896e;
        --scwf-success-ink: #7aefc5;
        --scwf-error-bg: #321e28;
        --scwf-error-border: #9d4f59;
        --scwf-error-ink: #ffabb3;
        --scwf-ground-bg: rgba(72, 31, 39, .92);
        --scwf-ground-border: #b96268;
        --scwf-ground-ink: #ffc4c8;
        --scwf-typing-correct: #59e1a9;
        --scwf-typing-wrong: #ff7884;
        --scwf-grid-line: rgba(160, 183, 216, .07);
        --scwf-rank-bg: #283857;
        --scwf-rank-color: #c2d2ff;
        --scwf-blue: #315ee8;
        --scwf-teal: #48d6ad;
        color-scheme: dark;
    }
}

@media (max-width: 680px) {
    .scwf-app { width: calc(100% - 16px); margin: 8px auto; font-size: 14px; }
    .scwf-top-note { display: none; }
    .scwf-intro { padding-top: 6px; }
    .scwf-level-grid { gap: 6px; padding-right: 8px; padding-left: 8px; }
    .scwf-level-card { gap: 3px; padding: 6px; }
    .scwf-level-title { font-size: 16px; }
    .scwf-level-range { font-size: 10px; }
    .scwf-level-best { min-height: 28px; font-size: 10px; }
    .scwf-button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
    .scwf-stats { gap: 5px; padding-right: 8px; padding-left: 8px; }
    .scwf-stat { padding: 6px; }
    .scwf-stage { margin-right: 8px; margin-left: 8px; padding-right: 6px; padding-left: 6px; }
    .scwf-lane { height: 255px; }
    .scwf-input-area { padding-right: 8px; padding-left: 8px; }
    .scwf-result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .scwf-leaderboard-tabs { gap: 5px; }
    .scwf-leaderboard-tab { min-height: 32px; padding-right: 9px; padding-left: 9px; font-size: 11px; }
}

@media (max-width: 390px) {
    .scwf-level-grid { grid-template-columns: 1fr; }
    .scwf-level-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .scwf-level-badge, .scwf-level-title, .scwf-level-range, .scwf-level-best, .scwf-level-empty { grid-column: 1; }
    .scwf-play-button { grid-column: 2; grid-row: 1 / span 4; width: auto; min-width: 88px; }
    .scwf-level-empty { grid-row: 5; }
    .scwf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .scwf-rules { flex-wrap: wrap; }
    .scwf-result-actions { flex-direction: column; }
    .scwf-round-actions, .scwf-leaderboard-actions { flex-direction: column; }
    .scwf-leaderboard-row { grid-template-columns: 24px 30px minmax(0, 1fr) auto; gap: 5px; padding-right: 6px; padding-left: 6px; }
    .scwf-leaderboard-avatar { width: 28px; height: 28px; }
    .scwf-leaderboard-score { font-size: 11px; }
    .scwf-leaderboard-arrow { font-size: 10px; }
}

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