* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: #173c31; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #387848; outline-offset: 3px; }
button:disabled { cursor: default; }
.wrap { width: min(1090px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid #e0e9dc; }
.top-inner, .brand, nav, .picker, .level-control, .play-top, .board-top { display: flex; align-items: center; }
.top-inner { min-height: 66px; justify-content: space-between; gap: 14px; }
.brand { gap: 8px; font-weight: 600; white-space: nowrap; }
.brand img { object-fit: contain; }
nav { gap: clamp(10px, 2.6vw, 30px); font-size: .875rem; }
nav a { padding-block: 9px; }
nav a[aria-current] { border-bottom: 2px solid #4d813d; color: #194e31; font-weight: 600; }
main { min-height: 70vh; padding-block: 36px 44px; }
.hero { position: relative; isolation: isolate; border: 1px solid #dbe9cd; border-radius: 26px; background: #eaf4dc; padding: clamp(24px, 5vw, 60px); display: grid; grid-template-columns: 1fr minmax(160px, 29%); align-items: center; gap: 20px; overflow: hidden; }
h1, h2, h3, p { margin: 0; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.85rem); line-height: 1.14; letter-spacing: -.045em; max-width: 16ch; }
.hero p { margin-top: 14px; max-width: 47ch; color: #416354; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 175px; }
.hero-art::before { content: ''; position: absolute; width: min(91%, 211px); aspect-ratio: 1; border-radius: 50%; background: #d9eabb; z-index: -1; }
.hero-art img { width: min(80%, 184px); height: auto; object-fit: contain; }
.hero-art span { position: absolute; padding: 4px 10px; border-radius: 10px; color: #315a35; background: #ffffffef; border: 1px solid #d0e5bd; box-shadow: 0 3px 7px #35562212; }
.hero-art span:first-child { left: 5%; top: 11%; transform: rotate(-12deg); font-size: 1.25rem; }
.hero-art span:last-child { right: 0; bottom: 12%; transform: rotate(8deg); font-size: .83rem; }
.picker { justify-content: space-between; gap: 16px; margin: 30px 0 16px; }
.picker h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.level-control { gap: 10px; font-size: .8rem; color: #4b6257; }
select, input { min-height: 45px; padding: 9px 12px; background: #fff; border: 1px solid #b7cbb8; border-radius: 11px; font: inherit; color: #173c31; }
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.game-card { min-width: 0; background: white; border: 1px solid #dae6d6; border-radius: 19px; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.game-card h3 { font-size: 1.16rem; }
.game-card p { color: #4b6257; margin-bottom: 6px; font-size: .9rem; }
.game-card button, .primary { border: 1px solid #234b38; border-radius: 11px; min-height: 46px; background: #244e3a; color: #fff; padding: 10px 14px; font-weight: 600; }
.game-card button { margin-top: auto; display: flex; justify-content: space-between; text-align: left; align-items: center; gap: 8px; }
.game-card button:hover, .primary:hover { background: #173e2d; }
.primary:disabled { background: #ecf1eb; color: #56685d; border-color: #c5d1c4; }
.game-preview { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 106px; border-radius: 12px; background: #eaf4df; color: #274b36; }
.card-pinyin .game-preview { background: #fbefda; }
.card-sentence .game-preview { background: #e9eeff; }
.card-listening .game-preview { background: #e1f2ee; }
.card-cloze .game-preview { background: #f3eaf6; }
.game-guide { margin-top: 30px; padding: clamp(16px, 4vw, 28px); background: #fff; border: 1px solid #dae6d6; border-radius: 17px; }
.game-guide h2 { font-size: 1.22rem; }
.game-guide p { margin-top: 9px; color: #416354; }
.game-guide h2:not(:first-child) { margin-top: 22px; }
.game-guide a { text-decoration: underline; }
.game-guide details { border-bottom: 1px solid #dae6d6; padding: 9px 0; }
.game-guide summary { min-height: 29px; cursor: pointer; font-weight: 600; }
.game-guide details p { margin: 5px 0 4px; }
.game-preview span { border: 1px solid #fff; background: #ffffffd9; box-shadow: 0 4px #192d2120; border-radius: 11px; padding: 6px 13px; font-size: 1.22rem; font-weight: 600; }
[lang="zh-CN"] { font-family: var(--font-hanzi, sans-serif); }
footer { border-top: 1px solid #dce7dd; padding-block: 17px 24px; font-size: .88rem; color: #456458; }
footer a:hover, .back:hover { text-decoration: underline; }
#play { max-width: 760px; margin: auto; }
.play-top { justify-content: space-between; gap: 12px; margin: 0 2px 12px; color: #4b6257; font-size: .9rem; }
.back { background: transparent; border: 0; color: #244e3a; padding: 7px 0; font-weight: 600; }
.board { padding: clamp(16px, 4vw, 34px); border-radius: 23px; background: #fff; border: 1px solid #d8e5d6; }
.board-top { justify-content: space-between; gap: 12px; align-items: baseline; }
.board-top h1 { font-size: clamp(1.3rem, 4.5vw, 2rem); }
#score { white-space: nowrap; font-weight: 600; padding: 3px 10px; border-radius: 24px; background: #eaf4df; }
progress { width: 100%; height: 10px; accent-color: #548744; margin-top: 14px; }
.progress-text { color: #4b6257; font-size: .84rem; margin-top: 3px; }
.match-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.tile { min-height: 78px; padding: 5px; border: 1px solid #bacfb7; border-radius: 11px; background: #eaf3dc; color: #305641; overflow-wrap: anywhere; font-size: .92rem; }
.tile[data-showing="true"] { background: #fff6df; border-color: #bea269; }
.tile[data-matched="true"] { background: #e1f3e4; border-color: #7fa988; color: #255333; }
.tile[lang="zh-CN"] { font-size: 1.3rem; }
.prompt { margin: 18px 0 8px; color: #4b6257; }
.question-hanzi { font-size: clamp(2.1rem, 7vw, 3.4rem); color: #244e3a; line-height: 1.22; margin: 2px 0 18px; }
form { display: flex; gap: 9px; }
form input { min-width: 0; flex: 1; }
.sentence-prompt { font-size: 1.16rem; font-weight: 600; margin-bottom: 12px; }
.sentence-line, .word-bank { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }
.sentence-line { background: #fafbf7; padding: 8px; min-height: 65px; border: 1px dashed #9daf9a; border-radius: 12px; }
.sentence-line p { color: #4b6257; padding: 8px 2px; font-size: .88rem; }
.word-bank { margin: 12px 0; min-height: 47px; }
.word { min-height: 42px; min-width: 42px; border: 1px solid #aac0ab; border-radius: 9px; background: #f1f6e8; color: #244e3a; font-size: 1.1rem; padding: 4px 10px; }
.word:disabled { background: #f7f8f4; color: #516458; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.choice-grid .word { min-height: 49px; overflow-wrap: anywhere; }
.choice-grid .word[data-option-state="correct"] { background: #e1f3e4; border-color: #66976e; color: #255333; }
.choice-grid .word[data-option-state="miss"] { background: #fff1de; border-color: #a47742; color: #633d1a; }
.audio-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.audio-message:not(:empty), .cloze-meaning { margin-top: 8px; color: #4b6257; }
.cloze-phrase { font-size: clamp(1.15rem, 3.8vw, 1.9rem); font-weight: 600; color: #244e3a; overflow-wrap: anywhere; }
#feedback:not(:empty) { padding: 10px 12px; border-radius: 10px; background: #f2f6ef; margin-top: 14px; color: #234238; }
#feedback[data-tone="miss"] { background: #fff2df; color: #633d1a; }
#feedback[data-tone="correct"] { background: #e8f4e8; color: #244e3a; }
.next { margin-top: 10px; }
.result { margin-top: 16px; }
.result ul { margin: 9px 0 16px; padding-left: 23px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.secondary { min-height: 46px; padding: 8px 13px; border-radius: 11px; border: 1px solid #aac0ab; color: #244e3a; background: #fff; }
@media (max-width: 740px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 510px) {
  .wrap { width: calc(100% - 28px); }
  main { padding-block: 22px 34px; }
  .top-inner { flex-wrap: wrap; padding-block: 9px; }
  .hero { grid-template-columns: 1fr 92px; gap: 4px; padding: 18px 14px; }
  .hero h1 { font-size: clamp(1.64rem, 6vw, 2.1rem); }
  .hero p { font-size: .86rem; }
  .hero-art { min-height: 100px; }
  .hero-art span { font-size: .72rem; padding: 2px 5px; }
  .hero-art span:first-child { font-size: .96rem; }
  .hero-art span:last-child { font-size: .62rem; bottom: 2%; }
  .picker { align-items: flex-start; flex-wrap: wrap; margin-top: 21px; }
  .games { grid-template-columns: 1fr; }
  .game-preview { min-height: 78px; }
  .match-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tile { min-height: 62px; }
}
