.chapter-page {
  background: #fbf7ed;
}

.chapter-hero {
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 44px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 36px;
  align-items: center;
}

.chapter-intro {
  max-width: 520px;
}

.goal-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d5bc8a;
  border-radius: 8px;
  background: #fff7df;
}

.goal-strip strong {
  color: #65432e;
  white-space: nowrap;
}

.goal-strip span {
  color: #4e5a53;
}

.market-picture {
  position: relative;
  border: 1px solid rgba(87, 70, 42, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: #f6ead6;
  box-shadow: var(--shadow);
}

.market-picture picture {
  display: block;
}

.market-picture img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.market-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: #382b21;
  background: #fffaf0;
  border-top: 1px solid rgba(132, 96, 51, 0.2);
}

.market-caption strong {
  color: #6f5147;
  white-space: nowrap;
}

.market-caption span {
  color: #4e5a53;
}

.play-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 70px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.player-card,
.story-card,
.basics-grid article,
.word-grid article,
.review-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(76, 56, 32, 0.08);
}

.player-card {
  position: sticky;
  top: 82px;
  padding: 22px;
}

.player-card h2,
.story-card h2 {
  margin: 0 0 8px;
}

.player-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.avatar-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: #eef5df;
  border: 1px solid #c8d8a5;
}

.tiny-rabbit {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background-image: url("../assets/images/world-style-guide.png");
  background-image: image-set(
    url("../assets/images/world-style-guide.webp") type("image/webp"),
    url("../assets/images/world-style-guide.png") type("image/png")
  );
  background-repeat: no-repeat;
  background-size: 640%;
  background-position: 39% 6%;
  border: 2px solid #c9bda7;
}

.inventory {
  display: grid;
  gap: 9px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e7;
  border: 1px solid #ead5aa;
}

.item-row strong {
  font-size: 15px;
}

.item-row span {
  color: #694a32;
  font-weight: 900;
}

.story-card {
  min-height: 520px;
  padding: 26px;
}

.basics-section {
  padding-top: 28px;
  padding-bottom: 38px;
}

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

.basics-grid article {
  padding: 22px;
}

.big-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 50%;
  color: #fffaf0;
  background: #6f5147;
  font-weight: 900;
}

.basics-grid p {
  margin: 0;
  color: var(--muted);
}

.kid-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  color: #405047;
  background: #eef5df;
  border: 1px solid #c9d9a7;
}

.step-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--carrot);
  font-size: 13px;
  font-weight: 900;
}

.scene-text {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
  color: #3f4b45;
  font-size: 18px;
}

.scene-text p {
  margin: 0;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.choice-button,
.continue-button {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #d3b783;
  background: #fff8e6;
  color: #332a22;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.choice-button:hover,
.continue-button:hover {
  background: #f7ead0;
}

.choice-button:disabled {
  cursor: not-allowed;
  color: #8b8376;
  background: #eee7d8;
}

.outcome {
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid #c8d8a5;
  background: #f2f7df;
}

.outcome h3 {
  margin-bottom: 8px;
}

.outcome p {
  margin: 0 0 10px;
}

.learn-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fffdf6;
  border: 1px solid #d9d0bd;
  color: #405047;
}

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

.word-grid article {
  padding: 20px;
}

.word-grid p {
  margin: 0;
  color: var(--muted);
}

.review-section {
  padding-top: 28px;
}

.review-board {
  padding: 22px;
  display: grid;
  gap: 12px;
  color: #3f4b45;
}

.review-board p {
  margin: 0;
}

.translation-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.translation-board article {
  min-width: 0;
  padding: 18px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #d7bd8f;
  box-shadow: 0 10px 26px rgba(76, 56, 32, 0.06);
}

.translation-board span {
  display: block;
  margin-bottom: 8px;
  color: var(--carrot);
  font-size: 13px;
  font-weight: 900;
}

.translation-board p {
  margin: 0;
  color: #3f4b45;
}

.chapter-route-section {
  padding-top: 0;
}

.route-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 22px;
  align-items: center;
  padding: 24px;
  border-radius: 8px;
  background: #fff8e6;
  border: 1px solid #d7bd8f;
  box-shadow: 0 10px 26px rgba(76, 56, 32, 0.08);
}

.route-panel h2 {
  font-size: clamp(26px, 4vw, 42px);
}

.route-panel p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  color: #4e5a53;
  font-size: 17px;
}

.route-actions {
  display: grid;
  gap: 10px;
}

.route-actions .button {
  width: 100%;
}

@media (max-width: 900px) {
  .chapter-hero,
  .play-shell {
    grid-template-columns: 1fr;
  }

  .player-card {
    position: static;
  }

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

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

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

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

  .translation-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .chapter-hero {
    min-height: auto;
    padding-top: 28px;
  }

  .market-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .goal-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .story-card {
    min-height: auto;
    padding: 20px;
  }

  .scene-text {
    font-size: 16px;
  }

  .word-grid {
    grid-template-columns: 1fr;
  }

  .basics-grid {
    grid-template-columns: 1fr;
  }

  .route-panel {
    padding: 20px;
  }

  .route-actions {
    grid-template-columns: 1fr;
  }
}
