:root {
  --ink: #234333;
  --green: #2d6843;
  --lime: #dff18c;
  --paper: #f8f7ed;
  --muted: #7b8976;
  --yellow: #f3cc62;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Noto Sans SC",
    system-ui,
    -apple-system,
    sans-serif;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #cc8b21;
  outline-offset: 4px;
}
.hidden {
  display: none !important;
}
.header {
  height: 110px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e6d7;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 1px;
}
.brand-mark {
  font-size: 48px;
  color: #44764c;
  line-height: 1;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 2.3px;
  font-weight: 600;
  margin-top: 3px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 25px;
}
.grade {
  font-size: 12px;
  border-right: 1px solid #d8ddcd;
  padding-right: 26px;
  color: #6f7e69;
}
.icon-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  min-height: 44px;
}
.icon-btn span {
  font-size: 12px;
  font-weight: 500;
}
main {
  max-width: 1600px;
  margin: auto;
}
.setup {
  display: grid;
  grid-template-columns: 46% 54%;
  padding: 55px 5% 45px;
  gap: 0;
  min-height: 790px;
}
.setup-copy {
  padding-right: 50px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #73855d;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow > span:not(#question-number) {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #82a34d;
}
h1 {
  font-size: clamp(32px, 3.3vw, 51px);
  line-height: 1.46;
  letter-spacing: -1.7px;
  margin: 17px 0 18px;
  font-weight: 900;
}
h1 > span {
  color: #4c7e41;
  position: relative;
}
h1 > span:after {
  content: "";
  height: 9px;
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  background: #e5ce79;
  z-index: -1;
  border-radius: 70%;
}
h1 i {
  font-size: 34px;
  display: inline-block;
  margin-left: 12px;
  color: #b3bd58;
  vertical-align: top;
  transform: rotate(15deg);
}
.intro {
  font-size: 13px;
  line-height: 1.9;
  color: #78836e;
  margin: 0 0 26px;
}
.step-label {
  font-size: 12px;
  font-weight: 700;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.step-label > span {
  font-size: 10px;
  color: #8a977f;
  border: 1px solid #ccd5be;
  border-radius: 50%;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}
.subjects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.subject {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 13px 15px;
  border: 1.5px solid #dfe3d5;
  border-radius: 13px;
  background: #fffdf6;
  gap: 12px;
  color: var(--ink);
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.subject:hover,
.lesson:hover,
.level:hover {
  transform: translateY(-2px);
}
.subject.active {
  background: #eaf0d7;
  border-color: #648450;
}
.subject .subject-icon {
  font-size: 27px;
  font-weight: 800;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e7ebd8;
  color: #5d783b;
}
.subject[data-subject="chinese"] .subject-icon {
  background: #f6e7c8;
  color: #ae7a39;
}
.subject strong {
  font-size: 16px;
  display: block;
}
.subject small {
  font-size: 9px;
  display: block;
  margin-top: 4px;
  color: #7e8972;
}
.check {
  margin-left: auto;
  border: 1.5px solid #d4dcc8;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 10px;
}
.active .check {
  color: #fff;
  background: #5c7a43;
  border-color: #5c7a43;
}
.lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lesson {
  background: transparent;
  border: 1px solid #dce1d0;
  border-radius: 8px;
  padding: 10px 13px;
  color: #7b846e;
  font-size: 12px;
  transition: 0.2s;
}
.lesson.active {
  background: #e9edda;
  color: #3f5d30;
  border-color: #78945e;
  font-weight: 700;
}
.levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.level {
  text-align: left;
  background: none;
  border: 1px solid #dde1d2;
  padding: 11px 14px;
  border-radius: 10px;
  color: #77856a;
  transition: 0.2s;
}
.level.active {
  border-color: #8d9e69;
  background: #f0f1e1;
  color: #365533;
}
.level strong {
  font-size: 12px;
  display: block;
}
.level small {
  font-size: 9px;
  display: block;
  margin-top: 5px;
  font-weight: 400;
}
.primary {
  border: 0;
  border-radius: 10px;
  background: #2e6541;
  color: #fff9df;
  font-weight: 700;
  padding: 16px 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  box-shadow: 0 4px 0 #1b4c2f;
  transition:
    transform 0.15s,
    background 0.15s;
  min-height: 52px;
}
.primary:hover {
  background: #39774b;
  transform: translateY(-2px);
}
.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1b4c2f;
}
#start {
  width: 100%;
  margin-top: 22px;
  font-size: 15px;
  justify-content: space-between;
}
#start > span {
  font-size: 24px;
  line-height: 1;
}
.setup-note {
  text-align: center;
  font-size: 10px;
  color: #8b947e;
  margin-top: 14px;
}
.garden-preview {
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.preview-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #778265;
  margin: 0 0 14px 4px;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8d9d50;
  box-shadow: 0 0 0 4px #edf0df;
}
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 520px;
  border-radius: 160px 160px 26px 26px;
  overflow: hidden;
  background: #b6d68c;
  box-shadow: inset 0 0 0 1px #ccd8b8;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#preview {
  position: absolute;
  inset: 0;
}
.map-stamp {
  position: absolute;
  bottom: 27px;
  left: 26px;
  right: 26px;
  display: flex;
  flex-direction: column;
  padding: 17px 23px;
  background: #fffbeac9;
  backdrop-filter: blur(8px);
  border: 1px solid #ffffff99;
  border-radius: 14px;
  transform: rotate(-2deg);
}
.map-stamp > span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #76855c;
}
.map-stamp strong {
  font-size: 23px;
  margin: 5px 0;
}
.map-stamp small {
  font-size: 10px;
  color: #7d896b;
}
.preview-bottom {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px 9px 0;
}
.little-sprout {
  font-size: 36px;
  color: #90a65b;
}
.preview-bottom strong {
  font-size: 12px;
}
.preview-bottom p {
  font-size: 10px;
  color: #8b957d;
  margin: 7px 0;
}
.sketch-arrow {
  margin-left: auto;
  font-size: 35px;
  transform: rotate(15deg);
  color: #9aa278;
}
footer {
  padding: 24px 5%;
  border-top: 1px solid #e2e6d7;
  display: flex;
  justify-content: space-between;
  color: #8b947d;
  font-size: 10px;
  gap: 20px;
}
.game {
  padding: 20px 5% 35px;
}
.game-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  padding: 10px 0;
  min-height: 44px;
}
.game-toolbar > span {
  font-size: 13px;
  font-weight: 700;
}
.game-controls {
  display: flex;
  gap: 20px;
}
.battle-wrap {
  position: relative;
  aspect-ratio: 2.6;
  min-height: 260px;
  max-height: 440px;
  border-radius: 20px;
  overflow: hidden;
  background: #9bc66e;
  border: 5px solid #76915b;
}
.battle-top {
  position: absolute;
  top: 15px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}
.sun-counter {
  background: #fcf5cc;
  border: 2px solid #ddc975;
  padding: 7px 13px;
  border-radius: 12px;
  font-size: 23px;
  color: #bb8b24;
  font-weight: 800;
  box-shadow: 0 3px 0 #5d743140;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sun-counter small {
  font-size: 9px;
  color: #8e8550;
  font-weight: 500;
}
.wave {
  text-align: center;
  color: #fff9df;
  text-shadow: 0 2px 3px #315123;
  font-size: 11px;
  font-weight: 700;
  padding-top: 4px;
}
.wave > div {
  width: 170px;
  height: 8px;
  border: 2px solid #355a36;
  background: #f1f0b7;
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
}
.wave i {
  width: 0;
  height: 100%;
  display: block;
  background: #f0ba4d;
  transition: width 0.5s;
}
.garden-life {
  color: #f5ca8c;
  text-shadow: 0 2px 2px #653f2c;
  font-size: 19px;
  letter-spacing: 4px;
}
.battle-message {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  color: #fffbdc;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 3px #163d20;
  background: #264c35ad;
  padding: 8px 16px;
  border-radius: 24px;
  white-space: nowrap;
}
.power {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 2px solid #d8f4fa;
  background: #d6f3e6;
  color: #285750;
  width: 84px;
  border-radius: 12px;
  font-size: 25px;
  padding: 9px 4px;
  box-shadow: 0 3px 0 #376d5b;
}
.power > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
}
.power small {
  display: block;
  font-size: 8px;
  margin-top: 5px;
}
.power:disabled {
  filter: grayscale(0.6);
  opacity: 0.6;
}
.power.ready {
  animation: power 1.5s infinite;
}
@keyframes power {
  50% {
    box-shadow: 0 0 20px #eeffe8;
  }
}
.question-panel {
  position: relative;
  background: #fffdf5;
  margin-top: 16px;
  border: 1px solid #e2e4d3;
  border-radius: 17px;
  padding: 24px 30px;
  min-height: 210px;
}
.question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.question-heading .eyebrow {
  font-size: 9px;
  letter-spacing: 1px;
}
h2 {
  font-size: 17px;
  margin: 6px 0 0;
}
.question-tools {
  display: flex;
  gap: 9px;
}
.soft-btn {
  background: #eef0e1;
  border: 1px solid #dce1cb;
  color: #5e7450;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 12px;
  min-height: 44px;
}
.answer-area {
  display: flex;
  gap: 35px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.prompt {
  font-size: clamp(29px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: 2px;
  min-width: 30%;
  white-space: nowrap;
}
.prompt.chinese {
  font-size: 54px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.prompt small {
  font-size: 13px;
  color: #879372;
  font-weight: 400;
  letter-spacing: 0;
  white-space: normal;
}
.options {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}
.answer {
  flex: 1;
  max-width: 180px;
  min-width: 60px;
  height: 74px;
  border: 2px solid #dbe3c9;
  border-bottom-width: 5px;
  border-radius: 13px;
  background: #f5f7e9;
  color: #385c36;
  font-size: 30px;
  font-weight: 700;
  transition: 0.15s;
}
.answer:hover:not(:disabled) {
  background: #e7efcf;
  border-color: #9caf74;
  transform: translateY(-3px);
}
.answer.correct {
  background: #d5edb1;
  border-color: #6d9f46;
  color: #36682b;
}
.answer.wrong {
  background: #fae3d4;
  border-color: #d9a78d;
  animation: shake 0.3s;
}
.answer:disabled {
  opacity: 0.6;
}
.answer.correct:disabled {
  opacity: 1;
}
.feedback {
  font-size: 12px;
  line-height: 1.8;
  color: #869174;
  margin-top: 18px;
  min-height: 24px;
}
.feedback.success {
  color: #39783e;
  font-weight: 700;
}
.feedback.try {
  color: #a97734;
}
.math-visual {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 15px;
  margin-top: 10px;
}
.dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 260px;
}
.dot {
  width: 13px;
  height: 13px;
  background: #9bb760;
  border-radius: 50%;
  display: inline-block;
}
.dot.second {
  background: #e8b756;
}
.dot.removed {
  opacity: 0.28;
  background: #a98e6c;
  position: relative;
}
.dot.removed:after {
  content: "";
  position: absolute;
  height: 2px;
  background: #8b705c;
  top: 6px;
  width: 100%;
  transform: rotate(-45deg);
}
.next {
  position: absolute;
  right: 30px;
  bottom: 16px;
  min-height: 42px;
  padding: 10px 20px;
  font-size: 12px;
}
.pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #163b2edb;
  backdrop-filter: blur(5px);
  z-index: 5;
  color: #fff9db;
  text-align: center;
}
.pause-overlay > span {
  font-size: 40px;
  color: #f3d377;
}
.pause-overlay h2 {
  font-size: 27px;
}
.pause-overlay p {
  font-size: 12px;
  margin-bottom: 20px;
}
.pause-overlay .primary {
  background: #f0d77f;
  color: #355234;
  box-shadow: 0 4px #aa9950;
}
.results {
  text-align: center;
  padding: 50px 5% 70px;
  min-height: 75vh;
  max-width: 900px;
  margin: auto;
}
.results .eyebrow {
  justify-content: center;
}
.result-flower {
  display: inline-block;
  color: #d2ad45;
  font-size: 75px;
  line-height: 1.5;
}
.results h1 {
  margin: 12px 0;
}
.results > p {
  color: #81916e;
  font-size: 13px;
}
.result-stats {
  display: flex;
  justify-content: center;
  margin: 35px 0;
}
.result-stats > div {
  padding: 0 35px;
  border-right: 1px solid #d8dfca;
}
.result-stats > div:last-child {
  border: 0;
}
.result-stats strong {
  display: block;
  font-size: 44px;
  color: #507640;
}
.result-stats span {
  font-size: 12px;
  color: #869371;
}
.result-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}
details {
  border-block: 1px solid #dfe4d3;
  padding: 16px 0;
  text-align: left;
  font-size: 12px;
  max-width: 620px;
  margin: auto;
}
summary {
  cursor: pointer;
  color: #597344;
}
#review-list > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px;
  border-bottom: 1px solid #ebeedf;
}
#review-list span {
  color: #82916e;
}
dialog {
  border: 0;
  border-radius: 22px;
  padding: 30px 38px;
  max-width: 490px;
  width: 90%;
  color: var(--ink);
  box-shadow: 0 20px 100px #12332444;
  background: var(--paper);
}
dialog::backdrop {
  background: #193b2eb5;
  backdrop-filter: blur(5px);
}
dialog .result-flower {
  font-size: 40px;
}
dialog h2 {
  font-size: 24px;
}
dialog ol {
  font-size: 13px;
  line-height: 2.2;
  padding-left: 20px;
}
dialog p {
  font-size: 11px;
  line-height: 1.9;
  color: #8a947b;
}
dialog .primary {
  width: 100%;
  font-size: 12px;
}
.dialog-close:not(.primary) {
  position: absolute;
  right: 18px;
  top: 15px;
  background: none;
  border: 0;
  font-size: 27px;
  color: #6e8260;
  min-width: 40px;
  min-height: 40px;
}
@keyframes shake {
  25%,
  75% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
}
@media (min-width: 1500px) {
  .setup {
    min-height: 850px;
  }
  .canvas-wrap {
    min-height: 610px;
  }
}
@media (max-width: 1050px) {
  .setup {
    padding-top: 35px;
    grid-template-columns: 49% 51%;
  }
  .setup-copy {
    padding-right: 25px;
  }
  .garden-preview {
    padding-left: 10px;
  }
  .header {
    height: 90px;
  }
  .brand {
    font-size: 20px;
  }
  .subject {
    padding: 11px 10px;
    gap: 8px;
  }
  .subject .subject-icon {
    width: 34px;
    height: 36px;
  }
  .subject small {
    font-size: 8px;
  }
  .canvas-wrap {
    min-height: 520px;
    border-radius: 120px 120px 22px 22px;
  }
  .setup {
    min-height: 770px;
  }
  .answer-area {
    gap: 20px;
  }
}
@media (max-width: 720px) {
  .header {
    height: 78px;
    padding: 0 5%;
  }
  .brand {
    font-size: 17px;
    gap: 7px;
  }
  .brand-mark {
    font-size: 35px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: 1.3px;
  }
  .header-right {
    gap: 13px;
  }
  .grade {
    display: none;
  }
  .icon-btn span {
    display: none;
  }
  .setup {
    grid-template-columns: 1fr;
    padding-top: 28px;
    gap: 25px;
  }
  .setup-copy {
    padding: 0;
  }
  .setup h1 {
    font-size: 36px;
    line-height: 1.35;
    margin-bottom: 12px;
  }
  .intro {
    font-size: 12px;
    margin-bottom: 18px;
  }
  .garden-preview {
    grid-row: 2;
    padding: 0;
  }
  .canvas-wrap {
    min-height: 330px;
    border-radius: 100px 100px 20px 20px;
  }
  .map-stamp {
    bottom: 16px;
    left: 16px;
    right: 16px;
    padding: 10px 15px;
  }
  .map-stamp strong {
    font-size: 18px;
  }
  .preview-bottom {
    padding-top: 14px;
  }
  .subject small {
    font-size: 10px;
  }
  .preview-label {
    margin-bottom: 10px;
  }
  .game {
    padding: 8px 3% 25px;
  }
  .game-toolbar {
    gap: 5px;
    margin-bottom: 5px;
  }
  .game-toolbar > span {
    font-size: 10px;
  }
  .game-controls {
    gap: 12px;
  }
  .game-controls .text-btn {
    font-size: 10px;
  }
  .text-btn {
    font-size: 10px;
  }
  .battle-wrap {
    aspect-ratio: 1.45;
    min-height: 240px;
    border-width: 3px;
    border-radius: 13px;
  }
  .battle-top {
    left: 9px;
    right: 9px;
    top: 10px;
  }
  .sun-counter {
    font-size: 17px;
    padding: 5px 8px;
  }
  .sun-counter small {
    display: none;
  }
  .wave {
    font-size: 9px;
  }
  .wave > div {
    width: 105px;
    height: 7px;
  }
  .garden-life {
    font-size: 15px;
    letter-spacing: 2px;
  }
  .battle-message {
    font-size: 9px;
    padding: 6px 8px;
    bottom: 9px;
    left: 40%;
  }
  .power {
    width: 64px;
    font-size: 20px;
    right: 8px;
    bottom: 9px;
    padding: 6px 2px;
  }
  .power > span {
    font-size: 9px;
  }
  .power small {
    font-size: 7px;
  }
  .question-panel {
    padding: 18px 15px 60px;
    min-height: 270px;
    margin-top: 10px;
  }
  .question-heading h2 {
    font-size: 14px;
  }
  .question-tools {
    gap: 6px;
  }
  .question-tools .soft-btn {
    padding: 7px 9px;
    font-size: 10px;
  }
  .answer-area {
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
    align-items: stretch;
  }
  .prompt {
    text-align: center;
    font-size: 34px;
  }
  .prompt.chinese {
    justify-content: center;
    font-size: 42px;
  }
  .options {
    justify-content: center;
    gap: 9px;
  }
  .answer {
    height: 60px;
    font-size: 26px;
    max-width: none;
  }
  .feedback {
    margin-top: 10px;
    font-size: 11px;
  }
  .next {
    right: 15px;
    bottom: 13px;
  }
  .results {
    padding: 30px 5%;
  }
  .results h1 {
    font-size: 31px;
  }
  .result-stats > div {
    padding: 0 17px;
  }
  .result-stats strong {
    font-size: 34px;
  }
  .result-stats span {
    font-size: 10px;
  }
  .result-actions {
    flex-direction: column;
  }
  footer {
    font-size: 9px;
  }
  footer > span:last-child {
    display: none;
  }
}
@media (max-height: 650px) and (orientation: landscape) {
  .header {
    height: 62px;
  }
  .game {
    padding-top: 0;
  }
  .battle-wrap {
    min-height: 180px;
    max-height: 220px;
  }
  .question-panel {
    padding: 12px 20px 42px;
    min-height: 150px;
  }
  .answer-area {
    margin-top: 6px;
    flex-direction: row;
  }
  .answer {
    height: 50px;
  }
  .prompt {
    font-size: 30px;
  }
  .question-heading h2 {
    font-size: 13px;
  }
  .feedback {
    margin-top: 8px;
  }
  .game-toolbar {
    margin: 0;
  }
  .next {
    bottom: 7px;
  }
  .setup {
    padding-top: 20px;
  }
  .canvas-wrap {
    min-height: 500px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
} /* Touch-first deployment and live combat. */
html {
  touch-action: manipulation;
}
button {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px;
}
button:disabled {
  opacity: 0.55;
}
input {
  accent-color: #47713e;
}
.speed-picker {
  border: 0;
  padding: 0;
  margin: 15px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}
.speed-picker legend {
  float: left;
  margin-right: 15px;
  font-weight: 700;
}
.speed-picker label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}
.speed-picker small {
  font-size: 9px;
  color: #899178;
}
.collection {
  font-size: 10px;
  color: #84916b;
  text-align: center;
  margin: 10px 0 0;
}
.in-game .header {
  height: 66px;
}
.in-game footer {
  padding-block: 12px;
}
.game {
  max-width: 1180px;
  margin: auto;
  padding-top: 8px;
}
.game-toolbar {
  margin-bottom: 5px;
}
.battle-wrap {
  aspect-ratio: 1000/560;
  min-height: 0;
  max-height: none;
  height: clamp(280px, 49svh, 500px);
  border: 4px solid #75623e;
  border-radius: 14px;
  box-shadow: 0 4px 0 #594a30;
}
.battle-top {
  top: 12px;
  left: 14px;
  right: 14px;
  gap: 10px;
}
.sun-counter {
  font-size: 17px;
  gap: 6px;
  padding: 8px 11px;
  background: #f3dfad;
  border-color: #9b8055;
  flex-wrap: nowrap;
  min-width: 145px;
}
.sun-counter strong {
  font-size: 19px;
  color: #5d7430;
  letter-spacing: 3px;
}
.sun-counter small {
  font-size: 9px;
}
.garden-life {
  font-size: 11px;
  letter-spacing: 0;
  background: #f3e7cce8;
  color: #655334;
  text-shadow: none;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid #b59a6e;
  white-space: nowrap;
}
.wave {
  font-size: 11px;
  background: #385b2ea8;
  padding: 7px 12px;
  border-radius: 10px;
  min-width: 190px;
}
.wave > div {
  width: 100%;
  margin-top: 6px;
}
.battle-message {
  font-size: 11px;
  bottom: 12px;
  max-width: 92%;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  background: #2c481fcd;
}
.plant-slots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.plant-slots .plant-slot {
  position: absolute;
  left: 24.4%;
  width: 16%;
  height: 18%;
  border: 2px dashed #fff4ba;
  background: #f7f1b636;
  border-radius: 12px;
  pointer-events: auto;
  color: #fff8d3;
  text-shadow: 0 1px 3px #244318;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  min-height: 46px;
  box-shadow: 0 0 0 3px #6e9d3930;
}
.plant-slots .plant-slot:nth-child(1) {
  top: 24%;
}
.plant-slots .plant-slot:nth-child(2) {
  top: 45.4%;
}
.plant-slots .plant-slot:nth-child(3) {
  top: 66.8%;
}
.plant-slots .plant-slot > span {
  font-size: 27px;
}
.plant-slots .plant-slot > small {
  font-size: 11px;
  font-weight: 700;
}
.plant-slots .plant-slot.occupied {
  background: #264e1a08;
  border-style: solid;
  border-color: #d8eb9d;
}
.plant-slots .plant-slot.occupied > span {
  opacity: 0;
}
.plant-slots .plant-slot.occupied > small {
  background: #365523bd;
  border-radius: 6px;
  padding: 3px 7px;
  transform: translateY(13px);
}
.deployment-panel {
  margin-top: 17px;
  background: #fffdf5;
  border: 1px solid #dddcc5;
  border-radius: 15px;
  padding: 20px;
}
.deployment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.deployment-heading .eyebrow {
  font-size: 9px;
}
.deployment-heading > span {
  font-size: 12px;
  color: #809364;
}
.seed-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}
.seed-card {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  border: 2px solid #dedcc5;
  border-bottom-width: 4px;
  border-radius: 12px;
  padding: 10px;
  background: #f6f1df;
  color: var(--ink);
  min-width: 0;
  transition: background 0.15s;
}
.seed-card.selected {
  background: #e6edc6;
  border-color: #819f4b;
  box-shadow: 0 0 0 3px #a4b85725;
}
.seed-card > img {
  width: 58px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
}
.seed-card strong {
  font-size: 13px;
  display: block;
}
.seed-card small {
  display: block;
  font-size: 9px;
  line-height: 1.8;
  color: #8c8c65;
  margin-top: 4px;
}
.seed-card em {
  display: block;
  font-style: normal;
  font-size: 9px;
  color: #699044;
  margin-top: 6px;
}
.deploy-note {
  font-size: 11px;
  color: #8c957d;
}
.deployment-panel > .primary {
  display: flex;
  margin-left: auto;
  padding: 12px 23px;
  font-size: 13px;
  min-height: 46px;
}
.question-panel {
  padding: 17px 24px;
  min-height: 190px;
  margin-top: 15px;
}
.question-heading h2 {
  font-size: 15px;
}
.answer-area {
  margin-top: 14px;
  gap: 20px;
}
.answer {
  height: 65px;
  font-size: 30px;
  max-width: 180px;
}
.feedback {
  margin-top: 10px;
  font-size: 11px;
}
.math-visual {
  margin-top: 5px;
}
.math-visual .dot {
  height: 10px;
  width: 10px;
}
.intermission {
  height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #617b44;
}
.intermission > span {
  font-size: 32px;
}
.intermission > strong {
  font-size: 18px;
}
.intermission > small {
  font-size: 12px;
  color: #889673;
}
.stage-banner {
  position: absolute;
  left: 50%;
  top: 29%;
  transform: translateX(-50%);
  font-size: clamp(19px, 3vw, 35px);
  font-weight: 900;
  color: #fff4b0;
  text-shadow:
    0 3px #5c501b,
    2px 0 #5c501b,
    -2px 0 #5c501b;
  background: #2c522dba;
  padding: 13px 25px;
  border-radius: 18px;
  white-space: nowrap;
  pointer-events: none;
  animation: skill-pop 0.3s ease-out;
}
.upgrade-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 23px;
}
.upgrade-choice {
  border: 2px solid #b7c68f;
  border-radius: 15px;
  background: #eff2db;
  color: #355732;
  padding: 24px 13px;
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}
.upgrade-choice > span {
  font-size: 45px;
  color: #a7973c;
}
.upgrade-choice strong {
  font-size: 17px;
  margin-top: 12px;
}
.upgrade-choice small {
  font-size: 11px;
  line-height: 1.8;
  color: #819067;
  margin-top: 10px;
}
.upgrade-choice em {
  font-style: normal;
  font-size: 11px;
  color: #4c743b;
  margin-top: 18px;
}
#upgrade {
  max-width: 580px;
}
#upgrade > p {
  font-size: 12px;
}
.result-sticker {
  width: 95px;
  height: 114px;
  object-fit: contain;
  margin: 15px 0;
}
.result-stars {
  font-size: 13px;
  color: #a38b35 !important;
}
footer {
  align-items: center;
}
footer > .text-btn {
  font-size: 10px;
  min-height: 30px;
  padding: 0;
  color: #8b947d;
}
.setup {
  padding-top: 35px;
}
.canvas-wrap {
  min-height: 560px;
}
#start {
  font-size: 14px;
}
.primary:disabled {
  transform: none;
  box-shadow: 0 3px #89977b;
  background: #a4b393;
  color: #fff;
}
.answer:active:not(:disabled),
.seed-card:active,
.upgrade-choice:active {
  transform: scale(0.97);
}
@keyframes skill-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}
@media (max-width: 900px) {
  .seed-card {
    gap: 7px;
    padding: 8px;
  }
  .seed-card > img {
    width: 45px;
    height: 60px;
  }
  .seed-card small {
    font-size: 8px;
  }
  .seed-card strong {
    font-size: 12px;
  }
  .sun-counter small {
    display: none;
  }
  .speed-picker {
    flex-wrap: wrap;
    gap: 0 15px;
  }
  .speed-picker small {
    width: 100%;
    margin-top: 0;
  }
  .battle-wrap {
    height: clamp(260px, 45svh, 420px);
  }
}
@media (max-width: 720px) {
  .setup {
    padding-top: 25px;
  }
  .canvas-wrap {
    min-height: 350px;
  }
  .in-game .header {
    height: 58px;
  }
  .game {
    padding-inline: 3%;
    padding-top: 0;
  }
  .battle-wrap {
    height: clamp(250px, 39svh, 330px);
    border-width: 3px;
  }
  .battle-top {
    left: 7px;
    right: 7px;
    top: 7px;
    gap: 5px;
  }
  .sun-counter {
    min-width: 0;
    font-size: 15px;
    padding: 6px 8px;
    gap: 4px;
  }
  .sun-counter strong {
    font-size: 15px;
    letter-spacing: 1px;
  }
  .wave {
    min-width: 0;
    font-size: 8px;
    padding: 5px 7px;
    flex: 1;
  }
  .garden-life {
    font-size: 8px;
    padding: 7px 5px;
  }
  .battle-message {
    font-size: 9px;
    bottom: 8px;
    left: 50%;
    padding: 6px 10px;
  }
  .plant-slots .plant-slot {
    left: 23%;
    width: 20%;
    border-radius: 8px;
    min-height: 44px;
  }
  .plant-slots .plant-slot > span {
    font-size: 22px;
  }
  .plant-slots .plant-slot > small {
    font-size: 8px;
  }
  .deployment-panel {
    padding: 15px 12px;
    margin-top: 12px;
  }
  .deployment-heading h2 {
    font-size: 15px;
  }
  .deployment-heading > span {
    font-size: 10px;
  }
  .seed-cards {
    gap: 7px;
    margin-top: 12px;
  }
  .seed-card {
    flex-direction: column;
    text-align: center;
    gap: 5px;
    padding: 8px 4px;
  }
  .seed-card > img {
    width: 55px;
    height: 65px;
  }
  .seed-card strong {
    font-size: 11px;
  }
  .seed-card small {
    font-size: 8px;
    line-height: 1.7;
    max-width: 100px;
  }
  .seed-card em {
    font-size: 8px;
    margin-top: 3px;
  }
  .deploy-note {
    font-size: 9px;
    line-height: 1.8;
  }
  .deployment-panel > .primary {
    width: 100%;
    margin-top: 12px;
  }
  .question-panel {
    padding: 15px;
    min-height: 230px;
  }
  .answer-area {
    gap: 12px;
    flex-direction: column;
  }
  .prompt {
    font-size: 32px;
  }
  .prompt.chinese {
    font-size: 40px;
  }
  .question-heading h2 {
    font-size: 13px;
  }
  .question-tools .soft-btn {
    font-size: 9px;
    padding: 6px 8px;
  }
  .answer {
    height: 58px;
    max-width: none;
    font-size: 27px;
  }
  .feedback {
    font-size: 10px;
    line-height: 1.8;
  }
  .question-heading .eyebrow {
    font-size: 8px;
  }
  .intermission {
    height: 230px;
  }
  .stage-banner {
    font-size: 22px;
    padding: 10px 17px;
  }
  .speed-picker small {
    width: auto;
    margin-left: auto;
    font-size: 8px;
  }
  .speed-picker legend {
    font-size: 10px;
    margin-right: 12px;
  }
  .result-sticker {
    width: 80px;
    height: 96px;
  }
}
@media (max-height: 600px) and (orientation: landscape) {
  .in-game .header {
    height: 45px;
  }
  .game-toolbar .text-btn {
    min-height: 30px;
  }
  .battle-wrap {
    height: 230px;
  }
  .question-panel {
    min-height: 140px;
    padding: 10px 17px;
  }
  .answer-area {
    flex-direction: row;
    margin-top: 6px;
  }
  .answer {
    height: 50px;
  }
  .deployment-panel {
    padding: 12px;
  }
  .seed-card {
    flex-direction: row;
  }
  .seed-card > img {
    width: 40px;
    height: 48px;
  }
  .seed-card small {
    display: none;
  }
  .stage-banner {
    font-size: 25px;
  }
  .intermission {
    height: 140px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage-banner {
    animation: none;
  }
  .seed-card,
  .answer,
  .upgrade-choice {
    transition: none;
  }
}
/* Keep the battlefield full width; preserve sprite proportions on narrow screens. */
.battle-wrap {
  width: 100%;
  aspect-ratio: 1000/450;
  height: auto;
}
.game {
  max-width: 1050px;
}
.plant-slots .plant-slot {
  height: 22%;
}
.plant-slots .plant-slot:nth-child(1) {
  top: 21%;
}
.plant-slots .plant-slot:nth-child(2) {
  top: 44.3%;
}
.plant-slots .plant-slot:nth-child(3) {
  top: 67.6%;
}
.seed-card > img {
  width: 65px;
  height: 39px;
  object-fit: cover;
  object-position: top;
}
.result-sticker {
  width: 100px;
  height: 60px;
  object-fit: cover;
  object-position: top;
}
#sound {
  min-width: 44px;
}
@media (max-width: 720px) {
  .battle-wrap {
    height: 260px;
    aspect-ratio: auto;
  }
  .plant-slots .plant-slot {
    height: 21%;
  }
  .seed-card > img {
    width: 65px;
    height: 39px;
  }
  .question-panel {
    min-height: 225px;
  }
  .result-sticker {
    width: 100px;
    height: 60px;
  }
}
@media (max-height: 600px) and (orientation: landscape) {
  .battle-wrap {
    height: 230px;
    aspect-ratio: auto;
  }
  .seed-card > img {
    width: 50px;
    height: 30px;
  }
}
