:root {
  --paper: #f6f2e9;
  --ink: #20313b;
  --muted: #6d7b7e;
  --line: #d9ddd4;
  --card: #fffdf8;
  --teal: #1d8b82;
  --teal-dark: #126a65;
  --coral: #ef755e;
  --yellow: #f7ca61;
  --blue: #dcecf0;
  --green: #e1f0e7;
  --shadow: 0 18px 45px rgba(32, 49, 59, 0.09);
  font-family: "Nunito", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
}

button, input { font: inherit; }
button { cursor: pointer; }

.student-auth {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.student-login-panel {
  width: min(410px, 100%);
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 34px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.student-login-panel h1 { margin: 8px 0 10px; font-size: 34px; letter-spacing: -1px; }
.student-login-copy { margin: 0 0 24px; color: var(--muted); font-size: 13px; font-weight: 700; }
.student-login-form { display: grid; gap: 8px; }
.student-login-form label { color: var(--ink); font-size: 12px; font-weight: 900; }
.student-login-form input { height: 46px; border: 2px solid #cfd8d1; border-radius: 10px; outline: 0; padding: 0 13px; color: var(--ink); background: #fff; font-size: 15px; font-weight: 800; }
.student-login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(29, 139, 130, 0.13); }
.student-login-form .primary-button { width: 100%; margin-top: 10px; min-height: 46px; }
.student-login-error { min-height: 18px; margin: 4px 0 0; color: #b84e3f; font-size: 12px; font-weight: 800; }

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 42px;
}

.topbar, .brand, .voice-state, .stats-row, .mode-tabs, .rail-heading,
.result-banner, .answer-row, .panel-footer, .word-meta, .footer-note {
  display: flex;
  align-items: center;
}

.topbar { justify-content: space-between; }

.student-account { display: flex; align-items: center; gap: 8px; }
.student-account span { color: var(--muted); font-size: 12px; font-weight: 900; }
.student-account .text-button { min-height: 30px; }

.brand {
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 13px 13px 13px 4px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 23px;
  font-weight: 900;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; line-height: 1.1; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }

.voice-state {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(29, 139, 130, 0.12);
}
.voice-dot.ai { background: var(--coral); box-shadow: 0 0 0 4px rgba(229, 108, 91, 0.13); }

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  min-height: 238px;
  padding: 58px 8px 38px;
}

.kicker, .section-label {
  margin: 0;
  color: var(--coral);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin: 10px 0 12px; font-size: clamp(42px, 6vw, 72px); line-height: 0.99; letter-spacing: -2.5px; }
h1 span { color: var(--teal); }
.intro-copy { margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; }

.goal-sticker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 35px 15px 0;
  padding: 13px 17px 13px 13px;
  transform: rotate(4deg);
  border: 2px solid var(--ink);
  border-radius: 17px 6px 17px 17px;
  background: var(--yellow);
  box-shadow: 6px 7px 0 rgba(32, 49, 59, 0.13);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.sticker-number { font-size: 38px; font-weight: 900; line-height: 1; }

.stats-row {
  gap: 18px;
  padding: 15px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 20px; border-bottom: 1px solid var(--line); background: #fff9e7; }
.session-bar strong, .session-bar span { display: block; }
.session-bar strong { color: var(--teal-dark); font-size: 13px; }
.session-bar span { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.session-actions { display: flex; gap: 7px; }
.compact-button { min-height: 34px; padding-inline: 11px; font-size: 11px; }
.compact-button:disabled { cursor: default; opacity: 0.45; transform: none; }
.daily-start-button { min-height: 44px; white-space: nowrap; }

.stat-item { min-width: 96px; }
.stat-label { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.stat-item strong { display: block; margin-top: 2px; font-size: 20px; }
.stat-score { text-align: right; }
.progress-track { flex: 1; height: 8px; overflow: hidden; border-radius: 99px; background: #e4e7df; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--teal); transition: width 280ms ease; }

.mode-tabs { gap: 8px; padding: 28px 0 18px; }
.mode-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 14px 9px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 900;
}
.mode-tab.active { border-color: var(--coral); color: var(--ink); }
.mode-tab span { display: inline-grid; min-width: 21px; height: 21px; margin-left: 4px; place-items: center; border-radius: 50%; background: var(--coral); color: white; font-size: 11px; }
.mode-tab[data-mode="games"] { color: var(--teal-dark); }
.flow-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-bottom: 19px; }
.flow-step { min-height: 72px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; background: rgba(255, 253, 248, 0.66); text-align: left; }
.flow-step:hover { border-color: #a9d1cb; background: #f1f8f4; }
.flow-step strong, .flow-step span, .flow-step small { display: block; }
.flow-step strong { color: var(--coral); font-size: 10px; letter-spacing: 1px; }
.flow-step span { margin-top: 5px; color: var(--ink); font-size: 12px; font-weight: 900; }
.flow-step small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 800; }

.workspace { display: grid; grid-template-columns: 286px 1fr; gap: 18px; }
.word-rail, .main-panel { border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.word-rail { display: flex; min-height: 515px; flex-direction: column; padding: 22px 18px 17px; border-radius: 19px; }
.rail-heading { justify-content: space-between; padding: 0 4px 16px; }
.section-label { color: var(--muted); font-size: 9px; letter-spacing: 1.4px; }
h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -0.8px; }
.deck-count { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--blue); color: var(--teal-dark); font-size: 13px; font-weight: 900; }
.deck-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 11px; }
.deck-filter { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 11px; font-weight: 900; }
.deck-filter span { margin-left: 3px; color: inherit; font-size: 10px; }
.deck-filter.active { border-color: #a9d1cb; color: var(--teal-dark); background: var(--green); }
.word-list { display: grid; gap: 7px; }
.empty-deck { display: grid; min-height: 170px; place-items: center; align-content: center; padding: 18px; border: 1px dashed #bedbd4; border-radius: 10px; color: var(--teal-dark); font-size: 14px; font-weight: 900; text-align: center; }
.empty-deck small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.5; }
.word-row {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px 7px 11px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.word-row:hover { transform: translateX(2px); border-color: #a9d1cb; background: #f3f7f2; }
.word-row:focus-visible { outline: 3px solid rgba(29, 139, 130, 0.24); outline-offset: 2px; }
.word-row.active { border-color: #bedbd4; background: var(--green); }
.word-row.selected { border-color: var(--teal); background: #eef8f5; }
.word-row.done .word-check { border-color: var(--teal); }
.word-row.missed .word-check { border-color: var(--coral); }
.word-number { width: 23px; color: var(--muted); font-size: 10px; font-weight: 900; }
.word-text { flex: 1; font-size: 14px; font-weight: 800; }
.word-errors { display: grid; width: 19px; height: 19px; place-items: center; margin-right: 5px; border-radius: 50%; color: #a34e43; background: #fff0ed; font-size: 10px; font-weight: 900; }
.word-check { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border: 2px solid #b8c2bc; border-radius: 7px; color: #fff; font-size: 14px; font-weight: 900; }
.word-row.selected .word-check { border-color: var(--teal); background: var(--teal); }
.word-page-tools { display: grid; gap: 8px; margin-top: 12px; }
.page-select-button { width: 100%; min-height: 44px; }
.word-pagination { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.word-pagination strong { text-align: center; font-size: 13px; }
.page-arrow { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 20px; font-weight: 900; }
.page-arrow:disabled { cursor: default; opacity: 0.35; }
.rail-reset { margin-top: 12px; }

.main-panel { min-height: 515px; border-radius: 19px; }
.panel-inner { display: flex; min-height: 513px; flex-direction: column; justify-content: space-between; padding: 38px 44px 30px; }
.panel-top { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.panel-kicker { margin: 0 0 8px; color: var(--coral); font-size: 11px; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; }
.panel-title { margin: 0; font-size: clamp(28px, 4vw, 43px); line-height: 1.05; letter-spacing: -1.5px; }
.panel-description { max-width: 480px; margin: 12px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.65; }
.mini-index { color: var(--muted); font-size: 12px; font-weight: 900; white-space: nowrap; }

.study-card { display: grid; grid-template-columns: 1fr 0.82fr; gap: 30px; align-items: center; margin-top: 25px; }
.example-box { margin-top: 22px; padding: 17px 19px 18px; border: 1px solid #c9dfd8; border-radius: 13px; background: #f1f8f4; }
.example-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.example-heading strong { color: var(--teal-dark); font-size: 13px; }
.example-heading span { color: var(--muted); font-size: 11px; font-weight: 800; }
.sentence-en { margin: 12px 0 3px; color: var(--ink); font-size: 16px; font-weight: 900; line-height: 1.45; }
.sentence-zh { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.example-speak { margin-top: 13px; }
.word-display { padding: 25px 0 30px; border-bottom: 1px solid var(--line); }
.word-display .english { margin: 0; color: var(--teal-dark); font-size: clamp(38px, 6vw, 64px); font-weight: 900; letter-spacing: -2px; line-height: 1; }
.word-display .meaning { margin: 9px 0 0; color: var(--muted); font-size: 16px; font-weight: 700; }
.sound-button, .primary-button, .secondary-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.sound-button { border: 1px solid #a9d1cb; background: #eef8f5; color: var(--teal-dark); }
.sound-button:hover, .primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.sound-button:active, .primary-button:active, .secondary-button:active { transform: translateY(0); }
.primary-button { border: 2px solid var(--ink); background: var(--coral); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.primary-button:hover { box-shadow: 5px 5px 0 var(--ink); }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.sound-button svg, .primary-button svg, .secondary-button svg { width: 17px; height: 17px; }

.memory-note { padding: 18px; border-left: 3px solid var(--yellow); background: #fff9e7; }
.memory-note strong { display: block; margin-bottom: 7px; font-size: 13px; }
.memory-note p { margin: 0; color: #6d6244; font-size: 13px; font-weight: 700; line-height: 1.6; }
.memory-note .sound-guide { margin-bottom: 5px; color: var(--teal-dark); font-size: 13px; font-weight: 900; }
.spelling-note { display: block; margin-top: 9px; color: #8a7c57; font-size: 11px; font-weight: 800; line-height: 1.45; }
.mastery-note { display: block; margin-top: 8px; color: #8a7c57; font-size: 11px; font-weight: 800; }
.panel-footer { justify-content: space-between; gap: 18px; padding-top: 22px; }
.panel-footer-copy { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.dictation-panel { max-width: 650px; margin: 24px auto 0; text-align: center; }
.dictation-prompt { margin: 0; font-size: 18px; font-weight: 800; }
.prompt-meaning { display: inline-block; margin-top: 10px; padding: 7px 12px; border-radius: 8px; background: var(--blue); color: var(--teal-dark); font-size: 14px; font-weight: 900; }
.dictation-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 25px auto; }
.listen-button { margin: 25px auto; }
.dictation-actions .listen-button { margin: 0; }
.answer-row { gap: 10px; }
.answer-input { flex: 1; min-width: 0; height: 50px; border: 2px solid #cfd8d1; border-radius: 10px; outline: 0; padding: 0 15px; color: var(--ink); background: #fff; font-size: 17px; font-weight: 800; transition: border-color 150ms ease, box-shadow 150ms ease; }
.answer-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(29, 139, 130, 0.13); }
.answer-input:disabled { background: #f4f5ef; }
.result-banner { gap: 13px; margin-top: 19px; padding: 13px 16px; border-radius: 10px; text-align: left; }
.result-banner.correct { background: var(--green); color: #21654e; }
.result-banner.wrong { background: #fff0ed; color: #a34e43; }
.result-icon { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: currentColor; color: white; font-size: 15px; }
.result-banner strong { display: block; font-size: 14px; }
.result-banner p { margin: 2px 0 0; color: inherit; opacity: 0.82; font-size: 12px; font-weight: 700; }
.finish-card { max-width: 570px; margin: 45px auto 0; text-align: center; }
.finish-score { margin: 20px 0 5px; color: var(--teal); font-size: 66px; font-weight: 900; letter-spacing: -3px; line-height: 1; }
.finish-copy { margin: 0 auto 25px; color: var(--muted); font-size: 14px; font-weight: 700; }

.review-list { display: grid; gap: 9px; margin-top: 23px; }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; border-radius: 10px; background: #fff0ed; }
.review-row strong { font-size: 15px; }
.review-row span { color: var(--coral); font-size: 12px; font-weight: 900; }
.empty-review { display: grid; min-height: 250px; place-items: center; margin-top: 25px; border: 1px dashed #bedbd4; border-radius: 13px; background: #f3f9f5; color: var(--teal-dark); font-size: 17px; font-weight: 900; text-align: center; }
.empty-review small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }

.game-panel-inner { padding-top: 30px; }
.game-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 25px 0 18px; }
.game-tab { min-height: 62px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 900; line-height: 1.2; }
.game-tab span { display: block; margin-bottom: 4px; color: var(--coral); font-size: 10px; }
.game-tab.active { border-color: var(--teal); background: var(--green); color: var(--teal-dark); box-shadow: 2px 2px 0 #a7ccc2; }
.game-arena { min-height: 270px; border: 1px solid #c9dfd8; border-radius: 14px; padding: 20px 22px 22px; background: #f1f8f4; }
.game-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.game-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.game-round { color: var(--muted); font-size: 11px; font-weight: 900; white-space: nowrap; }
.game-question { max-width: 620px; margin: 22px auto 0; text-align: center; }
.game-prompt { margin: 0; color: var(--ink); font-size: 16px; font-weight: 900; }
.game-word { margin: 0 0 6px; color: var(--teal-dark); font-size: 42px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; }
.missing-word { letter-spacing: 5px; }
.sentence-fill { margin: 0 auto 12px; color: var(--ink); font-size: 18px; font-weight: 900; line-height: 1.5; }
.life-hearts { margin-bottom: 14px; color: var(--coral); font-size: 27px; letter-spacing: 6px; }
.monster-display, .teacher-display { margin: 18px 0 12px; color: var(--ink); font-size: 34px; font-weight: 900; letter-spacing: 6px; }
.monster-display span { display: inline-block; min-width: 25px; }
.position-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.position-button { width: 34px; height: 34px; border: 1px solid #b9d8d0; border-radius: 50%; color: var(--teal-dark); background: #fff; font-size: 12px; font-weight: 900; }
.position-button:hover { border-color: var(--teal); background: #e5f3ed; }
.treasure-room { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 18px auto 14px; }
.treasure-card { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid var(--yellow); border-radius: 12px 6px 12px 6px; color: var(--ink); background: #fff9e7; font-size: 21px; font-weight: 900; box-shadow: 2px 3px 0 rgba(32, 49, 59, 0.09); }
.treasure-card:hover { transform: translateY(-3px) rotate(-2deg); }
.treasure-card.used { opacity: 0.35; pointer-events: none; }
.streak-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.game-finish { display: grid; min-height: 205px; place-items: center; align-content: center; gap: 18px; color: var(--teal-dark); font-size: 21px; text-align: center; }
.letter-answer { min-height: 48px; margin: 16px auto 13px; padding: 10px 12px; border: 1px dashed #a9d1cb; border-radius: 10px; background: #fff; color: var(--teal-dark); font-size: 24px; font-weight: 900; letter-spacing: 3px; }
.letter-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.letter-tile { width: 38px; height: 38px; border: 1px solid #a9d1cb; border-radius: 9px; color: var(--teal-dark); background: #fff; font-size: 17px; font-weight: 900; text-transform: lowercase; }
.letter-tile:hover { transform: translateY(-2px); }
.letter-tile.used { opacity: 0.3; pointer-events: none; }
.game-listen { margin: 17px auto; }
.game-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.game-option { min-height: 48px; border: 1px solid #b9d8d0; border-radius: 10px; padding: 8px 10px; color: var(--teal-dark); background: #fff; font-size: 14px; font-weight: 900; }
.game-option:hover { border-color: var(--teal); background: #e5f3ed; }
.game-option:disabled { cursor: default; opacity: 0.7; }
.game-option-grid.compact { max-width: 260px; margin-inline: auto; }
.game-type-form { display: flex; max-width: 500px; gap: 9px; margin: 18px auto 0; }
.game-input { flex: 1; min-width: 0; height: 48px; border: 2px solid #b9d8d0; border-radius: 10px; outline: 0; padding: 0 13px; color: var(--ink); background: #fff; font-size: 16px; font-weight: 800; }
.game-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(29, 139, 130, 0.13); }
.game-selection { margin: 12px 0 0; color: var(--teal-dark); font-size: 14px; font-weight: 800; }
.game-submit { margin-top: 15px; }
.game-result { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 17px; padding: 11px 12px; border-radius: 9px; font-size: 13px; }
.game-result.correct { color: #21654e; background: var(--green); }
.game-result.wrong { color: #a34e43; background: #fff0ed; }
.game-result span { font-size: 12px; font-weight: 700; }
.game-next { display: flex; margin: 12px auto 0; }

.daily-session-active .intro, .daily-session-active .mode-tabs, .daily-session-active .flow-strip,
.daily-session-active .word-rail, .dictation-active .word-rail,
.daily-session-active #clearSelection, .dictation-active #clearSelection,
.daily-session-active #selectAllWords, .dictation-active #selectAllWords,
.daily-session-active #startDailySession, .dictation-active #startDailySession { display: none; }
.daily-session-active .app-shell, .dictation-active .app-shell { width: min(920px, calc(100% - 48px)); }
.daily-session-active .workspace, .dictation-active .workspace { display: block; margin-top: 22px; }
.daily-session-active .main-panel { min-height: 610px; }
.daily-panel-inner { min-height: 608px; }
.daily-stage-line { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 24px 0 8px; }
.daily-stage-line.single { grid-template-columns: 1fr; }
.daily-stage-line span { min-height: 8px; overflow: hidden; border-radius: 99px; background: #e4e7df; color: transparent; font-size: 0; }
.daily-stage-line .done { background: #a9d1cb; }
.daily-stage-line .current { background: var(--coral); }
.daily-dictation { margin-top: 72px; }
.daily-memory { margin-top: 18px; }
.remediation-game { max-width: 650px; margin: 26px auto 0; text-align: center; }
.practice-instruction { margin-bottom: 18px; color: var(--ink); font-size: 16px; font-weight: 900; }
.practice-options { display: flex; justify-content: center; gap: 12px; }
.practice-options .game-option { width: 64px; font-size: 20px; }
.practice-feedback { min-height: 24px; margin: 14px 0 0; color: var(--coral); font-size: 13px; font-weight: 900; }
.sound-block { margin: 20px 0; color: var(--teal-dark); font-size: 21px; font-weight: 900; }
.rewrite-form { margin-top: 22px; }
.completion-check { width: fit-content; margin: 18px auto 24px; padding: 10px 14px; border-radius: 8px; background: var(--green); color: #21654e; font-size: 14px; font-weight: 900; }
.daily-finish { margin-top: 24px; }
.daily-finish .secondary-button { margin-top: 4px; }
.reward-strip { display: grid; gap: 7px; width: min(100%, 410px); margin: 0 auto 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; }
.reward-strip strong { color: #8a6a30; font-size: 12px; }
.reward-strip span { font-size: 14px; font-weight: 900; }
.reward-strip .primary-button { width: fit-content; margin: 4px auto 0; }
.optional-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; font-weight: 800; }

.growth-complete-active .topbar, .growth-complete-active .stats-row,
.growth-complete-active .session-bar, .growth-complete-active .footer-note { display: none; }
.growth-complete-active .app-shell { width: min(834px, calc(100% - 32px)); padding-top: 18px; }
.growth-complete-active .workspace { margin-top: 0; }
.growth-complete-active .main-panel { min-height: 0; border: 0; background: transparent; box-shadow: none; }
.growth-complete { padding: 20px 0 30px; text-align: center; }
.growth-result { display: flex; align-items: center; justify-content: center; gap: 15px; text-align: left; }
.growth-check { display: grid; width: 47px; height: 47px; flex: 0 0 47px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); }
.growth-check svg { width: 25px; height: 25px; }
.growth-result h2 { margin: 0; font-size: 36px; letter-spacing: 0; }
.growth-result p { margin: 7px 0 0; color: var(--muted); font-size: 15px; font-weight: 800; }
.growth-result p strong { margin-inline: 5px; color: var(--coral); font-size: 20px; }
.growth-result p span { margin-inline: 8px; color: var(--line); }
.growth-room-scene { width: 100%; margin: 22px 0 0; overflow: hidden; border-radius: 8px; aspect-ratio: 4 / 2.75; }
.growth-room-scene img { display: block; width: 100%; height: 100%; object-fit: cover; }
.growth-rewards { display: flex; width: fit-content; align-items: center; justify-content: center; gap: 17px; margin: -22px auto 0; border: 1px solid #e4d2b1; border-radius: 8px; padding: 13px 25px; background: var(--card); box-shadow: 0 8px 20px rgba(32, 49, 59, 0.1); position: relative; }
.growth-rewards strong { font-size: 15px; }
.growth-rewards span { color: #baa989; }
.growth-progress { width: min(100%, 680px); margin: 22px auto 0; text-align: left; }
.growth-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 13px; }
.growth-progress-heading strong { font-size: 17px; }
.growth-progress-heading span { color: var(--teal-dark); font-weight: 900; }
.growth-progress-track { height: 10px; margin-top: 10px; overflow: hidden; border-radius: 99px; background: #dfe2db; }
.growth-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.growth-progress p { margin: 7px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.growth-diary-line { width: min(100%, 680px); margin: 18px auto 11px; color: var(--ink); font-size: 13px; font-weight: 800; text-align: left; }
.growth-week { display: grid; width: min(100%, 680px); grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.growth-day { display: grid; min-height: 52px; place-items: center; gap: 4px; padding: 7px 2px; }
.growth-day small { color: var(--muted); font-size: 9px; font-weight: 900; }
.growth-day i { width: 8px; height: 8px; border-radius: 50%; background: #d8ddd7; }
.growth-day.completed i { background: #a8cfc3; }
.growth-day.current { border: 1px solid var(--teal); border-radius: 8px; background: #eef8f5; }
.growth-day.current i { width: 11px; height: 11px; background: var(--teal); }
.growth-actions { display: grid; width: min(100%, 560px); gap: 10px; margin: 18px auto 0; }
.growth-feed-button { min-height: 54px; font-size: 17px; }
.text-button { min-height: 38px; border: 0; padding: 4px 8px; color: var(--teal-dark); background: transparent; font-size: 12px; font-weight: 900; }
.text-button:hover { text-decoration: underline; }
.growth-unlocked { width: fit-content; margin: 13px auto 0; border-radius: 7px; padding: 8px 12px; color: #21654e; background: var(--green); font-size: 12px; font-weight: 900; }
.growth-extra-review { display: block; margin: 5px auto 0; }

.floating-pet { position: fixed; z-index: 40; right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); width: 132px; aspect-ratio: 192 / 208; isolation: isolate; border: 0; padding: 0; color: var(--ink); background: transparent; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; filter: drop-shadow(0 12px 14px rgba(32, 49, 59, 0.22)); animation: floating-pet-idle 3.2s ease-in-out infinite; transition: opacity 180ms ease, transform 180ms ease; }
.floating-pet-sprite { position: relative; z-index: 2; display: block; width: 100%; height: 100%; background-image: url("./assets/chengbao-spritesheet.webp"); background-repeat: no-repeat; background-size: 800% 1100%; }
.floating-pet-cosmetics,
.pet-cosmetics { position: absolute; inset: 0; pointer-events: none; }
.floating-pet-cosmetics { z-index: 3; }
.pet-cosmetics { z-index: 2; }
.cosmetic-art { display: block; width: 100%; height: 100%; background: url("./assets/cosmetic-atlas-v2.png") no-repeat; background-size: 600% 600%; }
.pet-cosmetic { position: absolute; display: block; }
.pet-cosmetic .cosmetic-art { filter: drop-shadow(0 3px 3px rgba(32, 49, 59, 0.18)); }
.pet-cosmetic.floating.category-hat { top: -15%; left: 23%; width: 54%; height: 44%; }
.pet-cosmetic.floating.category-scarf { top: 31%; left: 23%; width: 54%; height: 38%; }
.pet-cosmetic.floating.item-straw-hat { top: -13%; left: 22%; width: 56%; height: 44%; }
.pet-cosmetic.floating.item-berry-beret { top: -22%; left: 23%; width: 54%; height: 44%; }
.pet-cosmetic.floating.item-little-crown { top: -14%; left: 24%; width: 52%; height: 42%; }
.pet-cosmetic.floating.item-coral-scarf { top: 31%; left: 23%; width: 54%; height: 36%; }
.pet-cosmetic.floating.item-mint-bow { top: 35%; left: 28%; width: 44%; height: 30%; }
.pet-cosmetic.floating.item-sailor-collar { top: 29%; left: 22%; width: 56%; height: 40%; }
.floating-pet:hover { transform: translateY(-5px) scale(1.04); }
.floating-pet.is-dragging { cursor: grabbing; animation: none; transform: none; }
.floating-pet:focus-visible { outline: none; }
.floating-pet:focus-visible .floating-pet-sprite { filter: drop-shadow(0 0 4px rgba(29, 139, 130, 0.75)); }
.floating-food-count { position: absolute; z-index: 4; top: 0; right: 0; display: grid; min-width: 30px; height: 30px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; padding: 0 6px; color: #fff; background: var(--coral); font-size: 12px; font-weight: 900; box-shadow: 2px 3px 0 rgba(32, 49, 59, 0.18); }
.floating-food-count[hidden] { display: none; }
.pet-open .floating-pet { visibility: hidden; opacity: 0; pointer-events: none; transform: scale(0.8); }
@keyframes floating-pet-idle {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  48% { translate: 0 -7px; rotate: -1deg; }
  58% { translate: 0 -8px; rotate: 1deg; }
}

.pet-open { overflow: hidden; }
.pet-overlay { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(32, 49, 59, 0.58); }
.pet-overlay[hidden] { display: none; }
.pet-home { position: relative; display: grid; width: min(900px, 100%); max-height: calc(100dvh - 48px); grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr); overflow: auto; border: 2px solid var(--ink); border-radius: 18px; background: var(--card); box-shadow: 10px 12px 0 rgba(32, 49, 59, 0.22); }
.pet-close { position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: rgba(255, 253, 248, 0.92); font-size: 28px; line-height: 1; }
.pet-scene { min-height: 540px; overflow: hidden; background: #efe2c8; }
.pet-scene { position: relative; }
.pet-scene img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.025); will-change: transform; }
.pet-cosmetic.room.category-hat { top: -2%; left: 28%; width: 29%; height: 28%; }
.pet-cosmetic.room.category-scarf { top: 33%; left: 28%; width: 29%; height: 24%; }
.pet-cosmetic.room.category-bed { right: 3%; bottom: 3%; width: 34%; height: 32%; }
.pet-cosmetic.room.category-sticker { top: 8%; left: 4%; width: 17%; height: 17%; }
.pet-cosmetic.room.category-trail { bottom: 1%; left: 3%; width: 30%; height: 23%; }
.pet-cosmetic.room.category-prop { top: 44%; right: 4%; width: 21%; height: 24%; }
.pet-cosmetic.room.item-straw-hat { top: 2%; left: 27%; width: 31%; height: 30%; }
.pet-cosmetic.room.item-berry-beret { top: -3%; left: 29%; width: 28%; height: 27%; }
.pet-cosmetic.room.item-little-crown { top: -4%; left: 31%; width: 25%; height: 24%; }
.pet-cosmetic.room.item-coral-scarf { top: 34%; left: 28%; width: 29%; height: 24%; }
.pet-cosmetic.room.item-mint-bow { top: 36%; left: 32%; width: 22%; height: 18%; }
.pet-cosmetic.room.item-sailor-collar { top: 31%; left: 26%; width: 33%; height: 28%; }
.pet-cosmetic.room.item-paw-cushion { bottom: 3%; left: 4%; width: 22%; height: 22%; }
.pet-cosmetic.room.item-donut-bed { right: 3%; bottom: 3%; width: 34%; height: 32%; }
.pet-cosmetic.room.item-sunshine-sticker { top: 8%; left: 4%; width: 16%; height: 16%; }
.pet-cosmetic.room.item-leaf-trail { bottom: 1%; left: 3%; width: 29%; height: 22%; }
.pet-cosmetic.room.item-star-lamp { top: 44%; right: 4%; width: 20%; height: 23%; }
.pet-cosmetic.room.item-rainbow-trail { bottom: 1%; left: 3%; width: 30%; height: 23%; }
.pet-scene[data-stage="waiting"] img { animation: pet-waiting 3.2s ease-in-out infinite; }
.pet-scene[data-stage="eating"] img { animation: pet-eating 380ms ease-in-out infinite; transform-origin: 67% 72%; }
.pet-scene[data-stage="full"] img { animation: pet-full 3.8s ease-in-out infinite; transform-origin: 50% 62%; }
.pet-heart { position: absolute; display: none; color: var(--coral); font-size: 25px; opacity: 0; filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.8)); pointer-events: none; }
.pet-scene[data-stage="full"] .pet-heart { display: block; animation: pet-heart 2.8s ease-out infinite; }
.pet-heart-one { top: 24%; left: 18%; }
.pet-heart-two { top: 17%; left: 29%; animation-delay: 900ms !important; font-size: 18px; }
.pet-heart-three { top: 29%; left: 10%; animation-delay: 1.7s !important; font-size: 15px; }
@keyframes pet-waiting {
  0%, 100% { transform: scale(1.025) translateY(0) rotate(0); }
  48% { transform: scale(1.04) translateY(-5px) rotate(-0.4deg); }
  58% { transform: scale(1.04) translateY(-7px) rotate(0.4deg); }
}
@keyframes pet-eating {
  0%, 100% { transform: scale(1.035) translateY(0) rotate(0); }
  50% { transform: scale(1.045) translateY(5px) rotate(0.35deg); }
}
@keyframes pet-full {
  0%, 100% { transform: scale(1.025); }
  50% { transform: scale(1.045); }
}
@keyframes pet-heart {
  0% { opacity: 0; transform: translateY(8px) scale(0.7) rotate(-8deg); }
  24% { opacity: 0.9; }
  78% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-48px) scale(1.12) rotate(8deg); }
}
.pet-controls { display: flex; flex-direction: column; justify-content: center; padding: 54px 34px 34px; }
.pet-controls h2 { margin-top: 7px; font-size: 32px; }
.pet-stage-label { width: fit-content; margin-top: 8px; border-radius: 7px; padding: 5px 8px; color: var(--teal-dark); background: var(--green); font-size: 11px; }
.pet-message { min-height: 44px; margin: 11px 0 14px; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.55; }
.affection-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; font-size: 12px; font-weight: 900; }
.affection-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e4e7df; }
.affection-track span { display: block; height: 100%; border-radius: inherit; background: var(--coral); transition: width 300ms ease; }
.pet-growth-text { margin: 7px 0 0; color: var(--muted); font-size: 10px; font-weight: 900; text-align: right; }
.food-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.food-button { min-height: 104px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 6px; color: var(--ink); background: #fff; }
.food-button:hover:not(:disabled) { transform: translateY(-2px); border-color: #d8b56b; background: #fff9e7; }
.food-button:disabled { cursor: default; opacity: 0.4; }
.food-button span, .food-button strong, .food-button small { display: block; }
.food-button span { min-height: 24px; color: var(--coral); font-size: 17px; font-weight: 900; line-height: 1; }
.food-button strong { margin-top: 7px; font-size: 13px; }
.food-button small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 900; }
.pet-view-actions { display: flex; justify-content: center; gap: 8px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.pet-view-actions .text-button.active { color: var(--coral); text-decoration: underline; }
.pet-achievement-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.pet-achievement-summary strong { color: var(--coral); font-size: 17px; }
.pet-achievement-summary span { color: var(--muted); font-size: 10px; font-weight: 800; }
.pet-detail-list { display: grid; max-height: 218px; gap: 1px; overflow: auto; margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pet-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; color: var(--muted); border-bottom: 1px solid #edf0ea; }
.pet-detail-row:last-child { border-bottom: 0; }
.pet-detail-row strong { color: var(--ink); font-size: 12px; }
.pet-detail-row span { font-size: 10px; font-weight: 800; text-align: right; }
.pet-detail-row.unlocked span { color: var(--teal-dark); }
.achievement-list { margin-top: 8px; }
.achievement-row > div { min-width: 0; }
.achievement-row strong,
.achievement-row small,
.achievement-row span,
.achievement-row span b { display: block; }
.achievement-row small { margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.35; }
.achievement-row span { flex: 0 0 70px; }
.achievement-row span b { margin-top: 2px; color: var(--coral); font-size: 9px; }
.achievement-unlocked { width: fit-content; max-width: 100%; margin: 10px auto; border: 1px solid #a9d7c4; border-radius: 7px; padding: 8px 12px; color: #21654e; background: #e9f7f0; font-size: 11px; font-weight: 900; text-align: center; }
.pet-empty-copy { margin: 20px 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.6; }

.footer-note { justify-content: center; gap: 8px; padding-top: 23px; color: var(--muted); font-size: 12px; font-weight: 700; }
.footer-star { color: var(--coral); font-size: 17px; }
.shake { animation: shake 330ms ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

@media (max-width: 800px) {
  .app-shell { width: min(100% - 28px, 600px); padding-top: 18px; }
  .intro { min-height: 205px; padding: 45px 4px 30px; }
  h1 { font-size: clamp(39px, 12vw, 60px); }
  .goal-sticker { margin-right: 5px; transform: rotate(3deg) scale(0.9); }
  .workspace { grid-template-columns: 1fr; }
  .word-rail { min-height: auto; padding: 16px; }
  .word-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-page-tools { grid-template-columns: minmax(0, 1fr) minmax(144px, 180px); align-items: center; }
  .rail-reset { margin-top: 14px; }
  .main-panel { min-height: 560px; }
  .panel-inner { min-height: 558px; padding: 28px 22px 23px; }
  .study-card { grid-template-columns: 1fr; gap: 15px; }
  .game-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-tab:last-child { grid-column: span 2; }
  .game-arena { padding-inline: 15px; }
  .flow-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-note { margin-top: 4px; }
  .panel-footer { align-items: stretch; flex-direction: column; }
  .panel-footer .primary-button { width: 100%; }
  .pet-overlay { padding: 16px; }
  .pet-home { grid-template-columns: minmax(0, 1.08fr) minmax(290px, 0.92fr); }
  .pet-scene { min-height: 470px; }
  .pet-controls { padding: 50px 24px 28px; }
  .floating-pet { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 92px; }
  .growth-complete { padding-top: 8px; }
  .growth-room-scene { aspect-ratio: 4 / 2.55; }
}

@media (min-width: 801px) and (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .word-rail { min-height: auto; }
  .word-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word-page-tools { grid-template-columns: minmax(0, 1fr) 210px; align-items: center; }
  .rail-reset { width: 210px; align-self: end; }
  .daily-session-active .workspace { display: block; }
  .floating-pet { width: 96px; }
}

@media (min-width: 700px) and (max-width: 1100px) {
  .intro { min-height: 180px; padding: 36px 4px 24px; }
  h1 { font-size: clamp(36px, 7vw, 48px); }
  .goal-sticker { transform: rotate(3deg) scale(0.82); }
  .mode-tabs { padding: 18px 0 12px; }
  .flow-step { min-height: 60px; padding-block: 8px; }
  .word-rail { padding: 14px; }
  .word-row { min-height: 44px; padding-block: 5px; }
  .word-text { font-size: 13px; }
  .word-check { width: 22px; height: 22px; flex-basis: 22px; }
  .main-panel { min-height: 500px; }
  .panel-inner { min-height: 498px; padding: 26px 28px 24px; }
  .panel-title { font-size: clamp(26px, 4vw, 36px); }
  .daily-panel-inner { min-height: 498px; }
  .daily-dictation { margin-top: 42px; }
  .floating-pet { width: 72px; }
}

@media (min-width: 700px) and (max-width: 1100px) and (max-height: 900px) {
  .growth-complete-active .app-shell { padding-top: 8px; }
  .growth-complete { padding-block: 6px 18px; }
  .growth-result h2 { font-size: 29px; }
  .growth-result p { margin-top: 3px; font-size: 12px; }
  .growth-room-scene { height: 350px; margin-top: 12px; aspect-ratio: auto; }
  .growth-rewards { padding-block: 10px; }
  .growth-progress { margin-top: 14px; }
  .growth-diary-line { margin-block: 11px 7px; }
  .growth-day { min-height: 43px; padding-block: 5px; }
  .growth-actions { grid-template-columns: 1fr 1fr; margin-top: 11px; }
  .growth-actions .text-button { grid-column: 1 / -1; }
  .growth-unlocked { margin-top: 8px; }
}

@media (max-width: 480px) {
  .voice-state { display: none; }
  .student-login-panel { padding: 28px 22px; }
  .student-account span { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .voice-dot { width: 10px; height: 10px; }
  .intro { align-items: center; }
  .goal-sticker { margin-left: -20px; }
  .stats-row { gap: 10px; padding-inline: 8px; }
  .session-bar { align-items: stretch; flex-direction: column; padding-inline: 8px; }
  .session-actions { justify-content: flex-end; }
  .daily-start-button { flex: 1 0 100%; }
  .stat-item { min-width: 78px; }
  .mode-tabs { gap: 0; justify-content: space-between; }
  .mode-tab { padding-inline: 8px; }
  .answer-row { align-items: stretch; flex-direction: column; }
  .answer-input, .answer-row .primary-button { width: 100%; }
  .game-option-grid { grid-template-columns: 1fr; }
  .game-tab { min-height: 55px; }
  .flow-step { min-height: 63px; padding-inline: 7px; }
  .game-type-form { align-items: stretch; flex-direction: column; }
  .game-type-form .primary-button { width: 100%; }
  .word-rail { padding-inline: 12px; }
  .word-row { min-height: 46px; }
  .word-pagination { grid-template-columns: 44px minmax(38px, 1fr) 44px; }
  .floating-pet { width: 72px; }
  .floating-food-count { min-width: 26px; height: 26px; font-size: 11px; }
  .pet-overlay { padding: 0; }
  .pet-home { width: 100%; max-height: 100dvh; min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .pet-scene { min-height: 0; aspect-ratio: 1.15; }
  .pet-cosmetic.room.item-straw-hat { top: -4%; left: 29%; width: 27%; height: 26%; }
  .pet-cosmetic.room.item-berry-beret { top: -5%; left: 30%; width: 24%; height: 23%; }
  .pet-cosmetic.room.item-little-crown { top: -5%; left: 32%; width: 22%; height: 21%; }
  .pet-controls { padding: 28px 20px 24px; }
  .pet-controls h2 { font-size: 27px; }
  .pet-message { min-height: auto; }
  .growth-result h2 { font-size: 27px; }
  .growth-result p { font-size: 12px; }
  .growth-room-scene { aspect-ratio: 1.25; }
  .growth-progress-heading { align-items: start; flex-direction: column; gap: 4px; }
  .growth-diary-line { line-height: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
  .floating-pet, .pet-scene img, .pet-scene .pet-heart { animation: none !important; }
  .pet-scene[data-stage="full"] .pet-heart { display: none; }
}

/* Expedition is a focused route screen, separate from the school dictation workspace. */
body.expedition-active { background: #f7efe4; }
body.expedition-active .app-shell { width: 100%; max-width: none; margin: 0; padding: 0; }
body.expedition-active .topbar,
body.expedition-active .intro,
body.expedition-active .stats-row,
body.expedition-active .session-bar,
body.expedition-active .mode-tabs,
body.expedition-active .flow-strip,
body.expedition-active .word-rail,
body.expedition-active .footer-note,
body.expedition-active .floating-pet { display: none; }
body.expedition-active .workspace { display: block; margin: 0; }
body.expedition-active .main-panel {
  min-height: 100dvh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7efe4;
  box-shadow: none;
}

.expedition-page,
.expedition-run,
.expedition-complete {
  min-height: 100dvh;
  padding: 24px clamp(18px, 5vw, 70px) 30px;
  color: var(--ink);
}
.expedition-page {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.8), rgba(247, 239, 228, 0.72));
}
.expedition-topline,
.expedition-run-topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.expedition-back { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding-inline: 0; }
.expedition-back-icon { display: inline-flex; width: 16px; transform: rotate(180deg); }
.expedition-back-icon svg { width: 16px; height: 16px; }
.expedition-auto-progress {
  display: grid;
  grid-template-columns: auto auto minmax(74px, 120px);
  align-items: center;
  gap: 10px;
  border: 1px solid #e7d3b7;
  border-radius: 99px;
  padding: 7px 12px;
  color: var(--teal-dark);
  background: rgba(255, 253, 248, 0.78);
  font-size: 12px;
  font-weight: 900;
}
.expedition-auto-icon { display: inline-block; margin-right: 4px; color: var(--teal); font-size: 18px; line-height: 0; vertical-align: -2px; }
.expedition-auto-progress strong { color: var(--coral); font-size: 18px; }
.expedition-progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #eadfce; }
.expedition-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.expedition-heading { display: flex; align-items: start; justify-content: space-between; width: min(100%, 1040px); margin: 10px auto 2px; }
.expedition-heading h1 { margin: 0; color: var(--ink); font-size: clamp(40px, 6vw, 72px); letter-spacing: -2px; line-height: 1; }
.expedition-heading p { margin: 12px 0 0; color: var(--ink); font-size: clamp(16px, 2.1vw, 22px); font-weight: 900; }
.expedition-heading small { display: block; margin-top: 8px; color: var(--teal-dark); font-size: 13px; font-weight: 900; }
.expedition-heading-mark { margin: 4px 10% 0 0; color: var(--yellow); font-size: 42px; text-shadow: 0 2px 0 rgba(32, 49, 59, 0.1); }
.expedition-scene {
  position: relative;
  width: min(100%, 1040px);
  margin: 6px auto 10px;
  overflow: hidden;
  aspect-ratio: 1484 / 1060;
  background: #bde4f4 url("./assets/expedition-floating-islands-v1.png") center / 100% 100% no-repeat;
}
.expedition-scene::after {
  position: absolute;
  inset: 38% 31% auto 27%;
  height: 25%;
  border-top: 4px dotted rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  content: "";
  opacity: 0.9;
  transform: rotate(-25deg);
  pointer-events: none;
}
.expedition-stop {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 128px;
  justify-items: center;
  border: 2px solid var(--teal-dark);
  border-radius: 14px;
  padding: 8px 15px 7px;
  color: #fff;
  background: rgba(18, 106, 101, 0.92);
  box-shadow: 0 4px 0 rgba(32, 49, 59, 0.18);
  text-align: center;
}
.expedition-stop strong { font-size: clamp(12px, 1.6vw, 17px); }
.expedition-stop small { margin-top: 2px; color: #d9f2ed; font-size: 10px; font-weight: 800; }
.expedition-stop-number { display: grid; position: absolute; top: -13px; left: -13px; width: 28px; height: 28px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: 12px; font-weight: 900; }
.expedition-stop-practice { left: 16%; bottom: 26%; }
.expedition-stop-letters { left: 51%; top: 42%; }
.expedition-stop-treasure { right: 10%; top: 16%; }
.expedition-cat-marker {
  position: absolute;
  z-index: 3;
  left: 13%;
  bottom: 6%;
  width: clamp(62px, 10vw, 112px);
  aspect-ratio: 1 / 1.1;
  background: url("./assets/chengbao-spritesheet.webp") 0 0 / 800% 1100% no-repeat;
  filter: drop-shadow(0 7px 5px rgba(32, 49, 59, 0.2));
  animation: expedition-cat-bob 2.8s ease-in-out infinite;
}
@keyframes expedition-cat-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.expedition-route-choice { display: grid; width: min(100%, 620px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 10px auto; }
.expedition-route-card {
  display: flex;
  min-height: 63px;
  align-items: center;
  gap: 10px;
  border: 1px solid #e3d6c5;
  border-radius: 13px;
  padding: 9px 13px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.82);
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}
.expedition-route-card:hover { transform: translateY(-2px); border-color: var(--teal); }
.expedition-route-card.selected { border: 2px solid var(--teal); background: #eef8f5; box-shadow: 3px 3px 0 rgba(29, 139, 130, 0.18); }
.expedition-route-mark { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 50%; color: #fff; font-size: 16px; font-weight: 900; }
.expedition-route-mark.safe { background: var(--teal); }
.expedition-route-mark.treasure { background: var(--coral); }
.expedition-route-card strong, .expedition-route-card small { display: block; }
.expedition-route-card strong { font-size: 14px; }
.expedition-route-card small { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.expedition-reward-strip { display: flex; width: min(100%, 760px); min-height: 52px; align-items: center; justify-content: center; gap: 13px; margin: 9px auto 12px; border: 1px solid #e7cfab; border-radius: 99px; padding: 8px 18px; color: #806537; background: rgba(255, 253, 248, 0.7); font-size: 12px; font-weight: 900; }
.expedition-reward-strip strong { color: var(--coral); }
.expedition-reward-strip b { color: #cdbb9e; }
.expedition-empty-note { margin: 6px auto 9px; color: var(--coral); font-size: 12px; font-weight: 900; text-align: center; }
.expedition-start { display: flex; width: min(100%, 320px); min-height: 56px; margin: 8px auto 0; font-size: 17px; }
.expedition-diary { display: flex; margin: 2px auto 0; font-size: 13px; }
.expedition-diary svg, .expedition-complete-actions .text-button svg { width: 16px; height: 16px; }

.expedition-run { background: linear-gradient(180deg, #e5f5fa 0%, #f7efe4 74%); }
.expedition-run-topline { width: min(100%, 760px); margin: 0 auto; }
.expedition-run-progress { color: var(--muted); font-size: 12px; font-weight: 900; }
.expedition-run-heading { width: min(100%, 760px); margin: 28px auto 0; text-align: center; }
.expedition-run-heading > span { color: var(--coral); font-size: 12px; font-weight: 900; letter-spacing: 1.2px; }
.expedition-run-heading > strong { margin-left: 8px; color: var(--teal-dark); font-size: 12px; }
.expedition-run-heading h1 { margin: 10px 0 0; color: var(--ink); font-size: clamp(30px, 5vw, 50px); letter-spacing: -1px; line-height: 1.08; }
.expedition-run-route { display: flex; width: min(100%, 270px); align-items: center; justify-content: space-between; margin: 22px auto 0; }
.expedition-run-route span { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid #bdd9d4; border-radius: 50%; color: var(--teal-dark); background: rgba(255, 253, 248, 0.72); font-size: 12px; font-weight: 900; }
.expedition-run-route span.current { border-color: var(--coral); color: #fff; background: var(--coral); }
.expedition-run-route span.done { border-color: var(--teal); color: #fff; background: var(--teal); }
.expedition-question { width: min(100%, 580px); margin: 25px auto 0; border: 1px solid #d6e4df; border-radius: 20px; padding: 25px clamp(18px, 4vw, 36px) 28px; background: rgba(255, 253, 248, 0.9); box-shadow: 0 14px 30px rgba(32, 49, 59, 0.09); text-align: center; }
.expedition-question-label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.expedition-meaning { display: block; margin-top: 7px; color: var(--teal-dark); font-size: 23px; }
.expedition-listen { margin-top: 15px; }
.expedition-memory { margin-top: 18px; border-left: 3px solid var(--yellow); padding: 11px 14px; background: #fff9e7; text-align: left; }
.expedition-memory strong, .expedition-memory span { display: block; }
.expedition-memory strong { color: var(--teal-dark); font-size: 12px; }
.expedition-memory span { margin-top: 4px; color: var(--teal-dark); font-size: 14px; font-weight: 900; }
.expedition-memory p { margin: 4px 0 0; color: #6d6244; font-size: 12px; font-weight: 700; line-height: 1.5; }
.expedition-treasure-note { margin: 19px 0 0; color: #8a6a30; font-size: 12px; font-weight: 800; line-height: 1.5; }
.expedition-answer-row { display: flex; gap: 9px; margin-top: 21px; }
.expedition-answer-row .answer-input { flex: 1 1 auto; min-height: 50px; }
.expedition-answer-row .primary-button { min-width: 112px; }
.expedition-result { margin-top: 16px; border-radius: 10px; padding: 12px 14px; text-align: left; }
.expedition-result.correct { color: #21654e; background: var(--green); }
.expedition-result.wrong { color: #a34e43; background: #fff0ed; }
.expedition-result strong, .expedition-result span { display: block; }
.expedition-result strong { font-size: 13px; }
.expedition-result span { margin-top: 3px; font-size: 12px; font-weight: 700; }
.expedition-run-footer { display: flex; width: min(100%, 580px); align-items: center; justify-content: space-between; gap: 15px; margin: auto auto 0; }
.expedition-run-footer p { margin: 20px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.expedition-run-footer .primary-button { margin-top: 20px; }
.expedition-complete { display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 50% 20%, #dff1f6, transparent 48%), #f7efe4; text-align: center; }
.expedition-complete-mark { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); box-shadow: 4px 5px 0 rgba(32, 49, 59, 0.16); }
.expedition-complete-mark svg { width: 36px; height: 36px; }
.expedition-complete .panel-kicker { margin: 21px 0 8px; }
.expedition-complete h1 { margin: 0; color: var(--ink); font-size: clamp(32px, 5vw, 56px); letter-spacing: -1px; }
.expedition-complete-copy { max-width: 520px; margin: 13px auto 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.6; }
.expedition-complete-rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 23px auto; }
.expedition-complete-rewards strong { border: 1px solid #e7cfab; border-radius: 99px; padding: 10px 15px; color: #806537; background: rgba(255, 253, 248, 0.8); font-size: 13px; }
.expedition-complete-actions { display: grid; gap: 5px; }
.expedition-complete-actions .primary-button { min-width: 250px; }

@media (max-width: 800px) {
  body.expedition-active .main-panel { overflow: auto; }
  .expedition-page, .expedition-run, .expedition-complete { padding: 16px 14px 24px; }
  .expedition-topline { align-items: start; }
  .expedition-auto-progress { grid-template-columns: auto auto; gap: 5px 8px; padding: 6px 9px; font-size: 10px; }
  .expedition-auto-progress .expedition-progress-track { grid-column: 1 / -1; width: 100%; }
  .expedition-auto-progress strong { font-size: 15px; }
  .expedition-heading { margin-top: 14px; }
  .expedition-heading h1 { font-size: clamp(38px, 11vw, 54px); }
  .expedition-heading p { margin-top: 8px; font-size: 15px; line-height: 1.45; }
  .expedition-heading small { font-size: 11px; line-height: 1.45; }
  .expedition-heading-mark { margin-right: 4px; font-size: 28px; }
  .expedition-scene { margin-top: 5px; }
  .expedition-stop { min-width: 92px; border-width: 1px; border-radius: 10px; padding: 6px 8px 5px; }
  .expedition-stop strong { font-size: 10px; }
  .expedition-stop small { font-size: 8px; }
  .expedition-stop-number { top: -10px; left: -10px; width: 21px; height: 21px; font-size: 9px; }
  .expedition-stop-practice { left: 13%; bottom: 25%; }
  .expedition-stop-letters { left: 48%; top: 42%; }
  .expedition-stop-treasure { right: 7%; top: 15%; }
  .expedition-cat-marker { left: 11%; bottom: 6%; }
  .expedition-route-choice { gap: 7px; margin-top: 8px; }
  .expedition-route-card { min-height: 58px; gap: 7px; padding: 7px 8px; }
  .expedition-route-mark { width: 29px; height: 29px; flex-basis: 29px; font-size: 13px; }
  .expedition-route-card strong { font-size: 12px; }
  .expedition-route-card small { font-size: 9px; }
  .expedition-reward-strip { gap: 6px; margin-top: 8px; padding-inline: 8px; font-size: 10px; }
  .expedition-reward-strip strong { font-size: 10px; }
  .expedition-start { min-height: 52px; margin-top: 7px; font-size: 15px; }
  .expedition-run-heading { margin-top: 23px; }
  .expedition-run-heading h1 { font-size: 31px; }
  .expedition-question { margin-top: 18px; padding: 21px 16px 22px; }
  .expedition-meaning { font-size: 21px; }
  .expedition-answer-row { align-items: stretch; flex-direction: column; }
  .expedition-answer-row .primary-button { width: 100%; }
  .expedition-run-footer { align-items: stretch; flex-direction: column; gap: 0; }
  .expedition-run-footer .primary-button { width: 100%; }
  .expedition-complete h1 { font-size: 34px; }
  .expedition-complete-rewards { margin-block: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .expedition-cat-marker { animation: none; }
}

/* Roguelike expedition v2 */
.expedition-page,
.expedition-map-page,
.expedition-event-page,
.expedition-collection-page,
.expedition-run,
.expedition-complete {
  min-height: 100dvh;
  padding: 20px 34px 28px;
  letter-spacing: 0;
}

.expedition-map-page,
.expedition-event-page,
.expedition-collection-page {
  background: linear-gradient(180deg, #e7f5f8 0%, #f7efe4 76%);
}

.expedition-run-topline {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.expedition-hud {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 1px solid #ddcfbb;
  border-radius: 8px;
  padding: 7px 12px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 4px 12px rgba(32, 49, 59, 0.06);
  font-size: 12px;
  font-weight: 900;
}

.expedition-hearts { display: flex; gap: 3px; }
.expedition-hearts i { color: #d4ccc1; font-style: normal; font-size: 20px; }
.expedition-hearts i.full { color: var(--coral); }
.expedition-hud-progress { color: var(--teal-dark); white-space: nowrap; }
.expedition-hud-relics { max-width: 350px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.expedition-heading h1,
.expedition-map-heading h1,
.expedition-event-heading h1,
.collection-heading h1,
.expedition-run-heading h1,
.expedition-complete h1 {
  letter-spacing: 0;
}

.expedition-heading h1 { font-size: 52px; }
.expedition-heading p { font-size: 19px; }
.expedition-heading small { max-width: 720px; line-height: 1.45; }
.expedition-home-scene { max-height: 470px; border-radius: 8px; }
.expedition-home-status {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 8px auto;
  overflow: hidden;
  border: 1px solid #dfd4c4;
  border-radius: 8px;
  background: #dfd4c4;
}
.expedition-home-status > div { padding: 12px 16px; background: rgba(255, 253, 248, 0.92); }
.expedition-home-status strong,
.expedition-home-status span { display: block; }
.expedition-home-status strong { color: var(--ink); font-size: 13px; }
.expedition-home-status.done strong { color: var(--teal-dark); }
.expedition-home-status span { margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.4; }
.expedition-home-actions { display: flex; width: min(100%, 610px); justify-content: center; gap: 10px; margin: 10px auto 0; }
.expedition-home-actions .expedition-start { width: auto; min-width: 285px; margin: 0; }
.expedition-home-actions .secondary-button { min-width: 210px; }

.expedition-history { width: min(100%, 760px); margin: 18px auto 0; border-top: 1px solid #ddcfbb; padding-top: 10px; }
.expedition-history-heading,
.expedition-history-row { display: grid; align-items: center; }
.expedition-history-heading { grid-template-columns: 1fr auto; margin-bottom: 5px; }
.expedition-history-heading strong { font-size: 13px; }
.expedition-history-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.expedition-history-row { min-height: 36px; grid-template-columns: 86px 72px 1fr; border-top: 1px solid rgba(221, 207, 187, 0.7); font-size: 11px; }
.expedition-history-row span { color: var(--muted); }
.expedition-history-row strong { color: var(--teal-dark); }
.expedition-history-row small { color: var(--muted); font-weight: 700; }

.expedition-map-heading,
.expedition-event-heading {
  width: min(100%, 900px);
  margin: 18px auto 12px;
  text-align: center;
}
.expedition-map-heading h1,
.expedition-event-heading h1 { margin: 0; font-size: 34px; }
.expedition-map-heading p,
.expedition-event-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; }

.expedition-map-scene {
  position: relative;
  width: min(100%, 920px);
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 1.76 / 1;
  border-radius: 8px;
  background: #bde4f4 url("./assets/expedition-floating-islands-v1.png") center / cover no-repeat;
  box-shadow: 0 14px 34px rgba(32, 49, 59, 0.12);
}

.expedition-map-path {
  position: absolute;
  z-index: 1;
  height: 90px;
  border-top: 4px dotted rgba(255, 253, 248, 0.9);
  border-radius: 50%;
  pointer-events: none;
}
.expedition-map-path.path-one { inset: 59% 50% auto 22%; transform: rotate(-15deg); }
.expedition-map-path.path-two { inset: 32% 17% auto 51%; transform: rotate(-25deg); }
.expedition-map-node {
  position: absolute;
  z-index: 3;
  display: grid;
  min-width: 108px;
  min-height: 48px;
  place-items: center;
  border: 2px solid rgba(255, 253, 248, 0.95);
  border-radius: 8px;
  padding: 6px 10px;
  color: #fff;
  background: rgba(18, 106, 101, 0.92);
  box-shadow: 0 4px 0 rgba(32, 49, 59, 0.2);
  cursor: default;
  text-align: center;
}
.expedition-map-node strong { font-size: 12px; }
.expedition-map-node small { color: #d7f0ed; font-size: 9px; font-weight: 900; }
.expedition-map-node.available { cursor: pointer; animation: map-node-pulse 1.8s ease-in-out infinite; }
.expedition-map-node.available:hover,
.expedition-map-node.current { background: var(--coral); }
.expedition-map-node.done { background: #718c79; opacity: 0.82; }
.expedition-map-node:disabled { opacity: 0.72; }
.expedition-map-branch { position: absolute; z-index: 3; display: flex; gap: 7px; }
.expedition-map-branch .expedition-map-node { position: static; min-width: 96px; }
.node-departure { left: 8%; bottom: 16%; }
.node-first-branch { left: 31%; bottom: 35%; }
.node-camp { left: 49%; top: 44%; }
.node-second-branch { right: 18%; top: 27%; }
.node-guard { right: 8%; top: 18%; }
.node-boss { right: 6%; top: 6%; }
.expedition-map-cat {
  position: absolute;
  z-index: 4;
  left: 10%;
  bottom: 1%;
  width: 84px;
  aspect-ratio: 1 / 1.1;
  background: url("./assets/chengbao-spritesheet.webp") 0 0 / 800% 1100% no-repeat;
  filter: drop-shadow(0 7px 5px rgba(32, 49, 59, 0.2));
  animation: expedition-cat-bob 2.8s ease-in-out infinite;
}
@keyframes map-node-pulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.expedition-map-actions { width: min(100%, 700px); margin: 13px auto 0; text-align: center; }
.expedition-map-actions > p { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; }
.expedition-map-enter { min-width: 270px; }
.expedition-route-mark.practice { background: var(--teal); }
.expedition-route-mark.fog { background: #6c7f91; }
.expedition-route-mark.treasure { background: var(--coral); }
.expedition-route-mark.elite { background: #8b668f; }

.expedition-run { display: flex; flex-direction: column; background: linear-gradient(180deg, #e5f5fa 0%, #f7efe4 74%); }
.expedition-run.boss { background: linear-gradient(180deg, #dce9ef 0%, #f4e5dd 76%); }
.expedition-run-heading { margin-top: 18px; }
.expedition-run-heading > span { letter-spacing: 0; }
.expedition-run-heading h1 { margin-top: 6px; font-size: 38px; }
.expedition-run-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.expedition-question { margin-top: 16px; border-radius: 8px; }
.expedition-audio-only { margin: 0; color: var(--teal-dark); font-size: 15px; font-weight: 900; }
.expedition-listen-row { display: flex; justify-content: center; gap: 8px; margin-top: 15px; }
.expedition-listen-row .sound-button { margin: 0; }
.expedition-compass-result { margin: 10px auto 0; color: #725d2c; font-size: 11px; font-weight: 900; }
.expedition-correction-guide { margin-top: 12px; border-left: 3px solid var(--yellow); padding: 11px 14px; background: #fff9e7; text-align: left; }
.expedition-correction-guide strong,
.expedition-correction-guide span { display: block; }
.expedition-correction-guide strong { color: var(--teal-dark); font-size: 12px; }
.expedition-correction-guide span { margin-top: 5px; font-size: 14px; font-weight: 900; }
.expedition-correction-guide p { margin: 4px 0 0; color: #6d6244; font-size: 12px; font-weight: 700; line-height: 1.5; }

.expedition-event-page { display: flex; align-items: center; flex-direction: column; }
.expedition-event-page .expedition-run-topline { width: 100%; }
.expedition-relic-grid {
  display: grid;
  width: min(100%, 850px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 32px auto 0;
}
.expedition-relic-card {
  min-height: 270px;
  border: 1px solid #d8cbb9;
  border-radius: 8px;
  padding: 24px 18px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 12px 28px rgba(32, 49, 59, 0.1);
  text-align: center;
  transition: transform 150ms ease, border-color 150ms ease;
}
.expedition-relic-card:hover { transform: translateY(-4px); border-color: var(--teal); }
.expedition-relic-mark { display: grid; width: 70px; height: 70px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: #fff; font-size: 27px; font-weight: 900; }
.expedition-relic-mark.aqua { background: #55a7a0; }
.expedition-relic-mark.gold { background: #d6a946; }
.expedition-relic-mark.coral { background: var(--coral); }
.expedition-relic-mark.orange { background: #dd8a3d; }
.expedition-relic-mark.green { background: #72a967; }
.expedition-relic-mark.blue { background: #6d91b1; }
.expedition-relic-card strong { display: block; font-size: 19px; }
.expedition-relic-card p { min-height: 42px; margin: 9px 0 20px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.55; }
.expedition-relic-card small { color: var(--teal-dark); font-size: 11px; font-weight: 900; }

.expedition-camp-cat { width: 160px; margin-top: 48px; aspect-ratio: 1; background: url("./assets/pet/orange-cat-full-v1.png") center / contain no-repeat; filter: drop-shadow(0 10px 10px rgba(32, 49, 59, 0.12)); }
.expedition-event-page.camp .expedition-event-heading { margin-top: 5px; }
.expedition-camp-options { display: grid; width: min(100%, 620px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.expedition-camp-options .expedition-route-card { min-height: 82px; }
.camp-mark { background: #7a9b6a; }
.expedition-camp-result { width: min(100%, 520px); margin-top: 24px; border: 1px solid #d8cbb9; border-radius: 8px; padding: 22px; background: rgba(255, 253, 248, 0.92); text-align: center; }
.expedition-camp-result strong { color: var(--teal-dark); font-size: 20px; }
.expedition-camp-result p { margin: 7px 0 18px; color: var(--muted); font-size: 13px; font-weight: 700; }

.expedition-settlement-stats { display: grid; width: min(100%, 520px); grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 20px auto 0; overflow: hidden; border: 1px solid #ddcfbb; border-radius: 8px; background: #ddcfbb; }
.expedition-settlement-stats div { padding: 13px; background: rgba(255, 253, 248, 0.9); }
.expedition-settlement-stats strong,
.expedition-settlement-stats span { display: block; }
.expedition-settlement-stats strong { color: var(--coral); font-size: 24px; }
.expedition-settlement-stats span { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 900; }
.expedition-complete.failed .expedition-complete-mark { background: #8b7f72; }
.expedition-complete-rewards { max-width: 720px; }
.expedition-complete-actions { gap: 8px; }
.expedition-complete-actions .secondary-button { min-width: 250px; }

.expedition-collection-page { width: 100%; }
.collection-currency { display: flex; align-items: center; gap: 7px; border: 1px solid #ddcfbb; border-radius: 8px; padding: 7px 12px; background: rgba(255, 253, 248, 0.9); }
.collection-currency strong,
.collection-currency b { color: var(--coral); font-size: 17px; }
.collection-currency span { color: var(--muted); font-size: 10px; font-weight: 900; }
.collection-currency b { margin-left: 8px; color: var(--teal-dark); }
.collection-heading { display: flex; width: min(100%, 1040px); align-items: end; justify-content: space-between; margin: 20px auto 12px; }
.collection-heading h1 { margin: 0; font-size: 38px; }
.collection-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.collection-heading > strong { color: var(--teal-dark); font-size: 17px; }
.draw-station { display: grid; width: min(100%, 1040px); grid-template-columns: 1fr auto; align-items: center; gap: 16px; margin: 0 auto 14px; border: 1px solid #dcc8a6; border-radius: 8px; padding: 15px 17px; background: rgba(255, 249, 231, 0.92); }
.draw-station strong { font-size: 16px; }
.draw-station p { margin: 4px 0 0; color: #786846; font-size: 10px; font-weight: 800; }
.draw-actions { display: flex; gap: 8px; }
.draw-actions button { min-height: 44px; }
.draw-error { grid-column: 1 / -1; color: #a34e43 !important; }
.pity-progress { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pity-progress > div { min-width: 0; }
.pity-progress span { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: #5f5547; font-size: 10px; }
.pity-progress b { color: #7c6c58; }
.pity-progress i { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: #e1d6c5; }
.pity-progress i::after { display: block; width: var(--pity-progress); height: 100%; border-radius: inherit; background: #668d83; content: ""; }
.draw-result-panel { width: min(100%, 1040px); margin: 0 auto 14px; border: 1px solid #d9c9b2; border-radius: 8px; padding: 12px; background: rgba(255, 253, 248, 0.94); }
.draw-result-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.draw-result-heading strong { font-size: 14px; }
.draw-result-heading span { color: var(--muted); font-size: 10px; font-weight: 800; }
.draw-result-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 7px; }
.draw-result-item { min-width: 0; text-align: center; }
.draw-result-item strong,
.draw-result-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-result-item strong { margin-top: 5px; font-size: 10px; }
.draw-result-item small { color: var(--muted); font-size: 8px; font-weight: 800; }
.collection-filters { display: flex; width: min(100%, 1040px); gap: 4px; margin: 0 auto 10px; overflow-x: auto; padding: 2px; }
.collection-filters button { min-width: 62px; min-height: 38px; border: 1px solid #d7cabb; border-radius: 6px; padding: 7px 10px; color: #625b52; background: #fffdf8; font-size: 11px; font-weight: 900; white-space: nowrap; }
.collection-filters button.active { border-color: #24353e; color: #fff; background: #24353e; }
.collection-filters button.rare:not(.active) { color: #2d7185; }
.collection-filters button.epic:not(.active) { color: #77549a; }
.collection-filters button.legendary:not(.active) { color: #a35b2b; }
.collection-filters button.mythic:not(.active) { color: #a33f5e; }
.collection-grid { display: grid; width: min(100%, 1040px); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0 auto; }
.collection-item { display: grid; min-height: 78px; grid-template-columns: 54px 1fr auto; align-items: center; gap: 10px; border: 1px solid #d8cbb9; border-radius: 8px; padding: 9px 11px; background: rgba(255, 253, 248, 0.88); }
.collection-item.locked { background: rgba(247, 245, 240, 0.86); }
.collection-item.equipped { border: 2px solid var(--teal); background: #edf8f4; }
.collection-item.rarity-rare { border-color: #8eb8c4; }
.collection-item.rarity-epic { border-color: #ad98c3; }
.collection-item.rarity-legendary { border-color: #d4a064; background: #fffaf0; }
.collection-item.rarity-mythic { border-color: #d88ba4; background: #fff7fa; box-shadow: inset 3px 0 #b75173; }
.collection-item strong,
.collection-item span { display: block; }
.collection-item strong { font-size: 13px; }
.collection-item div > span { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; }
.collection-item .text-button { min-width: 50px; padding: 5px; font-size: 10px; }
.exchange-button { min-width: 68px; min-height: 34px; border: 1px solid #a7967e; border-radius: 6px; padding: 6px; color: #4f473d; background: #fff; font-size: 9px; font-weight: 900; }
.exchange-button:disabled { opacity: 0.45; }
.cosmetic-swatch { display: grid; width: 50px; height: 50px; place-items: center; border: 2px solid #fff; border-radius: 7px; background: color-mix(in srgb, var(--cosmetic-color) 22%, white); box-shadow: 0 0 0 1px color-mix(in srgb, var(--cosmetic-color) 48%, #d8cbb9); }
.cosmetic-swatch { overflow: hidden; }
.cosmetic-swatch .cosmetic-art { transform: scale(1.18); }
.cosmetic-swatch.poor { filter: saturate(0.72); }
.cosmetic-swatch.rare { box-shadow: 0 0 0 2px #5c98aa; }
.cosmetic-swatch.epic { box-shadow: 0 0 0 2px #8c68ad, 0 0 10px rgba(105, 72, 138, 0.2); }
.cosmetic-swatch.legendary { box-shadow: 0 0 0 2px #d19242, 0 0 13px rgba(209, 146, 66, 0.28); }
.cosmetic-swatch.mythic { box-shadow: 0 0 0 2px #c24b72, 0 0 16px rgba(194, 75, 114, 0.32); }
.draw-result-item .cosmetic-swatch { width: 100%; height: 54px; }

@media (max-width: 900px) {
  .expedition-page,
  .expedition-map-page,
  .expedition-event-page,
  .expedition-collection-page,
  .expedition-run,
  .expedition-complete { padding: 16px 20px 24px; }
  .expedition-heading h1 { font-size: 44px; }
  .expedition-heading p { font-size: 16px; }
  .expedition-home-scene { max-height: 420px; }
  .expedition-map-scene { aspect-ratio: 1.55 / 1; }
  .expedition-map-node { min-width: 92px; min-height: 44px; padding: 5px 7px; }
  .expedition-map-node strong { font-size: 10px; }
  .expedition-map-branch .expedition-map-node { min-width: 78px; }
  .node-first-branch { left: 28%; }
  .node-second-branch { right: 14%; }
  .draw-result-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 12px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .expedition-page,
  .expedition-map-page,
  .expedition-event-page,
  .expedition-collection-page,
  .expedition-run,
  .expedition-complete { padding: 13px 12px 20px; }
  .expedition-run-topline { align-items: flex-start; }
  .expedition-hud { min-height: 40px; flex-wrap: wrap; justify-content: flex-end; gap: 3px 8px; padding: 5px 7px; }
  .expedition-hud-relics { width: 100%; max-width: 210px; text-align: right; }
  .expedition-hearts i { font-size: 17px; }
  .expedition-heading { margin-top: 11px; }
  .expedition-heading h1 { font-size: 38px; }
  .expedition-heading p { font-size: 14px; }
  .expedition-heading small { font-size: 10px; }
  .expedition-home-scene { min-height: 315px; max-height: none; aspect-ratio: 1.18 / 1; background-size: cover; }
  .expedition-home-status { grid-template-columns: 1fr; }
  .expedition-home-actions { align-items: stretch; flex-direction: column; }
  .expedition-home-actions .expedition-start,
  .expedition-home-actions .secondary-button { width: 100%; min-width: 0; }
  .expedition-history { display: none; }
  .expedition-map-heading,
  .expedition-event-heading { margin-top: 14px; }
  .expedition-map-heading h1,
  .expedition-event-heading h1 { font-size: 27px; }
  .expedition-map-heading p,
  .expedition-event-heading p { font-size: 11px; line-height: 1.45; }
  .expedition-map-scene { min-height: 430px; aspect-ratio: auto; background-position: 53% center; }
  .expedition-map-node { min-width: 82px; min-height: 44px; }
  .expedition-map-branch { flex-direction: column; gap: 5px; }
  .node-departure { left: 3%; bottom: 11%; }
  .node-first-branch { left: 28%; bottom: 27%; }
  .node-camp { left: 45%; top: 43%; }
  .node-second-branch { right: 9%; top: 25%; }
  .node-guard { right: 3%; top: 14%; }
  .node-boss { right: 2%; top: 2%; }
  .expedition-map-cat { left: 3%; width: 65px; }
  .expedition-route-choice { grid-template-columns: 1fr; }
  .expedition-run-heading { margin-top: 14px; }
  .expedition-run-heading h1 { font-size: 29px; }
  .expedition-run-heading p { font-size: 11px; }
  .expedition-question { padding: 19px 13px 20px; }
  .expedition-listen-row { align-items: stretch; flex-direction: column; }
  .expedition-listen-row .sound-button { width: 100%; }
  .expedition-answer-row { flex-direction: column; }
  .expedition-answer-row .primary-button { width: 100%; }
  .expedition-run-footer { align-items: stretch; flex-direction: column; }
  .expedition-run-footer .primary-button { width: 100%; }
  .expedition-relic-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
  .expedition-relic-card { display: grid; min-height: 104px; grid-template-columns: 58px 1fr; grid-template-rows: auto auto auto; align-items: center; column-gap: 12px; padding: 12px; text-align: left; }
  .expedition-relic-mark { width: 54px; height: 54px; grid-row: 1 / 4; margin: 0; font-size: 21px; }
  .expedition-relic-card strong { font-size: 16px; }
  .expedition-relic-card p { min-height: 0; margin: 3px 0; font-size: 11px; }
  .expedition-camp-cat { width: 120px; margin-top: 24px; }
  .expedition-camp-options { grid-template-columns: 1fr; }
  .expedition-settlement-stats { margin-top: 14px; }
  .expedition-complete h1 { font-size: 29px; }
  .collection-heading h1 { font-size: 29px; }
  .collection-heading p { max-width: 250px; line-height: 1.4; }
  .draw-station { grid-template-columns: 1fr; }
  .draw-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .draw-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .expedition-map-node.available,
  .expedition-map-cat { animation: none; }
}

/* Tower */
body.tower-active {
  overflow-x: hidden;
  background: #dceef5;
}

body.tower-active .app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.tower-active .topbar,
body.tower-active .intro,
body.tower-active .stats-row,
body.tower-active .session-bar,
body.tower-active .mode-tabs,
body.tower-active .flow-strip,
body.tower-active .word-rail,
body.tower-active .footer-note,
body.tower-active .floating-pet {
  display: none;
}

body.tower-active .workspace { display: block; }

body.tower-active .main-panel {
  min-height: 100svh;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.dungeon-active .intro,
body.dungeon-active .stats-row,
body.dungeon-active .session-bar,
body.dungeon-active .flow-strip,
body.dungeon-active .word-rail,
body.dungeon-active .footer-note,
body.dungeon-active .floating-pet { display: none !important; }
body.dungeon-active .workspace { display: block; }
body.dungeon-active .main-panel { min-height: 720px; overflow: hidden; border-radius: 8px; background: #17272d; }
.dungeon-page, .dungeon-page * { letter-spacing: 0; }
.dungeon-page { min-height: 720px; color: #f8f1df; background: #17272d; }
.dungeon-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 54px; border-bottom: 1px solid rgba(231, 210, 169, 0.25); padding: 0 24px; background: rgba(12, 27, 32, 0.92); }
.dungeon-top .text-button { justify-self: start; color: #f8f1df; }
.dungeon-top strong { font-size: 13px; }
.dungeon-top small { justify-self: end; color: #d8c498; font-weight: 900; }
.dungeon-hud { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); border-bottom: 1px solid rgba(231, 210, 169, 0.22); background: #21383e; }
.dungeon-hud span { min-height: 58px; border-right: 1px solid rgba(231, 210, 169, 0.18); padding: 11px 16px; }
.dungeon-hud span:last-child { border-right: 0; }
.dungeon-hud b, .dungeon-hud strong { display: block; }
.dungeon-hud b { color: #b7c9c7; font-size: 9px; }
.dungeon-hud strong { margin-top: 4px; color: #ffd373; font-size: 16px; }
.dungeon-build { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid rgba(231,210,169,.18); padding: 7px 20px; background: #142f35; }
.dungeon-build > div { display: flex; flex-wrap: wrap; gap: 6px; }
.dungeon-build span { display: inline-flex; align-items: center; gap: 5px; color: #dce6e3; font-size: 9px; font-weight: 900; }
.dungeon-build span i, .dungeon-reward-grid small i { display: inline-grid; width: 20px; height: 20px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-style: normal; }
.dungeon-build span.rarity-common i { color: #6fc08b; }
.dungeon-build span.rarity-rare i { color: #78b8d0; }
.dungeon-build span.rarity-epic i { color: #b295d1; }
.dungeon-build span.rarity-legendary i { color: #ef7565; }
.dungeon-build span.dungeon-skill-chip i { color: #ffd373; }
.dungeon-build small { flex: 0 0 auto; color: #d7c89f; font-size: 9px; font-weight: 900; }
.dungeon-home { position: relative; overflow: hidden; background-image: linear-gradient(90deg, rgba(15, 33, 39, 0.96) 0 42%, rgba(15, 33, 39, 0.18) 72%), url("./assets/tower-lobby-v1.png"); background-position: center; background-size: cover; }
.dungeon-exit { position: absolute; z-index: 2; top: 24px; left: 28px; color: #fff; }
.dungeon-home-copy { position: relative; z-index: 2; width: min(820px, 72%); padding: 92px 0 54px 48px; }
.dungeon-home-copy h1, .dungeon-map header h1, .dungeon-reward header h1, .dungeon-camp h1, .dungeon-settlement h1 { margin: 0; font-family: "ZCOOL KuaiLe", "Nunito", sans-serif; font-size: 58px; line-height: 1; }
.dungeon-home-copy > p { margin: 22px 0; color: #d9e3df; font-size: 15px; font-weight: 800; line-height: 1.8; }
.dungeon-entry-choice { margin-top: 20px; }
.dungeon-entry-choice > header { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.dungeon-entry-choice > header > span { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid #f0b74f; border-radius: 50%; color: #172e33; background: #f0b74f; font-size: 11px; font-weight: 900; }
.dungeon-entry-choice header strong, .dungeon-entry-choice header small { display: block; }
.dungeon-entry-choice header strong { color: #f8f1df; font-size: 13px; }
.dungeon-entry-choice header small { margin-top: 2px; color: #aebfbc; font-size: 9px; font-weight: 800; }
.dungeon-character-picker, .dungeon-chapter-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.dungeon-entry-option { display: grid; min-height: 72px; align-content: center; border: 1px solid rgba(215,196,152,.35); border-radius: 6px; padding: 11px 13px; color: #f8f1df; background: rgba(7,24,29,.72); text-align: left; }
.dungeon-entry-option strong, .dungeon-entry-option small { display: block; }
.dungeon-entry-option strong { font-size: 13px; }
.dungeon-entry-option small { margin-top: 4px; color: #b8ccc8; font-size: 9px; font-weight: 800; line-height: 1.45; }
.dungeon-entry-option.selected { border-color: #f0b74f; box-shadow: inset 3px 0 #f0b74f; background: rgba(16,43,47,.94); }
.dungeon-class-line { display: grid; width: 330px; margin: 26px 0; border-left: 4px solid #f0b74f; padding: 8px 14px; background: rgba(7, 24, 29, 0.62); }
.dungeon-class-line span, .dungeon-class-line small { color: #b8ccc8; font-size: 10px; font-weight: 900; }
.dungeon-class-line strong { margin: 3px 0; font-size: 20px; }
.dungeon-class-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 18px; }
.dungeon-class-option { display: grid; min-height: 218px; align-content: start; border: 1px solid rgba(215, 196, 152, .42); border-radius: 7px; padding: 16px; color: #f8f1df; background: rgba(7, 24, 29, .76); text-align: left; }
.dungeon-class-option:hover { border-color: #f0b74f; transform: translateY(-2px); }
.dungeon-class-option.selected { border-color: #f0b74f; box-shadow: inset 4px 0 #f0b74f, 0 0 0 2px rgba(240,183,79,.14); background: rgba(16, 43, 47, .94); }
.dungeon-class-option span, .dungeon-class-option small, .dungeon-class-option b, .dungeon-class-option em { display: block; font-size: 9px; font-weight: 900; font-style: normal; }
.dungeon-class-option span { color: #f0b74f; }
.dungeon-class-option strong { margin: 5px 0 4px; font-size: 19px; }
.dungeon-class-option small { color: #b8ccc8; line-height: 1.5; }
.dungeon-class-option p { margin: 12px 0 8px; color: #d9e3df; font-size: 10px; font-weight: 800; line-height: 1.5; }
.dungeon-class-option b { margin-top: auto; color: #ffd373; }
.dungeon-class-option em { margin-top: 5px; color: #aebfbc; line-height: 1.4; }
.dungeon-home-cat { position: absolute; right: 7%; bottom: 20px; width: 330px; height: 360px; filter: drop-shadow(0 20px 20px rgba(0,0,0,.35)); }
.dungeon-home-cat span, .dungeon-cat-sprite { display: block; width: 100%; height: 100%; background-image: url("./assets/chengbao-spritesheet.webp"); background-repeat: no-repeat; background-position: left top; background-size: 800% auto; }
.dungeon-codex { margin-top: 30px; border: 1px solid rgba(215, 196, 152, .32); border-radius: 7px; background: rgba(7, 24, 29, .82); }
.dungeon-codex > header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(215, 196, 152, .2); padding: 10px 14px; }
.dungeon-codex header span, .dungeon-codex header strong { display: block; }
.dungeon-codex header span { color: #d8c498; font-size: 9px; font-weight: 900; }
.dungeon-codex header strong { margin-top: 3px; color: #f8f1df; font-size: 14px; }
.dungeon-codex nav { display: flex; gap: 4px; }
.dungeon-codex nav button { min-width: 58px; height: 32px; border: 1px solid rgba(215,196,152,.25); border-radius: 5px; color: #b8ccc8; background: transparent; font-size: 9px; font-weight: 900; }
.dungeon-codex nav button.active { border-color: #f0b74f; color: #172e33; background: #f0b74f; }
.dungeon-codex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dungeon-codex-grid article { display: grid; min-width: 0; min-height: 112px; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 10px; border-right: 1px solid rgba(215,196,152,.16); border-bottom: 1px solid rgba(215,196,152,.16); padding: 13px; }
.dungeon-codex-grid article:nth-child(3n) { border-right: 0; }
.dungeon-codex-grid article i { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #d8c498; border-radius: 50%; color: #ffd373; font-style: normal; font-weight: 900; }
.dungeon-codex-grid article small, .dungeon-codex-grid article strong, .dungeon-codex-grid article p { display: block; overflow-wrap: anywhere; }
.dungeon-codex-grid article small { color: #d8c498; font-size: 8px; font-weight: 900; }
.dungeon-codex-grid article strong { margin-top: 3px; color: #f8f1df; font-size: 12px; }
.dungeon-codex-grid article p { margin: 6px 0 0; color: #b8ccc8; font-size: 9px; font-weight: 800; line-height: 1.5; }
.dungeon-codex-grid article.locked { filter: grayscale(1); opacity: .62; }
.dungeon-map { background-image: linear-gradient(rgba(17, 37, 43, 0.76), rgba(17, 37, 43, 0.9)), url("./assets/tower-lobby-v1.png"); background-size: cover; }
.dungeon-map header, .dungeon-reward header { padding: 42px 48px 24px; text-align: center; }
.dungeon-map header h1, .dungeon-reward header h1 { font-size: 42px; }
.dungeon-map header p, .dungeon-reward header p { margin: 10px 0 0; color: #c7d5d2; font-weight: 800; }
.dungeon-route { display: grid; width: min(820px, calc(100% - 64px)); grid-template-columns: 1fr 56px 1fr 56px 1fr; align-items: center; margin: 34px auto; }
.dungeon-route.branched { width: min(900px, calc(100% - 64px)); grid-template-columns: repeat(2, minmax(180px, 1fr)); grid-template-areas: "start start" "left right" "gate gate"; gap: 18px 28px; }
.dungeon-route-step { display: grid; min-height: 190px; place-items: center; align-content: center; border: 1px solid #67817f; border-radius: 7px; padding: 20px; background: rgba(18, 43, 48, 0.9); text-align: center; }
.dungeon-route-step.lane-center:first-child { grid-area: start; width: 44%; justify-self: center; }
.dungeon-route-step.lane-left { grid-area: left; }
.dungeon-route-step.lane-right { grid-area: right; }
.dungeon-route-step.lane-center:last-child { grid-area: gate; width: 44%; justify-self: center; }
.dungeon-route-step i { display: grid; width: 62px; height: 62px; place-items: center; border: 2px solid #d4b979; border-radius: 50%; color: #ffd373; font-style: normal; font-size: 24px; font-weight: 900; }
.dungeon-route-step strong { margin-top: 15px; font-size: 15px; }
.dungeon-route-step span { margin-top: 4px; color: #d7c89f; font-size: 10px; font-weight: 900; }
.dungeon-route-step small { margin-top: 5px; color: #9fb5b2; font-weight: 900; }
.dungeon-route-step.hidden { filter: grayscale(1); opacity: .42; }
.dungeon-route-step.skipped { filter: grayscale(1); opacity: .28; }
.dungeon-route-step.revealed { border-color: #f0b74f; box-shadow: 0 0 0 3px rgba(240,183,79,.16); }
.dungeon-route-step.available { cursor: pointer; }
.dungeon-route-step.available:hover { transform: translateY(-3px); background: rgba(27, 59, 64, .98); }
.dungeon-route-step:disabled { color: #f8f1df; }
.dungeon-route-line { height: 2px; background: #7b8f89; }
.dungeon-map-action { text-align: center; }
.dungeon-map-action p { color: #9fb5b2; font-size: 10px; font-weight: 800; }
.dungeon-arena { display: grid; min-height: 390px; grid-template-columns: 1fr 150px 1fr; align-items: end; gap: 20px; padding: 28px 6% 18px; background-image: linear-gradient(rgba(13, 34, 40, .28), rgba(13, 34, 40, .86)), url("./assets/tower-lobby-v1.png"); background-position: center 44%; background-size: cover; }
.dungeon-fighter { display: grid; justify-items: center; gap: 8px; }
.dungeon-cat-sprite { width: 190px; height: 210px; filter: drop-shadow(0 14px 14px rgba(0,0,0,.34)); }
.dungeon-enemy-art { width: 230px; height: 245px; background-image: url("./assets/tower-boss-book-v1.png"); background-position: center; background-repeat: no-repeat; background-size: contain; filter: drop-shadow(0 14px 14px rgba(0,0,0,.38)); }
.boss-enemy .dungeon-enemy-art { width: 270px; background-image: url("./assets/tower-boss-gatekeeper-v1.png"); }
.elite-enemy .dungeon-enemy-art { filter: hue-rotate(145deg) saturate(1.2) drop-shadow(0 14px 14px rgba(0,0,0,.38)); }
.dungeon-fighter > strong { min-height: 24px; font-size: 15px; text-shadow: 0 2px 5px #000; }
.dungeon-health { width: min(280px, 80%); height: 13px; overflow: hidden; border: 2px solid #d8c498; border-radius: 8px; background: #283338; }
.dungeon-health i { display: block; height: 100%; background: #50b982; transition: width .25s ease; }
.dungeon-health.enemy i { background: #df6754; }
.dungeon-versus { align-self: center; text-align: center; }
.dungeon-versus span, .dungeon-versus strong, .dungeon-versus small { display: block; }
.dungeon-versus span { color: #ffd373; font-size: 12px; font-weight: 900; }
.dungeon-versus strong { margin: 8px 0; font-size: 34px; }
.dungeon-versus small { color: #d5dfdc; font-size: 9px; font-weight: 900; }
.dungeon-answer-dock { display: grid; grid-template-columns: 230px minmax(300px, 1fr); gap: 18px 28px; min-height: 220px; padding: 20px 34px; color: #20343a; background: #fffaf0; }
.dungeon-question { grid-row: 1 / 4; align-self: center; }
.dungeon-question > strong { display: block; color: #173a43; font-size: 25px; }
.dungeon-question p { margin: 8px 0; color: #536a70; font-size: 12px; font-weight: 800; line-height: 1.5; }
.dungeon-question small { color: #a06137; font-weight: 900; }
.dungeon-correction { min-width: 0; border-left: 4px solid #df6754; padding: 10px 14px; background: #fff1df; }
.dungeon-correction small, .dungeon-correction strong, .dungeon-correction b, .dungeon-correction span { display: block; }
.dungeon-correction small { color: #a84d40; font-size: 10px; font-weight: 950; }
.dungeon-correction strong { margin-top: 3px; overflow-wrap: anywhere; color: #173a43; font-size: 24px; }
.dungeon-correction b { margin-top: 2px; color: #5c777c; font-size: 12px; }
.dungeon-correction p, .dungeon-correction ol { margin: 6px 0 0; color: #4c6167; font-size: 11px; font-weight: 800; line-height: 1.55; }
.dungeon-correction ol { padding-left: 20px; }
.dungeon-correction span { margin-top: 6px; color: #a06137; font-size: 10px; font-weight: 900; }
.dungeon-echo-label { display: block; width: fit-content; margin: 0 auto 8px; border: 1px solid #a06137; border-radius: 5px; padding: 3px 7px; color: #7b4326; font-size: 11px; font-weight: 900; }
.dungeon-listen { display: grid; width: 128px; height: 128px; place-items: center; align-content: center; border: 7px solid #eee1c8; border-radius: 50%; color: #fff; background: #168b84; }
.dungeon-listen svg { width: 32px; height: 32px; }
.dungeon-listen span { margin-top: 4px; font-weight: 900; }
#dungeonAnswerForm { display: grid; grid-template-columns: 1fr 160px; gap: 10px; align-self: end; }
#dungeonAnswerInput { min-width: 0; height: 70px; border: 1px solid #d3c19f; border-radius: 7px; padding: 0 18px; color: #173a43; background: #fff; font-size: 21px; font-weight: 900; }
.dungeon-battle-tools { display: grid; grid-template-columns: minmax(260px, auto) minmax(0, 1fr); align-items: center; gap: 12px; }
.dungeon-skill-bar { display: grid; grid-template-columns: repeat(3, minmax(88px, 1fr)); gap: 6px; }
.dungeon-skill-bar button { min-height: 48px; padding: 6px 10px; }
.dungeon-skill-bar small { display: block; font-size: 8px; }
.dungeon-battle-tools span { color: #596e73; font-size: 11px; font-weight: 800; line-height: 1.45; }
.dungeon-math-form { display: grid; gap: 10px; }
.dungeon-math-chips, .dungeon-math-operators { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dungeon-math-chips button { min-width: 58px; height: 48px; border: 2px solid #d7c9ad; border-radius: 6px; color: #173a43; background: #fff; font-size: 19px; font-weight: 950; }
.dungeon-math-chips button.selected { border-color: #137e79; color: #fff; background: #158f89; }
.dungeon-math-operators button { min-width: 42px; height: 38px; border: 1px solid #d7c9ad; border-radius: 6px; color: #5e4635; background: #fff8e9; font-weight: 950; }
.dungeon-math-operators button.selected { border-color: #d85f49; color: #fff; background: #df6b50; }
.dungeon-math-operators #dungeonMathReset { width: auto; padding-inline: 10px; }
.dungeon-math-error { margin: 0; color: #a84d40; font-size: 11px; font-weight: 900; }
.dungeon-reward, .dungeon-camp { background: #20343a; }
.dungeon-reward-grid { display: grid; width: min(920px, calc(100% - 48px)); grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px auto 44px; }
.dungeon-reward-grid > button { min-height: 280px; border: 1px solid #9b8a65; border-radius: 8px; padding: 20px; color: #20343a; background: #fffaf0; text-align: left; }
.dungeon-reward-grid > button.rarity-common { border-top: 4px solid #4fa96f; }
.dungeon-reward-grid > button.rarity-rare { border-top: 4px solid #4e99b8; }
.dungeon-reward-grid > button.rarity-epic { border-top: 4px solid #8c68ad; }
.dungeon-reward-grid > button.rarity-legendary { border-top: 4px solid #d75b50; }
.dungeon-reward-grid > button:hover { border-color: #f0b74f; transform: translateY(-2px); }
.dungeon-reward-grid.starter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dungeon-skill-reward { min-height: 250px; border: 1px solid #9b8a65; border-top: 4px solid #f0b74f; border-radius: 8px; padding: 22px; color: #20343a; background: #fffaf0; }
.dungeon-skill-reward > small, .dungeon-skill-reward > strong, .dungeon-skill-reward > span { display: block; }
.dungeon-skill-reward > small { color: #8a6432; font-size: 9px; font-weight: 900; }
.dungeon-skill-reward > strong { margin-top: 8px; font-size: 20px; }
.dungeon-skill-reward > p { min-height: 48px; color: #596e73; font-size: 11px; font-weight: 800; line-height: 1.55; }
.dungeon-skill-reward > span { margin: 18px 0 8px; color: #8a6432; font-size: 10px; font-weight: 900; }
.dungeon-skill-reward > div { display: grid; gap: 6px; }
.dungeon-skill-reward > div button { min-height: 34px; border: 1px solid #a98d5a; border-radius: 5px; color: #27464c; background: #fff; font-size: 10px; font-weight: 900; }
.dungeon-item-art { display: block; width: 100%; height: 110px; background-image: url("./assets/equipment-atlas-v1.png"); background-position: center; background-size: 500% auto; }
.dungeon-reward-grid small, .dungeon-reward-grid strong { display: block; }
.dungeon-reward-grid small { display: flex; align-items: center; gap: 6px; color: #755c3c; font-size: 9px; font-weight: 900; }
.dungeon-reward-grid strong { margin-top: 5px; font-size: 18px; }
.dungeon-reward-grid p { color: #596e73; font-size: 11px; font-weight: 800; line-height: 1.55; }
.dungeon-camp-scene, .dungeon-settlement { display: grid; min-height: 608px; place-items: center; text-align: center; }
.dungeon-camp-scene { align-content: center; background-image: radial-gradient(circle at 50% 48%, rgba(240,183,79,.22), transparent 30%), url("./assets/tower-lobby-v1.png"); background-position: center; background-size: cover; }
.dungeon-campfire { display: none; }
.dungeon-camp p { color: #d5dfdc; font-weight: 800; }
.dungeon-event-scene { display: grid; min-height: 520px; align-content: center; gap: 28px; padding: 42px; background-image: linear-gradient(rgba(9,36,42,.38), rgba(9,36,42,.78)), url("./assets/tower-lobby-v1.png"); background-position: center; background-size: cover; }
.dungeon-event-copy { width: min(620px, 100%); margin: 0 auto; text-align: center; }
.dungeon-event-copy small { color: #ffd373; font-weight: 900; }
.dungeon-event-copy h1 { margin: 8px 0; font-family: "ZCOOL KuaiLe", "Nunito", sans-serif; font-size: 46px; }
.dungeon-event-copy p { color: #d5dfdc; font-weight: 800; line-height: 1.6; }
.dungeon-event-choices { display: grid; width: min(760px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 auto; }
.dungeon-event-choices button { min-height: 180px; border: 2px solid #8ca8a3; border-radius: 7px; padding: 22px; color: #20343a; background: #fffaf0; text-align: left; }
.dungeon-event-choices button:hover:not(:disabled) { border-color: #ffd373; transform: translateY(-2px); }
.dungeon-event-choices span, .dungeon-event-choices strong { display: block; }
.dungeon-event-choices span { color: #8a6432; font-size: 11px; font-weight: 900; }
.dungeon-event-choices strong { margin-top: 8px; font-size: 22px; }
.dungeon-event-choices p { color: #596e73; font-size: 12px; font-weight: 800; line-height: 1.55; }
.dungeon-shop { padding-bottom: 42px; background: #173239; }
.dungeon-shop header { padding: 40px 32px 22px; text-align: center; }
.dungeon-shop header h1 { margin: 0; font-family: "ZCOOL KuaiLe", "Nunito", sans-serif; font-size: 42px; }
.dungeon-shop header p { color: #c7d5d2; font-weight: 800; }
.dungeon-shop-grid { display: grid; width: min(920px, calc(100% - 48px)); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 auto 20px; }
.dungeon-shop-item { display: grid; min-width: 0; border: 2px solid #73908b; border-radius: 7px; padding: 16px; background: #fffaf0; color: #1f3438; }
.dungeon-shop-item .dungeon-item-art { height: 150px; }
.dungeon-shop-item small, .dungeon-shop-item strong, .dungeon-shop-item p { overflow-wrap: anywhere; }
.dungeon-shop-item small { font-weight: 900; }
.dungeon-shop-item strong { margin-top: 8px; font-size: 18px; }
.dungeon-shop-item p { min-height: 54px; font-size: 12px; font-weight: 800; }
.dungeon-shop-leave { display: block; margin: 0 auto; }
.dungeon-settlement { background-image: linear-gradient(rgba(14,35,41,.68), rgba(14,35,41,.78)), url("./assets/tower-lobby-v1.png"); background-size: cover; }
.dungeon-settlement > div { width: min(620px, calc(100% - 36px)); border: 1px solid #b6a173; border-radius: 8px; padding: 42px; background: rgba(21,48,54,.94); }
.dungeon-settlement p { color: #d5dfdc; font-weight: 800; line-height: 1.6; }
.dungeon-settlement dl { display: grid; grid-template-columns: repeat(4, 1fr); margin: 28px 0; border: 1px solid rgba(231,210,169,.3); }
.dungeon-settlement dl div { padding: 14px 8px; border-right: 1px solid rgba(231,210,169,.3); }
.dungeon-settlement dl div:last-child { border-right: 0; }
.dungeon-settlement dt { color: #aabfbb; font-size: 9px; font-weight: 900; }
.dungeon-settlement dd { margin: 5px 0 0; color: #ffd373; font-size: 24px; font-weight: 900; }
.dungeon-error { color: #ff9b87; font-weight: 900; }

@media (max-width: 800px) {
  body.dungeon-active .main-panel, .dungeon-page { min-height: 640px; }
  .dungeon-home-copy { width: auto; padding: 120px 24px 60px; }
  .dungeon-home-copy h1 { font-size: 46px; }
  .dungeon-home-cat { right: -70px; bottom: -40px; width: 220px; height: 240px; opacity: .72; }
  .dungeon-character-picker, .dungeon-chapter-picker { grid-template-columns: 1fr; }
  .dungeon-class-picker { grid-template-columns: 1fr; }
  .dungeon-class-option { min-height: 0; padding: 14px; }
  .dungeon-class-option p { margin: 8px 0; }
  .dungeon-codex > header { align-items: stretch; flex-direction: column; }
  .dungeon-codex nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dungeon-codex nav button { min-width: 0; }
  .dungeon-codex-grid { grid-template-columns: 1fr; }
  .dungeon-codex-grid article, .dungeon-codex-grid article:nth-child(3n) { border-right: 0; }
  .dungeon-hud { grid-template-columns: repeat(5, 1fr); }
  .dungeon-hud span { min-width: 0; padding: 8px 5px; text-align: center; }
  .dungeon-hud strong { font-size: 12px; }
  .dungeon-build { display: grid; gap: 6px; padding-inline: 12px; }
  .dungeon-build small { white-space: normal; }
  .dungeon-route, .dungeon-route.branched { width: calc(100% - 24px); grid-template-columns: 1fr; grid-template-areas: "start" "left" "right" "gate"; gap: 8px; margin: 16px auto; }
  .dungeon-route-step { min-height: 76px; grid-template-columns: 48px 1fr; justify-items: start; text-align: left; }
  .dungeon-route-step.lane-center:first-child, .dungeon-route-step.lane-center:last-child { width: 100%; }
  .dungeon-route-step i { width: 40px; height: 40px; grid-row: 1 / 5; font-size: 16px; }
  .dungeon-route-step strong, .dungeon-route-step span, .dungeon-route-step small { grid-column: 2; }
  .dungeon-route-step strong { margin: 0; }
  .dungeon-route-line { width: 2px; height: 14px; margin: -8px auto; }
  .dungeon-arena { min-height: 300px; grid-template-columns: 1fr 70px 1fr; gap: 4px; padding-inline: 8px; }
  .dungeon-cat-sprite { width: 120px; height: 135px; }
  .dungeon-enemy-art, .boss-enemy .dungeon-enemy-art { width: 130px; height: 150px; }
  .dungeon-versus strong { font-size: 24px; }
  .dungeon-answer-dock { grid-template-columns: 1fr; padding: 16px; }
  .dungeon-question { grid-row: auto; }
  .dungeon-listen { width: 90px; height: 90px; border-width: 5px; }
  #dungeonAnswerForm { grid-template-columns: 1fr 110px; }
  #dungeonAnswerInput { height: 58px; font-size: 17px; }
  .dungeon-battle-tools { grid-template-columns: 1fr; }
  .dungeon-skill-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dungeon-reward-grid, .dungeon-reward-grid.starter { grid-template-columns: 1fr; }
  .dungeon-shop-grid { width: calc(100% - 24px); grid-template-columns: 1fr; }
  .dungeon-event-scene { padding: 28px 16px; }
  .dungeon-event-copy h1 { font-size: 38px; }
  .dungeon-event-choices { grid-template-columns: 1fr; }
  .dungeon-event-choices button { min-height: 144px; }
  .dungeon-reward-grid > button { min-height: 190px; }
  .dungeon-settlement dl { grid-template-columns: repeat(2, 1fr); }
}

.tower-page,
.tower-page * { letter-spacing: 0; }

.tower-page {
  min-height: 100svh;
  color: #142a35;
}

.tower-page button:focus-visible,
.tower-page input:focus-visible {
  outline: 4px solid rgba(15, 145, 145, 0.3);
  outline-offset: 3px;
}

.tower-back {
  min-height: 48px;
  border: 1px solid #d7c5a7;
  border-radius: 8px;
  padding: 0 20px;
  color: #142a35;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 5px 18px rgba(27, 58, 68, 0.12);
  font-size: 15px;
  font-weight: 900;
}

.tower-back:hover { transform: translateY(-1px); }

.tower-back.light {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 252, 246, 0.92);
}

.tower-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tower-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid rgba(20, 42, 53, 0.13);
  border-radius: 8px;
  padding: 7px 14px;
  background: rgba(255, 252, 246, 0.92);
  box-shadow: 0 5px 18px rgba(27, 58, 68, 0.1);
}

.tower-wallet strong,
.tower-wallet b { color: #e5654f; font-size: 20px; }
.tower-wallet span { color: #60747b; font-size: 11px; font-weight: 900; }

.tower-equipment-art {
  display: block;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 7px;
  background-color: #fffaf1;
  background-image: url("./assets/equipment-atlas-v1.png");
  background-repeat: no-repeat;
  background-position: calc(var(--atlas-x) * 33.333333%) calc(var(--atlas-y) * 50%);
  background-size: 400% 300%;
}

.tower-equipment-art.atlas-2 { background-image: url("./assets/equipment-atlas-v2.png"); }

.tower-skin-art {
  display: block;
  width: 132px;
  height: 132px;
  flex: 0 0 auto;
  background-image: var(--skin-asset, url("./assets/orange-cat-skins-v1.png"));
  background-position: calc(var(--skin-x) * 33.333333%) calc(var(--skin-y) * 100%);
  background-repeat: no-repeat;
  background-size: 400% 200%;
}

.tower-home {
  display: grid;
  grid-template-rows: minmax(540px, 1fr) auto;
  background: #d8eef6;
}

.tower-home .tower-topline {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: 28px;
  left: 28px;
}

.tower-home-scene {
  display: flex;
  min-height: min(650px, calc(100svh - 150px));
  align-items: center;
  padding: 80px clamp(34px, 7vw, 120px) 42px;
  background-image: url("./assets/tower-lobby-v1.png");
  background-position: center;
  background-size: cover;
}

.tower-home-copy {
  width: min(520px, 48vw);
  padding-bottom: 6vh;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8), 0 6px 22px rgba(255, 255, 255, 0.92);
}

.tower-home-copy > span,
.tower-equipment-room header > span,
.tower-settlement-scene > span,
.tower-failure-scene > span {
  color: #0d716f;
  font-size: 12px;
  font-weight: 900;
}

.tower-home-copy h1 {
  margin: 12px 0 14px;
  font-family: "ZCOOL KuaiLe", "Nunito", sans-serif;
  font-size: 72px;
  line-height: 1;
}

.tower-home-copy p {
  max-width: 460px;
  margin: 0;
  color: #39555f;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.65;
}

.tower-floor-callout {
  display: flex;
  width: fit-content;
  align-items: baseline;
  gap: 14px;
  margin-top: 28px;
  border-left: 5px solid #ef755e;
  padding: 7px 14px;
  background: rgba(255, 252, 246, 0.84);
}

.tower-floor-callout strong { font-size: 28px; }
.tower-floor-callout small { color: #60747b; font-size: 12px; font-weight: 900; }

.tower-floor-picker {
  display: flex;
  width: min(270px, 100%);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(69, 98, 105, 0.24);
  border-radius: 7px;
  padding: 5px 8px 5px 12px;
  background: rgba(255, 252, 246, 0.92);
  text-shadow: none;
}

.tower-floor-picker span { color: #60747b; font-size: 10px; font-weight: 900; white-space: nowrap; }
.tower-floor-picker select { width: 100%; min-width: 0; border: 0; color: #173b43; background: transparent; font: inherit; font-size: 12px; font-weight: 900; }

.tower-route-note strong,
.tower-route-note span { display: block; }

.tower-route-note {
  width: fit-content;
  margin-top: 18px;
  border-left: 4px solid #18817b;
  padding: 8px 13px;
  color: #38565e;
  background: rgba(255, 252, 246, 0.88);
  text-shadow: none;
}

.tower-route-note strong { font-size: 15px; }
.tower-route-note span { margin-top: 2px; font-size: 10px; font-weight: 800; }

.tower-english-skills {
  display: grid;
  width: min(430px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 9px 12px;
  color: #38565e;
  background: rgba(255, 252, 246, 0.88);
  text-shadow: none;
}
.tower-english-skills span { min-width: 0; }
.tower-english-skills small,
.tower-english-skills strong { display: block; }
.tower-english-skills small { overflow: hidden; font-size: 9px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.tower-english-skills strong { margin-top: 2px; font-size: 15px; }
.tower-english-skills i { display: block; height: 3px; margin-top: 4px; overflow: hidden; background: #d8dfdc; }
.tower-english-skills b { display: block; height: 100%; background: #16827c; }

.tower-home-toolbar {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid #d7c5a7;
  padding: 24px clamp(28px, 6vw, 94px);
  background: #fffaf2;
  box-shadow: 0 -12px 36px rgba(27, 58, 68, 0.11);
}

.tower-loadout-preview {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.tower-loadout-preview > span:first-child {
  margin-right: 4px;
  color: #60747b;
  font-size: 12px;
  font-weight: 900;
}

.tower-loadout-preview > small { color: #7c8b8f; font-weight: 800; }

.tower-mini-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 128px;
}

.tower-mini-item .tower-equipment-art { width: 54px; height: 54px; }
.tower-mini-item b { font-size: 12px; }

.tower-mini-skin {
  display: flex;
  min-width: 140px;
  align-items: center;
  gap: 8px;
  border-right: 1px solid #d9c8aa;
  padding-right: 12px;
}

.tower-mini-skin .tower-skin-art { width: 64px; height: 64px; }
.tower-mini-skin b { font-size: 12px; }

.tower-home-actions,
.tower-settlement-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tower-home-actions .primary-button,
.tower-home-actions .secondary-button,
.tower-settlement-actions .primary-button,
.tower-settlement-actions .secondary-button {
  min-height: 52px;
  min-width: 164px;
}

.tower-battle {
  display: grid;
  min-height: 100svh;
  grid-template-rows: minmax(460px, 1fr) auto;
  background: #d8eef6;
}

.tower-battle-scene {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background-image: var(--tower-scene);
  background-position: center;
  background-size: cover;
}

.tower-battle-top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 24px;
  padding: 20px 28px;
}

.tower-battle-top .tower-back { justify-self: start; }

.tower-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
}

.tower-title strong {
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85), 0 5px 22px rgba(255, 255, 255, 0.9);
  font-family: "ZCOOL KuaiLe", "Nunito", sans-serif;
  font-size: 42px;
  line-height: 1;
}

.tower-title span,
.tower-rule {
  border-radius: 8px;
  padding: 9px 13px;
  color: #f9ffff;
  background: rgba(16, 91, 94, 0.88);
  font-size: 12px;
  font-weight: 900;
}

.tower-rule {
  justify-self: end;
  max-width: 260px;
  margin-top: 2px;
  text-align: center;
}

.tower-battle-status {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.tower-hearts,
.tower-seals { display: flex; align-items: center; gap: 8px; }

.tower-hearts {
  position: absolute;
  top: 54%;
  left: 19%;
}

.tower-seals {
  position: absolute;
  top: 86px;
  left: 55%;
  transform: translateX(-50%);
}

.tower-hearts span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-image: url("./assets/tower-status-atlas-v1.png");
  background-position: left center;
  background-size: 200% 100%;
  box-shadow: 0 4px 14px rgba(24, 65, 78, 0.16);
  filter: grayscale(0.9);
  opacity: 0.46;
}

.tower-hearts span.full { filter: none; opacity: 1; }

.tower-seals i {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-image: url("./assets/tower-status-atlas-v1.png");
  background-position: right center;
  background-size: 200% 100%;
  box-shadow: 0 5px 16px rgba(24, 65, 78, 0.18);
}

.tower-seals i.broken { filter: grayscale(0.9); opacity: 0.46; }

.tower-quick-slots {
  position: absolute;
  z-index: 2;
  bottom: 17px;
  left: clamp(24px, 8vw, 130px);
  display: flex;
  gap: 10px;
}

.tower-quick-slot {
  display: grid;
  width: 92px;
  grid-template-columns: 1fr auto;
  grid-template-rows: 70px auto;
  overflow: hidden;
  border: 2px solid rgba(255, 252, 246, 0.92);
  border-radius: 8px;
  color: #fff;
  background: rgba(12, 67, 72, 0.92);
  box-shadow: 0 5px 18px rgba(15, 45, 55, 0.25);
}

.tower-quick-slot .tower-equipment-art {
  width: 100%;
  height: 70px;
  grid-column: 1 / -1;
  border-radius: 0;
}

.tower-quick-slot span,
.tower-quick-slot b {
  padding: 5px 6px;
  font-size: 9px;
  line-height: 1.2;
}

.tower-quick-slot span { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.tower-quick-slot b { color: #ffd36d; }
.tower-quick-slot.empty { min-height: 96px; place-items: center; opacity: 0.64; }
.tower-quick-slot.empty span { grid-column: 1 / -1; white-space: normal; }

.tower-skin-companion {
  position: absolute;
  right: clamp(34px, 7vw, 110px);
  bottom: 5px;
  display: grid;
  justify-items: center;
  filter: drop-shadow(0 12px 18px rgba(20, 42, 53, 0.22));
}

.tower-skin-companion .tower-skin-art { width: clamp(150px, 18vw, 230px); height: clamp(150px, 18vw, 230px); }
.tower-skin-companion > b { border-radius: 6px; padding: 5px 9px; color: #fff; background: rgba(20, 42, 53, 0.86); font-size: 10px; font-weight: 900; }

.tower-answer-dock {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 200px 160px minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  border-top: 1px solid #d7c5a7;
  padding: 22px clamp(28px, 3vw, 48px);
  background: #fffaf2;
  box-shadow: 0 -14px 34px rgba(27, 58, 68, 0.13);
}

.tower-question-kicker {
  margin-bottom: 5px;
  color: #147a75;
  font-size: 10px;
  font-weight: 900;
}

.tower-listen-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.tower-audio-button {
  display: grid;
  width: 126px;
  height: 126px;
  flex: 0 0 126px;
  place-items: center;
  align-content: center;
  border: 8px solid #f0e5d2;
  border-radius: 50%;
  color: #fff;
  background: #159591;
  box-shadow: 0 0 0 2px #d8c7a8;
}

.tower-audio-button svg { width: 34px; height: 34px; }
.tower-audio-button span,
.tower-audio-button small { display: block; }
.tower-audio-button span { margin-top: 3px; font-size: 15px; font-weight: 900; }
.tower-audio-button small { margin-top: 1px; font-size: 9px; font-weight: 800; opacity: 0.86; }
.tower-audio-button:disabled { cursor: default; filter: grayscale(0.7); opacity: 0.58; }

.tower-tool-button {
  min-height: 42px;
  border: 1px solid #d7c5a7;
  border-radius: 7px;
  padding: 8px 10px;
  color: #31525b;
  background: #fff;
  font-size: 10px;
  font-weight: 900;
}

.tower-tool-button:disabled { cursor: default; opacity: 0.45; }

.tower-answer-main {
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
}

.tower-meaning {
  min-height: 24px;
  margin-bottom: 8px;
  color: #60747b;
  font-size: 12px;
  font-weight: 800;
}

#towerAnswerForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

#towerAnswerInput {
  width: 100%;
  min-width: 0;
  height: 78px;
  border: 1px solid #d7c5a7;
  border-radius: 8px;
  outline: 0;
  padding: 0 22px;
  color: #142a35;
  background: #fff;
  box-shadow: inset 0 1px 8px rgba(29, 58, 66, 0.05);
  font-size: 22px;
  font-weight: 900;
}

#towerAnswerInput::placeholder { color: #afb5b5; font-size: 16px; }
#towerAnswerForm .primary-button { min-width: 0; border-radius: 8px; font-size: 20px; }

.tower-pinyin-prompt strong,
.tower-pinyin-prompt span,
.tower-math-heading strong,
.tower-math-heading span { display: block; }
.tower-pinyin-prompt strong, .tower-math-heading strong { font-size: 17px; }
.tower-pinyin-prompt span, .tower-math-heading span { margin-top: 3px; color: #60747b; font-size: 11px; font-weight: 800; }
.tower-pinyin-prompt mark { border-radius: 4px; padding: 0 3px; color: #9c443a; background: #ffe0a8; }

.tower-word-prompt strong,
.tower-context-prompt strong { display: block; color: #183a44; font-size: 28px; }
.tower-word-prompt span,
.tower-context-prompt span { display: block; margin-top: 7px; color: #60747b; font-size: 13px; font-weight: 800; }
.tower-word-prompt .tower-meaning-instruction { margin-top: 10px; color: #a05b32; font-size: 11px; }
.tower-context-prompt p { margin: 10px 0 0; color: #183a44; font-size: 18px; font-weight: 900; }
.tower-skill-badge { display: grid; width: 104px; height: 104px; place-items: center; align-content: center; border: 1px solid #c9b997; border-radius: 50%; color: #fff; background: #16827c; }
.tower-skill-badge strong { font-size: 27px; }
.tower-skill-badge span { margin-top: 2px; font-size: 9px; font-weight: 900; }

#towerPinyinForm,
#towerMathForm { display: grid; gap: 8px; margin-top: 9px; }

.tower-pinyin-entry { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 9px; }
#towerPinyinInput { min-width: 0; height: 54px; border: 1px solid #d7c5a7; border-radius: 7px; outline: 0; padding: 0 14px; color: #183a44; background: #fff; font-size: 19px; font-weight: 900; }
#towerPinyinInput:focus { border-color: #16827c; box-shadow: 0 0 0 3px rgba(22, 130, 124, 0.12); }
.tower-tone-picker { display: grid; grid-template-columns: repeat(5, minmax(48px, 1fr)); gap: 5px; }
.tower-tone-picker button { min-height: 54px; border: 1px solid #d7c5a7; border-radius: 7px; padding: 4px 7px; color: #38535b; background: #fff; font-size: 10px; font-weight: 900; }
.tower-tone-picker button.selected { border-color: #16827c; color: #116c67; background: #e5f4ef; }

.tower-pinyin-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tower-pinyin-options button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  border: 1px solid #d7c5a7;
  border-radius: 7px;
  padding: 7px 9px;
  color: #243e47;
  background: #fff;
  text-align: left;
}

.tower-pinyin-options button small {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #60747b;
  background: #eef2ef;
  font-size: 9px;
  font-weight: 900;
}

.tower-pinyin-options button span { overflow-wrap: anywhere; font-size: 15px; font-weight: 900; }
.tower-pinyin-options button:hover,
.tower-pinyin-options button.selected { border-color: #14827d; background: #e5f4ef; }
.tower-pinyin-options button.answer { border-color: #2b8a68; color: #176b53; background: #e3f1e8; opacity: 1; }
.tower-pinyin-options button.wrong { border-color: #b85b4e; color: #9c443a; background: #fff0ed; opacity: 1; }
.tower-pinyin-options button:disabled:not(.answer, .wrong) { cursor: default; filter: grayscale(0.65); opacity: 0.35; }

.tower-submit-choice { min-height: 42px; justify-self: end; min-width: 146px; }

.tower-math-target {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  align-content: center;
  border: 7px solid #f0e5d2;
  border-radius: 50%;
  color: #fff;
  background: #df6b50;
  box-shadow: 0 0 0 2px #d8c7a8;
}
.tower-math-target strong { font-size: 30px; line-height: 1; }
.tower-math-target span { margin-top: 3px; font-size: 8px; font-weight: 900; }

.tower-math-chips,
.tower-math-operators { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.tower-math-chips button {
  min-width: 62px;
  height: 52px;
  border: 1px solid #b9c8c7;
  border-bottom: 4px solid #8ba9a6;
  border-radius: 7px;
  color: #173b43;
  background: #f8fffc;
  font-size: 21px;
  font-weight: 900;
}
.tower-math-chips button.selected { border-color: #137e79; color: #fff; background: #158f89; }
.tower-math-operators button {
  min-width: 42px;
  height: 38px;
  border: 1px solid #d7c5a7;
  border-radius: 6px;
  color: #31525b;
  background: #fff;
  font-weight: 900;
}
.tower-math-operators button.selected { border-color: #d85f49; color: #fff; background: #df6b50; }
.tower-math-operators #towerMathReset { width: auto; padding-inline: 10px; font-size: 10px; }
.tower-math-error { margin: 0; color: #a84d40; font-size: 10px; font-weight: 900; }

.tower-math-solution {
  margin-top: 8px;
  border-left: 4px solid #16827c;
  padding: 8px 11px;
  background: #e7f3ed;
  color: #21484f;
}

.tower-math-solution strong,
.tower-math-solution span,
.tower-math-solution small { display: block; }
.tower-math-solution ol { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 4px 0; padding-left: 19px; }
.tower-math-solution li { font-size: 11px; font-weight: 900; }
.tower-math-solution span { font-size: 12px; font-weight: 900; }
.tower-math-solution small { margin-top: 3px; color: #526c74; font-size: 9px; font-weight: 800; }

.tower-feedback {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  border-left: 4px solid currentColor;
  padding: 5px 10px;
  font-size: 11px;
}

.tower-feedback strong { white-space: nowrap; }
.tower-feedback span { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tower-feedback.correct { color: #1f785f; background: #e3f1e8; }
.tower-feedback.wrong { color: #a84d40; background: #fff0ed; }
.tower-feedback.neutral { color: #556b73; background: #eef3f4; }

.tower-dock-side {
  display: grid;
  width: 112px;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tower-dock-side .primary-button,
.tower-dock-side .secondary-button { width: 100%; }

.tower-dock-side .primary-button { min-height: 52px; }
.tower-dock-side .secondary-button { min-height: 94px; }

#towerEquipmentButton {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

#towerEquipmentButton img { width: 30px; height: 30px; object-fit: contain; }

@media (min-width: 761px) {
  .tower-battle-top .tower-back { min-width: 164px; min-height: 52px; }
  .tower-answer-main { display: flex; flex-direction: column; }
  .tower-answer-main #towerAnswerForm { order: 1; }
  .tower-answer-main .tower-meaning { order: 2; margin: 8px 12px 0; }
  .tower-answer-main .tower-feedback { order: 3; }
  #towerAnswerInput { height: 96px; }
  .tower-battle.subject-pinyin .tower-answer-dock,
  .tower-battle.subject-math24 .tower-answer-dock { padding-block: 14px; }
}

.tower-equipment-room {
  padding: 28px clamp(24px, 5vw, 84px) 54px;
  background: #f7f3ea;
}

.tower-equipment-room header {
  max-width: 720px;
  margin: 48px 0 26px;
}

.tower-equipment-room header h1 {
  margin: 7px 0 9px;
  font-family: "ZCOOL KuaiLe", "Nunito", sans-serif;
  font-size: 54px;
  line-height: 1;
}

.tower-equipment-room header p { margin: 0; color: #60747b; font-weight: 800; }

.tower-box-station {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #d9c8aa;
  border-bottom: 1px solid #d9c8aa;
  padding: 18px 0;
}

.tower-box-station strong,
.tower-box-station span { display: block; }
.tower-box-station strong { font-size: 17px; }
.tower-box-station span { margin-top: 3px; color: #60747b; font-size: 11px; font-weight: 800; }
.tower-box-station button { min-height: 46px; }

.tower-open-result {
  display: flex;
  max-width: 560px;
  align-items: center;
  gap: 18px;
  margin: 22px auto 0;
  border: 2px solid #1d8b82;
  border-radius: 8px;
  padding: 13px 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(26, 61, 68, 0.1);
}

.tower-open-result > div span,
.tower-open-result > div strong,
.tower-open-result > div small { display: block; }
.tower-open-result > div span { color: #60747b; font-size: 10px; font-weight: 900; }
.tower-open-result > div strong { margin-top: 3px; font-size: 22px; }
.tower-open-result > div small { margin-top: 4px; color: #60747b; font-size: 11px; font-weight: 800; }

.tower-equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.tower-equipment-item {
  display: grid;
  min-height: 150px;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 9px 13px;
  border: 1px solid #d7d8d2;
  border-radius: 8px;
  padding: 13px;
  background: #fffdf8;
}

.tower-equipment-item .tower-equipment-art {
  width: 88px;
  height: 88px;
  grid-row: 1 / 3;
}

.tower-equipment-item > div > span,
.tower-equipment-item > div > strong,
.tower-equipment-item > div > small { display: block; }
.tower-equipment-item > div > span { color: #60747b; font-size: 9px; font-weight: 900; }
.tower-equipment-item > div > strong { margin-top: 3px; font-size: 16px; }
.tower-equipment-item > div > small { margin-top: 5px; color: #60747b; font-size: 10px; font-weight: 800; line-height: 1.35; }
.tower-equipment-item.locked { filter: grayscale(0.85); opacity: 0.58; }
.tower-equipment-item.equipped { border-color: #1d8b82; box-shadow: inset 0 0 0 2px rgba(29, 139, 130, 0.14); }
.tower-equipment-item.rarity-rare { border-color: #5c98aa; }
.tower-equipment-item.rarity-epic { border-color: #8c68ad; }
.tower-equipment-item.rarity-legendary { border-color: #d19242; }

.tower-item-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.tower-item-actions b { margin-right: auto; color: #9c6b21; font-size: 10px; }
.tower-item-actions .text-button { min-height: 32px; padding: 3px 5px; font-size: 10px; }
.tower-notice { margin: 16px 0 0; color: #1d8b82; font-size: 12px; font-weight: 900; text-align: center; }
.tower-item-actions .text-button:disabled { cursor: default; color: #60747b; opacity: 0.6; text-decoration: none; }
.tower-error { margin: 16px 0 0; color: #a84d40; font-size: 12px; font-weight: 900; text-align: center; }

.tower-settlement,
.tower-failure {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background-image: url("./assets/tower-lobby-v1.png");
  background-position: center;
  background-size: cover;
}

.tower-settlement > .tower-back,
.tower-failure > .tower-back {
  position: absolute;
  z-index: 2;
  top: 22px;
  left: 28px;
}

.tower-settlement-scene,
.tower-failure-scene {
  width: min(620px, calc(100% - 36px));
  border: 1px solid rgba(215, 197, 167, 0.92);
  border-radius: 8px;
  padding: 38px clamp(24px, 5vw, 58px);
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 20px 54px rgba(25, 62, 72, 0.18);
  text-align: center;
}

.tower-settlement-scene h1,
.tower-failure-scene h1 {
  margin: 10px 0 12px;
  font-family: "ZCOOL KuaiLe", "Nunito", sans-serif;
  font-size: 48px;
  line-height: 1.08;
}

.tower-settlement-scene p,
.tower-failure-scene p { color: #526c74; font-weight: 800; line-height: 1.6; }

.tower-reward-box {
  margin: 22px 0;
  border-top: 1px solid #d9c8aa;
  border-bottom: 1px solid #d9c8aa;
  padding: 16px;
}

.tower-reward-box strong,
.tower-reward-box small { display: block; }
.tower-reward-box strong { color: #d16446; font-size: 20px; }
.tower-reward-box small { margin-top: 4px; color: #60747b; font-size: 11px; font-weight: 800; }
.tower-settlement-actions { justify-content: center; margin-top: 22px; }

.tower-story-unlock {
  margin: -4px 0 20px;
  border-left: 4px solid #16827c;
  padding: 10px 14px;
  background: #e7f3ed;
  text-align: left;
}

.tower-story-unlock span,
.tower-story-unlock strong { display: block; }
.tower-story-unlock span { color: #16766f; font-size: 9px; font-weight: 900; }
.tower-story-unlock strong { margin-top: 2px; font-size: 15px; }
.tower-story-unlock p { margin: 5px 0 0; font-size: 11px; }

.tower-skin-room {
  padding: 26px clamp(20px, 5vw, 82px) 64px;
  background: #f7f3ea;
}

.tower-skin-heading {
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 22px;
  border-bottom: 1px solid #d9c8aa;
  padding: 20px clamp(12px, 4vw, 54px);
  color: #fff;
  background: #223d43;
}

.tower-skin-heading span { color: #f4c76b; font-size: 10px; font-weight: 900; }
.tower-skin-heading h1 { margin: 7px 0; font-family: "ZCOOL KuaiLe", "Nunito", sans-serif; font-size: 56px; line-height: 1; }
.tower-skin-heading p { margin: 0; color: #d9e4df; font-size: 13px; font-weight: 800; }
.tower-skin-heading .tower-skin-art,
.tower-skin-heading img { width: 220px; height: 220px; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(0, 0, 0, 0.28)); }

.tower-skin-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.tower-skin-reveal {
  display: flex;
  min-height: 126px;
  align-items: center;
  gap: 12px;
  border: 1px solid #d7c5a7;
  border-radius: 7px;
  padding: 10px;
  background: #fffaf2;
  animation: skin-reveal 420ms ease-out both;
}

.tower-skin-reveal.new { border-color: #c88b32; box-shadow: inset 0 0 0 2px rgba(200, 139, 50, 0.18); }
.tower-skin-reveal .tower-skin-art { width: 104px; height: 104px; }
.tower-skin-reveal span,
.tower-skin-reveal strong,
.tower-skin-reveal small { display: block; }
.tower-skin-reveal span { color: #b36a2a; font-size: 9px; font-weight: 900; }
.tower-skin-reveal strong { margin-top: 4px; font-size: 15px; }
.tower-skin-reveal small { margin-top: 2px; color: #60747b; font-size: 9px; }

@keyframes skin-reveal {
  from { transform: translateY(10px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.tower-wish-station {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #d9c8aa;
  padding: 22px 0;
}

.tower-wish-station strong,
.tower-wish-station span { display: block; }
.tower-wish-station strong { font-size: 18px; }
.tower-wish-station span { margin-top: 3px; color: #60747b; font-size: 10px; font-weight: 800; }
.tower-wish-station i { display: block; width: min(360px, 100%); height: 5px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: #d9dfdc; }
.tower-wish-station i b { display: block; height: 100%; background: #14827d; }
.tower-wish-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tower-wish-actions button { min-height: 44px; }

.tower-skin-collection,
.tower-story-book { margin-top: 34px; }
.tower-collection-tabs { display: flex; gap: 6px; border-bottom: 1px solid #d9c8aa; padding: 14px 0 10px; }
.tower-collection-tabs button { min-height: 38px; border: 0; border-radius: 6px; padding: 0 15px; color: #60747b; background: transparent; font-size: 11px; font-weight: 900; }
.tower-collection-tabs button.active { color: #fff; background: #16827c; }
.tower-growth-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #d9c8aa; padding: 22px 0; }
.tower-growth-summary strong, .tower-growth-summary span { display: block; }
.tower-growth-summary strong { font-size: 19px; }
.tower-growth-summary span { margin-top: 3px; color: #60747b; font-size: 10px; font-weight: 800; }
.tower-subject-mini { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tower-subject-mini span { margin: 0; border: 1px solid #c8d8d3; border-radius: 5px; padding: 6px 9px; color: #176b65; background: #e7f3ed; }
.tower-skin-section-title { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid #d9c8aa; padding-bottom: 9px; }
.tower-skin-section-title strong { font-size: 19px; }
.tower-skin-section-title span { color: #60747b; font-size: 11px; font-weight: 900; }
.tower-skin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tower-skin-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  border: 1px solid #d7c5a7;
  border-radius: 7px;
  padding: 9px;
  background: #fffaf2;
}
.tower-skin-card .tower-skin-art { width: 108px; height: 108px; grid-row: 1 / 3; }
.tower-skin-card span,
.tower-skin-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tower-skin-card span { color: #a56b36; font-size: 8px; font-weight: 900; }
.tower-skin-card strong { margin-top: 3px; font-size: 12px; }
.tower-skin-card .text-button { min-height: 30px; justify-self: start; padding: 3px 0; font-size: 9px; }
.tower-skin-card.locked { filter: grayscale(0.85); opacity: 0.58; }
.tower-skin-card.equipped { border-color: #16827c; box-shadow: inset 0 0 0 2px rgba(22, 130, 124, 0.14); }
.growth-card { grid-template-rows: auto auto; align-items: start; }
.growth-card > div:nth-child(2) small { display: block; margin-top: 5px; color: #60747b; font-size: 9px; font-weight: 900; }
.growth-task-list { display: grid; grid-column: 1 / -1; gap: 7px; margin-top: 7px; }
.growth-task-list p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px; margin: 0; color: #60747b; font-size: 9px; font-weight: 800; }
.growth-task-list p.complete { color: #176b53; }
.growth-task-list p b { font-size: 9px; }
.growth-task-list p i { display: block; height: 4px; grid-column: 1 / -1; overflow: hidden; border-radius: 2px; background: #d9dfdc; }
.growth-task-list p em { display: block; height: 100%; background: #16827c; }
.growth-payments { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.growth-payments button { min-height: 30px; border: 1px solid #c8b58f; border-radius: 5px; padding: 4px 8px; color: #80572d; background: #fff7e8; font-size: 9px; font-weight: 900; }
.growth-payments button:disabled { opacity: 0.4; }
.tower-story-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tower-story-list article { border-left: 4px solid #16827c; padding: 12px 14px; background: #e7f3ed; }
.tower-story-list span,
.tower-story-list strong { display: block; }
.tower-story-list span { color: #5c777c; font-size: 9px; font-weight: 900; }
.tower-story-list strong { margin-top: 3px; font-size: 14px; }
.tower-story-list p,
.tower-story-empty { margin: 6px 0 0; color: #49646a; font-size: 10px; font-weight: 700; line-height: 1.55; }

@media (max-width: 1100px) {
  .tower-home-copy h1 { font-size: 60px; }
  .tower-battle { grid-template-rows: minmax(440px, 1fr) auto; }
  .tower-answer-dock { grid-template-columns: 140px 130px minmax(0, 1fr); gap: 18px; padding-inline: 24px; }
  .tower-audio-button { width: 104px; height: 104px; flex-basis: 104px; }
  .tower-equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tower-skin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tower-story-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body.tower-active { overflow-y: auto; }
  .tower-back { min-height: 42px; padding-inline: 13px; font-size: 12px; }
  .tower-wallet { min-height: 42px; padding: 5px 9px; }
  .tower-wallet strong, .tower-wallet b { font-size: 16px; }
  .tower-wallet span { font-size: 9px; }

  .tower-home { grid-template-rows: minmax(430px, 63svh) auto; }
  .tower-home .tower-topline { top: 12px; right: 12px; left: 12px; }
  .tower-home-scene { min-height: 0; align-items: end; padding: 76px 20px 28px; background-position: 61% center; }
  .tower-home-copy { width: 100%; padding: 0; }
  .tower-home-copy h1 { margin-block: 8px 10px; font-size: 44px; }
  .tower-home-copy p { max-width: 330px; font-size: 13px; line-height: 1.5; }
  .tower-floor-callout { display: block; margin-top: 16px; }
  .tower-floor-callout strong, .tower-floor-callout small { display: block; }
  .tower-floor-callout strong { font-size: 22px; }
  .tower-floor-callout small { margin-top: 2px; }
  .tower-route-note { margin-top: 12px; }
  .tower-english-skills { gap: 7px; padding-inline: 9px; }
  .tower-english-skills small { font-size: 8px; }
  .tower-home-toolbar { align-items: stretch; flex-direction: column; gap: 14px; padding: 18px 14px 22px; }
  .tower-loadout-preview { overflow-x: auto; }
  .tower-loadout-preview > span:first-child { min-width: 62px; }
  .tower-mini-item { min-width: 112px; }
  .tower-home-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tower-home-actions #startTowerFloor { grid-column: 1 / -1; }
  .tower-home-actions .primary-button, .tower-home-actions .secondary-button { min-width: 0; }

  .tower-battle { min-height: 100svh; grid-template-rows: minmax(310px, 44svh) auto; }
  .tower-battle-scene { min-height: 310px; background-position: center; }
  .tower-battle-top { grid-template-columns: auto 1fr; gap: 8px; padding: 10px 12px; }
  .tower-title { align-items: flex-start; flex-direction: column; gap: 3px; padding: 3px 0 0; }
  .tower-title strong { font-size: 25px; }
  .tower-title span { padding: 4px 7px; font-size: 9px; }
  .tower-rule { position: absolute; top: 62px; right: 12px; max-width: 190px; padding: 6px 8px; font-size: 9px; }
  .tower-battle-status { inset: 92px 12px auto; display: flex; align-items: center; justify-content: space-between; }
  .tower-hearts, .tower-seals { gap: 4px; }
  .tower-hearts, .tower-seals { position: static; transform: none; }
  .tower-hearts span,
  .tower-seals i { width: 30px; height: 30px; }
  .tower-quick-slots { bottom: 8px; left: 12px; gap: 5px; }
  .tower-quick-slot { width: 66px; grid-template-rows: 48px auto; }
  .tower-quick-slot .tower-equipment-art { height: 48px; }
  .tower-quick-slot span { grid-column: 1 / -1; padding: 4px; font-size: 7px; text-align: center; }
  .tower-quick-slot b { display: none; }
  .tower-quick-slot.empty { min-height: 70px; }

  .tower-answer-dock { align-items: stretch; grid-template-columns: 1fr; gap: 11px; padding: 14px 14px 20px; }
  .tower-listen-actions, .tower-answer-main, .tower-dock-side { grid-column: 1; grid-row: auto; }
  .tower-listen-actions { min-height: 72px; justify-content: flex-start; }
  .tower-audio-button { width: 72px; height: 72px; flex-basis: 72px; border-width: 5px; }
  .tower-audio-button svg { width: 23px; height: 23px; }
  .tower-audio-button span { display: none; }
  .tower-audio-button small { font-size: 7px; }
  .tower-tool-button { min-height: 38px; }
  .tower-meaning { margin-bottom: 5px; font-size: 10px; }
  .tower-question-kicker { font-size: 9px; }
  #towerAnswerForm { grid-template-columns: minmax(0, 1fr) 96px; gap: 7px; }
  #towerAnswerInput { height: 58px; padding-inline: 13px; font-size: 18px; }
  #towerAnswerInput::placeholder { font-size: 12px; }
  #towerAnswerForm .primary-button { font-size: 15px; }
  .tower-pinyin-prompt strong, .tower-math-heading strong { font-size: 15px; }
  .tower-pinyin-options { grid-template-columns: 1fr; gap: 6px; }
  .tower-pinyin-options button { min-height: 45px; }
  .tower-pinyin-options button span { font-size: 14px; }
  .tower-pinyin-entry { grid-template-columns: 1fr; }
  .tower-tone-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tower-tone-picker button { min-height: 44px; padding-inline: 3px; }
  .tower-submit-choice { width: 100%; min-width: 0; justify-self: stretch; }
  .tower-math-target { width: 66px; height: 66px; border-width: 5px; }
  .tower-math-target strong { font-size: 23px; }
  .tower-math-chips button { min-width: 54px; height: 46px; font-size: 18px; }
  .tower-math-operators button { min-width: 38px; height: 36px; }
  .tower-feedback { min-height: 42px; align-items: flex-start; flex-direction: column; gap: 2px; }
  .tower-feedback span { width: 100%; white-space: normal; }
  .tower-dock-side { width: auto; justify-self: stretch; grid-template-columns: 1fr 1.35fr; }
  .tower-dock-side .primary-button, .tower-dock-side .secondary-button { min-height: 46px; }
  #towerEquipmentButton { flex-direction: row; gap: 7px; }
  #towerEquipmentButton img { width: 20px; height: 20px; }

  .tower-equipment-room { padding: 14px 12px 30px; }
  .tower-equipment-room header { margin: 30px 0 20px; }
  .tower-equipment-room header h1 { font-size: 40px; }
  .tower-equipment-room header p { font-size: 12px; }
  .tower-box-station { grid-template-columns: 1fr 1fr; }
  .tower-box-station > div { grid-column: 1 / -1; }
  .tower-box-station button { min-width: 0; font-size: 11px; }
  .tower-equipment-grid { grid-template-columns: 1fr; }
  .tower-equipment-item { min-height: 134px; }
  .tower-open-result { margin-inline: 0; }

  .tower-settlement > .tower-back,
  .tower-failure > .tower-back { top: 12px; left: 12px; }
  .tower-settlement-scene,
  .tower-failure-scene { padding: 30px 18px; }
  .tower-settlement-scene h1,
  .tower-failure-scene h1 { font-size: 35px; }
  .tower-settlement-actions { display: grid; grid-template-columns: 1fr; }
  .tower-settlement-actions .primary-button,
  .tower-settlement-actions .secondary-button { min-width: 0; }

  .tower-skin-companion { right: 8px; bottom: 0; }
  .tower-skin-companion .tower-skin-art { width: 122px; height: 122px; }
  .tower-skin-companion > b { display: none; }
  .tower-skin-room { padding: 14px 12px 36px; }
  .tower-skin-room .tower-topline { align-items: flex-start; }
  .tower-skin-room .tower-wallet { max-width: 218px; flex-wrap: wrap; justify-content: flex-end; }
  .tower-skin-heading { min-height: 190px; gap: 8px; margin-top: 16px; padding: 16px; }
  .tower-skin-heading h1 { font-size: 40px; }
  .tower-skin-heading .tower-skin-art,
  .tower-skin-heading img { width: 142px; height: 142px; }
  .tower-wish-station { grid-template-columns: 1fr; gap: 14px; }
  .tower-wish-actions { display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch; }
  .tower-wish-actions .primary-button { grid-column: 1 / -1; }
  .tower-skin-grid { grid-template-columns: 1fr; }
  .tower-skin-card { grid-template-columns: 100px minmax(0, 1fr); }
  .tower-skin-card .tower-skin-art { width: 96px; height: 96px; }
  .tower-growth-summary { align-items: flex-start; flex-direction: column; }
  .tower-subject-mini { justify-content: flex-start; }
  .tower-story-list { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .tower-home .tower-wallet span { display: none; }
  .tower-battle-status { top: 88px; }
  .tower-rule { max-width: 150px; }
  .tower-answer-dock { padding-inline: 10px; }
  .tower-dock-side { grid-template-columns: 1fr; }
  .tower-skin-heading h1 { font-size: 34px; }
  .tower-skin-heading .tower-skin-art,
  .tower-skin-heading img { width: 118px; height: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .tower-page button { transition: none; }
  .tower-skin-reveal { animation: none; }
}
