[hidden] { display: none !important; }
.game-body { background: #e8e0ce; }
.game-shell { max-width: 1440px; margin: auto; min-height: 100vh; background: var(--paper); box-shadow: var(--shadow); }
.game-header { padding: 22px 5%; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.back-link { color: var(--ink-soft); font-size: 14px; text-underline-offset: 5px; }
.game-main { width: 90%; max-width: 1250px; }
.game-title-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 36px 0 28px; }
.game-title-row h1 { display: flex; align-items: center; gap: 20px; margin: 0; font: 500 clamp(36px, 4.2vw, 54px)/1.3 "STKaiti", "KaiTi", serif; letter-spacing: .06em; }
.title-seal { padding: 5px 3px; width: 28px; color: var(--cinnabar); border: 1px solid; font: 16px/1.15 "STKaiti",serif; writing-mode: vertical-rl; transform: rotate(4deg); }
.game-subtitle { margin: 10px 0 0; color: var(--ink-soft); letter-spacing: .12em; }
.revision-notice { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--gold); background: #f4eddb; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.game-totals { display: flex; gap: 34px; margin: 0; }
.game-totals div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.game-totals dt { font-size: 14px; color: var(--ink-soft); }
.game-totals dd { margin: 0; font: 38px/1.5 Georgia,serif; color: var(--jade); }
.game-totals small { font-size: 16px; margin-left: 6px; color: var(--ink-soft); }
.game-workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); border: 1px solid var(--line); background: #fffcf4; box-shadow: 0 12px 32px #28392b0c; }
.chapter-nav { background: #173b35; color: #fff7e6; padding: 26px 16px; }
.rail-title { margin: 0 0 22px 12px; font-size: 14px; color: #d8bc84; letter-spacing: .22em; }
.chapter-button { width: 100%; margin: 0 0 12px; padding: 20px 12px; display: grid; grid-template-columns: 38px 1fr; text-align: left; align-items: center; gap: 10px; border: 1px solid #ffffff25; color: inherit; background: transparent; cursor: pointer; }
.chapter-button[aria-pressed="true"] { background: #fff7e6; color: var(--jade); border-color: #fff7e6; }
.chapter-button:not([aria-pressed="true"]):hover { background: #ffffff12; }
.chapter-button .chapter-ordinal { font: 27px "STKaiti",serif; border-right: 1px solid currentColor; }
.chapter-button strong { display: block; font-size: 18px; font-weight: 500; }
.chapter-button small { display: block; font-size: 13px; opacity: .8; margin-top: 5px; }
.rail-note { margin: 30px 12px 18px; border-top: 1px solid #ffffff30; padding-top: 24px; }
.rail-note > span { color: #e6c58b; font-size: 15px; }
.rail-note p { color: #dbdfd7; font-size: 14px; line-height: 1.9; }
.rail-note small { display: block; color: #cbd7cb; font-size: 12px; }
.chapter-nav > .text-button { margin-left: 12px; color: #eed5a4; }
.text-button { border: 0; background: transparent; color: var(--jade); padding: 7px 0; cursor: pointer; font-size: 14px; text-underline-offset: 5px; }
.text-button:hover { text-decoration: underline; }
.game-content { min-width: 0; padding: 32px 36px; min-height: 670px; }
.chapter-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.chapter-heading h2 { font: 500 32px "STKaiti",serif; margin: 0; letter-spacing: .08em; }
.chapter-heading p:last-child { margin: 12px 0 0; color: var(--ink-soft); }
.chapter-completed { flex-shrink: 0; border: 1px solid var(--line); padding: 8px 12px; font-size: 14px; }
.level-legend { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 15px; color: var(--ink-soft); font-size: 14px; }
.legend-cleared { display: inline-block; width: 10px; height: 10px; background: var(--jade-light); margin-right: 6px; }
.level-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.level-button { position: relative; min-height: 75px; background: #f6f0e2; border: 1px solid #dcd7c8; padding: 9px; cursor: pointer; }
.level-button strong { display: block; font: 24px/1.1 Georgia,serif; }
.level-button small { display: block; margin-top: 7px; font-size: 12px; color: #5a6861; }
.level-button:hover { background: #eee6d5; border-color: var(--gold); }
.level-button.is-cleared { background: #e2eae0; border-color: #a8b9a5; }
.level-button.is-cleared strong::after { content: ' ✓'; font: 14px sans-serif; color: var(--jade); }
.level-button[aria-pressed="true"] { color: var(--cinnabar); border: 2px solid var(--cinnabar); background: #fcf0e3; }
.level-preview { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.level-preview .section-kicker { margin-bottom: 5px; }
.level-preview h3 { font-size: 18px; font-weight: 500; margin: 0; }
.level-preview p:last-child { font-size: 14px; color: var(--ink-soft); margin: 8px 0 0; }
.primary-button { border: 1px solid var(--cinnabar); background: var(--cinnabar); color: #fffaf1; padding: 13px 23px; min-height: 48px; cursor: pointer; white-space: nowrap; }
.primary-button:hover { background: var(--cinnabar-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: .5; }
.secondary-button { border: 1px solid #b5bbae; padding: 10px 18px; min-height: 44px; color: var(--jade); background: transparent; cursor: pointer; }
.secondary-button:hover { background: #e8ebdf; }
.coverage-note { margin: 22px 0 0; font-size: 13px; color: var(--ink-soft); }
.play-toolbar { display: flex; align-items: center; gap: 16px; justify-content: space-between; color: var(--ink-soft); font-size: 14px; }
#question-progress { display: block; width: 100%; height: 5px; margin: 16px 0 25px; border: 0; background: #e5e5d7; accent-color: var(--jade); }
#question-progress::-webkit-progress-bar { background: #e5e5d7; }
#question-progress::-webkit-progress-value { background: var(--jade); }
.play-heading { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.play-heading .section-kicker { letter-spacing: .04em; font-size: 14px; }
.round-label { font-size: 13px; color: var(--cinnabar); }
#question-instruction { font: 500 25px/1.6 "STKaiti",serif; margin: 8px 0 22px; }
#question-instruction:focus { outline: none; }
.sound-prompt { padding: 23px 20px; background: #f3eddd; border-left: 3px solid var(--gold); margin-bottom: 22px; text-align: center; }
.question-pinyin { font: 500 clamp(24px, 3.5vw, 38px)/1.6 system-ui, sans-serif; color: var(--jade); overflow-wrap: anywhere; }
.question-clue { margin: 10px 0 0; font-size: 15px; color: #546153; }
.speech-button { font-size: 13px; margin-top: 7px; }
.selected-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin: 26px 0; }
.tile-slot { width: 56px; height: 60px; border: 1px dashed #b7b6a1; background: #fbf6e8; color: var(--jade); font: 30px "STKaiti",serif; cursor: pointer; }
.tile-slot.has-letter { border: 1px solid var(--jade-light); background: #e8ecdd; }
.tile-slot.is-given { border-style: solid; background: #ece6d8; color: var(--ink-soft); cursor: default; opacity: 1; }
.tile-pool { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 540px; margin: auto; }
.letter-tile { min-height: 60px; border: 1px solid #c9c9b6; background: #fffef9; font: 29px "STKaiti",serif; box-shadow: 0 3px 0 #e6e4d4; cursor: pointer; }
.letter-tile:hover:not(:disabled) { border-color: var(--jade); background: #f0f1e3; }
.letter-tile:disabled { color: #a9b3a5; background: #eef0e6; box-shadow: none; cursor: default; }
.question-actions { display: flex; justify-content: center; gap: 14px; margin: 25px 0; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 25px 0; }
.word-option { display: flex; align-items: center; gap: 13px; text-align: left; border: 1px solid #cdd0be; background: #fffdf8; padding: 19px 17px; min-height: 78px; font-size: 22px; cursor: pointer; }
.option-marker { flex-shrink: 0; font: 14px Georgia,serif; color: #6a7668; border: 1px solid #d2d6c6; width: 27px; height: 27px; display: grid; place-items: center; }
.word-option:hover:not(:disabled) { border-color: var(--jade); background: #edf1e5; }
.word-option.is-right { border-color: var(--jade); background: #e1eddf; color: var(--jade); }
.word-option.is-wrong { border-color: var(--cinnabar); background: #fae8df; color: var(--cinnabar); }
.context-sentence { margin: 26px 0 20px; padding: 27px 24px; border-left: 3px solid var(--gold); background: #f5efdf; font: 24px/2 "STKaiti",serif; }
.blank-space { display: inline-block; color: var(--cinnabar); border-bottom: 2px solid; min-width: 94px; margin: 0 7px; text-align: center; }
.answer-feedback { margin: 20px 0; background: #eaf0e2; border-left: 3px solid var(--jade); padding: 17px 21px; }
.answer-feedback.is-mistake { border-color: var(--cinnabar); background: #fcf0e3; }
.answer-feedback strong { display: block; font-size: 19px; }
.answer-feedback p { margin: 7px 0 0; font-size: 16px; }
.answer-feedback small { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
#next-question { display: block; margin-left: auto; }
.result-screen { padding: 55px 10px 35px; text-align: center; }
.result-stamp { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 25px; border: 3px double var(--cinnabar); color: var(--cinnabar); font: 30px "STKaiti",serif; transform: rotate(-6deg); }
.result-screen h2 { font: 36px "STKaiti",serif; }
.result-score { color: var(--jade); font: 48px Georgia,serif; }
.result-score small { font-size: 19px; color: var(--ink-soft); }
.result-screen p { color: var(--ink-soft); }
.result-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.game-footer { background: transparent; color: var(--ink-soft); margin-top: 18px; padding: 25px 5%; min-height: 80px; }
.game-footer span { color: var(--jade); }
.catalog-dialog { width: min(860px, 92%); max-height: 85vh; border: 1px solid var(--line); background: #fffcf3; color: var(--ink); padding: 30px; }
.catalog-dialog::backdrop { background: #172d2ab3; }
.catalog-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.catalog-header h2 { margin: 0; font: 32px "STKaiti",serif; }
.catalog-note { font-size: 14px; color: var(--ink-soft); }
.catalog-source { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 15px; }
.catalog-source h3 { font-size: 19px; }
.catalog-source summary { cursor: pointer; padding: 12px 0; }
.catalog-words { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0 20px; }
.catalog-word { border: 1px solid #ded9c8; padding: 8px 12px; background: #f7f0df; }
.catalog-word small { display: block; font: 12px/1.5 system-ui,sans-serif; color: var(--ink-soft); }
.catalog-word span { display: block; font-size: 18px; }
.catalog-word.is-new { border-color: #a7352b88; }
.catalog-word .new-word-label { margin-top: 4px; color: #a7352b; }
.rail-note p #level-size { display: inline; font: inherit; color: inherit; }
.six-game-card { grid-column: 1 / -1; padding: 35px 38px; background: linear-gradient(110deg,#173b35,#28594e); color: #fff6e2; display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.six-game-card .section-kicker { color: #e8c48e; }
.six-game-card h2 { color: #fff6e2; }
.six-game-card p:not(.section-kicker) { color: #d8e2d4; }
.six-game-card .game-enter { color: #fff8e9; border: 1px solid #e3c89b; padding: 13px 22px; text-decoration: none; white-space: nowrap; background: #ffffff0b; }
@media (max-width: 950px) {
  .game-workspace { grid-template-columns: 185px minmax(0,1fr); }
  .game-content { padding: 25px 22px; }
  .chapter-nav { padding: 25px 10px; }
  .chapter-button { gap: 6px; padding: 17px 9px; }
  .chapter-button strong { font-size: 16px; }
  .game-totals { gap: 18px; }
  .game-totals div + div { padding-left: 18px; }
  .word-option { font-size: 19px; padding: 15px 12px; }
}
@media (max-width: 720px) {
  .game-header { padding: 18px 5%; }
  .back-link { font-size: 13px; }
  .game-title-row { align-items: flex-start; padding-top: 28px; }
  .game-title-row h1 { font-size: 35px; gap: 10px; }
  .title-seal { display: none; }
  .game-subtitle { font-size: 14px; }
  .game-totals { gap: 10px; }
  .game-totals div:first-child { display: none; }
  .game-totals div + div { border: 0; padding: 0; }
  .game-totals dd { font-size: 30px; }
  .game-workspace { grid-template-columns: 1fr; }
  .chapter-nav { padding: 15px 12px; }
  .rail-title, .rail-note { display: none; }
  #chapter-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .chapter-button { margin: 0; display: block; text-align: center; padding: 13px 4px; }
  .chapter-button .chapter-ordinal { display: none; }
  .chapter-button strong { font-size: 16px; }
  .chapter-button small { font-size: 12px; }
  .chapter-nav > .text-button { display: block; margin: 10px auto 0; padding: 3px 0; }
  .game-content { min-height: 550px; padding: 25px 18px; }
  .chapter-heading { gap: 10px; }
  .chapter-heading h2 { font-size: 29px; }
  .chapter-completed { padding: 5px 7px; font-size: 12px; }
  .chapter-heading p:last-child { font-size: 15px; }
  .level-list { gap: 7px; }
  .level-button { min-height: 68px; padding: 6px 2px; }
  .level-button strong { font-size: 22px; }
  .level-button small { font-size: 12px; }
  .level-preview { align-items: stretch; flex-direction: column; }
  .level-preview .primary-button { width: 100%; }
  .play-toolbar { flex-wrap: wrap; gap: 8px; font-size: 13px; }
  .play-toolbar .text-button { font-size: 13px; }
  .play-toolbar #play-location { order: 3; width: 100%; }
  .tile-slot { width: 48px; height: 52px; }
  .letter-tile { min-height: 54px; font-size: 27px; }
  .choice-grid { grid-template-columns: 1fr; gap: 10px; }
  .word-option { min-height: 64px; font-size: 22px; }
  .context-sentence { padding: 20px 16px; font-size: 22px; }
  .game-footer { align-items: center; flex-direction: column; gap: 6px; padding: 25px 5%; }
  .catalog-dialog { padding: 22px; }
  .six-game-card { padding: 30px 24px; align-items: flex-start; flex-direction: column; }
}
@media (max-width: 420px) {
  .game-title-row { flex-direction: column; gap: 16px; }
  .game-totals { width: 100%; justify-content: space-between; white-space: nowrap; }
  .game-totals div:first-child { display: block; }
}
@media (forced-colors: active) { .level-button[aria-pressed="true"], .chapter-button[aria-pressed="true"] { outline: 3px solid Highlight; } }
