/* Source-locked typing arcade for single-word Cambridge decks. */
.vocab-mode-switch { flex-wrap: wrap; }
.vocab-mode-switch[data-mode-count="3"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vocab-mode-switch[data-mode-count="4"] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vocab-mode-switch[data-mode-count="5"] { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.vocab-mode-switch[data-mode-count="2"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vocab-mode-switch[data-mode-count="3"] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vocab-mode-switch .button { justify-content: center; white-space: nowrap; }
.vocab-mode-switch .button:disabled, .vocab-deck-actions .button:disabled { cursor: not-allowed; opacity: .55; }
.vocab-deck-actions.has-typing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vocab-deck-actions.has-typing .vocab-study-action { grid-column: 1 / -1; }
.vocab-deck-actions .button { min-width: 0; }
.typing-intro, .typing-results { max-width: 790px; margin: 0 auto; padding: clamp(23px, 5vw, 42px); border: 1px solid #e2e7d7; border-radius: 20px; background: linear-gradient(145deg, #fffef9, #f7f9f1); box-shadow: 0 16px 45px rgba(39, 52, 28, .08); }
.typing-intro h3, .typing-results h3 { margin: 9px 0 8px; color: var(--ink); font-size: clamp(22px, 4vw, 31px); letter-spacing: -.045em; }
.typing-intro > p, .typing-results > p { max-width: 630px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.typing-intro-stats, .typing-results-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 23px 0 16px; }
.typing-intro-stats span, .typing-results-metrics > div { display: grid; gap: 4px; padding: 14px; border: 1px solid #e5eadc; border-radius: 12px; background: rgba(255,255,255,.75); color: var(--ink-soft); font-size: 11px; }
.typing-intro-stats strong, .typing-results-metrics strong { color: #527638; font-size: 19px; }
.typing-intro .typing-intro-hint { padding: 12px 14px; border-left: 3px solid #8cb84a; border-radius: 0 9px 9px 0; background: #f1f5e9; font-size: 11px; }
.typing-intro-actions, .typing-results-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.typing-game-shell { display: grid; gap: 10px; }
.typing-game-toolbar, .typing-game-brand, .typing-game-controls, .typing-game-hud, .typing-stage { display: flex; align-items: center; }
.typing-game-toolbar { justify-content: space-between; gap: 12px; }
.typing-game-brand { min-width: 0; gap: 10px; }
.typing-rocket-mark { display: grid; width: 39px; height: 39px; place-items: center; border: 1px solid #e0e5d3; border-radius: 13px; background: #f2f5e9; font-size: 19px; }
.typing-game-brand > div { display: grid; gap: 3px; }
.typing-game-brand strong { color: var(--ink); font-size: 15px; }
.typing-game-brand small { color: var(--ink-faint); font-size: 10px; }
.typing-game-controls { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.typing-game-controls .button { min-height: 34px; padding: 0 10px; font-size: 10px; }
.typing-game-hud { min-height: 47px; justify-content: space-between; gap: 10px; padding: 6px 13px; border: 1px solid #25233f; border-radius: 14px 14px 0 0; background: #14132b; color: #f7f8ed; }
.typing-score { display: grid; gap: 1px; min-width: 62px; }
.typing-score > span { color: #b0b2c2; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.typing-score strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.typing-stage { flex-direction: column; gap: 2px; text-align: center; }
.typing-stage > span:first-child { font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.typing-combo { color: #b7bbce; font-size: 9px; font-weight: 700; }
.typing-lives { display: flex; justify-content: flex-end; gap: 3px; min-width: 62px; font-size: 17px; }
.typing-lives .is-alive { color: #ff6684; text-shadow: 0 0 13px rgba(255, 73, 117, .5); }
.typing-lives .is-lost { color: #5d5b72; }
.typing-board { position: relative; min-height: clamp(360px, 54vh, 570px); overflow: hidden; isolation: isolate; border: 1px solid #25233f; border-top: 0; border-radius: 0 0 16px 16px; background: radial-gradient(ellipse at 50% 107%, rgba(86, 53, 112, .24), transparent 48%), radial-gradient(ellipse at 20% 25%, rgba(39, 58, 99, .24), transparent 42%), linear-gradient(160deg, #111129, #17112c 63%, #1d1430); }
.typing-stars, .typing-stars::before, .typing-stars::after { position: absolute; inset: 0; pointer-events: none; }
.typing-stars { opacity: .72; background-image: radial-gradient(1px 1px at 8% 18%, #ddd9ff 98%, transparent), radial-gradient(1px 1px at 37% 32%, #bbb5ef 98%, transparent), radial-gradient(1px 1px at 71% 13%, #fff 98%, transparent), radial-gradient(1px 1px at 86% 52%, #c8c0ed 98%, transparent), radial-gradient(1px 1px at 22% 69%, #fff 98%, transparent), radial-gradient(2px 2px at 57% 71%, #f4eaa0 98%, transparent); background-size: 290px 230px; }
.typing-stars::before { content: ""; opacity: .55; background: radial-gradient(1px 1px at 17% 37%, #fff 98%, transparent), radial-gradient(1px 1px at 67% 46%, #d1cbff 98%, transparent), radial-gradient(1px 1px at 91% 22%, #fff 98%, transparent); background-size: 370px 310px; }
.typing-target-layer { position: absolute; z-index: 2; inset: 4px 0 43px; }
.typing-target { position: absolute; max-width: min(43vw, 240px); padding: 7px 9px; transform: translateX(-50%); border: 1px solid rgba(203, 208, 244, .24); border-radius: 5px; background: rgba(8, 10, 27, .84); color: #f7f8f2; box-shadow: 0 0 16px rgba(152, 179, 92, .14); cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, background .12s ease; }
.typing-target:hover { border-color: #d8e47d; }
.typing-target.is-active { z-index: 3; border: 2px solid #e7d34f; padding: 6px 8px; box-shadow: 0 0 8px rgba(231, 211, 79, .44), 0 0 24px rgba(151, 207, 85, .25); }
.typing-target-word { display: flex; white-space: nowrap; font: 800 clamp(14px, 2.1vw, 19px)/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .055em; }
.typing-target-word > span { color: #f5f6f0; }
.typing-target-word > span.is-typed { color: #a8e86b; text-shadow: 0 0 8px rgba(168, 232, 107, .56); }
.typing-target-word > span.is-next { color: #ffe45a; text-shadow: 0 0 11px rgba(255, 228, 90, .7); }
.typing-target-word > span.is-hint { color: #67e5d2; text-shadow: 0 0 9px rgba(74, 221, 203, .54); }
.typing-target-word > span.is-blank { color: #e7f5f3; opacity: .82; }
.rain-game-shell .typing-board { background: radial-gradient(ellipse at 50% 108%, rgba(22, 194, 211, .2), transparent 49%), radial-gradient(ellipse at 18% 26%, rgba(34, 91, 128, .27), transparent 42%), linear-gradient(160deg, #071626, #08233a 63%, #0b3043); }
.rain-game-shell .typing-stars { opacity: .56; background-image: repeating-linear-gradient(106deg, transparent 0 52px, rgba(105, 206, 230, .2) 53px 54px, transparent 55px 107px); background-size: 193px 244px; }
.rain-game-shell .typing-danger-line { height: 3px; background: #5ce1ed; box-shadow: 0 0 14px rgba(64, 220, 233, .72); }
.rain-game-shell .typing-danger-line span { color: rgba(160, 244, 246, .82); }
.rain-game-shell .typing-rocket { filter: drop-shadow(0 0 12px rgba(56, 218, 238, .72)); }
.rain-target { display: grid; justify-items: center; gap: 4px; min-width: 88px; padding: 8px 10px 9px; border-color: rgba(105, 222, 242, .54); border-radius: 13px; background: rgba(8, 31, 49, .92); box-shadow: 0 5px 18px rgba(0, 9, 20, .28), 0 0 15px rgba(63, 188, 219, .16); }
.rain-target.is-active { border-color: #f5db4d; box-shadow: 0 0 8px rgba(245, 219, 77, .54), 0 0 24px rgba(68, 216, 218, .34); }
.rain-target-meaning { max-width: min(42vw, 225px); overflow: hidden; color: #f5fbff; font-size: 11px; font-weight: 750; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.rain-target-pos { color: #9cc3d3; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rain-target .typing-target-word { gap: 1px; }
.rain-target .typing-target-word > span { min-width: .58em; color: #eff8fb; }
.rain-target .typing-target-word > span.is-typed { color: #a8f078; }
.rain-target .typing-target-word > span.is-hint { color: #5ee6d7; }
.rain-target .typing-target-word > span.is-next { color: #ffe45a; }
.rain-game-shell .typing-input-row { grid-template-columns: auto minmax(160px, 1fr) auto auto; }
.rain-game-shell .typing-input-row .button { min-height: 42px; padding: 0 13px; white-space: nowrap; }
.rain-speech-note { color: var(--ink-faint); font-size: 10px; }
.typing-target.is-error { animation: typing-target-error .18s linear 2; border-color: #ff687c; }
.typing-target.is-exploding { pointer-events: none; animation: typing-target-explode .34s ease-out forwards; }
.typing-projectile { position: absolute; z-index: 8; width: 8px; height: 8px; border-radius: 50%; background: #fff5a3; box-shadow: 0 0 8px 3px #ffd966, 0 0 20px 7px rgba(137, 239, 122, .55); pointer-events: none; }
.typing-rocket { position: absolute; z-index: 4; bottom: 11px; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 0 12px rgba(100, 205, 255, .64)); font-size: 28px; }
.typing-danger-line { position: absolute; z-index: 3; right: 0; bottom: 35px; left: 0; height: 2px; background: #f24159; box-shadow: 0 0 13px rgba(242, 65, 89, .75); }
.typing-danger-line span { position: absolute; right: 12px; bottom: 6px; color: rgba(255, 151, 161, .72); font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.typing-feedback { position: absolute; z-index: 5; top: 12px; left: 50%; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 8px 11px; transform: translate(-50%, -8px); border: 1px solid rgba(169, 226, 122, .42); border-radius: 10px; background: rgba(13, 19, 29, .92); color: #f7f8f2; opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.typing-feedback.is-visible { transform: translate(-50%, 0); opacity: 1; }
.typing-feedback-label { color: #a8e86b; font-size: 9px; font-weight: 800; white-space: nowrap; }
.typing-feedback strong { font: 800 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.typing-feedback > span:not(.typing-feedback-label) { overflow: hidden; color: #d2d5df; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.typing-feedback-speak { width: 27px; height: 27px; flex: 0 0 auto; border: 1px solid #555b67; border-radius: 50%; background: #24283c; color: #fff; cursor: pointer; pointer-events: auto; }
.typing-countdown { position: absolute; z-index: 9; inset: 0; display: grid; place-items: center; background: rgba(10, 9, 24, .48); color: #fff; font-size: clamp(55px, 12vw, 94px); font-weight: 900; text-shadow: 0 0 30px rgba(196, 231, 124, .65); }
.typing-countdown[hidden] { display: none; }
.typing-state-overlay { position: fixed; z-index: 9999; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(9, 10, 23, .72); backdrop-filter: blur(5px); }
.typing-state-overlay > div { display: grid; justify-items: center; gap: 10px; width: min(100%, 390px); padding: 28px; border: 1px solid #dfe6d4; border-radius: 18px; background: #fffef9; color: var(--ink); text-align: center; box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.typing-state-overlay h3 { margin: 0; font-size: 22px; }
.typing-state-overlay p { margin: 0 0 7px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.button.button-danger { border-color: #f0ceca; background: #fff4f1; color: #a74436; }
.typing-input-row { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 10px; }
.typing-input-row label { color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.typing-input-row input { min-width: 0; height: 42px; padding: 0 13px; border: 1px solid #dce3d1; border-radius: 11px; background: #fffef9; color: var(--ink); font: 700 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none; }
.typing-input-row input:focus { border-color: #8cb84a; box-shadow: 0 0 0 3px rgba(140, 184, 74, .15); }
.typing-input-row input:disabled { background: #f0f1eb; }
.typing-input-hint { color: var(--ink-faint); font-size: 9px; text-align: right; }
.typing-game-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e8ecdf; }
.typing-game-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8cb84a, #b4d868); transition: width .2s ease; }
.typing-results { text-align: center; }
.typing-results-score { margin: 12px 0 0; color: #547a37; font-size: clamp(45px, 9vw, 68px); font-weight: 850; letter-spacing: -.07em; }
.typing-results-score span { color: var(--ink-faint); font-size: 16px; font-weight: 650; letter-spacing: 0; }
.typing-results > p { margin: 10px auto 20px; }
.typing-results-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.typing-results-metrics > div { justify-items: center; }
.typing-review-list { max-width: 570px; margin: 20px auto 0; text-align: left; }
.typing-review-list h4 { margin: 0 0 9px; color: var(--ink); font-size: 13px; }
.typing-review-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #e6e9de; }
.typing-review-item > div { display: grid; gap: 3px; }
.typing-review-item strong { color: var(--ink); font: 800 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.typing-review-item span { color: var(--ink-soft); font-size: 11px; }
.typing-review-item .button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.typing-no-misses { color: #567e3d; font-size: 12px; }
.match-intro, .match-results { max-width: 820px; margin: 0 auto; padding: clamp(23px, 5vw, 42px); border: 1px solid #dcebe5; border-radius: 22px; background: linear-gradient(145deg, #fff, #f2faf7); box-shadow: 0 18px 50px rgba(16, 76, 68, .09); }
.match-intro h3, .match-results h3 { margin: 10px 0 8px; color: var(--ink); font-size: clamp(24px, 4vw, 34px); letter-spacing: -.045em; }
.match-intro > p, .match-results > p { max-width: 680px; color: var(--ink-soft); font-size: 13px; line-height: 1.75; }
.match-intro-stats, .match-results-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 23px 0 16px; }
.match-intro-stats span, .match-results-metrics > div { display: grid; gap: 4px; padding: 14px; border: 1px solid #deeee8; border-radius: 14px; background: rgba(255,255,255,.82); color: #60736d; font-size: 11px; }
.match-intro-stats strong, .match-results-metrics strong { color: #087d70; font-size: 20px; }
.match-intro .match-intro-note { padding: 12px 14px; border-left: 3px solid #23b7a6; border-radius: 0 10px 10px 0; background: #eaf8f4; font-size: 11px; }
.match-intro-actions, .match-results-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 21px; }
.vocab-match-shell { position: relative; display: grid; gap: 16px; padding: clamp(14px, 2.5vw, 24px); overflow: hidden; border: 1px solid #d9e9e4; border-radius: 22px; background: linear-gradient(160deg, #fbfffd, #f2f8f6); }
.match-toolbar, .match-brand, .match-controls, .match-hud, .match-timer-wrap { display: flex; align-items: center; }
.match-toolbar { justify-content: space-between; gap: 14px; }
.match-brand { min-width: 0; gap: 10px; }
.match-brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid #b9eee4; border-radius: 14px; background: #e4faf4; font-size: 20px; }
.match-brand > div { display: grid; gap: 3px; }
.match-brand strong { color: #104e49; font-size: 16px; }
.match-brand small { color: #718780; font-size: 11px; }
.match-controls { flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.match-controls .button { min-height: 36px; padding: 0 10px; font-size: 10px; }
.match-hud { gap: 15px; min-height: 46px; }
.match-timer-wrap { flex: 1 1 auto; gap: 10px; color: #0f766e; }
.match-clock { font-size: 24px; line-height: 1; }
.match-timer-wrap > strong { min-width: 33px; color: #164e49; font-size: 14px; font-variant-numeric: tabular-nums; }
.match-timer-track { width: min(260px, 100%); height: 11px; overflow: hidden; border-radius: 99px; background: #e1ece8; }
.match-timer-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #25c6a9, #16a99b); transition: width .12s linear; }
.match-timer-wrap.is-urgent .match-timer-track > span { background: linear-gradient(90deg, #fbad56, #e65f56); }
.match-timer-wrap.is-urgent > strong { color: #c2443d; }
.match-score-pill, .match-combo-pill { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid #bcebe1; border-radius: 99px; background: #e9faf5; color: #087d70; font-size: 11px; }
.match-score-pill strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.match-combo-pill { border-color: #e2eae6; background: #fff; color: #687b75; }
.match-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid #e0ebe7; border-radius: 19px; background: rgba(255,255,255,.68); }
.match-tile { position: relative; display: grid; min-height: clamp(82px, 10vw, 112px); align-content: center; justify-items: center; gap: 7px; padding: 12px 10px; border: 1.5px solid #cddbd7; border-bottom-width: 3px; border-radius: 15px; background: #fff; color: #374b46; cursor: pointer; text-align: center; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.match-tile:hover:not(:disabled) { transform: translateY(-2px); border-color: #62d8c4; box-shadow: 0 8px 20px rgba(15, 118, 110, .1); }
.match-tile.is-english { border-color: #6de0ca; border-bottom-color: #45d4bb; color: #086b62; }
.match-tile.is-vietnamese { border-color: #d0dde7; border-bottom-color: #c2d0de; color: #4c6075; }
.match-tile-language { color: #84938e; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.match-tile strong { font-size: clamp(13px, 1.6vw, 16px); line-height: 1.35; overflow-wrap: anywhere; }
.match-tile.is-selected { z-index: 1; border-color: #0e9d8c; background: #e8fbf5; box-shadow: 0 0 0 3px rgba(40, 207, 180, .17); }
.match-tile.is-wrong { border-color: #df6f67; background: #fff0ed; color: #9f3932; animation: match-tile-error .28s ease-in-out 2; }
.match-tile.is-hinted { border-color: #e9af3e; background: #fff8e5; box-shadow: 0 0 0 4px rgba(249, 190, 68, .19); animation: match-hint-pulse .8s ease-in-out infinite alternate; }
.match-tile:focus-visible { outline: 3px solid #087d70; outline-offset: 3px; }
.match-tile:disabled { cursor: default; opacity: .8; }
.match-live-status { min-height: 20px; margin: 0; color: #637871; font-size: 12px; text-align: center; }
.match-round-progress { height: 5px; overflow: hidden; border-radius: 99px; background: #e1ece8; }
.match-round-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #42d8bd, #078779); transition: width .22s ease; }
.match-overlay { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(13, 45, 41, .54); backdrop-filter: blur(5px); }
.match-overlay > div { width: min(100%, 390px); padding: 25px; border: 1px solid #d6ebe4; border-radius: 20px; background: #fff; box-shadow: 0 20px 55px rgba(7, 35, 31, .22); }
.match-overlay h3 { margin: 7px 0; color: #154c45; font-size: 23px; }
.match-overlay p { color: #647972; font-size: 12px; line-height: 1.65; }
.match-overlay .button { margin: 4px 5px 0 0; }
.match-results-score { margin-top: 16px; color: #087d70; font-size: clamp(38px, 8vw, 57px); font-weight: 800; letter-spacing: -.06em; }
.match-results-score span { font-size: 14px; letter-spacing: 0; }
.match-results-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.match-review-list { display: grid; gap: 8px; margin-top: 20px; }
.match-review-list h4 { margin: 0 0 3px; color: #294d46; font-size: 13px; }
.match-review-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #e0ebe6; border-radius: 12px; background: #fff; }
.match-review-item > div { display: grid; gap: 3px; }
.match-review-item strong { color: #136b60; font-size: 12px; }
.match-review-item span, .match-no-misses { color: #657770; font-size: 11px; }
.match-review-item .button { min-height: 32px; padding: 0 9px; font-size: 10px; }
.match-results-actions { justify-content: flex-start; }
@keyframes match-tile-error { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes match-hint-pulse { to { box-shadow: 0 0 0 6px rgba(249, 190, 68, .09); } }
@keyframes typing-target-error { 25% { transform: translateX(calc(-50% - 4px)); } 75% { transform: translateX(calc(-50% + 4px)); } }
@keyframes typing-target-explode { 0% { opacity: 1; scale: 1; filter: brightness(1); } 40% { opacity: 1; scale: 1.25; filter: brightness(2.4); } 100% { opacity: 0; scale: .2; filter: brightness(2.8); } }
@media (max-width: 700px) {
  .vocab-mode-switch[data-mode-count="5"] { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-mode-switch[data-mode-count="5"] .button { min-height: 40px; padding: 0 8px; font-size: 10px; white-space: normal; }
  .typing-game-toolbar { align-items: flex-start; flex-direction: column; }
  .typing-game-controls { width: 100%; justify-content: flex-start; }
  .typing-game-controls .button { min-height: 37px; flex: 1; padding: 0 7px; font-size: 9px; }
  .typing-board { min-height: max(330px, 47svh); }
  .typing-target { max-width: min(45vw, 190px); padding: 7px; }
  .typing-target.is-active { padding: 6px; }
  .typing-target-word { font-size: clamp(13px, 4vw, 17px); letter-spacing: .025em; }
  .typing-input-row { grid-template-columns: 1fr; gap: 6px; }
  .typing-input-row input { height: 48px; font-size: 16px; }
  .typing-input-hint { text-align: left; }
  .typing-intro-stats { gap: 6px; }
  .typing-intro-stats span { padding: 10px 8px; font-size: 9px; }
  .typing-results-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .typing-feedback { top: 8px; gap: 5px; padding: 7px; }
  .typing-feedback-label { font-size: 8px; }
  .typing-feedback > span:not(.typing-feedback-label) { max-width: 38vw; }
  .vocab-match-shell { gap: 12px; padding: 12px; }
  .match-toolbar { align-items: flex-start; flex-direction: column; }
  .match-controls { width: 100%; justify-content: flex-start; }
  .match-controls .button { flex: 1 1 auto; }
  .match-board { gap: 7px; padding: 8px; }
  .match-tile { min-height: 82px; padding: 9px 7px; }
}
@media (max-width: 420px) {
  .vocab-mode-switch[data-mode-count="3"] { grid-template-columns: 1fr; }
  .vocab-mode-switch[data-mode-count="3"] .button { min-height: 36px; }
  .typing-game-hud { padding: 6px 8px; }
  .typing-stage > span:first-child { font-size: 9px; }
  .typing-combo { max-width: 155px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .typing-lives { min-width: 54px; font-size: 15px; }
  .typing-board { min-height: max(300px, 43svh); }
  .typing-results-actions { flex-direction: column-reverse; }
  .typing-results-actions .button { justify-content: center; }
}
@media (max-width: 700px) {
  .rain-game-shell .typing-input-row { grid-template-columns: 1fr; }
  .rain-game-shell .typing-input-row .button { min-height: 40px; }
  .rain-target { min-width: 76px; padding: 7px 7px 8px; }
  .rain-target-meaning { max-width: 42vw; font-size: 10px; }
  .rain-target-pos { font-size: 7px; }
}
@media (max-width: 420px) {
  .vocab-mode-switch[data-mode-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rain-game-shell .typing-board { min-height: max(310px, 45svh); }
  .rain-target .typing-target-word { font-size: clamp(12px, 3.7vw, 15px); }
  .rain-game-shell .typing-lives { min-width: 62px; }
  .vocab-mode-switch[data-mode-count="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-mode-switch[data-mode-count="5"] [data-vocab-mode="cards"] { grid-column: 1 / -1; }
  .vocab-mode-switch[data-mode-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-hud { flex-wrap: wrap; gap: 8px; }
  .match-timer-wrap { flex-basis: 100%; }
  .match-timer-track { flex: 1; }
  .match-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-tile { min-height: 76px; border-radius: 12px; }
  .match-tile strong { font-size: 12px; }
  .match-intro-stats { gap: 6px; }
  .match-intro-stats span { padding: 10px 8px; font-size: 9px; }
  .match-results-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .match-results-actions { flex-direction: column-reverse; }
  .match-results-actions .button { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-target, .typing-target.is-error, .typing-target.is-exploding, .typing-feedback, .typing-game-progress span, .match-tile, .match-tile.is-wrong, .match-tile.is-hinted { animation: none !important; transition: none !important; }
}
