/* Biudu forest adventure reward theme v0.4.0718.1620. */
body.adventure-theme {
  --adv-ink: #2d281e;
  --adv-muted: #665b45;
  --adv-paper: #f8edcf;
  --adv-wood-dark: #4c311d;
  --adv-forest: #466b3b;
  --adv-forest-dark: #284a31;
  --adv-leaf: #73964c;
  --adv-lake: #397b8d;
  --adv-orange: #df7624;
  --adv-gold: #edc35b;
  color: var(--adv-ink);
  background-color: #bdd4aa;
  background-image: linear-gradient(rgba(249, 239, 207, 0.08), rgba(240, 222, 163, 0.12)), url("./assets/adventure-camp-bg-v1.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

body.adventure-theme .app-shell {
  position: relative;
  z-index: 1;
  width: min(1720px, calc(100% - 24px));
  height: 100dvh;
  margin: 0 auto;
  padding: 10px 8px 14px;
  gap: 10px;
  background: transparent;
}

body.adventure-theme .topbar {
  position: relative;
  min-height: 70px;
  padding: 9px 18px;
  overflow: visible;
  color: #362616;
  background-color: #e5bd79;
  background-image: repeating-linear-gradient(4deg, transparent 0 14px, rgba(90, 55, 25, 0.055) 15px 16px), linear-gradient(90deg, rgba(255,255,255,0.18), transparent 28%, rgba(99,62,28,0.08));
  border: 3px solid var(--adv-wood-dark);
  border-radius: 14px 12px 15px 10px;
  box-shadow: 0 6px 0 rgba(76,49,29,0.38), 0 13px 24px rgba(40,57,30,0.16);
}

body.adventure-theme .topbar::before,
body.adventure-theme .topbar::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 8px;
  height: 8px;
  background: #674321;
  border: 2px solid #b8894b;
  border-radius: 50%;
}

body.adventure-theme .topbar::before { left: 10px; }
body.adventure-theme .topbar::after { right: 10px; }

body.adventure-theme .brand {
  gap: 13px;
  min-width: 280px;
}

body.adventure-theme .brand-mark {
  position: relative;
  width: 58px;
  height: 44px;
  flex: 0 0 58px;
  color: #fff8d9;
  background: var(--adv-orange);
  border: 3px solid var(--adv-wood-dark);
  border-radius: 5px 14px 14px 5px;
  box-shadow: inset 0 -4px 0 rgba(117,55,20,0.22);
  font-size: 18px;
  transform: rotate(-2deg);
}

body.adventure-theme .brand-mark::before {
  content: "";
  position: absolute;
  left: -8px;
  top: -8px;
  width: 5px;
  height: 60px;
  background: #604022;
  border-radius: 4px;
}

body.adventure-theme .brand h1 {
  color: #302317;
  font-size: clamp(22px, 1.7vw, 28px);
  font-weight: 1000;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-shadow: 0 1px #f8dd9e;
}

body.adventure-theme .brand p {
  color: #5b4228;
  font-size: 14px;
  font-weight: 850;
}

body.adventure-theme .top-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

body.adventure-theme .top-actions .icon-button,
body.adventure-theme .top-actions .text-button,
body.adventure-theme .cloud-sync-status {
  min-height: 42px;
  padding: 0 12px;
  color: #3f3424;
  background: #f7e8bd;
  border: 2px solid #7d552e;
  border-radius: 9px 8px 10px 7px;
  box-shadow: 0 3px 0 rgba(76,49,29,0.35);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

body.adventure-theme .top-actions .icon-button {
  width: 44px;
  padding: 0;
  font-size: 20px;
}

body.adventure-theme .main-grid {
  height: 100%;
  min-height: 0;
}

body.adventure-theme .learn-panel {
  height: 100%;
  min-height: 0;
  padding: 10px;
  gap: 9px;
  overflow: hidden;
  background: rgba(239, 226, 185, 0.52);
  border: 2px solid rgba(76,49,29,0.34);
  border-radius: 22px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.22), 0 12px 28px rgba(39,57,31,0.16);
  backdrop-filter: blur(2px);
}

body.adventure-theme .status-strip,
body.adventure-theme .daily-panel {
  position: relative;
  color: var(--adv-ink);
  background-color: var(--adv-paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 18px, rgba(119,89,45,0.035) 19px);
  border: 3px solid var(--adv-wood-dark);
  border-radius: 10px 14px 9px 12px;
  box-shadow: 0 4px 0 rgba(76,49,29,0.28);
}

body.adventure-theme .status-strip {
  min-height: 62px;
  padding: 8px 12px 8px 60px;
}

body.adventure-theme .status-strip::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 13px;
  width: 26px;
  height: 32px;
  background: var(--adv-orange);
  border: 2px solid #743817;
  clip-path: polygon(0 0, 100% 13%, 72% 52%, 100% 88%, 0 100%);
  transform: rotate(-4deg);
}

body.adventure-theme .status-strip::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 9px;
  width: 4px;
  height: 45px;
  background: var(--adv-wood-dark);
  border-radius: 4px;
}

body.adventure-theme .eyebrow {
  color: #8d4b22;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

body.adventure-theme #deckTitle {
  color: #2e281d;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 1000;
}

body.adventure-theme .stats { gap: 8px; }

body.adventure-theme .stats span {
  min-height: 34px;
  padding: 6px 10px;
  color: #3f3a2b;
  background: #ead69f;
  border: 1px dashed #8d6b36;
  border-radius: 8px;
  font-size: 14px;
}

body.adventure-theme .stats strong {
  color: #aa4e20;
  font-size: 18px;
}

body.adventure-theme .daily-panel {
  min-height: 64px;
  padding: 9px 12px;
  grid-template-columns: minmax(0,1fr) minmax(170px,240px) auto;
}

body.adventure-theme .daily-copy h3 {
  color: #2e281d;
  font-size: 20px;
  font-weight: 1000;
}

body.adventure-theme .daily-copy p {
  color: var(--adv-muted);
  font-size: 14px;
}

body.adventure-theme .meter-track,
body.adventure-theme .mini-meter {
  background: #d1bd89;
  border: 2px solid #7b5b32;
  border-radius: 999px;
  box-shadow: inset 0 2px 3px rgba(67,43,23,0.22);
}

body.adventure-theme .meter-track span,
body.adventure-theme .mini-meter span {
  background-color: var(--adv-leaf);
  background-image: repeating-linear-gradient(135deg, transparent 0 9px, rgba(255,255,255,0.18) 10px 12px);
  border-radius: 999px;
}

body.adventure-theme .mode-tabs {
  counter-reset: adventure-step;
  position: relative;
  z-index: 2;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 10px;
  min-height: 82px;
  margin: 0;
  padding: 5px 6px 9px;
}

body.adventure-theme .mode-tabs::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 48%;
  z-index: -1;
  height: 7px;
  background: #b38a4b;
  border: 2px dashed #6a4b29;
  border-radius: 999px;
}

body.adventure-theme .mode-tab {
  --sign-tilt: 0deg;
  --mode-icon: none;
  position: relative;
  min-width: 0;
  min-height: 70px;
  padding: 8px 8px 8px 78px;
  overflow: visible;
  color: #fff8dc;
  background-color: #5d7d3c;
  border: 3px solid #4d321d;
  border-radius: 9px 13px 8px 12px;
  box-shadow: 0 5px 0 #6f4827, 0 9px 14px rgba(52,49,26,0.18);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 1000;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px #2a452d;
  transform: rotate(var(--sign-tilt));
}

body.adventure-theme .mode-tab::before {
  content: counter(adventure-step);
  counter-increment: adventure-step;
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  color: #51351e;
  background: #f3d77f;
  border: 2px solid #5a3b21;
  border-radius: 50%;
  text-shadow: none;
}

body.adventure-theme .mode-tab::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 54px;
  height: 54px;
  background-image: var(--mode-icon);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  transform: translateY(-50%);
  filter: drop-shadow(0 2px 1px rgba(54,36,20,0.32));
}

body.adventure-theme .mode-tab:nth-child(1) { --mode-icon: url("./assets/adventure-mode-cards-v2.png"); --sign-tilt: -1deg; }
body.adventure-theme .mode-tab:nth-child(2) { --mode-icon: url("./assets/adventure-mode-sound-v2.png"); --sign-tilt: 0.6deg; }
body.adventure-theme .mode-tab:nth-child(3) { --mode-icon: url("./assets/adventure-mode-meaning-v2.png"); --sign-tilt: -0.45deg; }
body.adventure-theme .mode-tab:nth-child(4) { --mode-icon: url("./assets/adventure-mode-chunks-v2.png"); --sign-tilt: 0.8deg; }
body.adventure-theme .mode-tab:nth-child(5) { --mode-icon: url("./assets/adventure-mode-final-v2.png"); --sign-tilt: -0.7deg; }
body.adventure-theme .mode-tab:nth-child(6) { --mode-icon: url("./assets/adventure-mode-review-v2.png"); --sign-tilt: 0.5deg; }

body.adventure-theme .mode-tab:hover {
  color: #fff8dc;
  transform: translateY(-3px) rotate(var(--sign-tilt));
}

body.adventure-theme .mode-tab.is-active {
  color: #fff9df;
  background: var(--adv-orange);
  border-color: #753816;
  box-shadow: 0 5px 0 #8d431b, 0 0 0 4px #f4d46d, 0 10px 18px rgba(91,47,22,0.22);
  transform: translateY(-3px) rotate(var(--sign-tilt)) scale(1.015);
}

body.adventure-theme.mode-cards .daily-panel,
body.adventure-theme.mode-sound .daily-panel,
body.adventure-theme.mode-meaning .daily-panel,
body.adventure-theme.mode-chunks .daily-panel,
body.adventure-theme.mode-final .daily-panel { display: none; }

body.adventure-theme.mode-cards .status-strip,
body.adventure-theme.mode-sound .status-strip,
body.adventure-theme.mode-meaning .status-strip,
body.adventure-theme.mode-chunks .status-strip,
body.adventure-theme.mode-final .status-strip { display: flex; }

body.adventure-theme.mode-cards .learn-panel,
body.adventure-theme.mode-sound .learn-panel,
body.adventure-theme.mode-meaning .learn-panel,
body.adventure-theme.mode-chunks .learn-panel,
body.adventure-theme.mode-final .learn-panel { grid-template-rows: auto auto minmax(0,1fr); }

body.adventure-theme .game-area {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 5px;
  overflow: hidden;
  background: transparent;
  border: 0;
}

body.adventure-theme .game-area > .stage-fitted,
body.adventure-theme .game-area > .stage-measuring {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  transform: none !important;
}

body.adventure-theme .flash-card,
body.adventure-theme .question-card,
body.adventure-theme .spell-board,
body.adventure-theme .chunk-board,
body.adventure-theme .review-panel,
body.adventure-theme .match-panel,
body.adventure-theme .empty-state {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 12px 20px 14px 36px;
  overflow: auto;
  color: var(--adv-ink);
  background-color: var(--adv-paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 24px, rgba(117,89,52,0.035) 25px), linear-gradient(90deg, rgba(255,255,255,0.3), transparent 18%, rgba(120,82,38,0.04));
  border: 4px solid var(--adv-wood-dark);
  border-radius: 20px 14px 22px 16px;
  box-shadow: 0 7px 0 rgba(77,48,27,0.38), 0 16px 30px rgba(41,55,29,0.18);
}

body.adventure-theme .flash-card::before,
body.adventure-theme .question-card::before,
body.adventure-theme .spell-board::before,
body.adventure-theme .chunk-board::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 9%;
  bottom: 9%;
  width: 9px;
  background: repeating-linear-gradient(to bottom,#4e3623 0 8px,transparent 8px 22px);
  opacity: 0.74;
}

body.adventure-theme .mode-progress {
  min-height: 42px;
  padding: 7px 12px;
  color: #443621;
  background: #e7d39c;
  border: 2px dashed #8e6a35;
  border-radius: 9px;
}

body.adventure-theme .mode-progress-head { font-size: 15px; line-height: 1.2; }
body.adventure-theme .mini-meter { height: 8px; }

body.adventure-theme.mode-cards .flash-card {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  align-content: stretch;
  gap: 8px;
  overflow: hidden;
}

body.adventure-theme.mode-cards .card-main {
  display: grid;
  grid-template-columns: minmax(300px,0.78fr) minmax(420px,1.22fr);
  grid-template-rows: auto auto auto auto auto minmax(68px,auto) auto;
  grid-template-areas: "stars picture" "word picture" "phonetic picture" "phonics picture" "meaning picture" "read picture" "rep picture";
  align-items: center;
  gap: 6px 26px;
  min-height: 0;
  padding: 2px 10px;
  overflow: hidden;
  text-align: left;
}

body.adventure-theme.mode-cards .card-main > .study-picture-block { grid-area: picture; }
body.adventure-theme.mode-cards .card-main > .stars { grid-area: stars; justify-content: flex-start; }
body.adventure-theme.mode-cards .card-main > .word-big { grid-area: word; }
body.adventure-theme.mode-cards .card-main > .phonetic-line { grid-area: phonetic; }
body.adventure-theme.mode-cards .card-main > .phonics-guide { grid-area: phonics; }
body.adventure-theme.mode-cards .card-main > .meaning-big { grid-area: meaning; }
body.adventure-theme.mode-cards .card-main > .read-once { grid-area: read; }
body.adventure-theme.mode-cards .card-main > .rep-line { grid-area: rep; }

body.adventure-theme.mode-cards .stars { min-height: 26px; gap: 5px; }
body.adventure-theme.mode-cards .star { font-size: 24px; }

body.adventure-theme.mode-cards .word-big,
body.adventure-theme.surface-compact.mode-cards .word-big {
  position: static;
  margin: 2px 0;
  color: #203550;
  font-size: clamp(54px,7.4dvh,82px);
  font-weight: 1000;
  line-height: 1;
}

body.adventure-theme.mode-cards .phonetic-line,
body.adventure-theme.surface-compact.mode-cards .phonetic-line {
  display: block;
  min-height: 28px;
  color: #6f4b2c;
  font-size: clamp(19px,2.5dvh,25px);
  font-weight: 850;
  line-height: 1.2;
}

body.adventure-theme.mode-cards .meaning-big,
body.adventure-theme.surface-compact.mode-cards .meaning-big {
  color: #2f2a1f;
  font-size: clamp(25px,3.3dvh,35px);
  font-weight: 1000;
  line-height: 1.25;
}

body.adventure-theme.mode-cards .lookup-note,
body.adventure-theme.mode-cards .example { display: none; }

body.adventure-theme .phonics-guide,
body.adventure-theme.surface-compact .phonics-guide {
  width: 100%;
  max-width: 520px;
  margin: 0;
  padding: 7px 9px;
  gap: 5px;
  background: #efe0b5;
  border: 2px dashed #97713e;
  border-radius: 10px;
}

body.adventure-theme .phonics-title,
body.adventure-theme.surface-compact .phonics-title {
  color: #57442d;
  font-size: 15px;
  line-height: 1.25;
}

body.adventure-theme .phonics-row { gap: 6px; }

body.adventure-theme .phonics-chip,
body.adventure-theme .chunk-button,
body.adventure-theme .phonics-slot,
body.adventure-theme .answer-slot,
body.adventure-theme .tile-button {
  min-width: 46px;
  min-height: 38px;
  padding: 5px 9px;
  color: #3d3427;
  background: #f2ce70;
  border: 2px solid #704a27;
  border-radius: 8px;
  box-shadow: 0 3px 0 #8d6135;
  font-size: 19px;
}

body.adventure-theme .study-picture-block {
  align-self: stretch;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  overflow: hidden;
}

body.adventure-theme .study-picture-strip {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  gap: 12px;
  overflow: hidden;
}

body.adventure-theme .study-picture-strip.has-one { grid-template-columns: minmax(0,1fr); }

body.adventure-theme .study-picture-strip.has-two {
  grid-template-columns: minmax(0,3fr) minmax(150px,1fr);
  align-items: stretch;
}

body.adventure-theme .study-picture-item.meaning-picture.is-card,
body.adventure-theme.surface-compact .study-picture-item.meaning-picture.is-card {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 150px;
  padding: 9px;
  overflow: hidden;
  background: #fffaf0;
  border: 4px solid #5c4229;
  border-radius: 13px 16px 12px 15px;
  box-shadow: 0 5px 0 rgba(86,59,34,0.22);
}

body.adventure-theme .study-picture-item.meaning-picture img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0;
}

body.adventure-theme .study-picture-strip.has-two .study-picture-item.is-reference {
  align-self: end;
  height: min(62%,260px);
  min-height: 135px;
  border-width: 3px;
  transform: rotate(1.2deg);
}

body.adventure-theme .study-picture-item.is-memory {
  outline: 4px solid rgba(102,137,66,0.34);
  outline-offset: -9px;
}

body.adventure-theme .study-picture-item.is-reference {
  background: #efe0ba;
  border-color: #7b5933;
}

body.adventure-theme .meaning-picture .study-picture-tag {
  top: 8px;
  left: 8px;
  padding: 5px 10px;
  color: #fff8dc;
  background: var(--adv-forest);
  border: 2px solid #2b4a2d;
  border-radius: 7px;
  box-shadow: 0 2px 0 #25402a;
  font-size: 13px;
}

body.adventure-theme .study-picture-item.is-reference .study-picture-tag {
  background: var(--adv-lake);
  border-color: #244a5a;
}

body.adventure-theme .picture-draw-entry {
  justify-self: center;
  min-height: 42px;
  padding: 8px 20px;
  color: #fff9df;
  background: var(--adv-forest);
  border: 2px solid #29472d;
  border-radius: 9px;
  box-shadow: 0 4px 0 #29472d;
  font-size: 16px;
  font-weight: 1000;
}

body.adventure-theme .read-once {
  min-height: 66px;
  padding: 8px 10px;
  color: #443620;
  background: #e9d49d;
  border: 2px solid #8b6839;
  border-radius: 10px;
}

body.adventure-theme .read-once-label,
body.adventure-theme .read-once strong { font-size: 15px; }

body.adventure-theme .read-once-button,
body.adventure-theme .read-speak-button,
body.adventure-theme .read-playback-button { min-height: 40px; font-size: 15px; }

body.adventure-theme .rep-line {
  min-height: 22px;
  color: #5c503b;
  font-size: 15px;
  font-weight: 850;
}

body.adventure-theme .card-actions {
  gap: 10px;
  padding: 7px;
  background: rgba(221,196,139,0.62);
  border: 1px dashed #8d6938;
  border-radius: 12px;
}

body.adventure-theme .card-actions button,
body.adventure-theme .primary-button,
body.adventure-theme .soft-button,
body.adventure-theme .next-button,
body.adventure-theme .choice-button {
  min-height: 46px;
  padding: 0 18px;
  border-width: 2px;
  border-style: solid;
  border-radius: 10px 12px 9px 11px;
  font-size: 17px;
  font-weight: 1000;
  transition: transform 120ms ease,box-shadow 120ms ease,background-color 120ms ease;
}

body.adventure-theme .primary-button,
body.adventure-theme .next-button {
  color: #fff9e4;
  background: var(--adv-orange);
  border-color: #713717;
  box-shadow: 0 5px 0 #8e431c;
}

body.adventure-theme .soft-button {
  color: #3f3424;
  background: #efdfb5;
  border-color: #80603a;
  box-shadow: 0 4px 0 #a17a45;
}

body.adventure-theme .choice-button {
  min-height: 72px;
  color: #333021;
  background: #f3dfad;
  border-color: #74502e;
  box-shadow: 0 5px 0 #9d7441;
  font-size: clamp(23px,3vw,34px);
}

body.adventure-theme .choice-button.is-correct { color: #fff; background: var(--adv-forest); border-color: #27492f; }
body.adventure-theme .choice-button.is-wrong { color: #fff; background: #b8593f; border-color: #703426; }

body.adventure-theme .question-card,
body.adventure-theme .spell-board,
body.adventure-theme .chunk-board { align-content: start; gap: 12px; }

body.adventure-theme .question-top { gap: 10px; }
body.adventure-theme .question-label { color: #70401f; font-size: 17px; font-weight: 1000; }

body.adventure-theme .question-prompt,
body.adventure-theme.surface-compact .question-prompt {
  color: #203550;
  font-size: clamp(38px,6.5dvh,62px);
  line-height: 1.1;
}

body.adventure-theme .choices { gap: 12px; }
body.adventure-theme .feedback { min-height: 30px; font-size: 18px; }

body.adventure-theme .progressive-picture .meaning-picture.is-question {
  width: clamp(150px,19dvh,220px);
  height: clamp(105px,13.5dvh,155px);
  border-color: #74502e;
}

body.adventure-theme .parent-panel {
  color: var(--adv-ink);
  background-color: var(--adv-paper);
  background-image: repeating-linear-gradient(0deg,transparent 0 22px,rgba(107,80,44,0.04) 23px);
  border-left: 5px solid var(--adv-wood-dark);
  box-shadow: -12px 0 30px rgba(42,45,27,0.3);
}

body.adventure-theme .parent-panel .panel-heading {
  background: #e5c985;
  border: 2px solid #76502b;
  border-radius: 10px;
}

body.adventure-theme .cover-screen {
  background-color: #a9c992;
  background-image: linear-gradient(rgba(248,237,207,0.08),rgba(231,214,162,0.1)), url("./assets/adventure-camp-bg-v1.png");
  background-position: center;
  background-size: cover;
}

body.adventure-theme .cover-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background: url("./assets/adventure-guides-v1.png") center bottom / min(1180px,82vw) auto no-repeat;
  pointer-events: none;
}

body.adventure-theme .cover-card {
  z-index: 2;
  width: min(780px,94vw);
  color: var(--adv-ink);
  background-color: rgba(248,237,207,0.97);
  background-image: repeating-linear-gradient(0deg,transparent 0 24px,rgba(108,77,37,0.035) 25px);
  border: 5px solid var(--adv-wood-dark);
  border-radius: 18px 13px 21px 15px;
  box-shadow: 0 11px 0 rgba(76,49,29,0.42),0 28px 65px rgba(37,55,28,0.38);
}

body.adventure-theme .cover-card h1 {
  color: #2f291f;
  font-size: clamp(38px,5vw,64px);
  text-shadow: 0 2px #f5d98e;
}

body.adventure-theme .cover-card p { color: #5d533e; font-size: 17px; }

body.adventure-theme .cover-people {
  padding: 8px;
  background: rgba(232,208,145,0.66);
  border: 2px dashed #8b6837;
  border-radius: 14px;
}

body.adventure-theme .profile-choice {
  min-height: 88px;
  color: #fff7dd;
  background: var(--adv-forest);
  border: 3px solid var(--adv-wood-dark);
  border-radius: 10px 14px 9px 12px;
  box-shadow: 0 6px 0 #674222,0 12px 20px rgba(48,55,29,0.2);
}

body.adventure-theme .profile-choice:nth-child(2) { background: #3f7480; }
body.adventure-theme .profile-choice strong { font-size: clamp(26px,3vw,36px); }
body.adventure-theme .profile-choice .choice-copy span { color: #f4e6bd; font-size: 15px; }
body.adventure-theme .choice-arrow { color: #4b331e; background: var(--adv-gold); border: 2px solid #593a20; }

body.adventure-theme.surface-compact .topbar { min-height: 62px; padding: 7px 14px; }
body.adventure-theme.surface-compact .brand-mark { width: 50px; height: 40px; flex-basis: 50px; }
body.adventure-theme.surface-compact .brand h1 { font-size: 21px; }

body.adventure-theme.surface-compact .top-actions .icon-button,
body.adventure-theme.surface-compact .top-actions .text-button,
body.adventure-theme.surface-compact .cloud-sync-status { min-height: 39px; font-size: 14px; }

body.adventure-theme.surface-compact.mode-cards .status-strip,
body.adventure-theme.surface-compact.mode-sound .status-strip,
body.adventure-theme.surface-compact.mode-meaning .status-strip,
body.adventure-theme.surface-compact.mode-chunks .status-strip,
body.adventure-theme.surface-compact.mode-final .status-strip { display: none; }

body.adventure-theme.surface-compact.mode-cards .learn-panel,
body.adventure-theme.surface-compact.mode-sound .learn-panel,
body.adventure-theme.surface-compact.mode-meaning .learn-panel,
body.adventure-theme.surface-compact.mode-chunks .learn-panel,
body.adventure-theme.surface-compact.mode-final .learn-panel {
  grid-template-rows: auto minmax(0,1fr);
  gap: 7px;
  padding: 7px;
}

body.adventure-theme.surface-compact .mode-tabs { min-height: 74px; gap: 8px; }
body.adventure-theme.surface-compact .mode-tab { min-height: 66px; padding: 7px 7px 7px 70px; font-size: 15px; }
body.adventure-theme.surface-compact .mode-tab::after { left: 21px; width: 48px; height: 48px; }
body.adventure-theme.surface-compact .game-area { padding: 3px; }
body.adventure-theme.surface-compact.mode-cards .flash-card { padding: 8px 16px 10px 34px; gap: 6px; }

body.adventure-theme.surface-compact.mode-cards .card-main {
  grid-template-columns: minmax(280px,0.82fr) minmax(380px,1.18fr);
  gap: 4px 20px;
  overflow: hidden;
}

body.adventure-theme.surface-compact.mode-cards .star { font-size: 20px; }
body.adventure-theme.surface-compact .mode-progress { min-height: 36px; padding: 5px 10px; }
body.adventure-theme.surface-compact .mode-progress-head { font-size: 14px; }
body.adventure-theme.surface-compact .read-once { min-height: 58px; padding: 6px 8px; }
body.adventure-theme.surface-compact .card-actions button { min-height: 42px; font-size: 16px; }

@media (max-height: 840px) {
  body.adventure-theme.mode-cards .status-strip,
  body.adventure-theme.mode-sound .status-strip,
  body.adventure-theme.mode-meaning .status-strip,
  body.adventure-theme.mode-chunks .status-strip,
  body.adventure-theme.mode-final .status-strip { display: none; }

  body.adventure-theme.mode-cards .learn-panel,
  body.adventure-theme.mode-sound .learn-panel,
  body.adventure-theme.mode-meaning .learn-panel,
  body.adventure-theme.mode-chunks .learn-panel,
  body.adventure-theme.mode-final .learn-panel {
    grid-template-rows: auto minmax(0,1fr);
    gap: 7px;
    padding: 7px;
  }

  body.adventure-theme .app-shell { padding-top: 7px; }
  body.adventure-theme .topbar { min-height: 60px; padding-block: 6px; }
  body.adventure-theme .mode-tabs { min-height: 72px; padding-block: 3px 7px; }
  body.adventure-theme .mode-tab { min-height: 64px; padding-left: 69px; font-size: 15px; }
  body.adventure-theme .mode-tab::after { left: 21px; width: 47px; height: 47px; }
  body.adventure-theme.mode-cards .flash-card { padding-block: 7px 9px; }

  body.adventure-theme.mode-cards .word-big,
  body.adventure-theme.surface-compact.mode-cards .word-big { font-size: clamp(48px,7.5dvh,68px); }

  body.adventure-theme.mode-cards .stars { display: none; }

  body.adventure-theme.mode-cards .card-main {
    grid-template-rows: auto auto auto auto minmax(58px,auto) auto;
    grid-template-areas: "word picture" "phonetic picture" "phonics picture" "meaning picture" "read picture" "rep picture";
  }

  body.adventure-theme .read-once { min-height: 56px; }
}

@media (max-width: 1160px) {
  body.adventure-theme .brand { min-width: 230px; }
  body.adventure-theme .brand h1 { font-size: 20px; }
  body.adventure-theme .cloud-sync-status { display: none; }
  body.adventure-theme .mode-tab { padding-left: 65px; font-size: 14px; }
  body.adventure-theme .mode-tab::after { left: 19px; width: 45px; height: 45px; }

  body.adventure-theme.mode-cards .card-main {
    grid-template-columns: minmax(250px,0.82fr) minmax(340px,1.18fr);
    gap: 5px 16px;
  }
}

@media (max-width: 820px) {
  body.adventure-theme .app-shell { width: calc(100% - 10px); padding-inline: 4px; }
  body.adventure-theme .topbar { align-items: flex-start; flex-wrap: wrap; }
  body.adventure-theme .brand { min-width: 0; }
  body.adventure-theme .top-actions { width: 100%; overflow-x: auto; }
  body.adventure-theme .mode-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); min-height: 142px; }
  body.adventure-theme .mode-tabs::before { display: none; }
  body.adventure-theme.mode-cards .card-main { grid-template-columns: minmax(210px,0.9fr) minmax(260px,1.1fr); }
  body.adventure-theme .study-picture-strip.has-two { grid-template-columns: minmax(0,2.5fr) minmax(100px,1fr); }
}

@media (max-width: 620px) {
  body.adventure-theme .app-shell { height: 100dvh; }

  body.adventure-theme.mode-cards .card-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    text-align: center;
  }

  body.adventure-theme.mode-cards .card-main > .stars { justify-content: center; }
  body.adventure-theme .study-picture-block { min-height: 300px; }
  body.adventure-theme .cover-screen::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.adventure-theme .mode-tab,
  body.adventure-theme .profile-choice,
  body.adventure-theme button { transition: none; }
}


/* Forest adventure v3: iPad landscape, readable meanings, album wall and camp calendar. */

/* Completed stages remain readable instead of fading into the pale track. */
body.adventure-theme .mode-tab:disabled {
  opacity: 1;
  color: #fff6d6;
  background: #60794a;
  border-color: #4d321d;
  filter: saturate(0.82);
  text-shadow: 0 1px #2a452d;
  cursor: default;
}

body.adventure-theme .mode-tab:disabled::after {
  opacity: 0.86;
  filter: saturate(0.78) drop-shadow(0 2px 1px rgba(54,36,20,0.32));
}

/* Reference pictures never carry a label over the artwork. */
body.adventure-theme .study-picture-item.is-reference .study-picture-tag {
  display: none;
}

/* Meaning choice: keep long Chinese clues child-sized and inside their own column. */
body.adventure-theme.mode-meaning .question-card,
body.adventure-theme.surface-compact.mode-meaning .question-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  overflow: hidden;
}

body.adventure-theme.mode-meaning .question-top,
body.adventure-theme.surface-compact.mode-meaning .question-top {
  width: min(100%, 940px);
  grid-template-columns: minmax(118px, 158px) minmax(0, 1fr);
  grid-template-areas:
    "label rep"
    "picture prompt";
  column-gap: clamp(16px, 2vw, 28px);
  row-gap: 6px;
  padding: 2px 8px 6px;
}

body.adventure-theme.mode-meaning .question-top .choice-progressive-picture,
body.adventure-theme.surface-compact.mode-meaning .question-top .choice-progressive-picture {
  width: 100%;
  justify-self: stretch;
}

body.adventure-theme.mode-meaning .choice-progressive-picture .study-picture-hidden,
body.adventure-theme.surface-compact.mode-meaning .choice-progressive-picture .study-picture-hidden {
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  color: #5b503c;
  background: #ead9a9;
  border: 1px dashed #95703d;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.25;
}

body.adventure-theme.mode-meaning .question-top .question-prompt,
body.adventure-theme.surface-compact.mode-meaning .question-top .question-prompt {
  justify-self: stretch;
  max-width: 680px;
  color: #203550;
  font-size: clamp(25px, 3.5dvh, 34px);
  line-height: 1.2;
  text-align: left;
  text-wrap: balance;
}

body.adventure-theme.mode-meaning .meaning-prompt.meaning-small,
body.adventure-theme.surface-compact.mode-meaning .meaning-prompt.meaning-small {
  font-size: clamp(23px, 3.15dvh, 31px);
  line-height: 1.22;
}

body.adventure-theme.mode-meaning .meaning-prompt.meaning-smaller,
body.adventure-theme.surface-compact.mode-meaning .meaning-prompt.meaning-smaller {
  font-size: clamp(21px, 2.8dvh, 28px);
  line-height: 1.25;
}

body.adventure-theme.mode-meaning .meaning-prompt.meaning-tiny,
body.adventure-theme.surface-compact.mode-meaning .meaning-prompt.meaning-tiny {
  font-size: clamp(18px, 2.45dvh, 24px);
  line-height: 1.3;
}

body.adventure-theme.mode-meaning .choice-progressive-picture .meaning-picture.is-question,
body.adventure-theme.surface-compact.mode-meaning .choice-progressive-picture .meaning-picture.is-question {
  width: 100%;
  height: clamp(82px, 12dvh, 112px);
}

/* iPad Pro landscape: the spelling question and keyboard share one screen. */
@media (orientation: landscape) and (min-width: 900px) {
  body.adventure-theme.mode-final .spell-board,
  body.adventure-theme.surface-compact.mode-final .spell-board {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(520px, 1.28fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "progress progress"
      "question keyboard"
      "slots keyboard"
      "controls feedback"
      "continue continue";
    align-items: center;
    align-content: stretch;
    column-gap: clamp(22px, 3vw, 48px);
    row-gap: 7px;
    padding: 10px 28px 11px 40px;
    overflow: hidden;
  }

  body.adventure-theme.mode-final .spell-board > .mode-progress {
    grid-area: progress;
    width: min(100%, 620px);
  }

  body.adventure-theme.mode-final .spell-board > .question-top {
    grid-area: question;
    align-content: center;
    align-self: stretch;
    gap: 5px;
    width: 100%;
    min-height: 0;
    padding: 0;
  }

  body.adventure-theme.mode-final .spell-progressive-picture,
  body.adventure-theme.mode-final .spell-progressive-picture .study-picture-block,
  body.adventure-theme.mode-final .spell-progressive-picture .study-picture-strip {
    width: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body.adventure-theme.mode-final .spell-progressive-picture .meaning-picture.is-question {
    width: clamp(104px, 15dvh, 132px);
    height: clamp(74px, 10.6dvh, 94px);
    min-height: 0;
    padding: 5px;
    border-width: 2px;
    box-shadow: 0 3px 0 rgba(86,59,34,0.2);
  }

  body.adventure-theme.mode-final .question-top .meaning-big,
  body.adventure-theme.surface-compact.mode-final .question-top .meaning-big {
    max-width: 430px;
    color: #31445a;
    font-size: clamp(18px, 2.55dvh, 23px);
    line-height: 1.22;
    text-wrap: balance;
  }

  body.adventure-theme.mode-final .question-top .question-label {
    font-size: 15px;
  }

  body.adventure-theme.mode-final .question-top .rep-line {
    min-height: 18px;
    font-size: 13px;
  }

  body.adventure-theme.mode-final .question-top .big-round {
    min-width: 48px;
    min-height: 42px;
    font-size: 19px;
  }

  body.adventure-theme.mode-final .spell-board > .answer-slots {
    grid-area: slots;
    align-self: start;
    min-height: 52px;
    gap: 6px;
    padding: 4px;
  }

  body.adventure-theme.mode-final .answer-slot {
    width: 44px;
    height: 48px;
    min-width: 44px;
    min-height: 48px;
    padding: 2px;
    font-size: 25px;
  }

  body.adventure-theme.mode-final .spell-board > .qwerty-bank {
    grid-area: keyboard;
    align-self: center;
    width: min(100%, 720px);
    gap: 8px;
    padding: 8px 10px;
    background: rgba(226, 201, 143, 0.44);
    border: 2px dashed #8b6838;
    border-radius: 14px;
  }

  body.adventure-theme.mode-final .keyboard-row {
    gap: 7px;
  }

  body.adventure-theme.mode-final .qwerty-bank .tile-button {
    width: 100%;
    height: clamp(42px, 5.6dvh, 52px);
    min-height: 42px;
    aspect-ratio: auto;
    padding: 0;
    font-size: clamp(19px, 2.7dvh, 24px);
  }

  body.adventure-theme.mode-final .spell-board > .spell-controls {
    grid-area: controls;
    justify-content: center;
  }

  body.adventure-theme.mode-final .spell-board > .feedback {
    grid-area: feedback;
    justify-self: center;
    min-height: 24px;
    font-size: 15px;
  }

  body.adventure-theme.mode-final .spell-board > .wrong-continue-button {
    grid-area: continue;
    justify-self: center;
  }
}


/* Settings drawer: field journal styling with buttons that wrap instead of colliding. */
body.adventure-theme .parent-panel {
  width: min(720px, 100vw);
  padding: 16px 18px 22px;
  background-color: #f5e7c1;
  background-image:
    linear-gradient(90deg, transparent 0 31px, rgba(157, 76, 38, 0.16) 32px 33px, transparent 34px),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(91, 118, 76, 0.08) 28px 29px);
}

body.adventure-theme .parent-panel .panel-heading {
  top: -16px;
  z-index: 3;
  margin: -16px -18px 14px;
  padding: 14px 18px;
  background-color: #dfbd74;
  background-image: repeating-linear-gradient(3deg, transparent 0 14px, rgba(85, 51, 24, 0.05) 15px 16px);
  border: 0;
  border-bottom: 4px solid #604020;
  border-radius: 0;
  box-shadow: 0 5px 0 rgba(76, 49, 29, 0.22);
}

body.adventure-theme .parent-panel .panel-heading h2 {
  color: #2d281e;
  font-size: 28px;
}

body.adventure-theme .settings-section {
  margin: 10px 0;
  padding: 12px 14px 14px;
  border: 2px solid #8e6b3d;
  border-radius: 10px 14px 9px 12px;
  background: rgba(250, 240, 208, 0.92);
  box-shadow: 0 4px 0 rgba(98, 67, 35, 0.18);
}

body.adventure-theme .settings-section[open] {
  border-color: #5d7446;
  box-shadow: 0 4px 0 rgba(67, 89, 49, 0.2);
}

body.adventure-theme .settings-section summary {
  color: #2f4c35;
  font-size: 17px;
  line-height: 1.35;
}

body.adventure-theme .field-label,
body.adventure-theme .setting-title,
body.adventure-theme .range-field span,
body.adventure-theme .select-field span {
  color: #3f392c;
  font-size: 15px;
}

body.adventure-theme .helper-copy,
body.adventure-theme .history-image-summary,
body.adventure-theme .history-import-summary {
  color: #655b46;
  font-size: 14px;
  line-height: 1.55;
}

body.adventure-theme .text-input,
body.adventure-theme .word-input,
body.adventure-theme .select-field select {
  color: #27384a;
  background: #fffaf0;
  border: 2px solid #9b7b4a;
  border-radius: 9px;
  font-size: 16px;
  box-shadow: inset 0 2px 4px rgba(81, 54, 29, 0.08);
}

body.adventure-theme .word-input {
  min-height: 132px;
  line-height: 1.55;
}

body.adventure-theme .import-actions,
body.adventure-theme .file-row,
body.adventure-theme .history-image-actions,
body.adventure-theme .history-import-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.adventure-theme .parent-panel .primary-button,
body.adventure-theme .parent-panel .soft-button,
body.adventure-theme .parent-panel .danger-button {
  min-width: 0;
  min-height: 46px;
  height: auto;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.adventure-theme .shanbay-bridge-check,
body.adventure-theme .preview-box {
  border: 2px solid #b88b53;
  background: rgba(255, 248, 222, 0.9);
  border-radius: 10px;
  font-size: 14px;
}

body.adventure-theme .history-image-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.adventure-theme .history-image-row {
  grid-template-columns: 26px 104px minmax(0, 1fr);
  min-height: 94px;
  border: 2px solid #b59660;
  background: #fff9e9;
  box-shadow: 0 3px 0 rgba(94, 63, 32, 0.14);
}

body.adventure-theme .history-image-thumbnail {
  width: 104px;
  height: 76px;
  border-color: #9f7c49;
  background: #f4e5bb;
}

body.adventure-theme .history-image-word strong {
  font-size: 17px;
}

body.adventure-theme .history-image-word span {
  color: #625845;
  font-size: 13px;
}


/* Growth wall: a ranger's field album rather than a plain vertical list. */
body.adventure-theme .growth-modal,
body.adventure-theme .calendar-modal {
  background: rgba(25, 49, 35, 0.7);
  backdrop-filter: blur(4px);
}

body.adventure-theme .growth-card {
  width: min(1100px, calc(100vw - 30px));
  padding: 18px;
  gap: 16px;
  color: var(--adv-ink);
  background-color: #ead9aa;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(74, 104, 55, 0.11) 0 5px, transparent 6px),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(105, 79, 40, 0.045) 29px);
  border: 7px solid #54361f;
  border-radius: 18px 13px 22px 15px;
  box-shadow: 0 12px 0 rgba(50, 31, 18, 0.38), 0 28px 70px rgba(15, 34, 23, 0.42);
}

body.adventure-theme .growth-card > .panel-heading,
body.adventure-theme .calendar-card > .panel-heading {
  padding: 10px 14px;
  background: #ddbb70;
  border: 3px solid #65431f;
  border-radius: 10px 14px 9px 12px;
  box-shadow: 0 4px 0 rgba(76, 49, 29, 0.24);
}

body.adventure-theme .growth-card .panel-heading h2,
body.adventure-theme .calendar-card .panel-heading h2 {
  color: #2d281e;
  font-size: clamp(25px, 3vw, 34px);
}

body.adventure-theme .growth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 18px;
  padding: 10px 9px 14px;
}

body.adventure-theme .growth-item {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 300px;
  padding: 10px 10px 0;
  overflow: visible;
  background: #fffaf0;
  border: 2px solid #8b6d44;
  border-radius: 4px;
  box-shadow: 0 7px 0 rgba(87, 58, 31, 0.2), 0 13px 22px rgba(50, 55, 31, 0.16);
  transform: rotate(-0.55deg);
}

body.adventure-theme .growth-item:nth-child(3n + 2) {
  transform: rotate(0.7deg);
}

body.adventure-theme .growth-item:nth-child(3n) {
  transform: rotate(-0.2deg);
}

body.adventure-theme .growth-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -9px;
  width: 74px;
  height: 19px;
  background: rgba(224, 191, 112, 0.78);
  border: 1px solid rgba(120, 83, 40, 0.38);
  transform: translateX(-50%) rotate(-2deg);
}

body.adventure-theme .growth-photo {
  height: auto;
  min-height: 190px;
  aspect-ratio: 4 / 3;
  border: 2px solid #6a5033;
  background: #dce6ce;
}

body.adventure-theme .growth-photo img {
  background: #e7eddc;
  object-fit: contain;
}

body.adventure-theme .growth-meta {
  padding: 12px 5px 14px;
  background: transparent;
}

body.adventure-theme .growth-meta strong {
  color: #2f4733;
  font-size: 19px;
}

body.adventure-theme .growth-meta > span,
body.adventure-theme .growth-meta > small {
  color: #665b45;
  font-size: 13px;
}

body.adventure-theme .growth-sticker {
  border-color: #6d5030;
  box-shadow: 0 4px 0 rgba(76, 49, 29, 0.18);
}

body.adventure-theme .growth-empty {
  grid-column: 1 / -1;
  min-height: 360px;
  color: #2f4733;
  background:
    linear-gradient(rgba(244, 234, 199, 0.86), rgba(244, 234, 199, 0.86)),
    url("./assets/adventure-camp-bg-v1.png") center / cover;
  border: 3px dashed #68804d;
  border-radius: 16px;
}

body.adventure-theme .growth-empty strong {
  font-size: 28px;
}

body.adventure-theme .growth-empty span {
  color: #5d573f;
  font-size: 16px;
}

body.adventure-theme .wall-danger-zone {
  color: #665b45;
  font-size: 13px;
}

body.adventure-theme .photo-preview {
  background: rgba(20, 39, 29, 0.82);
  backdrop-filter: blur(5px);
}

body.adventure-theme .photo-preview-card img {
  border: 14px solid #f7edcf;
  border-bottom-width: 48px;
  border-radius: 5px;
  box-shadow: 0 0 0 6px #5b3c22, 0 24px 70px rgba(0, 0, 0, 0.46);
}


/* Check-in calendar: a camp stamp board with clear, large day targets. */
body.adventure-theme .calendar-card {
  width: min(680px, calc(100vw - 30px));
  padding: 18px;
  gap: 13px;
  color: var(--adv-ink);
  background-color: #f5e8c5;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(92, 113, 72, 0.065) 28px);
  border: 7px solid #54361f;
  border-radius: 17px 13px 20px 15px;
  box-shadow: 0 12px 0 rgba(50, 31, 18, 0.36), 0 28px 70px rgba(15, 34, 23, 0.42);
}

body.adventure-theme .calendar-card .calendar-head {
  padding: 4px 3px;
}

body.adventure-theme .calendar-card .calendar-head strong {
  color: #2f4733;
  font-size: 21px;
}

body.adventure-theme .calendar-card .calendar-head p {
  color: #665b45;
  font-size: 14px;
}

body.adventure-theme .calendar-actions .icon-button,
body.adventure-theme .growth-card .icon-button,
body.adventure-theme .calendar-card .icon-button {
  color: #fff8de;
  background: #527044;
  border: 2px solid #2f492f;
  box-shadow: 0 3px 0 #2e462d;
}

body.adventure-theme .calendar-card .week-reward {
  min-height: 68px;
  padding: 10px 12px;
  color: #47351e;
  background: #e7c875;
  border: 2px dashed #795626;
  border-radius: 11px;
  box-shadow: inset 0 0 0 3px rgba(255, 245, 199, 0.35);
}

body.adventure-theme .calendar-card .week-reward strong {
  font-size: 17px;
}

body.adventure-theme .calendar-card .week-reward p {
  color: #625038;
  font-size: 13px;
}

body.adventure-theme .calendar-weekdays,
body.adventure-theme .calendar-grid {
  gap: 7px;
}

body.adventure-theme .calendar-weekdays span {
  color: #4b653d;
  font-size: 14px;
}

body.adventure-theme .calendar-day {
  min-height: 58px;
  color: #3e382c;
  background: #fff8e5;
  border: 2px solid #aa8c58;
  border-radius: 9px 12px 8px 11px;
  font-size: 15px;
  box-shadow: 0 3px 0 rgba(97, 67, 34, 0.14);
}

body.adventure-theme .calendar-day.is-outside {
  opacity: 0.38;
  filter: saturate(0.5);
}

body.adventure-theme .calendar-day.is-progress {
  color: #305160;
  background: #dce9df;
  border-color: #66856e;
}

body.adventure-theme .calendar-day.is-today {
  color: #683215;
  background: #f5d18a;
  border-color: #c05c20;
  box-shadow: inset 0 0 0 2px #fff0b8, 0 3px 0 rgba(111, 54, 24, 0.23);
}

body.adventure-theme .calendar-day.is-checked {
  color: #fff8df;
  background: #557648;
  border-color: #2f4d32;
  box-shadow: inset 0 0 0 2px rgba(245, 224, 153, 0.38), 0 3px 0 #30482f;
}

body.adventure-theme .calendar-day .day-mark {
  color: #f4cf68;
  font-size: 17px;
}

body.adventure-theme .calendar-day.is-full-week::after {
  color: #f6d369;
  font-size: 13px;
}

@media (max-height: 760px) {
  body.adventure-theme .calendar-card {
    padding: 12px 14px;
    gap: 8px;
  }

  body.adventure-theme .calendar-card > .panel-heading {
    padding: 6px 10px;
  }

  body.adventure-theme .calendar-card .week-reward {
    min-height: 52px;
    padding: 7px 10px;
  }

  body.adventure-theme .calendar-day {
    min-height: 43px;
    font-size: 13px;
  }

  body.adventure-theme .calendar-day .day-mark {
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  body.adventure-theme .parent-panel {
    width: 100vw;
  }

  body.adventure-theme .import-actions,
  body.adventure-theme .file-row,
  body.adventure-theme .history-image-actions,
  body.adventure-theme .history-import-actions,
  body.adventure-theme .history-image-preview {
    grid-template-columns: 1fr;
  }

  body.adventure-theme .growth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.adventure-theme .growth-grid {
    grid-template-columns: 1fr;
  }

  body.adventure-theme .growth-item {
    transform: none;
  }
}

/* Two available memory images stay inside the compact meaning-picture column. */
body.adventure-theme.mode-meaning .choice-progressive-picture .study-picture-strip.has-two,
body.adventure-theme.surface-compact.mode-meaning .choice-progressive-picture .study-picture-strip.has-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

body.adventure-theme.mode-meaning .choice-progressive-picture .study-picture-strip.has-two .study-picture-item.is-reference,
body.adventure-theme.surface-compact.mode-meaning .choice-progressive-picture .study-picture-strip.has-two .study-picture-item.is-reference {
  align-self: stretch;
  width: 100%;
  height: clamp(82px, 12dvh, 112px);
  min-height: 0;
  transform: none;
}

/* Forest adventure v4: visual self-audit fixes. */

/* Inactive stage signs must stay readable in every browser state. */
body.adventure-theme .mode-tab:not(.is-active) {
  opacity: 1 !important;
  color: #fff8dc !important;
  background: #5d7d3c !important;
  border-color: #4d321d !important;
  text-shadow: 0 1px #2a452d !important;
  filter: none;
}

body.adventure-theme .mode-tab:not(.is-active):disabled {
  color: #fff4ce !important;
  background: #60794a !important;
  filter: saturate(0.82);
}

body.adventure-theme .mode-tab.is-active {
  color: #fff9df !important;
  background: var(--adv-orange) !important;
}

/* The spelling card owns the single drawing entry in its bottom action bar. */
body.adventure-theme.mode-cards .picture-draw-entry {
  display: none;
}

/* Center the entire reading column, not just the English word. */
body.adventure-theme.mode-cards .card-main > .stars,
body.adventure-theme.mode-cards .card-main > .word-big,
body.adventure-theme.mode-cards .card-main > .phonetic-line,
body.adventure-theme.mode-cards .card-main > .phonics-guide,
body.adventure-theme.mode-cards .card-main > .meaning-big,
body.adventure-theme.mode-cards .card-main > .read-once,
body.adventure-theme.mode-cards .card-main > .rep-line {
  justify-self: center;
}

body.adventure-theme.mode-cards .card-main > .stars {
  justify-content: center;
}

body.adventure-theme.mode-cards .card-main > .word-big,
body.adventure-theme.mode-cards .card-main > .phonetic-line,
body.adventure-theme.mode-cards .card-main > .phonics-guide,
body.adventure-theme.mode-cards .card-main > .meaning-big,
body.adventure-theme.mode-cards .card-main > .rep-line {
  width: min(100%, 540px);
  text-align: center;
}

body.adventure-theme.mode-cards .card-main > .meaning-big {
  text-wrap: balance;
  overflow-wrap: anywhere;
}

body.adventure-theme.mode-cards .phonics-row {
  justify-content: center;
}

/* Center Chinese clues in every question mode while keeping the picture beside them. */
body.adventure-theme.mode-meaning .question-top .question-prompt,
body.adventure-theme.surface-compact.mode-meaning .question-top .question-prompt {
  justify-self: center;
  text-align: center;
}

body.adventure-theme.mode-chunks .question-top .meaning-big,
body.adventure-theme.mode-final .question-top .meaning-big,
body.adventure-theme .mode-complete {
  text-align: center;
}

body.adventure-theme.mode-chunks .question-top .meaning-big {
  max-width: 620px;
  font-size: clamp(19px, 2.8dvh, 26px);
  line-height: 1.24;
  text-wrap: balance;
}

/* Tiny image labels obscure children's art; the border still distinguishes drawings. */
body.adventure-theme .review-picture-tag {
  display: none;
}

/* Review cards: prevent long words and recordings from pushing outside their cards. */
body.adventure-theme .review-page-grid {
  gap: 10px;
}

body.adventure-theme .review-item {
  min-width: 0;
  overflow: hidden;
  color: #2d281e;
  background: #fff8e7;
  border: 2px solid #9a7a4b;
  box-shadow: 0 3px 0 rgba(85, 57, 31, 0.16);
}

body.adventure-theme .review-item.is-selected {
  color: #263f2d;
  background: #e2edcf;
  border-color: #517044;
  box-shadow: inset 0 0 0 2px rgba(244, 210, 111, 0.42), 0 3px 0 rgba(52, 77, 47, 0.2);
}

body.adventure-theme .review-compact-copy,
body.adventure-theme .review-word,
body.adventure-theme .review-meta {
  min-width: 0;
  max-width: 100%;
}

body.adventure-theme .review-word {
  color: #203550;
  overflow-wrap: anywhere;
}

body.adventure-theme .review-recording {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep action rows centered when labels wrap on narrow iPad split views. */
body.adventure-theme .card-actions,
body.adventure-theme .spell-controls,
body.adventure-theme .review-actions {
  justify-content: center;
}

body.adventure-theme .card-actions button,
body.adventure-theme .spell-controls button,
body.adventure-theme .review-actions button {
  white-space: normal;
  line-height: 1.15;
}


/* Forest adventure v5: second visual-audit pass. */

/* Keep the bottom actions directly under the left learning column. */
body.adventure-theme.mode-cards .flash-card {
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  column-gap: 26px;
}

body.adventure-theme.mode-cards .flash-card > .mode-progress,
body.adventure-theme.mode-cards .flash-card > .card-main {
  grid-column: 1 / -1;
}

body.adventure-theme.mode-cards .flash-card > .card-actions-bottom {
  grid-column: 1;
  width: 100%;
  justify-self: stretch;
  margin: 0;
}

/* A balanced empty third column keeps the Chinese clue centered on the whole card. */
body.adventure-theme.mode-meaning .question-top,
body.adventure-theme.surface-compact.mode-meaning .question-top {
  grid-template-columns: minmax(118px, 158px) minmax(0, 1fr) minmax(118px, 158px);
  grid-template-areas:
    "label rep rep"
    "picture prompt .";
}

body.adventure-theme.mode-meaning .question-top .question-prompt,
body.adventure-theme.surface-compact.mode-meaning .question-top .question-prompt {
  width: 100%;
  max-width: 620px;
  justify-self: center;
}

/* Child-facing review controls use the same touch target as the practice controls. */
body.adventure-theme .review-actions button {
  min-height: 44px;
  padding: 7px 13px;
  font-size: 15px;
}

body.adventure-theme .mode-tab {
  font-size: clamp(16px, 1.25vw, 19px);
}

body.adventure-theme .choice-progressive-picture .study-picture-hidden {
  font-size: 14px;
}

/* Split-view and phone fallback: return the reading card to one full-width column. */
@media (max-width: 620px) {
  body.adventure-theme.mode-cards .flash-card {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  body.adventure-theme.mode-cards .flash-card > .mode-progress,
  body.adventure-theme.mode-cards .flash-card > .card-main,
  body.adventure-theme.mode-cards .flash-card > .card-actions-bottom {
    grid-column: 1;
  }

  body.adventure-theme.mode-meaning .question-top,
  body.adventure-theme.surface-compact.mode-meaning .question-top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "label"
      "picture"
      "prompt"
      "rep";
  }
}


/* Forest adventure v6: conditional-state and edge-case fixes. */

/* A card with no image must occupy the same right-hand picture area as a real image. */
body.adventure-theme.mode-cards .card-main > .meaning-picture.is-card {
  grid-area: picture;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-height: 240px;
  padding: 10px;
  overflow: hidden;
  background: #f2e4bd;
  border: 4px dashed #6d5131;
  border-radius: 13px 16px 12px 15px;
  box-shadow: inset 0 0 0 5px rgba(255, 250, 232, 0.45), 0 5px 0 rgba(86, 59, 34, 0.2);
}

body.adventure-theme .study-picture-item.is-broken-picture::after {
  display: none;
}

/* Long English words and phrases shrink in steps instead of creating oversized rows. */
body.adventure-theme.mode-cards .word-big.word-long {
  font-size: clamp(43px, 6.1dvh, 62px);
  line-height: 1.04;
}

body.adventure-theme.mode-cards .word-big.word-longer {
  font-size: clamp(35px, 5.1dvh, 52px);
  line-height: 1.07;
}

body.adventure-theme.mode-cards .word-big.word-longest {
  font-size: clamp(28px, 4.2dvh, 43px);
  line-height: 1.1;
}

/* Long Chinese definitions keep their hierarchy in every spelling-related mode. */
body.adventure-theme.mode-cards .meaning-big.meaning-small {
  font-size: clamp(21px, 2.9dvh, 29px);
}

body.adventure-theme.mode-cards .meaning-big.meaning-smaller {
  font-size: clamp(18px, 2.55dvh, 25px);
}

body.adventure-theme.mode-cards .meaning-big.meaning-tiny {
  font-size: clamp(16px, 2.2dvh, 21px);
  line-height: 1.3;
}

body.adventure-theme.mode-chunks .meaning-big.meaning-small {
  font-size: clamp(17px, 2.45dvh, 22px);
}

body.adventure-theme.mode-chunks .meaning-big.meaning-smaller,
body.adventure-theme.mode-chunks .meaning-big.meaning-tiny {
  font-size: clamp(15px, 2.1dvh, 19px);
  line-height: 1.3;
}

body.adventure-theme.mode-final .question-top .meaning-big.meaning-small {
  font-size: clamp(16px, 2.2dvh, 20px);
}

body.adventure-theme.mode-final .question-top .meaning-big.meaning-smaller,
body.adventure-theme.mode-final .question-top .meaning-big.meaning-tiny {
  font-size: clamp(14px, 1.9dvh, 18px);
  line-height: 1.3;
}

/* One or three answer choices are centered rather than left stranded in a two-column grid. */
body.adventure-theme .choices.choice-count-1 {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 520px);
}

body.adventure-theme .choices.choice-count-3 .choice-button:last-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 6px);
}

/* One or two growth photos stay centered like an album, not stuck to the left edge. */
body.adventure-theme .growth-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
}

/* Small split views preserve the same edge cases without horizontal overflow. */
@media (max-width: 620px) {
  body.adventure-theme.mode-cards .card-main > .meaning-picture.is-card {
    width: 100%;
    height: clamp(220px, 42dvh, 360px);
    min-height: 220px;
  }

  body.adventure-theme .choices.choice-count-3 .choice-button:last-child {
    width: 100%;
  }

  body.adventure-theme .growth-grid {
    grid-template-columns: minmax(0, 320px);
  }
}


/* Forest adventure v7: state-transition and hidden-branch audit. */

/* Correct and wrong answers add one final row; reserve it and allow safe fallback scrolling. */
body.adventure-theme.mode-meaning .question-card,
body.adventure-theme.surface-compact.mode-meaning .question-card {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: auto;
}

body.adventure-theme.mode-meaning .question-card > .read-once,
body.adventure-theme.surface-compact.mode-meaning .question-card > .read-once,
body.adventure-theme.mode-meaning .question-card > .wrong-continue-button,
body.adventure-theme.surface-compact.mode-meaning .question-card > .wrong-continue-button {
  justify-self: center;
  width: min(100%, 620px);
}

/* Near the 900px split-view threshold, flexible columns keep the keyboard inside the board. */
@media (orientation: landscape) and (min-width: 900px) {
  body.adventure-theme.mode-final .spell-board,
  body.adventure-theme.surface-compact.mode-final .spell-board {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
    column-gap: clamp(12px, 2vw, 34px);
    padding: 10px 18px 11px 36px;
    overflow: auto;
  }
}

/* The review tab is reachable before any word has been learned. */
body.adventure-theme .review-empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 240px;
  padding: 24px;
  color: #51452f;
  background: rgba(238, 220, 174, 0.58);
  border: 2px dashed #8f6d3e;
  border-radius: 12px;
  text-align: center;
}

body.adventure-theme .review-empty-state strong {
  color: #2f4c35;
  font-size: 24px;
}

body.adventure-theme .review-empty-state span {
  font-size: 15px;
  font-weight: 850;
}

/* Camera and reward dialogs stay closable even on a short landscape viewport. */
body.adventure-theme .camera-card,
body.adventure-theme .reward-card {
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

/* Release v0.4.0718.1620: seven-day chest theme reward. */

.pet-chest-scene.has-theme-reward {
  z-index: 10020;
  --chest-duration: 7200ms;
  --chest-size: 176px;
  --chest-stage-height: 270px;
  overflow: hidden;
  background: rgba(22, 42, 29, 0.7);
  isolation: isolate;
}

.pet-chest-scene.has-theme-reward::before {
  content: "";
  position: absolute;
  inset: -5%;
  z-index: 0;
  opacity: 0;
  background:
    linear-gradient(180deg, rgba(246, 214, 120, 0.12), rgba(25, 76, 46, 0.24)),
    url("./assets/adventure-camp-bg-v1.png") center / cover no-repeat;
  transform: scale(1.08);
}

.pet-chest-scene.has-theme-reward .pet-chest-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: calc(100dvh - 28px);
  padding: 18px 18px 20px;
  overflow: auto;
  color: #2d281e;
  background:
    linear-gradient(180deg, rgba(255, 249, 221, 0.97), rgba(229, 238, 196, 0.96));
  border: 4px solid #5a3f24;
  border-radius: 18px 13px 21px 15px;
  box-shadow: 0 12px 0 rgba(53, 34, 20, 0.38), 0 30px 72px rgba(8, 26, 17, 0.52);
}

.pet-chest-scene.has-theme-reward .pet-chest-stage {
  margin-bottom: 10px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 64%, rgba(255, 226, 117, 0.46), transparent 35%),
    linear-gradient(180deg, rgba(103, 157, 111, 0.2), rgba(61, 106, 68, 0.08));
}

.pet-chest-scene.has-theme-reward .pet-chest-glow {
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, rgba(255, 231, 120, 0.82), rgba(114, 183, 104, 0.35) 54%, transparent 73%);
}

.pet-chest-scene.has-theme-reward .pet-chest-rewards {
  top: 22px;
  width: min(100%, 440px);
  gap: 9px;
}

.pet-chest-scene.has-theme-reward .pet-reward-badge.is-theme {
  flex-basis: 100%;
  min-height: 76px;
  padding: 12px 24px;
  color: #fffbe6;
  background:
    linear-gradient(90deg, rgba(26, 74, 46, 0.9), rgba(93, 131, 64, 0.82)),
    url("./assets/adventure-camp-bg-v1.png") center 54% / cover no-repeat;
  border: 3px solid #f0ce68;
  border-radius: 14px 18px 13px 17px;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 204, 0.18), 0 8px 18px rgba(29, 65, 39, 0.35);
  font-size: clamp(20px, 3.2vw, 28px);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 2px rgba(19, 49, 31, 0.68);
}

.pet-chest-scene.has-theme-reward .pet-chest-card > strong {
  color: #29442f;
  font-size: clamp(25px, 4vw, 34px);
}

.pet-chest-scene.has-theme-reward .pet-chest-card > p {
  color: #5d5138;
  font-size: 16px;
}

.pet-chest-scene.has-theme-reward.is-theme-awakening::before {
  animation: forestThemeBackdropReveal 1800ms ease-out forwards;
}

.pet-chest-scene.has-theme-reward.is-theme-awakening .pet-chest-card {
  animation: forestThemeCardPulse 1250ms ease-out;
}

body.theme-reward-awakening .app-shell,
body.theme-reward-awakening .cover-screen {
  animation: forestThemePageAwaken 1500ms ease-out;
}

@keyframes forestThemeBackdropReveal {
  0% {
    opacity: 0;
    transform: scale(1.08);
    filter: saturate(0.72) brightness(1.22);
  }
  42% {
    opacity: 0.92;
  }
  100% {
    opacity: 0.78;
    transform: scale(1);
    filter: saturate(1) brightness(1);
  }
}

@keyframes forestThemeCardPulse {
  0% { transform: scale(1); }
  32% { transform: scale(1.035); box-shadow: 0 12px 0 rgba(53, 34, 20, 0.38), 0 0 55px rgba(242, 208, 105, 0.9); }
  100% { transform: scale(1); }
}

@keyframes forestThemePageAwaken {
  0% { filter: saturate(0.72) brightness(1.18); }
  100% { filter: saturate(1) brightness(1); }
}

@media (max-height: 720px) {
  .pet-chest-scene.has-theme-reward {
    --chest-stage-height: 225px;
  }

  .pet-chest-scene.has-theme-reward .pet-reward-badge.is-theme {
    min-height: 60px;
    padding-block: 9px;
  }

  .pet-chest-scene.has-theme-reward .pet-chest-card {
    padding: 12px 14px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pet-chest-scene.has-theme-reward::before {
    opacity: 0.78;
    transform: none;
  }

  .pet-chest-scene.has-theme-reward.is-theme-awakening::before,
  .pet-chest-scene.has-theme-reward.is-theme-awakening .pet-chest-card,
  body.theme-reward-awakening .app-shell,
  body.theme-reward-awakening .cover-screen {
    animation: none;
  }
}