:root {
  --bg: #fff6ea;
  --surface: #ffffff;
  --panel: #f8eadc;
  --panel-cool: #eaf3ef;
  --text: #3b261b;
  --muted: #7a6a5d;
  --orange: #f27a2e;
  --orange-dark: #c9572f;
  --green: #2f7d67;
  --blue: #7db7d8;
  --yellow: #f4b63f;
  --red-soft: #e86a4a;
  --shadow: 0 18px 44px rgba(59, 38, 27, 0.14);
  --soft-shadow: 0 10px 24px rgba(59, 38, 27, 0.1);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 13% 15%, rgba(244, 182, 63, 0.25), transparent 17rem),
    radial-gradient(circle at 92% 14%, rgba(125, 183, 216, 0.2), transparent 16rem),
    linear-gradient(180deg, #fff9f0 0%, var(--bg) 46%, #fff0df 100%);
}

button {
  font: inherit;
}

.game-shell {
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 28px 24px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.topbar,
.lighthouse-strip,
.taskbar {
  position: relative;
  z-index: 5;
}

.topbar {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  z-index: 20;
}

.brand {
  text-align: center;
}

.brand-kicker,
.panel-kicker,
.level-kicker {
  display: block;
  color: var(--orange-dark);
  font-size: 16px;
  font-weight: 800;
}

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

h1 {
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.small-button,
.primary-button,
.secondary-button,
.level-card,
.option-card,
.emotion-card {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  font-size: 28px;
  font-weight: 900;
}

.ppt-menu-wrap {
  position: relative;
}

.ppt-button {
  font-size: 18px;
  letter-spacing: 0;
}

.ppt-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max-content;
  min-width: 146px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.ppt-menu::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 22px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.96);
  transform: rotate(45deg);
}

.ppt-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ppt-menu a {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.ppt-menu a::before {
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--panel-cool);
  color: var(--green);
  font-size: 17px;
  line-height: 1;
}

.ppt-menu a:first-child::before {
  content: "↗";
}

.ppt-menu a:last-child::before {
  content: "↓";
}

.ppt-menu a:hover,
.ppt-menu a:focus-visible {
  outline: none;
  background: #fff4df;
}

.icon-button:active,
.small-button:active,
.primary-button:active,
.secondary-button:active,
.level-card:active,
.option-card:active,
.emotion-card:active {
  transform: translateY(2px);
}

.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.lighthouse-strip {
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(244, 182, 63, 0.32);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.lighthouse-mini,
.teacher-dots {
  display: flex;
  gap: 8px;
}

.mini-light,
.teacher-dots span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e3d5c4;
  border: 3px solid #fff8ef;
}

.mini-light {
  position: relative;
  overflow: hidden;
}

.mini-light::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: var(--fill, 0%);
  background: var(--yellow);
  transition: height 240ms ease;
}

.mini-light.is-lit {
  box-shadow: 0 0 14px rgba(244, 182, 63, 0.62);
}

.mini-light.is-complete {
  box-shadow: 0 0 18px rgba(244, 182, 63, 0.86);
}

.teacher-dots span.is-lit {
  background: var(--yellow);
  box-shadow: 0 0 18px rgba(244, 182, 63, 0.86);
}

.lighthouse-strip p {
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.screen {
  min-height: 0;
}

.map-screen {
  display: grid;
}

.map-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 360px) 1fr;
  align-items: center;
  gap: 28px;
}

.map-center {
  min-height: 440px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 32%, rgba(244, 182, 63, 0.35), transparent 9rem),
    linear-gradient(160deg, #ffffff 0%, #fff2df 100%);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.map-center::before {
  content: "";
  position: absolute;
  width: 170%;
  height: 120px;
  left: -35%;
  bottom: -40px;
  background: rgba(47, 125, 103, 0.16);
  border-radius: 50%;
}

.lighthouse {
  width: 180px;
  height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.beam {
  position: absolute;
  top: 0;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(244, 182, 63, 0.13);
  filter: blur(4px);
}

.lighthouse.is-complete .beam {
  background: rgba(244, 182, 63, 0.36);
  box-shadow: 0 0 80px rgba(244, 182, 63, 0.8);
  animation: glowPulse 1.8s ease-in-out infinite;
}

.tower-layer {
  width: 92px;
  height: 38px;
  margin-bottom: 4px;
  border-radius: 12px;
  background: #f0d9c1;
  border: 4px solid #fff6ea;
  box-shadow: inset 0 -8px 0 rgba(59, 38, 27, 0.05);
  transition: background 500ms ease, box-shadow 500ms ease;
}

.tower-layer:nth-child(2) {
  width: 118px;
}

.tower-layer:nth-child(3) {
  width: 108px;
}

.tower-layer:nth-child(4) {
  width: 98px;
}

.tower-layer:nth-child(5) {
  width: 88px;
}

.tower-layer.is-lit {
  background: linear-gradient(180deg, #ffe19b, var(--yellow));
  box-shadow: 0 0 24px rgba(244, 182, 63, 0.7);
}

.tower-base {
  width: 140px;
  height: 48px;
  border-radius: 18px 18px 10px 10px;
  background: var(--orange-dark);
  box-shadow: 0 10px 0 rgba(59, 38, 27, 0.08);
}

.map-title {
  position: absolute;
  bottom: 28px;
  left: 28px;
  right: 28px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.map-title strong {
  font-size: 28px;
}

.map-title span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 18px;
}

.level-card {
  min-height: 154px;
  padding: 20px;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  text-align: left;
  display: grid;
  grid-template-columns: 62px 1fr;
  grid-template-rows: auto auto auto;
  gap: 6px 14px;
  align-items: center;
  border: 4px solid transparent;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.level-card:hover,
.level-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(244, 182, 63, 0.8);
  outline: none;
}

.level-card.is-complete {
  border-color: rgba(47, 125, 103, 0.5);
  background: #edf7f2;
}

.level-card.is-locked {
  opacity: 0.72;
  filter: grayscale(0.18);
}

.level-icon {
  grid-row: 1 / 4;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.level-card.garden .level-icon {
  background: var(--green);
}

.level-card.shop .level-icon {
  background: var(--orange);
}

.level-card.bubble .level-icon {
  background: var(--blue);
}

.level-card.workshop .level-icon {
  background: var(--orange-dark);
}

.level-card.party .level-icon {
  background: var(--yellow);
}

.level-title {
  font-size: 27px;
  font-weight: 900;
}

.level-skill {
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
}

.level-note {
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.taskbar {
  min-height: 86px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 180px;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.taskbar p {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.22;
  font-weight: 900;
  text-align: center;
}

.small-button,
.primary-button,
.secondary-button {
  min-height: 62px;
  border-radius: 20px;
  padding: 0 22px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.small-button {
  background: var(--blue);
}

.primary-button {
  min-height: 72px;
  background: var(--orange);
}

.secondary-button {
  background: var(--green);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.level-screen {
  display: grid;
}

.level-layout {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 14px;
}

.level-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.level-tools {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.read-step-button {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  padding: 0 15px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.read-step-button span {
  width: 30px;
  height: 30px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
}

.read-step-button.is-speaking span {
  background: var(--yellow);
  box-shadow: 0 0 14px rgba(244, 182, 63, 0.8);
}

.read-step-button.is-paused span {
  background: var(--green);
}

.voice-select {
  min-height: 48px;
  width: clamp(118px, 14vw, 176px);
  border: 0;
  border-radius: 18px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: var(--soft-shadow);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
}

.voice-select:disabled {
  opacity: 0.55;
}

.step-progress {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.step-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #dfd0bf;
}

.step-dot.is-done {
  background: var(--green);
}

.step-dot.is-current {
  background: var(--yellow);
  box-shadow: 0 0 14px rgba(244, 182, 63, 0.8);
}

.story-stage {
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 234, 220, 0.9)),
    radial-gradient(circle at 80% 10%, rgba(125, 183, 216, 0.25), transparent 15rem);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(170px, 280px) 1fr minmax(140px, 220px);
  align-items: center;
  gap: 22px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

.theme-garden .story-stage {
  background: linear-gradient(160deg, #f2fbf0, #fff5df);
}

.theme-shop .story-stage {
  background: linear-gradient(160deg, #fff2e6, #ffffff);
}

.theme-bubble .story-stage {
  background: linear-gradient(160deg, #edf7fb, #fff7ec);
}

.theme-workshop .story-stage {
  background: linear-gradient(160deg, #f2f5ef, #fff0df);
}

.theme-party .story-stage {
  background: linear-gradient(160deg, #fff1e8, #fff9dc);
}

.scene-card {
  min-height: 190px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  padding: 26px;
  box-shadow: inset 0 0 0 3px rgba(244, 182, 63, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.scene-card.is-hinting {
  box-shadow: inset 0 0 0 5px rgba(125, 183, 216, 0.78), 0 0 22px rgba(125, 183, 216, 0.35);
  animation: softNudge 420ms ease;
}

.scene-label {
  width: max-content;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff1d0;
  color: var(--orange-dark);
  font-size: 17px;
  font-weight: 900;
}

.scene-card p {
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.24;
  font-weight: 900;
}

.scene-card small {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.choice-zone {
  min-height: 155px;
  border-radius: 28px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.story-prompt {
  height: 100%;
  min-height: 120px;
  border-radius: 22px;
  background: var(--panel-cool);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px;
}

.story-prompt strong {
  font-size: clamp(26px, 3vw, 38px);
}

.story-prompt span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.option-grid,
.emotion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 14px;
}

.sequence-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.option-card,
.emotion-card {
  min-height: 96px;
  border-radius: 22px;
  padding: 16px 18px;
  background: #fff;
  color: var(--text);
  border: 4px solid transparent;
  box-shadow: var(--soft-shadow);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.22;
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.emotion-card {
  min-height: 126px;
  display: grid;
  gap: 6px;
  place-items: center;
}

.emotion-card span {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--emotion-color);
  font-size: 34px;
}

.option-card:hover,
.emotion-card:hover,
.option-card:focus-visible,
.emotion-card:focus-visible,
.option-card.is-selected {
  outline: none;
  transform: translateY(-4px);
  border-color: var(--yellow);
  background: #fff9e8;
}

.option-card.needs-look {
  border-color: var(--blue);
  animation: softNudge 420ms ease;
}

.phrase-builder {
  display: grid;
  gap: 14px;
}

.built-sentence {
  min-height: 70px;
  border-radius: 22px;
  padding: 12px 18px;
  background: #fff8e9;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 900;
}

.built-sentence strong {
  min-width: 92px;
  min-height: 46px;
  border-radius: 16px;
  padding: 7px 13px;
  background: #fff;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.phrase-columns h3 {
  margin-bottom: 8px;
  color: var(--orange-dark);
  font-size: 20px;
}

.phrase-columns .option-card {
  width: 100%;
  margin-bottom: 8px;
  min-height: 74px;
  font-size: clamp(18px, 2vw, 23px);
}

.animal,
.animal-group,
.animal-pair {
  justify-self: center;
}

.animal {
  width: clamp(130px, 15vw, 190px);
  aspect-ratio: 1;
  border-radius: 46% 46% 42% 42%;
  background: #d8a25f;
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 0 rgba(59, 38, 27, 0.08);
  animation: breathe 2.6s ease-in-out infinite;
}

.animal::before,
.animal::after {
  content: "";
  position: absolute;
  width: 34%;
  height: 34%;
  border-radius: 999px;
  background: inherit;
  top: -9%;
}

.animal::before {
  left: 4%;
}

.animal::after {
  right: 4%;
}

.animal span {
  position: relative;
  z-index: 1;
  width: 62%;
  height: 42%;
  display: grid;
  place-items: center;
  border-radius: 42%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: clamp(44px, 5vw, 70px);
  font-weight: 900;
  transform: translateY(8%);
}

.rabbit {
  background: #f2c9b5;
}

.rabbit::before,
.rabbit::after {
  width: 24%;
  height: 58%;
  border-radius: 999px 999px 40% 40%;
  top: -34%;
}

.fox {
  background: #e97939;
}

.bear {
  background: #c58a54;
}

.elephant {
  background: #91b7bd;
}

.monkey {
  background: #c4834f;
}

.bird {
  background: #7db7d8;
}

.animal-group,
.animal-pair {
  min-width: 230px;
  display: flex;
  justify-content: center;
  align-items: end;
}

.animal-group .animal,
.animal-pair .animal {
  width: 110px;
  margin: 0 -12px;
}

.reward-preview {
  min-height: 160px;
  display: grid;
  place-items: center;
}

.flowers {
  display: flex;
  gap: 12px;
  align-items: end;
}

.flowers i {
  width: 46px;
  height: 46px;
  border-radius: 999px 999px 8px 999px;
  background: var(--yellow);
  transform: rotate(45deg);
  box-shadow: 0 44px 0 -16px var(--green);
}

.gift {
  width: 112px;
  height: 96px;
  border-radius: 18px;
  background: var(--orange);
  position: relative;
  box-shadow: var(--soft-shadow);
}

.gift::before,
.gift::after {
  content: "";
  position: absolute;
  background: var(--yellow);
}

.gift::before {
  width: 20px;
  top: 0;
  bottom: 0;
  left: 46px;
}

.gift::after {
  height: 20px;
  left: 0;
  right: 0;
  top: 34px;
}

.bubble-pop {
  width: 122px;
  height: 122px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(125, 183, 216, 0.42);
  border: 5px solid #fff;
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
}

.gear {
  color: var(--orange-dark);
  font-size: 100px;
}

.party-stars {
  color: var(--yellow);
  font-size: 42px;
  font-weight: 900;
}

.story-stage.is-rewarding .reward-preview {
  animation: rewardPop 760ms ease;
}

.story-stage.is-rewarding .animal,
.story-stage.is-rewarding .animal-group,
.story-stage.is-rewarding .animal-pair {
  animation: happyHop 650ms ease;
}

.summary-screen {
  display: grid;
  place-items: center;
}

.summary-card {
  width: min(880px, 100%);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 34px;
  text-align: center;
}

.summary-card h2 {
  margin-bottom: 12px;
}

.summary-card > p {
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.42;
}

.celebration {
  color: var(--yellow);
  font-size: 52px;
  animation: glowPulse 1.5s ease-in-out infinite;
}

.summary-card ul {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  text-align: left;
}

.summary-card li {
  min-height: 112px;
  border-radius: 20px;
  padding: 16px;
  background: var(--panel-cool);
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto 1fr;
  gap: 4px 12px;
}

.summary-card li span {
  grid-row: 1 / 3;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: #fff;
  font-size: 24px;
}

.summary-card li strong {
  font-size: 22px;
}

.summary-card li p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}

.teacher-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  justify-content: end;
  background: rgba(59, 38, 27, 0.28);
}

.teacher-panel.is-open {
  display: flex;
}

.teacher-card {
  width: min(480px, 92vw);
  height: 100%;
  padding: 24px;
  background: #fffaf3;
  box-shadow: -18px 0 48px rgba(59, 38, 27, 0.18);
  overflow: auto;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}

.teacher-progress {
  border-radius: 22px;
  padding: 16px;
  background: var(--panel);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 20px;
}

.teacher-list {
  display: grid;
  gap: 12px;
}

.teacher-row {
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.teacher-row.is-done {
  background: #edf7f2;
}

.teacher-row strong {
  display: block;
  font-size: 21px;
}

.teacher-row span {
  display: block;
  margin: 4px 0;
  color: var(--green);
  font-weight: 900;
}

.teacher-row p {
  color: var(--muted);
  line-height: 1.38;
  font-weight: 700;
}

.panel-actions {
  margin-top: 18px;
}

.panel-actions .secondary-button {
  width: 100%;
}

.rotate-hint {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(255, 246, 234, 0.96);
}

.rotate-hint.is-visible {
  display: grid;
}

.rotate-card {
  width: min(340px, 100%);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 12px;
  text-align: center;
}

.rotate-icon {
  width: 82px;
  height: 82px;
  border-radius: 26px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: #fff;
  font-size: 48px;
}

.rotate-card strong {
  font-size: 28px;
}

.rotate-card span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes happyHop {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-16px);
  }
}

@keyframes rewardPop {
  0% {
    transform: scale(0.72);
    opacity: 0.6;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes softNudge {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-5px);
  }
  70% {
    transform: translateX(5px);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.86;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 1040px) {
  .game-shell {
    padding: 14px 16px 18px;
    gap: 10px;
  }

  .map-stage {
    grid-template-columns: 300px 1fr;
    gap: 16px;
  }

  .map-center {
    min-height: 380px;
  }

  .level-card {
    min-height: 132px;
    padding: 16px;
  }

  .level-title {
    font-size: 23px;
  }

  .story-stage {
    grid-template-columns: 180px 1fr 150px;
    padding: 18px;
    gap: 14px;
  }

  .option-grid,
  .emotion-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .game-shell {
    min-height: 100vh;
    padding: 8px 12px;
    gap: 8px;
  }

  .topbar {
    grid-template-columns: 54px 1fr auto;
  }

  .brand-kicker {
    display: none;
  }

  h1 {
    font-size: 30px;
  }

  .icon-button {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 24px;
  }

  .top-actions {
    gap: 8px;
  }

  .ppt-button {
    font-size: 15px;
  }

  .ppt-menu {
    top: calc(100% + 8px);
    min-width: 132px;
  }

  .ppt-menu a {
    min-height: 40px;
    font-size: 16px;
  }

  .lighthouse-strip {
    min-height: 42px;
  }

  .mini-light,
  .teacher-dots span {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }

  .lighthouse-strip p {
    font-size: 16px;
  }

  .map-stage {
    grid-template-columns: 220px 1fr;
  }

  .map-center {
    min-height: 245px;
    border-radius: 22px;
    padding: 14px;
  }

  .lighthouse {
    width: 115px;
    height: 185px;
  }

  .tower-layer {
    height: 24px;
    border-width: 2px;
  }

  .tower-base {
    width: 96px;
    height: 30px;
  }

  .map-title {
    display: none;
  }

  .level-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .level-card {
    min-height: 96px;
    grid-template-columns: 44px 1fr;
    border-radius: 18px;
    padding: 10px;
    gap: 4px 8px;
  }

  .level-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 24px;
  }

  .level-title {
    font-size: 18px;
  }

  .level-skill,
  .level-note {
    font-size: 13px;
  }

  .level-layout {
    grid-template-rows: auto minmax(104px, 1fr) auto;
    gap: 6px;
  }

  .level-kicker {
    display: none;
  }

  h2 {
    font-size: 24px;
  }

  .level-tools {
    gap: 6px;
  }

  .read-step-button {
    min-height: 34px;
    border-radius: 12px;
    padding: 0 9px 0 6px;
    gap: 5px;
    font-size: 14px;
  }

  .read-step-button span {
    width: 23px;
    height: 23px;
    border-radius: 9px;
    font-size: 15px;
  }

  .voice-select {
    min-height: 34px;
    width: 92px;
    border-radius: 12px;
    padding: 0 8px;
    font-size: 13px;
  }

  .story-stage {
    min-height: 104px;
    grid-template-columns: 96px 1fr 82px;
    border-radius: 22px;
    padding: 8px;
    gap: 8px;
  }

  .animal {
    width: 94px;
  }

  .animal-group,
  .animal-pair {
    min-width: 120px;
  }

  .animal-group .animal,
  .animal-pair .animal {
    width: 62px;
    margin: 0 -8px;
  }

  .scene-card {
    min-height: 88px;
    border-radius: 18px;
    padding: 10px;
    gap: 6px;
  }

  .scene-label,
  .scene-card small {
    display: none;
  }

  .scene-card p {
    font-size: 21px;
  }

  .reward-preview {
    min-height: 78px;
    transform: scale(0.6);
  }

  .choice-zone {
    min-height: 72px;
    border-radius: 18px;
    padding: 8px;
  }

  .story-prompt {
    min-height: 58px;
    padding: 10px;
  }

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

  .story-prompt span {
    display: none;
  }

  .option-grid,
  .emotion-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .option-card,
  .emotion-card {
    min-height: 64px;
    border-radius: 16px;
    border-width: 3px;
    padding: 8px;
    font-size: 16px;
  }

  .emotion-card {
    min-height: 72px;
  }

  .emotion-card span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 20px;
  }

  .phrase-builder {
    gap: 8px;
  }

  .built-sentence {
    min-height: 44px;
    font-size: 17px;
    padding: 6px 10px;
  }

  .built-sentence strong {
    min-height: 32px;
  }

  .phrase-columns {
    gap: 8px;
  }

  .phrase-columns h3 {
    display: none;
  }

  .phrase-columns .option-card {
    min-height: 44px;
    margin-bottom: 6px;
    font-size: 14px;
  }

  .taskbar {
    min-height: 58px;
    grid-template-columns: 92px minmax(0, 1fr) 112px;
    gap: 8px;
    border-radius: 18px;
    padding: 6px;
  }

  .taskbar p {
    font-size: 17px;
  }

  .small-button,
  .primary-button,
  .secondary-button {
    min-height: 44px;
    border-radius: 14px;
    padding: 0 10px;
    font-size: 16px;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .game-shell {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 48px 1fr auto;
  }

  .brand-kicker {
    display: none;
  }

  h1 {
    font-size: 30px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 23px;
  }

  .top-actions {
    gap: 7px;
  }

  .ppt-button {
    font-size: 14px;
  }

  .ppt-menu {
    top: calc(100% + 8px);
    min-width: 128px;
  }

  .ppt-menu a {
    min-height: 40px;
    font-size: 16px;
  }

  .lighthouse-strip {
    min-height: 46px;
  }

  .map-stage {
    grid-template-columns: 1fr;
  }

  .map-center {
    min-height: 260px;
  }

  .lighthouse {
    height: 205px;
    transform: scale(0.84);
  }

  .map-title {
    bottom: 16px;
  }

  .map-title strong {
    font-size: 22px;
  }

  .map-title span {
    font-size: 15px;
  }

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

  .level-card {
    min-height: 108px;
  }

  .story-stage {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .reward-preview {
    display: none;
  }

  .scene-card {
    min-height: 150px;
  }

  .choice-zone {
    min-height: 140px;
  }

  .option-grid,
  .emotion-grid,
  .phrase-columns,
  .summary-card ul {
    grid-template-columns: 1fr;
  }

  .taskbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* emotion-square2 map redesign */
.map-journey-screen {
  min-height: 0;
}

.world-map {
  min-height: 0;
  height: 100%;
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 24%, rgba(103, 173, 113, 0.2), transparent 11rem),
    radial-gradient(circle at 75% 20%, rgba(125, 183, 216, 0.28), transparent 12rem),
    radial-gradient(circle at 52% 76%, rgba(244, 182, 63, 0.2), transparent 14rem),
    linear-gradient(150deg, #eaf7ef 0%, #fff5df 46%, #eaf4f9 100%);
  box-shadow: var(--shadow);
  border: 5px solid rgba(255, 255, 255, 0.72);
}

.world-map::before,
.world-map::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.world-map::before {
  width: 32%;
  height: 16%;
  left: -5%;
  bottom: -5%;
  background: rgba(47, 125, 103, 0.14);
}

.world-map::after {
  width: 42%;
  height: 20%;
  right: -9%;
  top: -7%;
  background: rgba(125, 183, 216, 0.16);
}

.map-sky {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 9% 12%, rgba(255, 255, 255, 0.8) 0 22px, transparent 23px),
    radial-gradient(circle at 88% 19%, rgba(255, 255, 255, 0.78) 0 28px, transparent 29px),
    radial-gradient(circle at 62% 8%, rgba(255, 255, 255, 0.65) 0 18px, transparent 19px);
}

.map-path {
  position: absolute;
  inset: 5% 4%;
  width: 92%;
  height: 90%;
  overflow: visible;
  filter: drop-shadow(0 8px 0 rgba(59, 38, 27, 0.05));
}

.map-path path {
  fill: none;
  stroke: #e7bb82;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1 10;
}

.map-lighthouse {
  position: absolute;
  left: 89%;
  top: 25%;
  width: 146px;
  height: 184px;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px 10px;
  box-shadow: var(--shadow);
  z-index: 2;
  isolation: isolate;
}

.map-lighthouse::before {
  content: "";
  position: absolute;
  width: 138px;
  height: 138px;
  left: 50%;
  top: -54px;
  transform: translateX(-50%) scale(var(--beam-scale, 0.58));
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 218, 94, 0.9) 0 18%, rgba(255, 218, 94, 0.34) 42%, transparent 70%);
  opacity: var(--beam-opacity, 0.12);
  z-index: 0;
  transition: opacity 240ms ease, transform 240ms ease;
}

.map-lighthouse.is-complete::before {
  animation: glowPulse 1.6s ease-in-out infinite;
}

.map-lamp,
.map-tower,
.map-lighthouse strong {
  position: relative;
  z-index: 1;
}

.map-lamp {
  width: 64px;
  height: 34px;
  border-radius: 28px 28px 10px 10px;
  background: linear-gradient(180deg, #f7d57a 0%, #f4b63f 58%, #c9572f 59% 100%);
  border: 3px solid rgba(255, 248, 239, 0.95);
  box-shadow: 0 7px 0 rgba(59, 38, 27, 0.08);
}

.map-lamp::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 15px;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #d8c7a5;
  transition: background 240ms ease, box-shadow 240ms ease;
}

.map-lighthouse.has-light .map-lamp::after {
  background: #ffe17a;
  box-shadow: 0 0 18px rgba(244, 182, 63, 0.88);
}

.map-tower {
  width: 76px;
  height: 100px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  gap: 4px;
  padding: 8px;
  border-radius: 16px 16px 11px 11px;
  background:
    linear-gradient(90deg, rgba(201, 87, 47, 0.92) 0 14%, transparent 14% 86%, rgba(201, 87, 47, 0.92) 86%),
    linear-gradient(180deg, #fff7df 0 18%, #ffe6b5 18% 36%, #fff7df 36% 54%, #ffe6b5 54% 72%, #fff7df 72%);
  border: 3px solid rgba(255, 248, 239, 0.95);
  box-shadow: inset 0 -8px 0 rgba(59, 38, 27, 0.08), 0 8px 0 rgba(59, 38, 27, 0.06);
}

.tower-floor {
  height: 13px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: center;
  padding: 2px;
  border-radius: 7px;
  background: rgba(59, 38, 27, 0.07);
}

.tower-floor.is-lit {
  background: rgba(244, 182, 63, 0.22);
}

.tower-floor i {
  width: 100%;
  height: 8px;
  border-radius: 999px 999px 3px 3px;
  background: #d6c2a2;
  transition: background 240ms ease, box-shadow 240ms ease;
}

.tower-floor i.is-lit {
  background: #ffd85f;
  box-shadow: 0 0 10px rgba(244, 182, 63, 0.92);
}

.map-lighthouse strong {
  font-size: 17px;
  text-align: center;
}

.map-region {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%);
  width: clamp(170px, 17vw, 218px);
  min-height: 146px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  border: 4px solid rgba(255, 255, 255, 0.86);
  box-shadow: var(--soft-shadow);
  z-index: 4;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.map-region:hover,
.map-region:focus-within {
  transform: translate(-50%, -54%);
  box-shadow: 0 18px 42px rgba(59, 38, 27, 0.18);
}

.map-region.is-complete {
  border-color: rgba(47, 125, 103, 0.5);
  background: rgba(238, 249, 242, 0.9);
}

.map-region.is-locked {
  filter: saturate(0.72);
}

.map-region.garden {
  background: rgba(237, 248, 232, 0.9);
}

.map-region.shop {
  background: rgba(255, 238, 220, 0.92);
}

.map-region.bubble {
  background: rgba(233, 246, 250, 0.92);
}

.map-region.workshop {
  background: rgba(248, 237, 223, 0.92);
}

.map-region.party {
  background: rgba(255, 245, 203, 0.93);
}

.region-sign,
.mini-node {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.region-sign {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 22px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  text-align: left;
  box-shadow: inset 0 -4px 0 rgba(59, 38, 27, 0.04);
}

.region-sign img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 8px 6px rgba(59, 38, 27, 0.12));
}

.region-sign strong {
  display: block;
  font-size: clamp(18px, 1.8vw, 23px);
  line-height: 1.08;
}

.region-sign em {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-style: normal;
  font-size: 15px;
  font-weight: 900;
}

.mini-node-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.mini-node {
  min-height: 58px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -4px 0 rgba(59, 38, 27, 0.05);
  transition: transform 160ms ease, background 160ms ease;
}

.mini-node:hover,
.mini-node:focus-visible {
  outline: none;
  transform: translateY(-4px);
  background: #fff9e7;
}

.mini-node img {
  width: 39px;
  height: 39px;
  object-fit: contain;
}

.mini-node span {
  position: absolute;
  right: 5px;
  bottom: 4px;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.mini-node.is-done span {
  background: var(--green);
}

.mini-node.is-done::after {
  content: "✓";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.mini-node.is-locked {
  opacity: 0.48;
  filter: grayscale(0.8);
}

.mini-node.is-locked::before {
  content: "锁";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #d9c8b8;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.scene-animals {
  min-width: 180px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 12px;
}

.scene-animals img {
  width: clamp(118px, 13vw, 180px);
  height: clamp(118px, 13vw, 180px);
  object-fit: contain;
  filter: drop-shadow(0 16px 10px rgba(59, 38, 27, 0.14));
  animation: breathe 2.7s ease-in-out infinite;
}

.scene-animals.is-group {
  min-width: 250px;
  gap: 0;
}

.scene-animals.is-group img {
  width: clamp(82px, 9vw, 126px);
  height: clamp(82px, 9vw, 126px);
  margin: 0 -8px;
}

.node-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-breadcrumb > span {
  min-width: 64px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  font-size: 20px;
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

@media (max-width: 1040px) {
  .world-map {
    min-height: 500px;
  }

  .map-region {
    width: 188px;
    min-height: 132px;
    border-radius: 22px;
    padding: 9px;
  }

  .region-sign {
    grid-template-columns: 52px 1fr;
    min-height: 64px;
    border-radius: 18px;
  }

  .region-sign img {
    width: 52px;
    height: 52px;
  }

  .region-sign strong {
    font-size: 20px;
  }

  .mini-node {
    min-height: 50px;
  }

  .mini-node img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .game-shell {
    grid-template-rows: 42px 34px minmax(0, 1fr) 48px;
  }

  .topbar {
    align-self: center;
  }

  .lighthouse-strip {
    min-height: 34px;
  }

  .world-map {
    min-height: 230px;
    border-radius: 22px;
  }

  .map-lighthouse {
    left: 89%;
    top: 29%;
    width: 92px;
    height: 116px;
    border-radius: 18px;
    padding: 8px;
    gap: 4px;
  }

  .map-lighthouse::before {
    width: 78px;
    height: 78px;
    top: -29px;
  }

  .map-lamp {
    width: 42px;
    height: 22px;
    border-width: 2px;
  }

  .map-lamp::after {
    width: 16px;
    height: 9px;
    top: 5px;
  }

  .map-tower {
    width: 48px;
    height: 62px;
    border-width: 2px;
    border-radius: 11px 11px 8px 8px;
    gap: 2px;
    padding: 5px;
  }

  .tower-floor {
    height: 8px;
    gap: 2px;
    padding: 1px;
    border-radius: 4px;
  }

  .tower-floor i {
    height: 5px;
  }

  .map-lighthouse strong {
    font-size: 12px;
  }

  .map-region {
    width: 134px;
    min-height: 82px;
    border-radius: 18px;
    border-width: 3px;
    padding: 6px;
  }

  .region-sign {
    grid-template-columns: 34px 1fr;
    min-height: 44px;
    gap: 6px;
    padding: 5px;
    border-radius: 14px;
  }

  .region-sign img {
    width: 34px;
    height: 34px;
  }

  .region-sign strong {
    font-size: 13px;
  }

  .region-sign em {
    display: none;
  }

  .mini-node-row {
    gap: 5px;
    margin-top: 5px;
  }

  .mini-node {
    min-height: 31px;
    border-radius: 12px;
  }

  .mini-node img {
    width: 22px;
    height: 22px;
  }

  .mini-node span {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .scene-animals {
    min-width: 110px;
  }

  .scene-animals img {
    width: 86px;
    height: 86px;
  }

  .scene-animals.is-group {
    min-width: 130px;
  }

  .scene-animals.is-group img {
    width: 54px;
    height: 54px;
    margin: 0 -5px;
  }

  .node-breadcrumb > span {
    min-width: 48px;
    height: 34px;
    font-size: 15px;
  }

  .taskbar {
    min-height: 50px;
  }

  .small-button,
  .primary-button,
  .secondary-button {
    min-height: 38px;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .level-header {
    align-items: start;
    flex-direction: column;
  }

  .level-tools {
    width: 100%;
    justify-content: space-between;
  }

  .voice-select {
    flex: 1;
    min-width: 130px;
  }

  .world-map {
    min-height: 820px;
    overflow: visible;
  }

  .map-path {
    display: none;
  }

  .map-lighthouse {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 18px auto;
  }

  .map-region {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: calc(100% - 24px);
    margin: 12px auto;
  }

  .map-region:hover,
  .map-region:focus-within {
    transform: none;
  }

  .scene-animals {
    min-width: 0;
  }

  .scene-animals.is-group {
    min-width: 0;
  }

  .scene-animals img {
    width: 118px;
    height: 118px;
  }

  .scene-animals.is-group img {
    width: 74px;
    height: 74px;
  }

  .node-breadcrumb {
    flex-wrap: wrap;
    justify-content: end;
  }
}
