@charset "UTF-8";

:root {
  color-scheme: light;
  --bg: #f5f2fc;
  --surface: #fff;
  --ink: #302744;
  --muted: #8f819e;
  --purple: #7654dc;
  --purple-deep: #6040c3;
  --purple-pale: #f0eafa;
  --border: #e8e1f1;
  --mint: #e4f3e8;
  --peach: #fff0e3;
  --lavender: #ece7fa;
  --shadow: 0 8px 30px #39265705;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; letter-spacing: -.025em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; letter-spacing: inherit; border: 0; }
button:disabled { cursor: default; opacity: .4; }
button, input, select, textarea { outline: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #a18be7; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { word-break: keep-all; }
svg { display: block; }
span[data-icon] { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
span[data-icon] svg { width: 20px; height: 20px; stroke-width: 1.8; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { width: calc(100% - 64px); max-width: 1800px; margin: 0 auto; padding-top: 18px; }
.site-header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 800; white-space: nowrap; letter-spacing: -1px; }
.brand-icon { position: relative; width: 36px; height: 36px; display: grid; place-items: center; background: var(--purple); color: #fff; border-radius: 12px; font-family: Georgia, serif; font-size: 34px; font-style: italic; font-weight: bold; line-height: 1; padding-right: 4px; padding-bottom: 5px; letter-spacing: -3px; }
.brand-icon > span { position: absolute; font: 12px sans-serif; right: 4px; top: 5px; }
.brand-light { font-weight: 500; }
.brand-divider { height: 16px; width: 1px; background: #d6cfdf; margin: 0 5px; }
.brand-caption { font-size: 13px; color: #91849f; font-weight: 500; letter-spacing: -.3px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.quiet-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; background: transparent; color: #82718f; white-space: nowrap; border-radius: 11px; padding: 9px 12px; font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.quiet-button:hover:not(:disabled), .icon-button:hover:not(:disabled) { background: #eae3f8; color: var(--purple); }
.icon-button { width: 42px; flex: 0 0 42px; padding: 0; }
#settingsButton { border: 1px solid #e2d8f1; background: #fff9; color: #8669b1; }
#settingsButton:hover:not(:disabled) { background: #eae1fa; }

.intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 22px 0 23px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--purple); font-size: 12px; font-weight: 800; letter-spacing: .025em; }
.small-dot { width: 6px; height: 6px; background: var(--purple); border-radius: 50%; }
h1 { font-size: clamp(38px, 3.4vw, 50px); line-height: 1.22; letter-spacing: -2.6px; margin: 6px 0 8px; font-weight: 850; }
h1 > span { color: var(--purple); white-space: nowrap; }
.title-spark { display: inline-block; font-size: 36px; font-weight: 500; margin-left: 8px; vertical-align: top; transform: translateY(-4px); }
.intro p { font-size: 14px; color: #8c7e9b; letter-spacing: -.4px; }

.game-layout { display: block; width: 100%; }
.play-area { min-width: 0; }
.board, .judgement-panel { border: 1px solid var(--border); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); }
.board { padding: 23px 28px 18px; }
.board-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin-bottom: 21px; }
.round-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; min-width: 0; }
.round-pill { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; color: #96869f; }
.round-pill strong { color: var(--purple); background: #f1ecfb; padding: 4px 10px; border-radius: 8px; font-size: 16px; letter-spacing: 1px; }
.phase-pill { font-size: 12px; border: 1px solid #e4dced; color: #9888a6; padding: 4px 11px; border-radius: 20px; font-weight: 600; white-space: nowrap; }
.phase-pill[data-phase="running"] { color: var(--purple); border-color: #decef6; background: #f4edff; }
.phase-pill[data-phase="review"] { color: #ad7c89; background: #fff1f4; border-color: #edd3dd; }
.phase-pill[data-phase="waiting"] { color: #a78762; background: #fff6e9; border-color: #eee0c6; }
.board-top > #shuffleAll { justify-self: end; }
.primary-button, .soft-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border-radius: 12px; padding: 11px 21px; font-size: 15px; font-weight: 700; line-height: 1.5; transition: background .15s, box-shadow .15s, transform .15s; }
.primary-button { background: var(--purple); color: white; box-shadow: 0 4px 10px #7654dc1c; }
.primary-button:hover:not(:disabled) { background: var(--purple-deep); box-shadow: 0 5px 16px #7654dc30; transform: translateY(-1px); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
#primaryButton { justify-self: center; min-width: 208px; min-height: 58px; padding: 12px 32px; border-radius: 16px; font-size: 22px; letter-spacing: -.6px; }
#primaryButton svg { width: 22px; height: 22px; }
#primaryButton.stop-button { background: #c87481; box-shadow: 0 4px 10px #c874811c; }
#primaryButton.stop-button:hover:not(:disabled) { background: #b45f6d; box-shadow: 0 5px 16px #c8748130; }
.soft-button { background: #f2edfc; border: 1px solid #e6dbf7; color: var(--purple); box-shadow: none; }
.soft-button:hover:not(:disabled) { background: #e8defa; }
.full-width { width: 100%; }

.question-card { position: relative; overflow: hidden; background: #f3effb; border: 1px solid #e6ddf3; border-radius: 19px; padding: 22px 34px 27px; min-height: 195px; }
.section-kicker { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #9478b8; position: relative; z-index: 1; }
.bubble-symbol { display: grid; place-items: center; border-radius: 8px 8px 8px 2px; color: #fff; background: #b9a4de; width: 25px; height: 25px; font-size: 14px; font-weight: 800; line-height: 1; }
.question-card h2 { position: relative; z-index: 1; font-size: clamp(44px, 3.7vw, 60px); line-height: 1.42; font-weight: 750; letter-spacing: -1.8px; margin-top: 13px; padding-right: 20px; overflow-wrap: anywhere; white-space: pre-line; }
.question-shuffle { position: absolute; z-index: 2; right: 19px; top: 17px; width: 38px; height: 38px; background: #ebe3f8; border-radius: 50%; display: grid; place-items: center; color: #a38cc5; }
.question-shuffle:hover:not(:disabled) { background: #e1d5f4; color: var(--purple); }
.question-shuffle svg { width: 18px; height: 18px; }
.question-decoration { position: absolute; right: 22px; bottom: -93px; line-height: 1; font-family: Georgia, serif; font-size: 290px; color: #eae2f7; pointer-events: none; }
.words-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 22px 2px 15px; }
.words-heading h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: #796584; }
.words-heading h3 svg { width: 19px; height: 19px; color: #ad99ba; }
.words-heading > span { font-size: 13px; color: #a995b4; white-space: nowrap; }
.word-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.word-card { position: relative; min-width: 0; min-height: 224px; text-align: center; border: 1px solid #d4e7da; background: var(--mint); border-radius: 19px; padding: 18px 18px 15px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; transition: box-shadow .2s, border-color .2s; }
.word-card:nth-child(3n + 2) { background: var(--peach); border-color: #efdccb; }
.word-card:nth-child(3n) { background: var(--lavender); border-color: #dcd1ed; }
.word-number { font-size: 11px; line-height: 1; letter-spacing: 1px; font-weight: 800; color: #88a491; border: 1px solid #c4daca; border-radius: 50%; width: 27px; height: 27px; display: grid; place-items: center; background: #ffffff65; }
.word-card:nth-child(3n + 2) .word-number { color: #bf9c7b; border-color: #e8d4bf; }
.word-card:nth-child(3n) .word-number { color: #a18cbd; border-color: #d1c4e4; }
.word-term { display: block; max-width: 100%; font-size: clamp(52px, 4.25vw, 70px); line-height: 1.25; font-weight: 800; letter-spacing: -2.3px; color: #375940; margin-top: 11px; overflow-wrap: anywhere; word-break: keep-all; }
.word-card:nth-child(3n + 2) .word-term { color: #7b5537; }
.word-card:nth-child(3n) .word-term { color: #67518d; }
.word-variants { font-size: 15px; line-height: 1.6; color: #607961; margin-top: 5px; overflow-wrap: anywhere; word-break: keep-all; max-width: 100%; }
.word-card:nth-child(3n + 2) .word-variants { color: #ad8866; }
.word-card:nth-child(3n) .word-variants { color: #9b83b4; }
.word-meaning { font-size: 14px; line-height: 1.6; color: #7d927d; margin-top: 6px; max-width: 100%; overflow-wrap: anywhere; word-break: keep-all; }
.word-card:nth-child(3n + 2) .word-meaning { color: #b19780; }
.word-card:nth-child(3n) .word-meaning { color: #a38bb8; }
.word-kind { font-size: 12px; color: #8b9b8c; margin-top: auto; padding-top: 9px; }
.word-card:nth-child(3n + 2) .word-kind { color: #b69c86; }
.word-card:nth-child(3n) .word-kind { color: #a991ba; }
.word-edit { position: absolute; right: 11px; top: 11px; display: grid; place-items: center; width: 38px; height: 32px; border-radius: 9px; background: #ffffff65; color: #a391b2; padding: 0; font-size: 12px; }
.word-edit:hover:not(:disabled) { background: #ffffffb0; color: #87699e; }
.word-edit svg { width: 15px; height: 15px; }
.word-card.flagged { border: 2px solid #dc777b; box-shadow: 0 0 0 3px #dc777b15; }
.word-card.flagged::after { content: "✕"; position: absolute; left: 12px; top: 8px; color: #c75464; font-size: 23px; font-weight: 800; }
.word-grid:has(> .word-card:only-child) { grid-template-columns: 1fr; }
.word-grid:has(> .word-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-grid:has(> .word-card:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.word-grid:has(> .word-card:nth-child(5):last-child), .word-grid.many { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.word-grid:has(> .word-card:nth-child(4):last-child) .word-term { font-size: clamp(40px, 3.5vw, 56px); }
.word-grid:has(> .word-card:nth-child(5):last-child) .word-term, .word-grid.many .word-term { font-size: clamp(34px, 2.8vw, 45px); letter-spacing: -1.5px; }
.word-grid:has(> .word-card:nth-child(5):last-child) .word-card, .word-grid.many .word-card { min-height: 205px; padding-right: 12px; padding-left: 12px; }
.word-grid.many .word-variants, .word-grid.many .word-meaning { font-size: 13px; }
.board-note { display: flex; align-items: center; justify-content: center; gap: 7px; color: #a28eaf; margin-top: 17px; font-size: 13px; line-height: 1.6; text-align: center; }
.board-note svg { width: 15px; height: 15px; }
#roundError { margin: 0 0 17px; text-align: center; }

.judgement-panel { padding: 17px 26px; margin-top: 16px; border-radius: 19px; }
.round-status { color: #a08aac; font-size: 14px; line-height: 1.7; margin-bottom: 12px; word-break: keep-all; }
.judge-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.found-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 16px; border-radius: 11px; font-size: 16px; font-weight: 700; color: #b96f7e; background: #fff1f4; }
.found-button:hover:not(:disabled) { background: #fce2e9; }
.found-button svg { width: 18px; height: 18px; }
.judge-actions { display: flex; align-items: center; gap: 9px; }
.judge-caption { font-size: 13px; color: #a691b1; margin-right: 7px; }
.judge-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 78px; min-height: 42px; background: #f5f0f8; padding: 8px 15px; border-radius: 10px; font-size: 15px; font-weight: 600; color: #a088b0; }
.judge-button svg { width: 16px; height: 16px; }
.judge-button.success { color: #74a085; background: #edf7f0; }
.judge-button.fail { color: #be8793; background: #fcf0f3; }
.judge-button:hover:not(:disabled) { filter: brightness(.96); }
.found-selection { border-top: 1px solid var(--border); margin-top: 16px; padding: 17px 0 0; }
.found-selection > strong { font-size: 16px; }
.found-selection p { font-size: 14px; color: var(--muted); margin-top: 11px; line-height: 1.8; }
#continueButton { margin-top: 15px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip, .chip-list button { border-radius: 22px; min-height: 40px; background: #f2edfb; color: #987dad; font-size: 14px; padding: 7px 15px; border: 1px solid #e7ddf6; overflow-wrap: anywhere; }
.chip.selected, .chip[aria-pressed="true"], .chip-list button.selected, .chip-list button[aria-pressed="true"] { border-color: #d17a81; background: #fff0f1; color: #b05761; }
.bottom-tip { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: #a690b0; margin: 14px 0 0; line-height: 1.7; }
.bottom-tip b { font-weight: 600; color: #9980a6; }
.hand-cross { font-weight: 800; font-size: 17px; color: #b1a0c8; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 0 20px; margin-top: 17px; border-top: 1px solid #e6e0ee; color: #b3a0c1; font-size: 11px; }
.site-footer > span:first-child { font-size: 12px; font-weight: 600; color: #a58db4; }
.site-footer b { font-size: 9px; letter-spacing: 1.3px; font-weight: 500; margin-left: 8px; color: #b6a0c7; }
.expanded-view .app-shell { max-width: none; }

dialog { border: 1px solid #e7e0f0; padding: 28px; background: #fff; box-shadow: 0 24px 90px #30224435; color: var(--ink); border-radius: 24px; max-height: 90dvh; max-width: calc(100vw - 32px); overflow: auto; font-size: 14px; scrollbar-width: thin; scrollbar-color: #dcd0eb transparent; }
dialog::backdrop { background: #34234763; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 27px; line-height: 1.4; letter-spacing: -1px; }
.dialog-heading .eyebrow { font-size: 12px; letter-spacing: 1.4px; margin-bottom: 6px; }
.dialog-heading > .icon-button { flex-shrink: 0; background: #f7f4fb; }
.dialog-intro, .settings-intro { font-size: 14px; color: var(--muted); line-height: 1.8; margin: -4px 0 21px; }
.settings-dialog { width: 980px; padding: 30px; }
.settings-panel { width: 100%; max-height: none; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
.panel-heading, .panel-heading > div { display: flex; align-items: center; gap: 8px; }
.panel-heading { justify-content: space-between; margin-bottom: 18px; }
.panel-heading h2 { font-size: 18px; letter-spacing: -.6px; }
.panel-heading svg { width: 20px; height: 20px; color: #ab99ca; }
.teacher-badge { font-size: 12px; color: #a18bad; border-radius: 6px; background: #f5f0fa; padding: 4px 9px; }
.tabs { display: flex; gap: 3px; padding: 5px; background: #f6f2fb; border-radius: 12px; margin-bottom: 24px; }
.tabs button { width: 50%; min-height: 43px; padding: 8px 6px; background: none; color: #a48aB6; border-radius: 8px; font-size: 15px; font-weight: 600; }
.tabs button[aria-selected="true"] { background: white; color: var(--purple); box-shadow: 0 1px 5px #55447710; }
#gameSettings, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 26px; align-items: start; }
#gameSettings > .settings-grid { grid-column: 1 / -1; }
.setting-block { border: 1px solid #eee6f5; border-radius: 14px; background: #fdfbff; margin: 0; padding: 19px 18px 18px; min-width: 0; }
.setting-block legend { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 6px; font-weight: 700; font-size: 15px; color: #836994; }
.setting-block legend > span { font-size: 11px; color: #ae99ce; background: #f2edf9; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; letter-spacing: 0; }
.count-control { display: flex; align-items: center; justify-content: center; gap: 36px; padding: 0 12px; margin: 0 0 11px; }
.count-control > div { display: flex; align-items: baseline; gap: 6px; }
.count-control strong { font-size: 42px; font-weight: 700; color: var(--purple); letter-spacing: -1px; line-height: 1.4; }
.count-control > div > span { font-size: 15px; color: #ad91bf; }
.count-button { width: 40px; height: 40px; border-radius: 50%; background: #f1eafa; color: #a590c2; font-size: 23px; line-height: 1; }
.count-button:hover:not(:disabled) { background: #e4d5f6; color: var(--purple); }
input[type="range"] { display: block; width: 100%; height: 7px; accent-color: var(--purple); cursor: pointer; margin: 16px 0 12px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--purple); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; font-size: 14px; color: #b098bf; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { border: 1px solid #e4d9ed; background: #fff; border-radius: 9px; padding: 10px 12px; min-height: 42px; min-width: 0; max-width: 100%; transition: border-color .15s; letter-spacing: -.2px; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #b8a7c5; }
input:hover, select:hover, textarea:hover { border-color: #cbb6e4; }
select { width: 100%; color: #947ba6; padding-right: 28px; cursor: pointer; background-color: #fefcff; text-overflow: ellipsis; }
textarea { resize: vertical; width: 100%; line-height: 1.7; }
.inline-input { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: #a58bb6; margin-top: 13px; }
.inline-input > span { display: flex; align-items: center; gap: 7px; }
.inline-input input[type="range"] { max-width: 160px; margin: 0; }
.mode-options { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px 0 14px; font-size: 14px; color: #a18daa; }
.mode-options label { display: flex; align-items: center; gap: 6px; min-height: 32px; white-space: nowrap; cursor: pointer; }
.category-list { display: flex; flex-wrap: wrap; gap: 7px; }
.category-list label, .category-check { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; font-size: 14px; border: 1px solid #e8e1f0; background: #fff; border-radius: 8px; padding: 7px 9px; color: #a58bb6; cursor: pointer; }
.category-list label:has(input:checked) { border-color: #d9c7ed; background: #f5efff; color: #9370b2; }
.category-check small { font-size: 12px; color: #b3a0c3; }
.pool-info { font-size: 14px; color: #ad95bd; margin-top: 13px; line-height: 1.7; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; color: #8d71a0; }
.field-heading strong { font-weight: 700; }
.text-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 0; background: transparent; font-size: 14px; color: #a07cbd; text-decoration: underline; text-decoration-color: #d9cde8; text-underline-offset: 4px; }
.text-link:hover:not(:disabled) { color: var(--purple); }
.checkbox-line { display: flex !important; align-items: center; gap: 8px; font-size: 14px !important; color: #a287b5 !important; margin-top: 13px; min-height: 30px; line-height: 1.7; cursor: pointer; }
.extra-settings { font-size: 14px; color: #a183b8; border: 1px solid #eee6f5; background: #fdfbff; border-radius: 14px; padding: 15px 18px; }
.extra-settings summary { font-weight: 600; cursor: pointer; list-style-position: inside; padding: 3px 0; min-height: 30px; }
.extra-settings .field-hint { margin-top: 12px; }
.field-hint { font-size: 14px; color: #a58bb7; line-height: 1.75; }
.saved-note { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: #b69fc7; }
.saved-note svg { width: 16px; height: 16px; }
.error-box { border: 1px solid #f0cad0; background: #fff1f3; color: #bb6573; padding: 12px 14px; border-radius: 9px; font-size: 14px; }
#gameSettings > .error-box, #gameSettings > #prepareButton, #gameSettings > .saved-note, #gameSettings > .settings-footer, #gameSettings > .dialog-footer { grid-column: 1 / -1; }
#prepareButton { min-height: 46px; }
.settings-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; border-top: 1px solid var(--border); padding-top: 19px; margin-top: 4px; }
.library-summary { padding: 2px 0 21px; }
.library-summary strong { font-size: 19px; color: #836799; }
.library-summary p { font-size: 14px; color: #ab91bd; line-height: 1.9; margin-top: 8px; }
#librarySettings > .soft-button { margin-bottom: 12px; text-align: left; justify-content: flex-start; min-height: 48px; }
#librarySettings > .soft-button > span:last-child:not([data-icon]) { margin-left: auto; color: #ab89c5; font-size: 14px; }
.library-note { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.85; color: #ac93bd; margin: 22px 0 18px; padding-top: 19px; border-top: 1px solid var(--border); }
.library-note svg { width: 19px; height: 19px; margin-top: 4px; }
.danger-link { color: #bc7c87; text-decoration-color: #eeced6; }
#customWordsBox { margin-top: 14px; }
#customWordsBox > label { font-size: 14px; color: var(--muted); }
#customWordsBox textarea { margin: 8px 0 4px; }
#chooseWords { margin-top: 13px; }

.help-dialog { width: 680px; padding: 30px; }
.help-steps { display: grid; gap: 22px; margin: 6px 0 24px; }
.help-steps > div { position: relative; padding-left: 48px; }
.help-steps b { position: absolute; top: 0; left: 0; width: 32px; height: 32px; background: #eee7fb; color: var(--purple); border-radius: 10px; display: grid; place-items: center; font-size: 13px; }
.help-steps h3 { font-size: 17px; margin-bottom: 7px; }
.help-steps p { font-size: 14px; color: #a088b2; line-height: 1.85; }
.help-note { border-radius: 12px; background: #f8f5fc; color: #a085b4; font-size: 14px; line-height: 1.8; padding: 15px 18px; margin-bottom: 22px; }
.editor-dialog { width: 1120px; }
.editor-toolbar { display: flex; gap: 12px; margin-bottom: 15px; }
.editor-toolbar > input { flex: 1; }
.editor-toolbar > select { width: 185px; }
.editor-toolbar .soft-button { white-space: nowrap; }
.word-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; margin-top: 19px; }
.library-list { max-height: 650px; overflow: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #e5ddef transparent; }
.library-item { border: 1px solid var(--border); background: #fcfafd; border-radius: 12px; padding: 14px; margin-bottom: 10px; display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.library-item.selected, .library-item:has(input:checked) { border-color: #d5c3ed; background: #f9f5ff; }
.library-item label.library-item-check { display: flex; flex: 0 0 18px; padding-top: 5px; min-height: 30px; cursor: pointer; }
.library-item button.library-item-main { display: block; background: none; text-align: left; white-space: normal; padding: 0; flex: 1; min-width: 0; color: #806093; border-radius: 0; min-height: 40px; }
.library-item-main strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.library-item-main > small, .library-item-main > span { display: block; font-size: 14px; color: #a58bb7; line-height: 1.65; overflow-wrap: anywhere; }
.library-item-main > span { margin-top: 4px; }
.library-item > .chip { font-size: 14px; padding: 6px 10px; flex: 0 0 auto; }
.library-item-actions { display: flex; gap: 6px; }
.word-form { border-left: 1px solid var(--border); padding-left: 26px; min-width: 0; }
.word-form h3 { font-size: 19px; margin-bottom: 18px; }
.word-form > label, .form-columns > label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: #a083b4; margin-bottom: 16px; }
.word-form input:not([type="checkbox"]), .word-form textarea, .word-form select { color: #9374a8; width: 100%; }
.word-form fieldset { padding: 0; border: 0; margin: 0 0 16px; min-width: 0; }
.word-form legend { font-size: 14px; color: #a083b4; margin-bottom: 9px; padding: 0; }
.edit-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-categories label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #a085b4; border: 1px solid #eae0f3; padding: 7px 9px; border-radius: 8px; min-height: 40px; margin-top: 0; }
.word-form > .field-hint { margin: -5px 0 16px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 20px; margin-top: 18px; }
.form-actions .primary-button { min-width: 135px; }
.bulk-box { border-top: 1px solid var(--border); padding-top: 17px; margin-top: 22px; font-size: 14px; color: #a486b9; }
.bulk-box summary { cursor: pointer; margin-bottom: 10px; min-height: 30px; }
.bulk-box textarea { margin: 12px 0 9px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 19px; font-size: 14px; color: #a081b7; }
.dialog-footer .primary-button { min-width: 150px; }
.question-dialog { width: 900px; }
.question-library-list { display: grid; gap: 11px; max-height: 52dvh; overflow-y: auto; margin: 19px 0; scrollbar-width: thin; }
.question-list-item { display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: #fcfafd; }
.question-list-item > span { font-size: 14px; color: #b09bc0; margin-top: 11px; }
.question-library-list textarea { flex: 1; }
.question-list-item > .icon-button { margin-top: 3px; background: #f8edf3; color: #c08a9e; }
.new-question-form { display: flex; align-items: stretch; gap: 13px; margin-top: 17px; }
.new-question-form textarea { flex: 1; }
.new-question-form button { white-space: nowrap; }
.empty-state { grid-column: 1 / -1; border: 1px dashed #dfd2ed; border-radius: 14px; padding: 36px 22px; text-align: center; font-size: 15px; color: #ac8bbf; }

.result-dialog { width: 740px; text-align: center; padding: 34px; }
.result-symbol { display: grid; place-items: center; font-size: 40px; color: var(--purple); background: #f1eafb; width: 80px; height: 80px; border-radius: 26px; margin: 0 auto 20px; }
.result-dialog[data-result="fail"] .result-symbol { background: #fff0e8; color: #ca9071; }
.result-dialog[data-result="void"] .result-symbol { background: #f0edf5; color: #a695b6; }
.result-dialog > .eyebrow { justify-content: center; font-size: 14px; margin-bottom: 8px; }
.result-dialog h2 { font-size: 34px; line-height: 1.4; }
.result-question { font-size: 16px; color: #a887bc; margin: 14px 0 20px; overflow-wrap: anywhere; }
.result-words { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.result-word { background: #f0eafa; color: #a07cbb; border: 1px solid #e1d6ef; border-radius: 22px; padding: 7px 15px; font-size: 15px; max-width: 100%; overflow-wrap: anywhere; }
.result-word small { display: block; font-size: 14px; color: #b499c9; }
.result-word.flagged { background: #fff0f2; border-color: #efcbd2; color: #bb697b; }
.alternative-box { text-align: left; background: #f9f6fc; border: 1px solid var(--border); padding: 20px; border-radius: 15px; }
.alternative-box h3 { font-size: 17px; margin-bottom: 5px; }
#alternatives { margin-top: 12px; }
.alternative-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid #e9e1f1; font-size: 15px; line-height: 1.8; }
.alternative-item:last-child { border: 0; padding-bottom: 0; }
.alternative-item > strong { flex: 0 0 92px; min-width: 0; color: #a47dbb; overflow-wrap: anywhere; }
.alternative-item > span:last-child { flex: 1; min-width: 0; color: #9b7cac; overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 12px; margin-top: 24px; }
.result-actions > button { flex: 1; }
.result-dialog > .text-link { margin-top: 17px; }
.toast { position: fixed; z-index: 2000; bottom: 25px; left: 50%; transform: translateX(-50%); border: 1px solid #e2d8ef; background: #fff; color: #9874ad; border-radius: 13px; padding: 14px 24px; box-shadow: 0 8px 35px #39234825; font-size: 14px; max-width: calc(100vw - 32px); text-align: center; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 1000px) {
  .judgement-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 28px; }
  .round-status { margin-bottom: 0; }
  .judge-row { gap: 29px; }
  .found-selection { grid-column: 1 / -1; }
}

@media (min-width: 1550px) {
  .app-shell { width: calc(100% - 80px); padding-top: 22px; }
  .intro { margin: 24px 0 26px; }
  .board { padding: 25px 32px 20px; }
  .question-card { padding: 25px 38px 30px; min-height: 214px; }
  .word-card { min-height: 248px; padding: 20px; }
  .word-grid { gap: 20px; }
  .word-grid.many { gap: 15px; }
}

@media (max-width: 1190px) {
  .app-shell { width: calc(100% - 48px); }
  .brand-caption, .brand-divider { display: none; }
  .board { padding: 21px 23px 17px; }
  .question-card { min-height: 184px; padding: 21px 29px 25px; }
  .question-card h2 { font-size: 44px; }
  .word-card { min-height: 210px; padding: 17px 14px 14px; }
  .word-term { font-size: 52px; }
  .word-grid.many { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .word-grid:has(> .word-card:nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .word-grid:has(> .word-card:nth-child(5):last-child) .word-term { font-size: 42px; }
  .word-grid:has(> .word-card:nth-child(4):last-child) .word-term, .word-grid.many .word-term { font-size: 34px; }
  .word-variants { font-size: 14px; }
  .word-meaning { font-size: 13px; }
}

@media (min-width: 900px) and (max-height: 820px) {
  .app-shell { padding-top: 11px; }
  .site-header { min-height: 42px; }
  .intro { margin-top: 14px; margin-bottom: 16px; }
  .intro .eyebrow { display: none; }
  h1 { font-size: 37px; margin: 0 0 5px; line-height: 1.2; }
  .intro p { font-size: 12px; }
  .title-spark { font-size: 29px; }
  .board { padding: 16px 22px 13px; }
  .board-top { margin-bottom: 15px; }
  #primaryButton { min-height: 50px; min-width: 185px; font-size: 20px; padding: 9px 27px; }
  .question-card { min-height: 150px; padding: 17px 28px 20px; }
  .section-kicker { font-size: 13px; }
  .bubble-symbol { width: 22px; height: 22px; font-size: 13px; }
  .question-card h2 { font-size: 44px; line-height: 1.32; margin-top: 9px; }
  .words-heading { margin-top: 16px; margin-bottom: 11px; }
  .words-heading h3 { font-size: 14px; }
  .word-card { min-height: 183px; padding: 12px 15px 11px; }
  .word-number { width: 23px; height: 23px; font-size: 10px; }
  .word-term { font-size: 52px; margin-top: 7px; line-height: 1.18; }
  .word-variants { font-size: 14px; line-height: 1.5; margin-top: 4px; }
  .word-meaning { font-size: 13px; line-height: 1.5; margin-top: 4px; }
  .word-kind { font-size: 11px; padding-top: 6px; }
  .word-grid.many .word-card { min-height: 185px; }
  .board-note { margin-top: 12px; font-size: 12px; }
  .judgement-panel { padding: 12px 22px; margin-top: 12px; }
  .found-button { min-height: 40px; padding-top: 7px; padding-bottom: 7px; font-size: 15px; }
  .judge-button { min-height: 40px; }
  .bottom-tip { margin-top: 10px; font-size: 12px; }
  .site-footer { padding-top: 14px; padding-bottom: 15px; margin-top: 12px; }
}

@media (max-width: 899px) {
  .app-shell { width: calc(100% - 36px); padding-top: 15px; }
  .brand { font-size: 21px; gap: 8px; }
  .header-actions { gap: 3px; }
  .header-actions .quiet-button { font-size: 13px; padding: 9px 10px; }
  #fullscreenLabel { display: none; }
  .intro { margin: 22px 0; }
  h1 { font-size: 38px; }
  .board { padding: 20px; }
  .board-top { gap: 12px; margin-bottom: 19px; }
  .round-meta { gap: 7px; }
  .round-pill { font-size: 10px; gap: 6px; }
  .round-pill strong { font-size: 14px; }
  .phase-pill { font-size: 11px; padding: 3px 8px; }
  #primaryButton { min-width: 166px; min-height: 52px; font-size: 19px; padding: 11px 23px; }
  #shuffleAll { font-size: 13px; gap: 5px; padding: 8px 0 8px 8px; }
  .question-card { padding: 20px 25px 24px; min-height: 180px; }
  .question-card h2 { font-size: 37px; line-height: 1.45; letter-spacing: -1.4px; }
  .word-grid { gap: 12px; }
  .word-card { min-height: 214px; padding: 16px 12px 14px; }
  .word-term { font-size: 43px; letter-spacing: -1.9px; }
  .word-variants, .word-meaning { font-size: 13px; }
  .word-kind { font-size: 11px; }
  .word-grid.many, .word-grid:has(> .word-card:nth-child(4):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .word-grid:has(> .word-card:nth-child(4):last-child) .word-term, .word-grid:has(> .word-card:nth-child(5):last-child) .word-term, .word-grid.many .word-term { font-size: 34px; }
  .judgement-panel { padding: 15px 20px; }
  .found-button { font-size: 14px; padding-left: 13px; padding-right: 13px; }
  .judge-actions { gap: 6px; }
  .judge-caption { font-size: 12px; margin-right: 3px; }
  .judge-button { min-width: 65px; padding-left: 11px; padding-right: 11px; font-size: 14px; }
  .bottom-tip { font-size: 12px; }
  .site-footer > span:nth-child(2) { display: none; }
  .settings-dialog { padding: 25px; }
  #gameSettings, .settings-grid { gap: 20px 18px; }
  .setting-block { padding-right: 15px; padding-left: 15px; }
  .mode-options { gap: 9px; }
  .word-editor-layout { grid-template-columns: 1fr; gap: 22px; }
  .library-list { max-height: 350px; padding-right: 0; }
  .word-form { border-left: 0; padding: 22px 0 0; border-top: 1px solid var(--border); }
}

@media (max-width: 640px) {
  .app-shell { width: calc(100% - 26px); padding-top: 12px; }
  .site-header { flex-wrap: wrap; gap: 10px; }
  .brand { font-size: 21px; }
  .brand-icon { width: 33px; height: 33px; font-size: 31px; border-radius: 11px; }
  .header-actions { margin-left: auto; gap: 2px; }
  .header-actions .quiet-button { min-height: 40px; gap: 5px; font-size: 12px; padding: 8px; }
  .header-actions .icon-button { width: 36px; flex-basis: 36px; min-height: 40px; }
  .header-actions span[data-icon] svg { width: 17px; height: 17px; }
  #soundButton, #fullscreenButton { width: 34px; flex-basis: 34px; padding: 7px; }
  .intro { margin: 23px 0 20px; }
  .intro .eyebrow { font-size: 11px; }
  h1 { font-size: 34px; letter-spacing: -2px; margin-top: 7px; }
  .title-spark { font-size: 25px; margin-left: 5px; }
  .intro p { font-size: 12px; line-height: 1.8; max-width: 320px; word-break: keep-all; }
  .board { padding: 15px; border-radius: 20px; }
  .board-top { gap: 7px; margin-bottom: 15px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .round-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .round-pill { font-size: 8px; gap: 4px; letter-spacing: .7px; }
  .round-pill strong { font-size: 12px; padding: 3px 6px; }
  .phase-pill { font-size: 10px; padding: 2px 7px; }
  #primaryButton { min-width: 125px; min-height: 49px; padding: 9px 13px; font-size: 17px; border-radius: 12px; gap: 7px; }
  #primaryButton svg { width: 17px; height: 17px; }
  #shuffleAll { font-size: 11px; padding: 7px 0; flex-wrap: wrap; justify-content: flex-end; gap: 4px; white-space: normal; text-align: right; }
  #shuffleAll span[data-icon] svg { width: 16px; height: 16px; }
  .question-card { min-height: 0; padding: 19px 20px 24px; border-radius: 15px; }
  .section-kicker { font-size: 12px; gap: 6px; }
  .bubble-symbol { width: 21px; height: 21px; font-size: 12px; }
  .question-card h2 { font-size: 31px; line-height: 1.48; letter-spacing: -1.3px; margin-top: 15px; padding-right: 0; }
  .question-shuffle { right: 12px; top: 13px; width: 31px; height: 31px; }
  .question-shuffle svg { width: 15px; height: 15px; }
  .question-decoration { right: 6px; bottom: -69px; font-size: 220px; }
  .words-heading { margin-top: 19px; margin-bottom: 13px; }
  .words-heading h3 { font-size: 13px; gap: 5px; }
  .words-heading h3 svg { width: 15px; height: 15px; }
  .words-heading > span { font-size: 11px; }
  .word-grid, .word-grid:has(> .word-card:nth-child(2):last-child), .word-grid:has(> .word-card:nth-child(4):last-child), .word-grid:has(> .word-card:nth-child(5):last-child) { grid-template-columns: 1fr; gap: 13px; }
  .word-card, .word-grid:has(> .word-card:nth-child(5):last-child) .word-card { min-height: 212px; padding: 17px 20px; border-radius: 16px; }
  .word-term, .word-grid:has(> .word-card:nth-child(4):last-child) .word-term, .word-grid:has(> .word-card:nth-child(5):last-child) .word-term { font-size: 48px; }
  .word-variants, .word-meaning { font-size: 14px; }
  .word-kind { font-size: 12px; }
  .word-grid.many { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .word-grid.many .word-card { min-height: 214px; padding: 14px 10px; }
  .word-grid.many .word-term { font-size: 32px; letter-spacing: -1.1px; margin-top: 13px; }
  .word-grid.many .word-variants, .word-grid.many .word-meaning { font-size: 12px; }
  .word-grid.many .word-kind { font-size: 11px; }
  .word-grid.many .word-edit { width: 27px; height: 27px; right: 6px; top: 7px; }
  .word-grid.many .word-number { width: 23px; height: 23px; font-size: 10px; }
  .board-note { font-size: 11px; align-items: flex-start; margin-top: 15px; }
  .board-note svg { margin-top: 2px; width: 13px; height: 13px; }
  .judgement-panel { padding: 15px; margin-top: 13px; border-radius: 16px; }
  .judge-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .found-button { min-height: 43px; }
  .judge-actions { justify-content: center; gap: 7px; }
  .judge-caption { display: none; }
  .judge-button { flex: 1; min-height: 42px; padding: 8px; }
  .found-selection > strong { font-size: 15px; }
  .found-selection p { font-size: 13px; }
  .bottom-tip { align-items: flex-start; font-size: 11px; padding: 0 3px; margin-top: 13px; }
  .hand-cross { font-size: 14px; margin-top: 1px; }
  .site-footer { font-size: 10px; padding: 16px 0; gap: 10px; }
  .site-footer > span:first-child { font-size: 11px; }
  .site-footer b { font-size: 8px; margin-left: 6px; }
  dialog { max-width: calc(100vw - 20px); max-height: 92dvh; padding: 21px; border-radius: 20px; }
  .dialog-heading { gap: 12px; margin-bottom: 19px; }
  .dialog-heading h2 { font-size: 23px; }
  .dialog-heading .eyebrow { font-size: 11px; }
  .dialog-heading > .icon-button { width: 40px; flex-basis: 40px; min-height: 40px; }
  .settings-dialog { padding: 22px 19px; }
  .dialog-intro, .settings-intro { margin-bottom: 19px; }
  #gameSettings, .settings-grid { grid-template-columns: 1fr; gap: 19px; }
  .setting-block { padding: 18px 15px; }
  .tabs { margin-bottom: 21px; }
  .tabs button { font-size: 14px; min-height: 42px; }
  .count-control { gap: 34px; }
  .mode-options { gap: 11px; }
  .category-list label { font-size: 14px; }
  .extra-settings { padding: 15px; }
  .settings-footer { gap: 10px; }
  .settings-footer > button { flex: 1; }
  .settings-footer .saved-note { flex: 1 1 100%; }
  .editor-toolbar { flex-wrap: wrap; gap: 9px; }
  .editor-toolbar > input { flex: 1 1 100%; width: 100%; }
  .editor-toolbar > select { flex: 1; width: 130px; }
  .editor-toolbar .soft-button { padding-left: 13px; padding-right: 13px; font-size: 14px; }
  .library-list { max-height: 330px; }
  .library-item { padding: 11px; gap: 8px; }
  .library-item-main strong { font-size: 17px; }
  .library-item > .chip { padding: 6px 8px; font-size: 13px; }
  .form-columns { gap: 11px; }
  .dialog-footer { gap: 12px; font-size: 14px; }
  .dialog-footer .primary-button { min-width: 128px; padding-left: 13px; padding-right: 13px; font-size: 14px; }
  .help-dialog { padding: 23px; }
  .help-steps > div { padding-left: 41px; }
  .help-steps b { width: 28px; height: 28px; font-size: 12px; }
  .help-steps h3 { font-size: 16px; }
  .help-note { padding: 14px; }
  .question-library-list { max-height: 48dvh; gap: 10px; }
  .question-list-item { gap: 7px; padding: 9px; flex-wrap: wrap; }
  .question-list-item > span { flex: 0 0 20px; }
  .question-list-item > textarea { flex: 1; min-width: 0; }
  .question-list-item > .icon-button { width: 34px; flex-basis: 34px; }
  .new-question-form { flex-direction: column; gap: 10px; }
  .new-question-form button { min-height: 42px; }
  .result-dialog { padding: 26px 20px; }
  .result-symbol { width: 70px; height: 70px; font-size: 35px; border-radius: 23px; }
  .result-dialog h2 { font-size: 28px; }
  .result-question { font-size: 15px; }
  .alternative-box { padding: 16px; }
  .alternative-item { gap: 8px; font-size: 14px; flex-wrap: wrap; }
  .alternative-item > strong { flex-basis: auto; }
  .alternative-item > span:last-child { flex-basis: 100%; }
  .result-actions { flex-direction: column; gap: 10px; }
  .result-actions > button { min-height: 46px; }
  .toast { font-size: 13px; padding: 12px 18px; width: max-content; max-width: calc(100vw - 30px); }
}

@media (max-width: 440px) {
  .site-header { gap: 8px; }
  .header-actions { width: 100%; justify-content: flex-start; gap: 5px; }
  .header-actions #helpButton, .header-actions #settingsButton { flex: 1; }
  .header-actions .quiet-button { font-size: 13px; }
  .intro { margin-top: 19px; }
  h1 { font-size: 32px; }
  .board { padding: 13px; }
  .board-top { gap: 6px; }
  #primaryButton { min-width: 117px; font-size: 16px; }
  .round-pill { font-size: 7px; gap: 3px; }
  .round-pill strong { font-size: 11px; padding: 3px 5px; }
  #shuffleAll { font-size: 10px; }
  .question-card { padding: 18px 18px 22px; }
  .question-card h2 { font-size: 29px; }
  .word-grid.many { gap: 8px; }
  .word-grid.many .word-card { padding-left: 8px; padding-right: 8px; }
  .word-grid.many .word-number { align-self: flex-start; }
  .word-grid.many .word-term { font-size: 32px; }
  .site-footer b { display: none; }
  .form-columns { grid-template-columns: 1fr; gap: 0; }
  .library-item { flex-wrap: wrap; }
  .library-item > .chip { margin-left: 26px; }
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer > .primary-button { margin-left: auto; }
}

/* Keep the title in the center of the top bar and reserve the screen for play. */
.site-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.site-header > .brand { justify-self: start; }
.site-header > .header-actions { justify-self: end; }
.site-header .intro { margin: 0; text-align: center; justify-content: center; }
.site-header .eyebrow { justify-content: center; }
.site-header h1 { font-size: clamp(32px, 2.7vw, 46px); margin: 3px 0; }
.site-header .intro p { font-size: 12px; }
.site-header .title-spark { font-size: .7em; }

@media (min-width: 1000px) {
  .app-shell { height: 100dvh; padding: 12px 0 6px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
  .site-header { gap: 12px; min-height: 76px; }
  .brand-caption, .brand-divider { display: none; }
  .header-actions { gap: 3px; }
  .header-actions .quiet-button { padding: 8px; }
  .game-layout, .play-area { min-height: 0; }
  .play-area { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 8px; }
  .board { min-height: 0; padding: 14px 22px 10px; display: flex; flex-direction: column; gap: 10px; }
  .board-top { flex: 0 0 auto; margin: 0; }
  #primaryButton { min-height: 46px; padding: 8px 26px; font-size: 20px; }
  .question-card { flex: 0 0 auto; min-height: 0; padding: 12px 26px 16px; }
  .question-card h2 { font-size: clamp(30px, 4.7dvh, 54px); line-height: 1.25; margin-top: 6px; }
  .section-kicker { font-size: 13px; }
  .bubble-symbol { width: 22px; height: 22px; }
  .question-shuffle { top: 10px; width: 32px; height: 32px; }
  .question-decoration { font-size: 190px; bottom: -64px; }
  .words-heading { flex: 0 0 auto; margin: 0; }
  .words-heading h3 { font-size: 14px; }
  .word-grid { flex: 1 1 0; min-height: 0; grid-auto-rows: minmax(0, 1fr); gap: 10px; }
  .word-grid.many, .word-grid:has(> .word-card:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  #wordCards .word-card { min-height: 0; padding: 14px 16px 10px; justify-content: center; }
  .word-number { position: absolute; top: 10px; left: 11px; width: 23px; height: 23px; font-size: 10px; }
  .word-edit { top: 7px; right: 8px; height: 28px; }
  .word-grid .word-term { margin-top: 7px; font-size: clamp(42px, 6.8dvh, 70px); line-height: 1.15; }
  .word-grid.many .word-term, .word-grid:has(> .word-card:nth-child(5):last-child) .word-term { font-size: clamp(28px, 4.5dvh, 44px); letter-spacing: -1.3px; }
  .word-grid:has(> .word-card:nth-child(4):last-child) .word-term { font-size: clamp(34px, 5.4dvh, 56px); }
  #wordCards .word-variants, #wordCards .word-meaning { font-size: 13px; line-height: 1.4; margin-top: 5px; }
  .word-grid .word-kind { font-size: 11px; margin-top: 5px; padding-top: 0; }
  .board-note { flex: 0 0 auto; margin: 0; font-size: 11px; }
  #roundError { margin: 0; flex: 0 0 auto; }
  .judgement-panel { position: relative; margin: 0; padding: 8px 20px; gap: 0 14px; }
  .round-status { font-size: 12px; line-height: 1.5; }
  .judge-row { gap: 15px; }
  .found-button, .judge-button { min-height: 38px; font-size: 14px; padding: 6px 12px; }
  .found-selection { position: absolute; z-index: 5; bottom: calc(100% + 8px); left: 0; right: 0; background: white; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 10px 40px #30274425; padding: 18px 22px; margin: 0; max-height: 55dvh; overflow: auto; }
  .bottom-tip { margin: 0; font-size: 11px; line-height: 1.4; }
  .site-footer { margin: 0; padding: 5px 0 0; font-size: 10px; }
}

@media (min-width: 1000px) and (max-height: 760px) {
  .app-shell { padding-top: 7px; gap: 7px; }
  .site-header { min-height: 63px; }
  .site-header h1 { font-size: 34px; }
  .site-header .intro p { font-size: 11px; }
  .board { padding: 10px 16px 8px; gap: 7px; }
  .question-card { padding: 8px 21px 10px; }
  #primaryButton { min-height: 40px; font-size: 18px; padding: 6px 22px; }
  #wordCards .word-card { padding: 9px 10px 7px; }
  #wordCards .word-meaning, #wordCards .word-variants { font-size: 12px; margin-top: 3px; }
  .word-grid .word-kind { font-size: 10px; margin-top: 4px; }
  .word-number { top: 7px; left: 7px; width: 20px; height: 20px; font-size: 9px; }
  .word-edit { font-size: 10px; width: 30px; height: 24px; top: 4px; right: 4px; }
  .board-note { font-size: 10px; }
  .judgement-panel { padding: 5px 14px; }
}

@media (min-width: 1000px) and (max-width: 1190px) {
  .site-header h1 { font-size: 32px; }
  #fullscreenLabel { display: none; }
  .header-actions .quiet-button { font-size: 12px; gap: 5px; }
  .site-header .intro p { font-size: 10px; }
  .board { padding: 10px 16px 8px; gap: 7px; }
  .question-card { padding: 8px 18px 12px; }
  .question-card h2 { font-size: 28px; line-height: 1.2; }
  #wordCards .word-card { padding: 8px; }
  #wordCards.many .word-term, #wordCards:has(> .word-card:nth-child(5):last-child) .word-term { font-size: 26px; letter-spacing: -1px; }
  #wordCards .word-meaning, #wordCards .word-variants { font-size: 11.5px; line-height: 1.35; margin-top: 3px; }
  #wordCards .word-kind { font-size: 10px; }
}

@media (max-width: 999px) {
  .site-header { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 20px; }
  .site-header .intro { grid-row: 2; grid-column: 1 / -1; }
  .site-header > .header-actions { grid-row: 1; grid-column: 2; }
  .site-header h1 { font-size: clamp(30px, 5vw, 42px); }
  .site-header .intro p { max-width: none; }
}

@media (max-width: 640px) {
  .site-header { grid-template-columns: 1fr; }
  .site-header > .brand { justify-self: center; }
  .site-header .intro { grid-row: 2; grid-column: 1; }
  .site-header > .header-actions { grid-row: 3; grid-column: 1; justify-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
