.game11-page {
  width: min(100%, 1040px);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.title-group {
  min-width: 0;
}

.title-group .eyebrow {
  margin-bottom: 6px;
}

.story-subtitle {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.home-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d8ebff 0%, #b9d9fb 100%);
  color: #174266;
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.stage-nav {
  padding: 14px;
}

.stage-nav ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 9px 10px;
  background: #f3f8fc;
  color: var(--text-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  touch-action: manipulation;
}

.stage-button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dfeaf4;
  font-size: 0.9rem;
}

.stage-button.is-active {
  border-color: rgba(75, 132, 198, 0.38);
  background: #d8ebff;
  color: #174266;
}

.stage-button.is-active span {
  background: var(--accent-deep);
  color: #fff;
}

.stage-button.is-visited:not(.is-active) {
  color: #3d6b91;
}

.stage-button:focus-visible,
.home-link:focus-visible,
button:focus-visible,
summary:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(75, 132, 198, 0.45);
  outline-offset: 3px;
}

.load-message {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.learning-step {
  padding: 26px;
}

.step-heading {
  margin-bottom: 20px;
}

.step-heading h2,
.step-heading h3 {
  margin: 0;
  color: var(--text-main);
  line-height: 1.3;
}

.step-heading h2 {
  font-size: 1.7rem;
}

.step-heading h3 {
  font-size: 1.3rem;
}

.step-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.step-heading.compact {
  margin-bottom: 14px;
}

.story-text {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fbff;
}

.story-text p {
  margin: 0;
  font-size: clamp(1.18rem, 2.5vw, 1.38rem);
  font-weight: 600;
  line-height: 1.95;
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.split-actions {
  justify-content: space-between;
}

.primary-button,
.secondary-button,
.quiet-button,
.card-action,
.speak-button {
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  padding: 11px 17px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  touch-action: manipulation;
}

.primary-button {
  background: linear-gradient(180deg, #cfe7ff 0%, #aed5f9 100%);
  color: #174266;
  box-shadow: 0 10px 22px rgba(75, 132, 198, 0.15);
}

.secondary-button,
.quiet-button,
.card-action {
  background: #eef5fb;
  color: #315f85;
}

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

.vocabulary-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
}

.word-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.word-heading h3 {
  margin: 0;
  color: var(--accent-deep);
  font-size: 1.45rem;
  line-height: 1.3;
}

.speak-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 48px;
  min-height: 48px;
  padding: 7px;
  background: #dceeff;
  color: #174266;
  font-size: 1.22rem;
}

.pinyin {
  margin: 7px 0 0;
  color: #456f95;
  font-size: 1rem;
  font-weight: 700;
}

.french {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.expression-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.expression-list {
  display: grid;
  gap: 10px;
}

.expression-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff9e8;
}

.expression-card > div {
  min-width: 0;
}

.expression-zh {
  color: var(--text-main);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.5;
}

.tts-status,
.save-status {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.faithful-note {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #efdca7;
  border-radius: 17px;
  background: #fff8e8;
  line-height: 1.6;
}

.faithful-note span {
  color: var(--text-soft);
  font-size: 0.9rem;
}

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

.element-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #f8fbff;
}

.element-card h3 {
  margin: 0;
  color: var(--accent-deep);
  font-size: 1.35rem;
  line-height: 1.35;
}

.element-card h3 span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

.element-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 15px;
}

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

.card-action.answer-action {
  background: #dff3e6;
  color: #17633f;
}

.clue-box,
.answer-box {
  margin: 12px 0 0;
  padding: 13px 14px;
  border-radius: 14px;
  line-height: 1.7;
}

.clue-box {
  background: #edf6ff;
  color: #315f85;
}

.answer-box {
  background: #eff9f2;
  color: #28583e;
}

.answer-box p {
  margin: 0 0 8px;
}

.answer-box p:last-child {
  margin-bottom: 0;
}

.retell-form {
  display: grid;
  gap: 13px;
}

.retell-line {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #f8fbff;
}

.prompt-text {
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.55;
}

.retell-line textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 2px solid #cddfeb;
  border-radius: 13px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text-main);
  font: inherit;
  font-size: 1.04rem;
  line-height: 1.55;
}

.retell-line textarea::placeholder {
  color: #9aaaba;
}

.retell-tools {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin-top: 17px;
}

.quiet-button {
  min-height: 50px;
  background: #fff1e9;
  color: #934f38;
}

.reference-details {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fbff;
}

.reference-details summary {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 10px 15px;
  color: #315f85;
  cursor: pointer;
  font-weight: 800;
  touch-action: manipulation;
}

.reference-details p {
  margin: 0;
  padding: 0 16px 17px;
  font-size: 1.04rem;
  line-height: 1.85;
}

.completion-panel {
  padding: 34px 26px;
  text-align: center;
}

.completion-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: #dff3e6;
  color: #17633f;
  font-size: 1.7rem;
  font-weight: 900;
}

.completion-panel h2 {
  margin: 0;
  color: #17633f;
  font-size: 1.75rem;
}

.completion-panel > p {
  margin: 9px 0 0;
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.6;
}

.completion-panel .step-actions {
  justify-content: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .vocabulary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page-header {
    flex-direction: column;
  }

  .home-link {
    width: 100%;
  }

  .stage-nav ol,
  .element-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-button {
    justify-content: flex-start;
  }

  .learning-step {
    padding: 21px 17px;
  }

  .story-text {
    padding: 19px 17px;
  }

  .split-actions,
  .retell-tools {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .step-actions button,
  .retell-tools > button,
  .reference-details {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .stage-nav ol,
  .element-grid {
    grid-template-columns: 1fr;
  }

  .expression-card {
    align-items: flex-start;
  }
}
