:root {
  --bg: #fffaf0;
  --card: #ffffff;
  --yellow: #ffd86b;
  --yellow-strong: #ffc93f;
  --yellow-light: #fff8dc;
  --yellow-dark: #a87300;
  --text: #2f2a1f;
  --muted: #7b725f;
  --line: #f1dfaa;
  --green: #2f8f46;
  --red: #c2410c;
  --shadow: 0 18px 45px rgba(130, 96, 20, 0.09);
  --soft-shadow: 0 14px 34px rgba(130, 96, 20, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

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

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 240, 184, 0.85), rgba(255, 250, 240, 0.45) 36%, rgba(255, 233, 163, 0.72)),
    var(--bg);
  overflow-x: hidden;
}

button,
a,
.drop-zone {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus,
a:focus,
.drop-zone:focus {
  outline: none;
}

button:focus-visible,
a:focus-visible,
.drop-zone:focus-visible {
  outline: 3px solid rgba(255, 201, 63, 0.8);
  outline-offset: 4px;
}

.lesson-page {
  width: min(1440px, 94%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto minmax(126px, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.back-link,
.unit-pill,
.brand {
  font-weight: 900;
}

.back-link {
  width: fit-content;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(130, 96, 20, 0.06);
  color: #6f560f;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ffd15c, #fff0ae);
  color: #4a3500;
  box-shadow: 0 10px 24px rgba(255, 185, 36, 0.25);
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 19px;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.unit-pill {
  justify-self: end;
  width: fit-content;
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--yellow-light);
  border: 1px solid var(--line);
  color: var(--yellow-dark);
  white-space: nowrap;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(241, 223, 170, 0.8);
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd86b, #ffc93f);
}

.main-card {
  border-radius: 34px;
  background: linear-gradient(135deg, #ffffff 0%, #fff8dc 100%);
  border: 1px solid rgba(241, 223, 170, 0.95);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 38px);
  animation: screenIn 0.35s ease;
}

.intro {
  max-width: 900px;
  margin-bottom: 24px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--yellow-dark);
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.92fr) minmax(370px, 1.12fr) minmax(300px, 0.96fr);
  gap: 18px;
  align-items: stretch;
}

.panel {
  min-height: 580px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
  padding: 22px;
}

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

.panel h2,
.word-section h3 {
  margin: 0;
  letter-spacing: 0;
}

.panel h2 {
  font-size: 26px;
}

.word-section + .word-section {
  margin-top: 22px;
}

.word-section h3 {
  margin-bottom: 12px;
  font-size: 17px;
}

.small-hint {
  min-height: 44px;
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.word-card {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--chip-bg, #fffaf0);
  color: var(--chip-fg, var(--text));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: grab;
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.25;
  box-shadow: 0 9px 18px rgba(130, 96, 20, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  touch-action: manipulation;
  user-select: none;
}

.word-card:active {
  cursor: grabbing;
}

.word-card:hover,
.word-card.picked {
  transform: translateY(-2px);
  border-color: var(--yellow-strong);
  box-shadow: 0 12px 22px rgba(255, 199, 67, 0.24);
}

.word-card.placed {
  background: var(--yellow);
  border-color: var(--yellow-strong);
  color: #3a2c05;
}

.word-card.color-card {
  border-color: rgba(47, 42, 31, 0.12);
}

.word-card.white-card {
  border-color: #d6cba8;
}

.word-icon {
  width: 22px;
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
}

.word-text {
  overflow-wrap: anywhere;
}

.category-tabs {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 1000;
  transition: 0.18s ease;
}

.category-tab:hover,
.category-tab.active {
  background: var(--yellow);
  border-color: var(--yellow-strong);
  color: #3a2c05;
}

.category-icon {
  font-size: 17px;
}

.sentence-strip {
  min-height: 70px;
  border-radius: 22px;
  background: #fffaf0;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 1000;
}

.sentence-slot {
  min-height: 42px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow-wrap: anywhere;
}

.balance-chip {
  min-width: 60px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--yellow);
  color: #3a2c05;
  text-align: center;
  box-shadow: 0 10px 22px rgba(255, 199, 67, 0.28);
}

.scale-visual {
  height: 330px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, #fffdf6 0%, #fff4cd 100%);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.balance-badge {
  position: absolute;
  left: 50%;
  top: 54px;
  z-index: 4;
  transform: translateX(-50%);
  min-width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 3px solid #fff3bf;
  color: #3a2c05;
  font-size: 24px;
  font-weight: 1000;
  box-shadow: 0 12px 24px rgba(130, 96, 20, 0.14);
}

.moving-scale {
  position: absolute;
  left: 50%;
  bottom: 105px;
  width: min(390px, 88%);
  transform: translateX(-50%);
  transform-origin: center center;
  transition: transform 0.35s ease;
}

.scale-visual.tilted-left .moving-scale {
  transform: translateX(-50%) rotate(-6deg);
}

.scale-visual.balanced .moving-scale {
  transform: translateX(-50%) rotate(0deg);
}

.scale-beam {
  height: 12px;
  border-radius: 999px;
  background: #6d4c19;
  box-shadow: 0 6px 12px rgba(89, 58, 11, 0.18);
}

.pan-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 74px;
  margin-top: -2px;
}

.pan-wrap {
  display: grid;
  justify-items: center;
}

.pan-line {
  width: 2px;
  height: 56px;
  background: #8c6820;
}

.drop-zone {
  width: 152px;
  min-height: 80px;
  border: 2px dashed #ddbd5b;
  border-radius: 24px 24px 30px 30px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  font-weight: 1000;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: inset 0 -10px 18px rgba(255, 216, 107, 0.18);
  transition: 0.18s ease;
}

.drop-zone.drag-over {
  background: #fff8dc;
  border-color: var(--yellow-strong);
  transform: translateY(-2px);
}

.pan-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--yellow);
  color: #3a2c05;
}

.remove-chip {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #fff2bd;
  color: #785200;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.scale-pillar {
  position: absolute;
  left: 50%;
  bottom: 50px;
  width: 18px;
  height: 102px;
  transform: translateX(-50%);
  border-radius: 999px 999px 0 0;
  background: #8c6820;
}

.scale-base {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 132px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #6d4c19;
}

.sentence-output {
  min-height: 42px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: 25px;
  font-weight: 1000;
  line-height: 1.35;
  text-align: center;
}

.feedback-card {
  min-height: 54px;
  border-radius: 18px;
  padding: 14px 16px;
  font-weight: 900;
  line-height: 1.55;
  border: 1px solid var(--line);
}

.feedback-card.hint {
  background: #fffaf0;
  color: #6f560f;
}

.feedback-card.warn {
  background: #fff4e8;
  border-color: #ffd2a8;
  color: var(--red);
}

.feedback-card.success {
  background: #f0fff4;
  border-color: #bdecc8;
  color: var(--green);
}

.button-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.nav-btn {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 22px;
  cursor: pointer;
  font-weight: 1000;
}

.nav-btn:hover {
  background: var(--yellow-light);
}

.meaning-stage {
  height: 365px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #eaf7ff 0%, #fff8dc 72%, #f7dc93 100%);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scene-hint {
  width: min(260px, 86%);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 16px;
  text-align: center;
  font-weight: 900;
  line-height: 1.6;
}

.meaning-text {
  min-height: 54px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.65;
}

.scene {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
}

.visual-object {
  --main-color: #ffd86b;
  --accent-color: #fff6cc;
  --scale: 1;
  --move-x: 0px;
  --move-y: 0px;
  width: 160px;
  height: 160px;
  position: relative;
  z-index: 2;
  transform: translate(var(--move-x), var(--move-y)) scale(var(--scale));
  transform-origin: center bottom;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.visual-object.size-big {
  --scale: 1.2;
}

.visual-object.size-small {
  --scale: 0.72;
}

.visual-object.size-huge {
  --scale: 1.48;
}

.visual-object.place-box {
  --move-y: 34px;
}

.visual-object.place-table {
  --move-y: -28px;
}

.visual-object.place-school {
  --move-y: 10px;
}

.visual-object.speed-fast {
  animation: dashFast 0.9s ease-in-out infinite;
}

.visual-object.speed-slow {
  animation: dashSlow 2.4s ease-in-out infinite;
}

.temperature-hot::after,
.temperature-cold::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 42px;
  pointer-events: none;
  z-index: -1;
}

.temperature-hot::after {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.28), transparent 68%);
  animation: pulseWarm 1.2s ease-in-out infinite;
}

.temperature-cold::after {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 68%);
  box-shadow: 0 0 24px rgba(96, 165, 250, 0.3);
}

.effect-symbol {
  position: absolute;
  right: -12px;
  top: -12px;
  width: 42px;
  max-width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(130, 96, 20, 0.12);
  color: var(--text);
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
  overflow: hidden;
  padding: 0;
  text-align: center;
  white-space: nowrap;
  z-index: 12;
}

.effect-symbol::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: rgba(255, 216, 107, 0.22);
  z-index: -1;
}

.effect-symbol:empty {
  display: none;
}

.sparkles,
.dirt-layer,
.crack-mark,
.room-stain,
.car-smoke {
  pointer-events: none;
  opacity: 0;
}

.state-clean .sparkles {
  opacity: 1;
}

.state-dirty .dirt-layer,
.state-dirty .room-stain {
  opacity: 1;
}

.state-broken .crack-mark,
.state-broken .car-smoke {
  opacity: 1;
}

.material-wooden .ball-core,
.material-wooden .apple-body {
  background:
    repeating-linear-gradient(90deg, rgba(111, 78, 37, 0.2) 0 8px, rgba(255, 255, 255, 0.08) 8px 13px),
    #b77935;
}

.material-metal .ball-core,
.material-metal .apple-body {
  background: linear-gradient(135deg, #e5e7eb, #6b7280 52%, #f8fafc);
}

.material-plastic .ball-core,
.material-plastic .apple-body {
  background: linear-gradient(135deg, var(--main-color), #ffffff 210%);
  filter: saturate(1.35);
}

.place-prop {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  z-index: 1;
}

.place-prop.place-box {
  width: 176px;
  height: 108px;
}

.box-back,
.box-front {
  position: absolute;
  left: 0;
  width: 100%;
  border: 4px solid #b77935;
  background: #d8a35d;
}

.box-back {
  top: 10px;
  height: 74px;
  opacity: 0.62;
}

.box-front {
  bottom: 0;
  height: 52px;
  border-radius: 0 0 18px 18px;
}

.place-prop.place-table {
  width: 210px;
  height: 106px;
  bottom: 58px;
}

.table-top {
  position: absolute;
  left: 0;
  top: 6px;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: #9a641f;
}

.table-leg {
  position: absolute;
  top: 20px;
  width: 16px;
  height: 74px;
  border-radius: 999px;
  background: #7c4f18;
}

.table-leg.left {
  left: 34px;
}

.table-leg.right {
  right: 34px;
}

.place-prop.place-school {
  width: 210px;
  height: 145px;
  bottom: 36px;
}

.school-roof {
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 78px solid transparent;
  border-right: 78px solid transparent;
  border-bottom: 42px solid #b45309;
}

.school-body {
  width: 170px;
  height: 90px;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff3bf;
  border: 4px solid #c08422;
  display: grid;
  place-items: center;
  color: #8a5500;
  font-weight: 1000;
}

.visual-ball .ball-core {
  position: absolute;
  left: 28px;
  top: 25px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--main-color);
  border: 4px solid rgba(47, 42, 31, 0.14);
  box-shadow: inset -18px -18px 28px rgba(47, 42, 31, 0.12), 0 16px 25px rgba(47, 42, 31, 0.13);
}

.visual-ball.shape-long .ball-core {
  left: 13px;
  top: 48px;
  width: 134px;
  height: 72px;
  border-radius: 999px;
}

.visual-ball .shine,
.visual-apple .apple-shine {
  position: absolute;
  width: 26px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  transform: rotate(26deg);
}

.visual-ball .shine {
  left: 54px;
  top: 42px;
}

.visual-ball.color-white .ball-core {
  border-color: #cfc6ad;
}

.visual-apple .apple-body {
  position: absolute;
  left: 32px;
  top: 48px;
  width: 98px;
  height: 92px;
  border-radius: 48% 52% 55% 55%;
  background: var(--main-color);
  border: 4px solid rgba(127, 29, 29, 0.18);
  box-shadow: inset -14px -16px 22px rgba(127, 29, 29, 0.16), 0 16px 24px rgba(47, 42, 31, 0.12);
}

.visual-apple .apple-body::before {
  content: "";
  position: absolute;
  left: 42px;
  top: -5px;
  width: 20px;
  height: 16px;
  border-radius: 0 0 999px 999px;
  background: rgba(255, 255, 255, 0.22);
}

.apple-stem {
  position: absolute;
  left: 77px;
  top: 28px;
  width: 12px;
  height: 30px;
  border-radius: 999px;
  background: #7c4f18;
  transform: rotate(10deg);
}

.apple-leaf {
  position: absolute;
  left: 88px;
  top: 28px;
  width: 34px;
  height: 20px;
  border-radius: 100% 0 100% 0;
  background: #2f8f46;
  transform: rotate(-18deg);
}

.apple-shine {
  left: 54px;
  top: 66px;
}

.visual-dog {
  width: 188px;
  height: 160px;
}

.dog-body {
  position: absolute;
  left: 50px;
  top: 76px;
  width: 94px;
  height: 48px;
  border-radius: 999px;
  background: var(--main-color);
  box-shadow: inset -12px -10px 14px rgba(89, 58, 11, 0.12);
}

.dog-head {
  position: absolute;
  left: 112px;
  top: 48px;
  width: 58px;
  height: 58px;
  border-radius: 45% 45% 50% 50%;
  background: var(--main-color);
  border: 3px solid rgba(89, 58, 11, 0.12);
}

.dog-ear {
  position: absolute;
  top: 2px;
  width: 18px;
  height: 34px;
  border-radius: 999px;
  background: #8a5a2b;
}

.dog-ear.left {
  left: -8px;
  transform: rotate(24deg);
}

.dog-ear.right {
  right: -8px;
  transform: rotate(-24deg);
}

.dog-eye {
  position: absolute;
  top: 22px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2f2a1f;
}

.dog-eye.left {
  left: 18px;
}

.dog-eye.right {
  right: 18px;
}

.dog-nose {
  position: absolute;
  left: 25px;
  top: 31px;
  width: 8px;
  height: 6px;
  border-radius: 50% 50% 60% 60%;
  background: #2f2a1f;
}

.dog-face {
  position: absolute;
  left: 18px;
  top: 38px;
  width: 24px;
  height: 12px;
}

.dog-mouth {
  position: absolute;
  left: 5px;
  top: -1px;
  width: 15px;
  height: 9px;
  border-bottom: 3px solid #5f3b18;
  border-radius: 0 0 999px 999px;
}

.dog-mouth::before,
.dog-mouth::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 7px;
  height: 7px;
  border-bottom: 2px solid #5f3b18;
  border-radius: 0 0 999px 999px;
}

.dog-mouth::before {
  left: -1px;
  transform: rotate(14deg);
}

.dog-mouth::after {
  right: -1px;
  transform: rotate(-14deg);
}

.dog-tail {
  position: absolute;
  left: 28px;
  top: 62px;
  width: 50px;
  height: 14px;
  border-radius: 999px;
  background: var(--main-color);
  transform-origin: right center;
  transform: rotate(-28deg);
}

.mood-happy .dog-tail {
  animation: tailWag 0.42s ease-in-out infinite;
}

.mood-sad .dog-head,
.mood-tired .dog-head {
  transform: translateY(8px);
}

.mood-sad .dog-mouth {
  top: 5px;
  border-top: 3px solid #5f3b18;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.mood-sad .dog-mouth::before,
.mood-sad .dog-mouth::after,
.mood-tired .dog-mouth::before,
.mood-tired .dog-mouth::after {
  display: none;
}

.mood-tired .dog-eye {
  height: 2px;
  border-radius: 999px;
  transform: translateY(2px);
}

.mood-tired .dog-mouth {
  width: 13px;
  height: 2px;
  top: 5px;
  border-top: 2px solid #5f3b18;
  border-bottom: 0;
  border-radius: 999px;
}

.dog-leg {
  position: absolute;
  top: 114px;
  width: 12px;
  height: 34px;
  border-radius: 999px;
  background: #9a672f;
}

.dog-leg.one {
  left: 64px;
}

.dog-leg.two {
  left: 92px;
}

.dog-leg.three {
  left: 121px;
}

.dog-leg.four {
  left: 142px;
}

.visual-person {
  width: 155px;
  height: 185px;
}

.person-head {
  position: absolute;
  left: 49px;
  top: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffd37a;
  border: 3px solid rgba(47, 42, 31, 0.12);
  z-index: 2;
}

.person-hair {
  position: absolute;
  left: 43px;
  top: 14px;
  width: 70px;
  height: 38px;
  border-radius: 35px 35px 14px 14px;
  background: #5f3b18;
  z-index: 3;
}

.person-hair.short {
  height: 28px;
}

.person-hair.long {
  height: 70px;
  border-radius: 34px 34px 28px 28px;
}

.person-face {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-size: 20px;
}

.person-body {
  position: absolute;
  left: 45px;
  top: 76px;
  width: 66px;
  height: 70px;
  border-radius: 18px 18px 26px 26px;
  background: #60a5fa;
  z-index: 1;
}

.character-girl .person-body {
  background: #f472b6;
  border-radius: 20px 20px 42px 42px;
}

.person-arm {
  position: absolute;
  top: 86px;
  width: 15px;
  height: 58px;
  border-radius: 999px;
  background: #ffd37a;
  z-index: 0;
}

.person-arm.left {
  left: 30px;
  transform: rotate(18deg);
}

.person-arm.right {
  right: 30px;
  transform: rotate(-18deg);
}

.person-leg {
  position: absolute;
  top: 140px;
  width: 18px;
  height: 42px;
  border-radius: 999px;
  background: #315b90;
}

.person-leg.left {
  left: 56px;
}

.person-leg.right {
  right: 55px;
}

.person-role-prop {
  position: absolute;
  right: 4px;
  top: 92px;
  min-width: 36px;
  height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(130, 96, 20, 0.12);
  font-weight: 1000;
}

.person-role-prop:empty {
  display: none;
}

.role-student .person-body {
  background: #22c55e;
}

.role-teacher .person-body {
  background: #8b5cf6;
}

.role-doctor .person-body {
  background: #f8fafc;
  border: 3px solid #60a5fa;
}

.role-driver .person-body {
  background: #f97316;
}

.role-friend .person-arm.right {
  transform: rotate(-64deg);
}

.visual-car {
  width: 210px;
  height: 145px;
}

.car-body {
  position: absolute;
  left: 22px;
  top: 70px;
  width: 166px;
  height: 52px;
  border-radius: 26px 30px 18px 18px;
  background: var(--main-color);
  box-shadow: inset -14px -12px 16px rgba(127, 29, 29, 0.15), 0 16px 22px rgba(47, 42, 31, 0.14);
}

.car-top {
  position: absolute;
  left: 64px;
  top: 38px;
  width: 88px;
  height: 50px;
  border-radius: 32px 32px 8px 8px;
  background: var(--main-color);
}

.car-window {
  position: absolute;
  top: 49px;
  width: 34px;
  height: 24px;
  border-radius: 12px 12px 4px 4px;
  background: #c7e8ff;
  z-index: 2;
}

.car-window.left {
  left: 76px;
}

.car-window.right {
  left: 116px;
}

.car-light {
  position: absolute;
  right: 20px;
  top: 84px;
  width: 14px;
  height: 10px;
  border-radius: 999px;
  background: #fde047;
  z-index: 2;
}

.car-wheel {
  position: absolute;
  top: 108px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f2937;
  border: 7px solid #6b7280;
  z-index: 2;
}

.car-wheel.left {
  left: 48px;
}

.car-wheel.right {
  right: 48px;
}

.state-broken .car-wheel.right {
  transform: rotate(24deg) translateY(8px);
}

.car-smoke {
  position: absolute;
  left: 16px;
  top: 62px;
  width: 42px;
  height: 32px;
  border-radius: 50%;
  background: rgba(107, 114, 128, 0.42);
  filter: blur(2px);
}

.visual-room {
  width: 226px;
  height: 184px;
}

.room-wall {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 190px;
  height: 118px;
  border-radius: 20px 20px 8px 8px;
  background: var(--main-color);
  border: 4px solid #e3c66b;
}

.room-floor {
  position: absolute;
  left: 10px;
  bottom: 18px;
  width: 206px;
  height: 58px;
  border-radius: 10px 10px 24px 24px;
  background:
    repeating-linear-gradient(90deg, rgba(124, 79, 24, 0.16) 0 2px, transparent 2px 32px),
    #d4a452;
}

.room-window {
  position: absolute;
  left: 28px;
  top: 24px;
  width: 50px;
  height: 42px;
  border-radius: 12px;
  background: #bde9ff;
  border: 4px solid #ffffff;
}

.room-door {
  position: absolute;
  right: 31px;
  bottom: -4px;
  width: 44px;
  height: 74px;
  border-radius: 14px 14px 4px 4px;
  background: #9a641f;
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.state-open .room-door {
  transform: perspective(160px) rotateY(-44deg);
}

.room-stain {
  position: absolute;
  bottom: 42px;
  width: 42px;
  height: 18px;
  border-radius: 50%;
  background: rgba(94, 55, 16, 0.4);
  z-index: 4;
}

.room-stain.one {
  left: 48px;
}

.room-stain.two {
  right: 48px;
  width: 34px;
}

.availability-full .room-wall {
  filter: saturate(0.7);
}

.visual-book {
  width: 170px;
  height: 150px;
}

.book-cover {
  position: absolute;
  left: 32px;
  top: 26px;
  width: 108px;
  height: 104px;
  border-radius: 16px 22px 22px 16px;
  background: var(--main-color);
  border: 4px solid #1d4ed8;
  box-shadow: 10px 10px 0 #dbeafe, 0 16px 24px rgba(47, 42, 31, 0.13);
}

.book-pages {
  position: absolute;
  left: 44px;
  top: 34px;
  width: 86px;
  height: 88px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.28);
}

.book-line {
  position: absolute;
  left: 60px;
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.book-line.one {
  top: 66px;
}

.book-line.two {
  top: 84px;
}

.state-open .book-cover {
  transform: rotateY(-24deg);
}

.visual-weatherscene {
  width: 220px;
  height: 172px;
}

.weather-sun {
  position: absolute;
  left: 34px;
  top: 24px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 0 16px rgba(250, 204, 21, 0.18), 0 0 34px rgba(250, 204, 21, 0.5);
}

.weather-cloud {
  position: absolute;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 14px 22px rgba(47, 42, 31, 0.12);
}

.weather-cloud::before,
.weather-cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.weather-cloud.first {
  left: 86px;
  top: 72px;
  width: 110px;
  height: 42px;
}

.weather-cloud.first::before {
  left: 18px;
  top: -26px;
  width: 48px;
  height: 48px;
}

.weather-cloud.first::after {
  right: 16px;
  top: -18px;
  width: 40px;
  height: 40px;
}

.weather-cloud.second {
  left: 45px;
  top: 104px;
  width: 82px;
  height: 32px;
  opacity: 0.92;
}

.rain-line,
.wind-line {
  position: absolute;
  opacity: 0;
}

.rain-line {
  top: 122px;
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: #3b82f6;
  transform: rotate(18deg);
}

.rain-line.one {
  left: 98px;
}

.rain-line.two {
  left: 132px;
}

.rain-line.three {
  left: 166px;
}

.wind-line {
  left: 28px;
  width: 158px;
  height: 5px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.7);
}

.wind-line.one {
  top: 58px;
}

.wind-line.two {
  top: 92px;
  width: 120px;
}

.weather-sunny .weather-sun {
  transform: scale(1.16);
  box-shadow: 0 0 0 22px rgba(250, 204, 21, 0.22), 0 0 42px rgba(250, 204, 21, 0.65);
}

.weather-rainy .rain-line {
  opacity: 1;
  animation: rainDrop 0.8s linear infinite;
}

.weather-rainy .weather-sun {
  opacity: 0.36;
}

.weather-windy .wind-line {
  opacity: 1;
  animation: windSweep 1.1s ease-in-out infinite;
}

.visual-mystery {
  width: 170px;
  height: 170px;
}

.mystery-question {
  position: absolute;
  left: 43px;
  top: 22px;
  width: 86px;
  height: 86px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  background: var(--main-color);
  border: 4px solid #f0be3d;
  color: #5a3d00;
  font-size: 64px;
  font-weight: 1000;
  box-shadow: 0 16px 24px rgba(47, 42, 31, 0.12);
}

.mystery-result {
  position: absolute;
  left: 42px;
  top: 26px;
  width: 90px;
  height: 90px;
  opacity: 0;
}

.mystery-result::before,
.mystery-result::after {
  content: "";
  position: absolute;
}

.mystery-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  color: var(--yellow-dark);
  font-weight: 1000;
}

.visual-mystery.object-ball .mystery-question,
.visual-mystery.object-apple .mystery-question,
.visual-mystery.object-book .mystery-question {
  opacity: 0;
}

.visual-mystery.object-ball .mystery-result,
.visual-mystery.object-apple .mystery-result,
.visual-mystery.object-book .mystery-result {
  opacity: 1;
}

.visual-mystery.object-ball .mystery-result::before {
  inset: 8px;
  border-radius: 50%;
  background: #f8fafc;
  border: 4px solid #d6cba8;
  box-shadow: inset -12px -12px 20px rgba(47, 42, 31, 0.13);
}

.visual-mystery.object-apple .mystery-result::before {
  left: 8px;
  top: 22px;
  width: 74px;
  height: 64px;
  border-radius: 48% 52% 56% 56%;
  background: #ef4444;
  box-shadow: inset -10px -10px 18px rgba(127, 29, 29, 0.15);
}

.visual-mystery.object-apple .mystery-result::after {
  left: 50px;
  top: 8px;
  width: 28px;
  height: 16px;
  border-radius: 100% 0 100% 0;
  background: #2f8f46;
}

.visual-mystery.object-book .mystery-result::before {
  left: 14px;
  top: 12px;
  width: 66px;
  height: 74px;
  border-radius: 12px 16px 16px 12px;
  background: #3b82f6;
  border: 4px solid #1d4ed8;
  box-shadow: 8px 8px 0 #dbeafe;
}

.dirt-layer {
  position: absolute;
  inset: 18px;
  border-radius: 32px;
  z-index: 5;
  background:
    radial-gradient(circle at 28% 62%, rgba(94, 55, 16, 0.48) 0 8px, transparent 9px),
    radial-gradient(circle at 66% 38%, rgba(94, 55, 16, 0.38) 0 7px, transparent 8px),
    radial-gradient(circle at 58% 72%, rgba(94, 55, 16, 0.32) 0 6px, transparent 7px);
}

.crack-mark {
  position: absolute;
  left: 50%;
  top: 32px;
  z-index: 6;
  width: 44px;
  height: 78px;
  border-left: 5px solid #2f2a1f;
  transform: translateX(-50%) rotate(12deg);
}

.crack-mark::before,
.crack-mark::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 5px;
  background: #2f2a1f;
  transform-origin: left center;
}

.crack-mark::before {
  top: 24px;
  left: -3px;
  transform: rotate(-42deg);
}

.crack-mark::after {
  top: 44px;
  left: -3px;
  transform: rotate(38deg);
}

.sparkles {
  position: absolute;
  inset: -4px;
  z-index: 7;
  background:
    radial-gradient(circle at 24% 22%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 74% 26%, #ffffff 0 5px, transparent 6px),
    radial-gradient(circle at 72% 72%, #ffffff 0 4px, transparent 5px);
  animation: sparkle 1s ease-in-out infinite;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }

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

@keyframes dashFast {
  0%,
  100% {
    transform: translate(-42px, var(--move-y)) scale(var(--scale));
  }

  50% {
    transform: translate(42px, var(--move-y)) scale(var(--scale));
  }
}

@keyframes dashSlow {
  0%,
  100% {
    transform: translate(-20px, var(--move-y)) scale(var(--scale));
  }

  50% {
    transform: translate(20px, var(--move-y)) scale(var(--scale));
  }
}

@keyframes tailWag {
  0%,
  100% {
    transform: rotate(-34deg);
  }

  50% {
    transform: rotate(8deg);
  }
}

@keyframes pulseWarm {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.62;
  }

  50% {
    opacity: 1;
  }
}

@keyframes rainDrop {
  from {
    transform: translateY(-10px) rotate(18deg);
  }

  to {
    transform: translateY(8px) rotate(18deg);
  }
}

@keyframes windSweep {
  0%,
  100% {
    transform: translateX(-14px);
  }

  50% {
    transform: translateX(18px);
  }
}

@media (max-width: 1180px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

  .meaning-stage {
    height: 340px;
  }
}

@media (max-width: 720px) {
  .lesson-page {
    width: calc(100% - 20px);
    padding-top: 14px;
    padding-bottom: 28px;
  }

  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 10px;
  }

  .brand {
    justify-content: flex-start;
    order: -1;
  }

  .unit-pill {
    justify-self: start;
  }

  .main-card,
  .panel {
    border-radius: 24px;
    padding: 18px;
  }

  .intro h1 {
    font-size: 2.15rem;
    line-height: 1.1;
  }

  .intro p {
    font-size: 1rem;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sentence-strip {
    grid-template-columns: 1fr;
    font-size: 1.55rem;
  }

  .balance-chip {
    justify-self: center;
  }

  .scale-visual {
    height: 310px;
  }

  .moving-scale {
    width: min(330px, 92%);
  }

  .pan-row {
    gap: 36px;
  }

  .drop-zone {
    width: 128px;
    min-height: 76px;
    font-size: 0.88rem;
  }

  .sentence-output {
    font-size: 1.35rem;
  }

  .meaning-stage {
    height: 320px;
  }
}

@media (max-width: 420px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .pan-row {
    gap: 18px;
  }

  .drop-zone {
    width: 116px;
    border-radius: 20px 20px 24px 24px;
  }

  .visual-object {
    --scale: 0.86;
  }
}

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