:root {
  color-scheme: light;
  --ink: #24313b;
  --muted: #66727c;
  --paper: #fffdf8;
  --page: #f3f0e8;
  --line: #d8d2c4;
  --green: #4e9f7a;
  --blue: #4e8fb9;
  --amber: #e6a23c;
  --coral: #d0663f;
  --soft-green: #eaf4ef;
  --soft-blue: #f6fbff;
  --soft-amber: #fff7e8;
  --soft-coral: #fff0eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
}

body.access-locked {
  overflow: hidden;
}

body.game-open,
body.eye-resting {
  overflow: hidden;
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(78, 159, 122, 0.94), rgba(78, 143, 185, 0.92));
}

body.access-locked .access-gate {
  display: grid;
}

body.access-locked .app-shell {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.access-card {
  width: min(460px, calc(100vw - 32px));
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgba(36, 49, 59, 0.24);
}

.access-card h2 {
  margin-bottom: 8px;
  font-size: 34px;
}

.access-card p {
  color: var(--muted);
  line-height: 1.5;
}

.access-card label {
  display: block;
  margin: 18px 0 12px;
  color: var(--muted);
  font-weight: 900;
}

.access-card input {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font-size: 22px;
}

.access-card button {
  width: 100%;
  min-height: 58px;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.access-error {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--coral);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr) minmax(260px, 310px);
  gap: 18px;
  width: 100%;
  min-height: 100vh;
  padding: 22px;
}

.left-panel,
.main-panel,
.right-panel {
  min-width: 0;
  min-height: calc(100vh - 44px);
  border: 1px solid var(--line);
  background: var(--paper);
}

.left-panel,
.right-panel {
  border-radius: 22px;
  padding: 22px;
}

.main-panel {
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand,
.top-status,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-status {
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 48px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 28px;
  line-height: 1;
}

.today-card,
.teacher-box,
.mom-box,
.settings-box,
.result-card,
.phonics-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.today-card {
  margin: 22px 0;
  background: var(--soft-green);
}

.today-card p,
.result-label,
.tiny {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.word-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.word-group-title {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.word-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.word-item.active {
  border-color: var(--green);
  background: var(--soft-green);
}

.word-item.review {
  border-color: #edcf8c;
  background: var(--soft-amber);
}

.word-item.later {
  opacity: 0.64;
}

.word-item strong {
  display: block;
  font-size: 17px;
}

.word-item span {
  color: var(--muted);
  font-size: 13px;
}

.word-item .mini-visual {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--soft-amber);
  font-size: 23px;
}

.word-item .word-status {
  min-width: 58px;
  padding: 7px 9px;
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.score-pill {
  min-width: 126px;
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.learning-card {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 300px;
  padding: 28px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ffffff 0%, #f9fbf5 100%);
  border: 1px solid var(--line);
}

.visual-card {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 26px;
  background: var(--soft-amber);
  font-size: 112px;
}

.word-content {
  position: relative;
  min-height: 188px;
  border-radius: 22px;
  padding: 2px;
}

.word-content.is-masked .chinese,
.word-content.is-masked .sentence,
.word-content.is-masked .focus,
#wordTitle.is-masked {
  color: transparent;
  text-shadow: 0 0 16px rgba(36, 49, 59, 0.28);
  user-select: none;
}

.word-content.is-masked::after {
  position: absolute;
  inset: -8px;
  display: grid;
  place-items: center;
  border: 2px dashed #d7b85d;
  border-radius: 22px;
  background: rgba(255, 247, 232, 0.94);
  color: var(--ink);
  content: "文字盖住啦，看图想一想";
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

#wordTitle.is-masked {
  position: relative;
}

#wordTitle.is-masked::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center start;
  color: var(--ink);
  content: "想一想怎么说";
  text-shadow: none;
}

.chinese {
  margin-bottom: 18px;
  font-size: 30px;
  font-weight: 800;
}

.sentence {
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.18;
}

.focus {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.step-button {
  height: 58px;
  padding: 0 8px;
  border-radius: 16px;
  background: #eee9dd;
  color: var(--ink);
  font-weight: 800;
}

.step-button.active {
  background: var(--green);
  color: white;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.primary-action,
.secondary-action,
.record-action,
.dialog-actions button {
  min-height: 62px;
  border-radius: 17px;
  padding: 0 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.compact {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 15px;
}

.primary-action {
  background: var(--ink);
  color: white;
}

.secondary-action {
  background: #dceefa;
  color: #164866;
}

.record-action {
  background: var(--amber);
  color: var(--ink);
}

.record-action.blue {
  background: var(--blue);
  color: white;
}

.record-action.listening {
  background: var(--coral);
  color: white;
}

.result-card {
  flex: 1;
  background: white;
}

.recognized {
  min-height: 34px;
  margin-bottom: 14px;
  font-size: 22px;
  font-weight: 800;
}

.meter {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7db;
}

.meter-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.35s ease;
}

.teacher-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.phonics-card {
  background: #fffaf0;
}

.phonics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.phonics-head h3 {
  margin-bottom: 0;
}

.phonics-guide {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}

.chunk-row,
.choice-buttons,
.letter-bank,
.train-track {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chunk-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid #e3c57d;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.choice-box {
  margin: 16px 0;
  padding: 14px;
  border-radius: 16px;
  background: white;
  border: 1px solid #ead8a9;
}

.choice-box p {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 900;
}

.choice-buttons button,
.letter-bank button {
  min-width: 88px;
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: #f1f6ff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.choice-buttons button.is-correct {
  border-color: var(--green);
  background: var(--soft-green);
}

.choice-buttons button.is-wrong,
.letter-bank button.is-wrong,
.spell-input-row input.is-wrong {
  border-color: var(--coral);
  background: var(--soft-coral);
  animation: shake 0.32s ease both;
}

.spell-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 12px;
}

.spell-input-row input {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 0 18px;
  background: white;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.spell-feedback {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

.game-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
}

.game-card:not(.is-locked) {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg transform='rotate(-35 24 24)'%3E%3Crect x='19' y='18' width='8' height='25' rx='4' fill='%238b5e3c' stroke='%2324313b' stroke-width='2'/%3E%3Crect x='10' y='8' width='28' height='16' rx='5' fill='%23f2c66d' stroke='%2324313b' stroke-width='2'/%3E%3Crect x='14' y='11' width='20' height='5' rx='2.5' fill='%23fff3bd'/%3E%3C/g%3E%3C/svg%3E") 13 10, pointer;
}

.game-card.is-locked {
  background: #f7f4ec;
}

.game-head,
.game-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.game-head h3 {
  margin-bottom: 0;
}

.game-card .secondary-action {
  min-height: 48px;
}

.game-card button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.game-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 10px;
}

.game-option {
  min-height: 104px;
  border: 1px solid #c7d9d0;
  border-radius: 18px;
  padding: 16px;
  background: var(--soft-green);
  color: var(--ink);
  text-align: left;
}

.game-option.train {
  border-color: #e1c88a;
  background: var(--soft-amber);
}

.game-option strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.game-option span {
  color: var(--muted);
  font-weight: 800;
}

.game-prompt {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--soft-blue);
}

.game-prompt p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.game-prompt strong {
  display: block;
  font-size: 26px;
}

.icon-button.mini {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  font-size: 18px;
}

.mole-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 12px;
  min-height: 146px;
}

.mole-button {
  position: relative;
  min-height: 140px;
  overflow: hidden;
  border: 1px solid #ccbfa8;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf8 0%, #eee1ce 100%);
  color: var(--ink);
  font-weight: 900;
  cursor: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mole-button:hover {
  box-shadow: 0 10px 22px rgba(36, 49, 59, 0.12);
  transform: translateY(-2px);
}

.mole-button:active {
  transform: translateY(3px) rotate(-1deg);
}

.mole-button::after {
  position: absolute;
  right: 12px;
  bottom: 8px;
  left: 12px;
  height: 20px;
  border-radius: 50%;
  background: rgba(83, 61, 43, 0.22);
  content: "";
}

.mole-button::before {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 2;
  opacity: 0;
  font-size: 24px;
  font-weight: 900;
  pointer-events: none;
}

.mole-button.is-hit::before {
  content: "★";
  color: var(--amber);
  animation: sparkleRise 0.42s ease both;
}

.mole-button.is-miss::before {
  content: "?";
  color: var(--coral);
  animation: sparkleRise 0.32s ease both;
}

.mole-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
  margin: 10px 10px 22px;
  border-radius: 46px 46px 20px 20px;
  background: radial-gradient(circle at 34% 21%, #ffe0b5 0 18%, transparent 19%),
    linear-gradient(180deg, #f8c786 0%, #e8a35d 100%);
  box-shadow: inset 0 -8px 0 rgba(155, 93, 46, 0.16);
  line-height: 1.2;
  padding: 15px 9px 8px;
}

.mole-ear {
  position: absolute;
  top: -2px;
  width: 24px;
  height: 24px;
  border: 2px solid #9f6537;
  border-radius: 50%;
  background: #f2b06d;
}

.mole-ear::after {
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: #ffd6a0;
  content: "";
}

.mole-ear.left {
  left: 10px;
}

.mole-ear.right {
  right: 10px;
}

.mole-label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(255, 252, 243, 0.78);
  font-size: 15px;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: center;
}

.mole-face {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 20px 1fr;
  align-items: center;
  justify-items: center;
  height: 32px;
  margin-top: 6px;
}

.mole-eye {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.mole-nose {
  width: 15px;
  height: 11px;
  border-radius: 50% 50% 58% 58%;
  background: #5a3d31;
}

.mole-tooth {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 11px;
  height: 13px;
  border: 1px solid rgba(36, 49, 59, 0.18);
  border-radius: 0 0 5px 5px;
  background: white;
  transform: translateX(-50%);
}

.mole-button.is-hit .mole-head {
  animation: bonk 0.42s ease both;
  background: linear-gradient(180deg, #72c99f 0%, var(--green) 100%);
  color: white;
}

.mole-button.is-hit .mole-label {
  background: rgba(255, 255, 255, 0.24);
  color: white;
}

.mole-button.is-miss .mole-head {
  animation: shake 0.32s ease both;
  background: var(--soft-coral);
}

.game-feedback {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.game-feedback.big {
  font-size: 22px;
  text-align: center;
}

.game-screen,
.eye-break {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: none;
  padding: 22px;
  background: #eef4ef;
}

.game-screen.show,
.eye-break.show {
  display: block;
}

.game-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
}

.game-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.game-screen-head h2 {
  font-size: 42px;
}

.screen-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.game-screen .game-prompt {
  margin: 0;
}

.game-screen .game-prompt strong,
.train-prompt strong {
  font-size: 34px;
}

.game-screen .mole-grid {
  flex: 1;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  align-content: stretch;
  min-height: 0;
}

.game-screen .mole-button {
  min-height: 190px;
}

.game-screen .mole-head {
  min-height: 150px;
  border-radius: 62px 62px 26px 26px;
}

.game-screen .mole-label {
  min-height: 58px;
  font-size: 22px;
}

.train-screen {
  background: #f4f1e7;
}

.train-prompt {
  padding: 18px 20px;
  border: 1px solid #e1c88a;
  border-radius: 18px;
  background: var(--soft-amber);
}

.train-prompt p,
.train-prompt span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 900;
}

.train-track {
  flex: 1;
  align-content: center;
  justify-content: center;
  min-height: 140px;
  padding: 20px;
  border-radius: 24px;
  background: white;
  border: 1px dashed #d4bd7a;
}

.train-car,
.train-gap {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  font-size: 34px;
  font-weight: 900;
}

.train-car {
  border: 2px solid #d4bd7a;
  background: #fff7df;
  color: var(--ink);
}

.train-car.filled {
  border-color: var(--green);
  background: var(--soft-green);
}

.train-gap {
  width: 34px;
}

.letter-bank {
  justify-content: center;
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.letter-bank button {
  min-width: 70px;
  min-height: 66px;
  background: #e8f3fb;
  font-size: 28px;
}

.letter-bank button.is-used {
  background: var(--soft-green);
  color: var(--green);
  opacity: 0.62;
}

.eye-break {
  z-index: 40;
  display: none;
  place-items: center;
  background: #e8f2ed;
}

.eye-break.show {
  display: grid;
}

.eye-break-card {
  width: min(620px, calc(100vw - 40px));
  padding: 38px;
  border: 1px solid #bfd7ca;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(36, 49, 59, 0.2);
  text-align: center;
}

.eye-break-card h2 {
  font-size: 42px;
}

.eye-break-card p {
  color: var(--muted);
  font-size: 21px;
  line-height: 1.6;
}

.eye-break-card strong {
  display: block;
  margin: 22px 0 8px;
  color: var(--green);
  font-size: 64px;
  line-height: 1;
}

.eye-break-card span {
  color: var(--muted);
  font-weight: 900;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  pointer-events: none;
  background: rgba(36, 49, 59, 0.16);
}

.celebration.show {
  display: grid;
}

.celebration-card {
  width: min(440px, calc(100vw - 48px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: white;
  box-shadow: 0 22px 70px rgba(36, 49, 59, 0.24);
  text-align: center;
  animation: pop 0.48s ease both;
}

.celebration-card span {
  display: block;
  color: var(--amber);
  font-size: 54px;
  animation: twinkle 0.8s ease infinite alternate;
}

.celebration-card strong {
  display: block;
  margin: 8px 0;
  font-size: 25px;
}

.celebration-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.teacher-box {
  background: var(--soft-blue);
}

.mom-box {
  margin-top: 16px;
  background: var(--soft-amber);
}

.settings-box {
  margin-top: 16px;
  background: white;
}

.mark-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.mark-grid button {
  min-height: 48px;
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  border: 1px solid var(--line);
}

.mom-box p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.settings-box label {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
}

.settings-box select,
.settings-box input {
  width: 100%;
  margin-top: 8px;
}

.settings-box select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

.library-dialog {
  width: min(820px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
}

.library-dialog::backdrop {
  background: rgba(36, 49, 59, 0.36);
}

.dialog-help {
  color: var(--muted);
  line-height: 1.5;
}

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: white;
  color: var(--ink);
  line-height: 1.5;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.dialog-actions button:first-child {
  background: var(--soft-blue);
  color: var(--ink);
}

.dialog-actions button:last-child {
  background: var(--ink);
  color: white;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 16px;
    padding: 18px;
  }

  .right-panel {
    grid-column: 1 / -1;
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .teacher-box,
  .mom-box,
  .settings-box {
    margin-top: 0;
  }

  .mole-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .left-panel,
  .right-panel,
  .main-panel {
    min-height: auto;
  }

  .main-panel {
    order: 1;
    padding: 22px;
  }

  .right-panel {
    order: 2;
    grid-template-columns: 1fr 1fr;
    padding: 18px;
  }

  .left-panel {
    order: 3;
    padding: 18px;
  }

  .word-list {
    max-height: 420px;
  }

  h2 {
    font-size: 40px;
  }

  .learning-card {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 20px;
    min-height: 240px;
    padding: 22px;
  }

  .visual-card {
    font-size: 88px;
  }

  .sentence {
    font-size: 24px;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-screen .mole-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .spell-input-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .access-gate {
    padding: 16px;
  }

  .access-card {
    padding: 22px;
  }

  .access-card h2 {
    font-size: 30px;
  }

  .app-shell {
    padding: 10px;
    gap: 12px;
  }

  .main-panel,
  .left-panel,
  .right-panel {
    border-radius: 18px;
  }

  .main-panel {
    padding: 16px;
    gap: 14px;
  }

  .right-panel {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 34px;
  }

  .learning-card {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px;
  }

  .visual-card {
    max-width: 180px;
    margin: 0 auto;
    font-size: 78px;
  }

  .word-content {
    min-height: 150px;
  }

  .chinese {
    font-size: 27px;
  }

  .sentence {
    font-size: 22px;
  }

  .steps,
  .actions,
  .game-options,
  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .step-button,
  .primary-action,
  .secondary-action,
  .record-action,
  .dialog-actions button {
    min-height: 54px;
    border-radius: 14px;
    padding: 0 12px;
  }

  .game-prompt strong {
    font-size: 22px;
  }

  .mole-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mole-button {
    min-height: 128px;
  }

  .game-screen {
    padding: 10px;
  }

  .game-stage {
    padding: 16px;
    border-radius: 20px;
  }

  .game-screen-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-screen-head h2 {
    font-size: 32px;
  }

  .game-screen .mole-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .game-screen .mole-button {
    min-height: 150px;
  }

  .game-screen .mole-head {
    min-height: 112px;
  }

  .game-screen .mole-label {
    font-size: 17px;
  }

  .train-car,
  .train-gap {
    width: 58px;
    height: 58px;
    font-size: 26px;
  }

  .letter-bank button {
    min-width: 56px;
    min-height: 56px;
    font-size: 24px;
  }

  .eye-break-card {
    padding: 28px;
  }

  .eye-break-card h2 {
    font-size: 32px;
  }

  .eye-break-card strong {
    font-size: 52px;
  }

  .mole-head {
    min-height: 96px;
    margin: 9px 8px 20px;
  }

  .word-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .word-item .word-status {
    grid-column: 2;
    width: fit-content;
  }
}

@media (max-width: 420px) {
  .steps,
  .actions,
  .mark-grid,
  .game-options,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  h2 {
    font-size: 30px;
  }

  .recognized {
    font-size: 20px;
  }

  .mole-label {
    font-size: 14px;
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: scale(0.88) translateY(18px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes twinkle {
  0% {
    transform: rotate(-8deg) scale(0.92);
  }
  100% {
    transform: rotate(8deg) scale(1.08);
  }
}

@keyframes bonk {
  0% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(22px) scale(0.94);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes sparkleRise {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.7) rotate(-12deg);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px) scale(1.3) rotate(12deg);
  }
}
