:root {
  --ink: #214837;
  --ink-soft: #4b705d;
  --leaf: #69b877;
  --leaf-deep: #3c8f65;
  --sky: #95d5ec;
  --sun: #ffd76d;
  --orange: #ff9954;
  --coral: #f76f67;
  --blue: #5bb8dd;
  --violet: #8d7bd6;
  --cream: #fff8dd;
  --paper: rgba(255, 255, 255, 0.88);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 22px 58px rgba(35, 77, 56, 0.18);
  --line: rgba(255, 255, 255, 0.82);
  --dock-height: 132px;
  color-scheme: light;
  font-family:
    "Nunito", "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  color: var(--ink);
  background: #b8e2e9;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 251, 222, 0.26)),
    url("assets/classroom-jungle.png") center / cover no-repeat;
}

.backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 20%, transparent 80%, rgba(255, 255, 255, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.3) 58%, rgba(255, 247, 207, 0.22));
}

.motion-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.drift {
  position: absolute;
  display: block;
  opacity: 0.75;
  animation: driftAcross 16s linear infinite;
}

.leaf {
  width: 34px;
  height: 18px;
  border-radius: 100% 0 100% 0;
  background: #79bd66;
  box-shadow: inset 8px 0 0 rgba(57, 137, 82, 0.34);
}

.leaf-a {
  top: 19%;
  left: -5%;
  animation-delay: 0s;
}

.leaf-b {
  top: 42%;
  left: -8%;
  transform: rotate(30deg);
  animation-duration: 21s;
  animation-delay: 4s;
}

.leaf-c {
  top: 12%;
  left: -12%;
  transform: rotate(-30deg);
  animation-duration: 24s;
  animation-delay: 9s;
}

.sparkle {
  width: 22px;
  height: 22px;
  color: var(--sun);
  opacity: 0.9;
}

.sparkle::before {
  content: "✦";
  font-size: 22px;
}

.sparkle-a {
  top: 25%;
  left: -4%;
  animation-duration: 18s;
}

.sparkle-b {
  top: 56%;
  left: -10%;
  animation-duration: 25s;
  animation-delay: 7s;
}

.sparkle-c {
  top: 76%;
  left: -7%;
  animation-duration: 19s;
  animation-delay: 12s;
}

@keyframes driftAcross {
  0% {
    translate: -30px 0;
    rotate: 0deg;
  }

  50% {
    translate: 55vw 32px;
    rotate: 130deg;
  }

  100% {
    translate: 112vw -12px;
    rotate: 260deg;
  }
}

.topbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  pointer-events: none;
}

.topbar button,
.student-dock button,
.teacher-badge,
.name-entry,
.hero-button,
.island,
.habitat,
.drop-zone,
.color-card,
.flashcard,
.metric-card,
.value-grid article,
.rules-dialog form {
  backdrop-filter: blur(14px);
}

.nav-cluster,
.quick-nav,
.control-cluster {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar button {
  pointer-events: auto;
}

.pill-button,
.brand-pill,
.quick-nav button,
.round-button,
.hero-button,
.start-button,
.reset-button {
  min-height: 54px;
  border: 3px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--glass);
  box-shadow: 0 9px 0 rgba(56, 128, 84, 0.13), var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.pill-button:hover,
.brand-pill:hover,
.quick-nav button:hover,
.round-button:hover,
.hero-button:hover,
.start-button:hover,
.reset-button:hover,
.island:hover,
.habitat:hover,
.drop-zone:hover,
.color-card:hover,
.animal-card:hover,
.lesson-tabs button:hover {
  transform: translateY(-3px);
  filter: saturate(1.07);
}

.pill-button:active,
.brand-pill:active,
.quick-nav button:active,
.round-button:active,
.hero-button:active,
.start-button:active,
.reset-button:active,
.island:active,
.habitat:active,
.drop-zone:active,
.color-card:active,
.animal-card:active,
.lesson-tabs button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 0 rgba(56, 128, 84, 0.1), 0 12px 28px rgba(35, 77, 56, 0.14);
}

.pill-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  font-weight: 900;
}

.pill-button.warm,
.hero-button.primary,
.start-button {
  color: #fff;
  background: linear-gradient(180deg, #ffb06c, var(--orange));
  text-shadow: 0 1px 0 rgba(115, 66, 31, 0.22);
}

.pill-button.ghost {
  background: rgba(255, 255, 255, 0.83);
}

.brand-pill {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  max-width: 460px;
  min-height: 62px;
  padding: 7px 17px 7px 8px;
  text-align: left;
}

.brand-pill img,
.teacher-badge img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-pill span {
  display: grid;
  min-width: 0;
  margin-left: 9px;
}

.brand-pill strong {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--leaf-deep);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-pill small {
  color: #d8713f;
  font-size: 0.76rem;
  font-weight: 900;
}

.quick-nav button {
  min-width: 118px;
  min-height: 54px;
  padding: 0 17px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(193, 230, 244, 0.86);
  font-weight: 900;
}

.round-button {
  width: 54px;
  min-width: 54px;
  padding: 0;
  font-weight: 1000;
  background: rgba(255, 255, 255, 0.88);
}

.teacher-badge {
  position: fixed;
  top: 92px;
  right: 20px;
  z-index: 18;
  display: grid;
  justify-items: center;
  width: 94px;
  min-height: 104px;
  padding: 8px 7px;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  text-align: center;
}

.teacher-badge strong {
  font-size: 0.72rem;
}

.teacher-badge span {
  font-size: 0.68rem;
  font-weight: 900;
  color: #d8713f;
}

.deck {
  position: relative;
  width: 100%;
  height: 100vh;
  padding: 104px 32px calc(var(--dock-height) + 28px);
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 102px 32px calc(var(--dock-height) + 34px);
}

.slide.active {
  display: flex;
  animation: slideIn 0.48s cubic-bezier(0.2, 0.74, 0.18, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  max-width: 1120px;
  margin-top: 24px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: #df7042;
  font-size: 1.45rem;
  font-weight: 1000;
  text-shadow: 0 3px 0 #fff, 0 7px 22px rgba(120, 92, 46, 0.22);
}

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

.hero-copy h1 {
  margin-bottom: 8px;
  color: #4f963f;
  font-size: 5.9rem;
  line-height: 0.98;
  font-weight: 1000;
  text-shadow:
    0 4px 0 #fff,
    0 8px 0 rgba(255, 255, 255, 0.76),
    0 18px 34px rgba(54, 95, 63, 0.22);
}

.hero-copy h1 .en {
  display: block;
  margin-top: 12px;
  color: #ff8c4d;
  font-size: 3rem;
}

.hero-sub {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-bottom: 24px;
  padding: 8px 20px;
  border-radius: 999px;
  color: #6a4d30;
  background: rgba(255, 255, 255, 0.74);
  font-size: 1.05rem;
  font-weight: 1000;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.hero-button {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-width: 196px;
  min-height: 62px;
  padding: 0 28px;
  font-size: 1.12rem;
  font-weight: 1000;
}

.hero-button.secondary {
  color: #fff;
  background: linear-gradient(180deg, #6fc37d, #3f9b67);
}

.hero-button.cool {
  background: rgba(196, 230, 244, 0.9);
}

.teacher-line {
  max-width: 760px;
  min-height: 48px;
  margin: 0;
  padding: 12px 28px;
  border-radius: 999px;
  color: #69482f;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1.05rem;
  font-weight: 1000;
  box-shadow: 0 14px 34px rgba(47, 87, 65, 0.14);
}

.teacher-line .en {
  display: block;
  margin-top: 2px;
  color: #d87340;
}

.hero-orbit {
  position: absolute;
  inset: 112px 11% calc(var(--dock-height) + 74px);
  pointer-events: none;
}

.orbit-token {
  position: absolute;
  width: 88px;
  height: 88px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #68bce0, #4ca574);
  box-shadow: var(--shadow);
  font-weight: 1000;
  pointer-events: auto;
  animation: bob 3.4s ease-in-out infinite;
}

.token-1 {
  left: 4%;
  top: 54%;
}

.token-2 {
  right: 7%;
  top: 31%;
  background: linear-gradient(180deg, #ffb461, #f3755c);
  animation-delay: 0.6s;
}

.token-3 {
  right: 18%;
  bottom: 4%;
  background: linear-gradient(180deg, #ffe36d, #65be84);
  animation-delay: 1.1s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.section-heading {
  position: absolute;
  top: 118px;
  left: 50%;
  display: grid;
  justify-items: center;
  width: min(1000px, calc(100% - 64px));
  transform: translateX(-50%);
  text-align: center;
}

.section-heading.compact {
  top: 110px;
}

.big-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 4px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 2rem;
  box-shadow: var(--shadow);
}

.section-heading h2 {
  margin-bottom: 6px;
  color: var(--leaf-deep);
  font-size: 3.4rem;
  line-height: 1.02;
  font-weight: 1000;
  text-shadow: 0 3px 0 #fff, 0 10px 24px rgba(54, 95, 63, 0.18);
}

.section-heading h2 .en {
  display: block;
  margin-top: 5px;
  color: #ff8c4d;
  font-size: 0.52em;
}

.section-heading p {
  margin-bottom: 0;
  padding: 8px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #6b4b31;
  font-size: 1rem;
  font-weight: 900;
}

.island-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 22px;
  width: min(1010px, 100%);
  margin-top: 148px;
}

.island {
  position: relative;
  display: grid;
  justify-items: center;
  min-height: 150px;
  padding: 18px 16px 15px;
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 30px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 11px 0 rgba(65, 126, 84, 0.12), var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.island::after {
  position: absolute;
  right: 14px;
  bottom: 10px;
  width: 42px;
  height: 12px;
  border-radius: 999px;
  content: "";
  background: rgba(96, 154, 109, 0.18);
}

.island-emoji {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 2rem;
}

.island strong {
  font-size: 1.26rem;
  line-height: 1.16;
}

.island small {
  margin-top: 4px;
  color: #d3733d;
  font-weight: 1000;
}

.island-warm {
  background: linear-gradient(180deg, rgba(255, 241, 176, 0.86), rgba(255, 255, 255, 0.76));
}

.island-explore {
  background: linear-gradient(180deg, rgba(189, 232, 179, 0.86), rgba(255, 255, 255, 0.76));
}

.island-learn {
  background: linear-gradient(180deg, rgba(186, 226, 243, 0.9), rgba(255, 255, 255, 0.76));
}

.island-match {
  background: linear-gradient(180deg, rgba(255, 204, 155, 0.88), rgba(255, 255, 255, 0.77));
}

.island-quiz {
  background: linear-gradient(180deg, rgba(215, 199, 244, 0.88), rgba(255, 255, 255, 0.77));
}

.island-paint {
  background: linear-gradient(180deg, rgba(255, 180, 202, 0.86), rgba(255, 255, 255, 0.76));
}

.warmup-stage {
  display: grid;
  grid-template-columns: 300px minmax(440px, 660px);
  gap: 38px;
  align-items: center;
  margin-top: 168px;
}

.action-circle {
  display: grid;
  place-items: center;
  width: 290px;
  height: 290px;
  border: 7px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  color: #fff;
  background: conic-gradient(from 10deg, #f76f67, #ffb455, #6fc37d, #58b6dd, #8d7bd6, #f76f67);
  box-shadow: var(--shadow);
  text-align: center;
  animation: breathe 2.7s ease-in-out infinite;
}

.action-circle span {
  font-size: 5rem;
  line-height: 1;
}

.action-circle strong {
  font-size: 2.5rem;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.action-circle small {
  font-size: 1.15rem;
  font-weight: 1000;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.action-ring {
  display: grid;
  grid-template-columns: repeat(3, minmax(136px, 1fr));
  gap: 16px;
}

.action-ring button,
.lesson-tabs button,
.paint-tools button {
  min-height: 64px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 0 rgba(64, 126, 84, 0.11), var(--shadow);
  font-weight: 1000;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.start-button {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: 220px;
  margin-top: 6px;
  padding: 0 30px;
  font-weight: 1000;
}

.start-button.smaller {
  position: absolute;
  bottom: calc(var(--dock-height) + 34px);
  min-width: 170px;
}

.habitat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(170px, 1fr));
  gap: 20px;
  width: min(880px, 100%);
  margin-top: 170px;
}

.habitat {
  display: grid;
  justify-items: center;
  min-height: 128px;
  padding: 16px 12px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 0 rgba(64, 126, 84, 0.11), var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.habitat span {
  font-size: 2.6rem;
}

.habitat strong {
  font-size: 1.4rem;
}

.habitat small {
  font-weight: 1000;
  color: #d3733d;
}

.habitat.canopy {
  background: linear-gradient(180deg, rgba(169, 219, 145, 0.88), rgba(255, 255, 255, 0.75));
}

.habitat.flower {
  background: linear-gradient(180deg, rgba(255, 189, 212, 0.9), rgba(255, 255, 255, 0.75));
}

.habitat.river {
  background: linear-gradient(180deg, rgba(153, 219, 242, 0.88), rgba(255, 255, 255, 0.75));
}

.habitat.house {
  background: linear-gradient(180deg, rgba(255, 211, 143, 0.88), rgba(255, 255, 255, 0.75));
}

.habitat.sky {
  background: linear-gradient(180deg, rgba(211, 199, 244, 0.88), rgba(255, 255, 255, 0.75));
}

.habitat.path {
  background: linear-gradient(180deg, rgba(246, 226, 160, 0.88), rgba(255, 255, 255, 0.75));
}

.response-line {
  position: absolute;
  bottom: calc(var(--dock-height) + 30px);
  left: 50%;
  min-width: 260px;
  margin: 0;
  padding: 13px 28px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: #603f25;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  font-weight: 1000;
  text-align: center;
  transform: translateX(-50%);
}

.lesson-tabs {
  position: absolute;
  top: 248px;
  left: 50%;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

.lesson-tabs button {
  min-width: 132px;
  min-height: 52px;
  border-radius: 999px;
  color: #5f4b2e;
}

.lesson-tabs button.active {
  color: #fff;
  background: linear-gradient(180deg, #65be84, #3e9a67);
}

.flashcard {
  display: grid;
  grid-template-columns: 210px minmax(300px, 470px) 172px;
  gap: 24px;
  align-items: center;
  width: min(920px, 100%);
  min-height: 280px;
  margin-top: 178px;
  padding: 24px;
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.flash-emoji {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  border-radius: 42px;
  background: linear-gradient(180deg, #fff0a7, #bde8b3);
  font-size: 6.5rem;
}

.flash-copy p {
  margin-bottom: 8px;
  color: #d87340;
  font-weight: 1000;
}

.flash-copy h3 {
  margin-bottom: 6px;
  color: var(--leaf-deep);
  font-size: 4rem;
  line-height: 1;
}

.flash-copy strong {
  display: block;
  margin-bottom: 14px;
  font-size: 1.7rem;
  color: #6b4b31;
}

.flash-copy span {
  font-size: 1.16rem;
  font-weight: 900;
}

.flash-actions {
  display: grid;
  gap: 12px;
}

.flash-actions button {
  min-height: 62px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #69bee1, #4b9e76);
  box-shadow: 0 7px 0 rgba(35, 111, 93, 0.22);
  font-weight: 1000;
  cursor: pointer;
}

.match-board {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(500px, 690px);
  gap: 28px;
  align-items: stretch;
  width: min(1040px, 100%);
  margin-top: 172px;
}

.drag-tray,
.drop-zones {
  display: grid;
  gap: 14px;
}

.drag-tray {
  grid-template-columns: 1fr 1fr;
}

.drag-card {
  min-height: 92px;
  border: 4px solid rgba(255, 255, 255, 0.84);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 0 rgba(64, 126, 84, 0.1), var(--shadow);
  font-weight: 1000;
  cursor: grab;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.drag-card span {
  display: block;
  font-size: 2.1rem;
}

.drag-card.selected {
  outline: 5px solid var(--sun);
  transform: translateY(-5px);
}

.drag-card.matched {
  opacity: 0.5;
  filter: grayscale(0.35);
  pointer-events: none;
}

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

.drop-zone {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 260px;
  padding: 18px 14px;
  border: 5px dashed rgba(255, 255, 255, 0.9);
  border-radius: 34px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.drop-zone span {
  font-size: 4.2rem;
}

.drop-zone strong {
  font-size: 1.6rem;
}

.drop-zone small {
  color: #d3733d;
  font-weight: 1000;
}

.drop-zone.filled {
  border-style: solid;
  border-color: rgba(105, 184, 119, 0.78);
  background: rgba(209, 244, 200, 0.72);
}

.drag-ghost {
  position: fixed;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 132px;
  height: 92px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  font-weight: 1000;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1.04);
}

.drag-ghost span {
  display: block;
  font-size: 2.1rem;
}

.drop-zone.shake,
.color-card.shake,
.habitat.pop,
.animal-card.pop,
.flashcard.pop,
.action-circle.pop {
  animation: popShake 0.42s ease;
}

@keyframes popShake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-7px);
  }

  60% {
    transform: translateX(7px);
  }
}

.quiz-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 18px;
  width: min(830px, 100%);
  margin-top: 162px;
}

.color-card {
  min-height: 128px;
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  color: #fff;
  box-shadow: 0 10px 0 rgba(64, 126, 84, 0.12), var(--shadow);
  font-size: 1.55rem;
  font-weight: 1000;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.color-card small {
  font-size: 1rem;
}

.red {
  background: #f76f67;
}

.yellow {
  color: #684c27;
  background: #ffe36d;
  text-shadow: none;
}

.blue {
  background: #58b6dd;
}

.green {
  background: #65be84;
}

.orange {
  background: #ff9954;
}

.purple {
  background: #8d7bd6;
}

.color-card.correct {
  animation: correctPulse 0.72s ease;
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.08) rotate(-1deg);
  }

  100% {
    transform: scale(1);
  }
}

.paint-studio {
  display: grid;
  grid-template-columns: minmax(480px, 880px) 92px;
  gap: 16px;
  align-items: center;
  width: min(1010px, 100%);
  margin-top: 168px;
}

#paintCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
  border: 6px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: #fffdf3;
  box-shadow: var(--shadow);
  touch-action: none;
}

.paint-tools {
  display: grid;
  gap: 10px;
}

.paint-tools button {
  width: 72px;
  min-height: 52px;
  border-radius: 20px;
}

.swatch {
  position: relative;
  background: var(--swatch) !important;
}

.swatch.active::after {
  position: absolute;
  inset: 11px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 13px;
  content: "";
}

.parent-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 18px;
  width: min(760px, 100%);
  margin-top: 156px;
}

.metric-card {
  display: grid;
  justify-items: center;
  min-height: 154px;
  padding: 18px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.metric-card span {
  font-size: 2.3rem;
}

.metric-card strong {
  color: var(--leaf-deep);
  font-size: 3rem;
  line-height: 1;
}

.metric-card small {
  color: #d3733d;
  font-weight: 1000;
}

.value-grid {
  position: absolute;
  bottom: calc(var(--dock-height) + 32px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  width: min(980px, calc(100% - 64px));
  transform: translateX(-50%);
}

.value-grid article {
  min-height: 132px;
  padding: 18px 20px;
  border: 4px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.value-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--leaf-deep);
  font-size: 1.12rem;
}

.value-grid p {
  margin: 0;
  color: #5f4b37;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
}

.student-dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 24;
  display: grid;
  grid-template-columns: 88px 160px minmax(520px, 660px) 92px;
  gap: 12px;
  align-items: center;
  width: min(960px, calc(100% - 28px));
  min-height: var(--dock-height);
  padding: 14px 16px;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(238, 255, 226, 0.84);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.dock-title {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--leaf-deep);
  font-weight: 1000;
  text-align: center;
}

#starCounter {
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: #ff9954;
  font-size: 0.9rem;
}

.name-entry {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 3px solid rgba(255, 255, 255, 0.84);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
  font-weight: 1000;
}

.name-entry input {
  width: 100%;
  height: 42px;
  border: 3px solid rgba(105, 184, 119, 0.38);
  border-radius: 14px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  font-size: 1rem;
  font-weight: 900;
}

.animal-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.animal-card {
  display: grid;
  justify-items: center;
  min-width: 0;
  min-height: 94px;
  padding: 7px 4px 6px;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.78), 0 7px 0 rgba(64, 126, 84, 0.08);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, filter 0.18s ease;
}

.animal-card .animal-emoji {
  font-size: 2rem;
  line-height: 1.05;
}

.animal-card strong {
  overflow: hidden;
  width: 100%;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animal-card small {
  overflow: hidden;
  width: 100%;
  color: #d3733d;
  font-size: 0.68rem;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animal-card.bound {
  background: rgba(255, 231, 157, 0.82);
}

.reset-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(180deg, #f99bbb, #f76f67);
  font-weight: 1000;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-height) + 26px);
  z-index: 40;
  min-width: 260px;
  max-width: 680px;
  padding: 13px 24px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 122, 90, 0.9);
  box-shadow: var(--shadow);
  font-weight: 1000;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti {
  position: fixed;
  z-index: 60;
  width: 12px;
  height: 16px;
  border-radius: 4px;
  pointer-events: none;
  animation: confettiFall 900ms ease-out forwards;
}

@keyframes confettiFall {
  from {
    opacity: 1;
    transform: translateY(-10px) rotate(0);
  }

  to {
    opacity: 0;
    transform: translateY(110px) rotate(220deg);
  }
}

.rules-dialog {
  width: min(520px, calc(100% - 42px));
  border: 0;
  border-radius: 32px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.rules-dialog::backdrop {
  background: rgba(31, 74, 54, 0.34);
  backdrop-filter: blur(8px);
}

.rules-dialog form {
  display: grid;
  gap: 18px;
  justify-items: center;
  padding: 32px;
  border: 5px solid rgba(255, 255, 255, 0.88);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  text-align: center;
}

.rules-dialog h2 {
  margin-bottom: 0;
  color: var(--leaf-deep);
  font-size: 2.2rem;
}

.rules-dialog p {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.55;
}

body.lang-cn .en {
  display: none !important;
}

body.lang-en .cn {
  display: none !important;
}

body.lang-en .hero-copy h1 .en {
  display: block !important;
}

body.presentation-mode .topbar {
  opacity: 0.12;
}

body.presentation-mode .topbar:hover {
  opacity: 1;
}

body.presentation-mode .teacher-badge {
  transform: translateY(-128px);
}

body.presentation-mode .student-dock {
  width: min(760px, calc(100% - 28px));
  opacity: 0.22;
}

body.presentation-mode .student-dock:hover {
  opacity: 1;
}

@media (max-width: 1180px) {
  :root {
    --dock-height: 118px;
  }

  .topbar {
    grid-template-columns: auto minmax(190px, 1fr) auto;
  }

  .quick-nav {
    display: none;
  }

  .teacher-badge {
    display: none;
  }

  .hero-copy h1 {
    font-size: 4.6rem;
  }

  .hero-copy h1 .en {
    font-size: 2.45rem;
  }

  .island-map {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
  }

  .student-dock {
    grid-template-columns: 74px 142px minmax(420px, 1fr) 76px;
  }

  .animal-card {
    min-height: 82px;
  }
}

@media (max-height: 820px) and (min-width: 901px) {
  :root {
    --dock-height: 116px;
  }

  .topbar {
    top: 10px;
    left: 14px;
    right: 14px;
    gap: 10px;
  }

  .pill-button,
  .quick-nav button,
  .round-button {
    min-height: 48px;
  }

  .brand-pill {
    min-height: 54px;
  }

  .brand-pill img {
    width: 42px;
    height: 42px;
  }

  .teacher-badge {
    top: 86px;
    width: 86px;
    min-height: 96px;
  }

  .slide {
    padding-top: 78px;
    padding-bottom: calc(var(--dock-height) + 24px);
  }

  .hero-copy {
    margin-top: 64px;
  }

  .hero-copy h1 {
    font-size: 4.55rem;
  }

  .hero-copy h1 .en {
    font-size: 2.42rem;
  }

  .hero-sub {
    margin-bottom: 18px;
  }

  .hero-actions {
    margin-bottom: 18px;
  }

  .section-heading,
  .section-heading.compact {
    top: 88px;
  }

  .big-icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-size: 1.55rem;
  }

  .section-heading h2 {
    margin-bottom: 4px;
    font-size: 2.82rem;
  }

  .section-heading p {
    padding: 6px 18px;
    font-size: 0.86rem;
  }

  .island-map {
    gap: 14px;
    width: min(1010px, calc(100% - 250px));
    margin-top: 162px;
  }

  .island {
    min-height: 128px;
    padding: 13px 12px 12px;
    border-radius: 26px;
  }

  .island-emoji {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    font-size: 1.7rem;
  }

  .island strong {
    font-size: 1.08rem;
  }

  .warmup-stage,
  .habitat-grid,
  .flashcard,
  .match-board,
  .quiz-panel,
  .paint-studio,
  .parent-dashboard {
    margin-top: 150px;
  }

  .flashcard {
    min-height: 238px;
  }

  .paint-studio {
    grid-template-columns: minmax(520px, 840px) 172px;
  }

  .paint-tools {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .paint-tools button {
    width: 78px;
    min-height: 46px;
  }

  .drop-zone {
    min-height: 230px;
  }

  .parent-dashboard {
    margin-top: 126px;
  }

  .metric-card {
    min-height: 122px;
    padding: 12px;
  }

  .metric-card span {
    font-size: 1.85rem;
  }

  .metric-card strong {
    font-size: 2.35rem;
  }

  .value-grid {
    bottom: calc(var(--dock-height) + 16px);
  }

  .value-grid article {
    min-height: 100px;
    padding: 12px 16px;
  }

  .value-grid strong {
    margin-bottom: 4px;
    font-size: 0.96rem;
  }

  .value-grid p {
    font-size: 0.78rem;
    line-height: 1.28;
  }

  .student-dock {
    grid-template-columns: 88px 160px minmax(500px, 660px) 92px;
    min-height: var(--dock-height);
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .animal-card {
    min-height: 82px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    top: 8px;
    grid-template-columns: 1fr;
    margin: 8px;
  }

  .nav-cluster,
  .control-cluster {
    justify-content: center;
  }

  .brand-pill {
    justify-self: center;
  }

  .deck,
  .slide {
    position: relative;
    height: auto;
    min-height: 920px;
    padding: 38px 16px 270px;
  }

  .slide {
    display: none;
  }

  .slide.active {
    display: flex;
  }

  .hero-copy h1 {
    font-size: 3.25rem;
  }

  .hero-copy h1 .en {
    font-size: 1.8rem;
  }

  .section-heading,
  .section-heading.compact {
    position: static;
    width: 100%;
    transform: none;
  }

  .section-heading h2 {
    font-size: 2.35rem;
  }

  .island-map,
  .habitat-grid,
  .quiz-panel,
  .parent-dashboard,
  .value-grid {
    position: static;
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 28px;
    transform: none;
  }

  .warmup-stage,
  .flashcard,
  .match-board,
  .paint-studio {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 28px;
  }

  .lesson-tabs {
    position: static;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    transform: none;
  }

  .action-circle {
    justify-self: center;
  }

  .drop-zones {
    grid-template-columns: 1fr;
  }

  .paint-tools {
    grid-template-columns: repeat(4, 1fr);
  }

  .paint-tools button {
    width: auto;
  }

  .student-dock {
    grid-template-columns: 1fr;
    width: calc(100% - 18px);
    max-height: none;
  }

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

  .toast,
  .response-line,
  .start-button.smaller {
    position: fixed;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
