:root {
  --bg: #101d21;
  --bg-soft: #14252a;
  --accent: #ff8a00;
  --accent-dark: #cf6900;
  --accent-border: #7a4824;
  --text-muted: #6f8188;
  --border: #30464e;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(39, 61, 67, 0.18), transparent 30rem),
    var(--bg);
  color: white;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button {
  font: inherit;
}

.landing {
  width: min(100vw, 430px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 8px max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
}

.hero {
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(58px, 12vh, 94px);
  text-align: center;
}

.mascot-button {
  width: clamp(228px, 67vw, 292px);
  aspect-ratio: 1;
  margin: 0 0 clamp(14px, 3vh, 26px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mascot-button:focus-visible {
  outline: 3px solid rgba(255, 138, 0, 0.55);
  outline-offset: 10px;
}

.mascot-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  isolation: isolate;
  perspective: 700px;
}

.ground-shadow {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 16%;
  width: 48%;
  height: 7.5%;
  border-radius: 50%;
  background: rgba(92, 101, 104, 0.68);
  filter: blur(1.2px);
  transform: translateX(-50%);
  animation: shadow-breathe 3.25s ease-in-out infinite;
}

.greeting-bubble {
  position: absolute;
  z-index: 20;
  top: -7%;
  left: 50%;
  max-width: 92%;
  padding: 9px 14px 10px;
  border-radius: 18px;
  background: #ffffff;
  color: #19252a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  font-size: clamp(0.9rem, 4vw, 1rem);
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(0.92);
}

.greeting-bubble::after {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.confetti {
  position: absolute;
  inset: 12% 5% 23%;
  z-index: 1;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
}

.confetti span:nth-child(2n) {
  background: #ffe26a;
}

.confetti span:nth-child(3n) {
  background: #ffffff;
}

.confetti span:nth-child(4n) {
  background: #ff5a3d;
}

.confetti span:nth-child(1) {
  --x: -82px;
  --y: -78px;
  --r: 42deg;
}

.confetti span:nth-child(2) {
  --x: -48px;
  --y: -108px;
  --r: -58deg;
}

.confetti span:nth-child(3) {
  --x: 2px;
  --y: -124px;
  --r: 72deg;
}

.confetti span:nth-child(4) {
  --x: 52px;
  --y: -104px;
  --r: -28deg;
}

.confetti span:nth-child(5) {
  --x: 86px;
  --y: -72px;
  --r: 98deg;
}

.confetti span:nth-child(6) {
  --x: -100px;
  --y: -18px;
  --r: -86deg;
}

.confetti span:nth-child(7) {
  --x: 108px;
  --y: -10px;
  --r: 54deg;
}

.confetti span:nth-child(8) {
  --x: -62px;
  --y: 34px;
  --r: 118deg;
}

.confetti span:nth-child(9) {
  --x: 58px;
  --y: 38px;
  --r: -112deg;
}

.confetti span:nth-child(10) {
  --x: -22px;
  --y: -88px;
  --r: 20deg;
}

.confetti span:nth-child(11) {
  --x: 26px;
  --y: -80px;
  --r: -42deg;
}

.confetti span:nth-child(12) {
  --x: 0px;
  --y: 52px;
  --r: 144deg;
}

.mascot-tilt,
.mascot-rig,
.part,
.head-group {
  position: absolute;
}

.mascot-tilt {
  inset: 0;
  z-index: 2;
  transform: rotateX(var(--tilt-y)) rotateY(var(--tilt-x));
  transform-style: preserve-3d;
  transition: transform 180ms ease;
}

.mascot-rig {
  inset: 0;
  transform-origin: 50% 73%;
  animation: mascot-breathe 3.25s ease-in-out infinite;
}

.part {
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.tail {
  z-index: 1;
  width: 46%;
  top: 35%;
  right: 5%;
  transform-origin: 30% 72%;
  animation: tail-idle 4.2s ease-in-out infinite;
}

.body {
  z-index: 2;
  width: 43%;
  left: 28.5%;
  top: 50%;
  transform-origin: 50% 80%;
  animation: body-breathe 3.25s ease-in-out infinite;
}

.feet {
  z-index: 4;
  width: 21.5%;
  left: 39.25%;
  top: 70%;
  transform-origin: 50% 50%;
}

.greeting-arm {
  z-index: 9;
  width: 15.5%;
  top: 58%;
  right: 31%;
  opacity: 0;
  transform-origin: 28% 18%;
}

.head-group {
  z-index: 7;
  width: 66%;
  left: 17%;
  top: 3%;
  aspect-ratio: 822 / 722;
  transform-origin: 50% 66%;
  animation: head-breathe 3.25s ease-in-out infinite;
}

.head-group .part {
  position: absolute;
}

.head {
  inset: 0;
  width: 100%;
}

.head,
.eyes,
.nose,
.mouth {
  z-index: 8;
}

.eyes-open {
  left: 9%;
  top: 31.8%;
  width: 82%;
}

.eyes-closed {
  left: 14.5%;
  top: 42.3%;
  width: 71%;
}

.eyes-happy {
  left: 9%;
  top: 31.8%;
  width: 82%;
  opacity: 0;
}

.nose {
  left: 43.3%;
  top: 72.8%;
  width: 13.6%;
}

.mouth {
  left: 43%;
  top: 84.7%;
  width: 14%;
}

.mouth-open {
  left: 41.2%;
  top: 84.2%;
  width: 17.8%;
}

.eyes-open,
.mouth-closed {
  opacity: 1;
}

.eyes-closed,
.eyes-happy,
.mouth-open {
  opacity: 0;
}

.mascot-button.is-blinking .eyes-open {
  opacity: 0;
}

.mascot-button.is-blinking .eyes-closed {
  opacity: 1;
}

.landing.is-question-intro .eyes-open,
.landing.is-question-intro .eyes-closed,
.mascot-button.is-celebrating .eyes-open,
.mascot-button.is-celebrating .eyes-closed {
  opacity: 0;
}

.landing.is-question-intro .eyes-happy,
.mascot-button.is-celebrating .eyes-happy {
  opacity: 1;
}

.mascot-button.is-happy .mouth-closed,
.mascot-button.is-excited .mouth-closed,
.mascot-button.is-celebrating .mouth-closed {
  opacity: 0;
}

.mascot-button.is-happy .mouth-open,
.mascot-button.is-excited .mouth-open,
.mascot-button.is-celebrating .mouth-open {
  opacity: 1;
}

.mascot-button.is-excited .mascot-rig {
  animation: mascot-hop 560ms cubic-bezier(0.24, 1.38, 0.42, 1) 1;
}

.mascot-button.is-excited .tail {
  animation: tail-wag 560ms ease-in-out 2;
}

.mascot-button.is-greeting .greeting-bubble {
  animation: bubble-pop 3.7s ease both;
}

.mascot-button.is-greeting .mascot-rig {
  animation: greeting-dance 920ms cubic-bezier(0.24, 1.38, 0.42, 1) 2;
}

.mascot-button.is-greeting .head-group {
  animation: greeting-head 920ms ease-in-out 2;
}

.mascot-button.is-greeting .tail {
  animation: tail-wag 560ms ease-in-out 4;
}

.mascot-button.is-greeting .greeting-arm {
  opacity: 1;
  animation: greeting-wave 760ms ease-in-out 4;
}

.landing.is-onboarding .greeting-bubble {
  opacity: 1;
  animation: bubble-show 180ms ease-out both;
}

.mascot-button.is-celebrating .confetti span {
  animation: confetti-pop 1180ms cubic-bezier(0.12, 0.95, 0.28, 1) both;
}

.mascot-button.is-celebrating .confetti span:nth-child(2) {
  animation-delay: 25ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(3) {
  animation-delay: 45ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(4) {
  animation-delay: 70ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(5) {
  animation-delay: 95ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(6) {
  animation-delay: 115ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(7) {
  animation-delay: 130ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(8) {
  animation-delay: 145ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(9) {
  animation-delay: 160ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(10) {
  animation-delay: 55ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(11) {
  animation-delay: 85ms;
}

.mascot-button.is-celebrating .confetti span:nth-child(12) {
  animation-delay: 110ms;
}

.mascot-button.is-celebrating .mascot-rig {
  animation: celebration-pop 820ms cubic-bezier(0.18, 1.42, 0.32, 1) 1;
}

.mascot-button.is-celebrating .head-group {
  animation: celebration-head 820ms ease-in-out 1;
}

.mascot-button.is-celebrating .tail {
  animation: tail-wag 420ms ease-in-out 3;
}

.landing.is-question-intro .greeting-bubble {
  max-width: min(116%, 340px);
  white-space: normal;
}

.landing.is-onboarding .brand-copy {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-10px);
}

h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(2.1rem, 10.5vw, 2.9rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: lowercase;
}

.brand-copy {
  display: grid;
  max-height: 116px;
  justify-items: center;
  opacity: 1;
  transition:
    max-height 240ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.hero p {
  margin: 17px 0 0;
  color: var(--text-muted);
  font-size: clamp(0.98rem, 4.2vw, 1.12rem);
  font-weight: 500;
  line-height: 1.35;
}

.actions {
  display: grid;
  gap: 15px;
  padding-bottom: 2px;
}

.choice-panel {
  display: grid;
  gap: 12px;
  animation: panel-rise 260ms ease both;
}

.choice-panel[hidden] {
  display: none;
}

.choice-panel h2 {
  margin: 0 0 2px;
  color: #ffffff;
  font-size: clamp(1.05rem, 4.8vw, 1.22rem);
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.actions button {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font-size: 0.89rem;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease;
}

.actions button:active {
  transform: translateY(3px);
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: #172027;
  box-shadow: 0 6px 0 var(--accent-dark);
}

.actions .primary-action {
  font-size: 1.12rem;
  letter-spacing: 0;
}

.continue-action {
  display: none;
}

.landing.is-onboarding .actions [data-action="start"],
.landing.is-onboarding .secondary-action {
  display: none;
}

.landing.is-onboarding .continue-action {
  display: block;
}

.landing[data-step="time"] .continue-action,
.landing[data-step="path"] .continue-action {
  display: none;
}

.choice-action {
  border: 2px solid #2e4c57;
  background: #172a30;
  color: #f5fbff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.24);
}

.choice-action.is-selected {
  border-color: var(--accent);
  background: #21353b;
  color: #ffd58e;
}

.primary-action:active {
  box-shadow: 0 3px 0 var(--accent-dark);
}

.secondary-action {
  border: 2px solid var(--accent-border);
  background: var(--bg-soft);
  color: var(--accent);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.secondary-action:active {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22);
}

.landing.is-lesson {
  grid-template-rows: 1fr;
  padding: max(18px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.landing.is-lesson .hero,
.landing.is-lesson .actions {
  display: none;
}

.lesson-screen[hidden] {
  display: none;
}

.lesson-screen {
  display: grid;
  min-height: calc(100svh - max(28px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom)));
  grid-template-rows: auto auto auto auto 1fr auto auto;
  gap: clamp(10px, 2.2vh, 16px);
  color: #ffffff;
  animation: panel-rise 260ms ease both;
}

.lesson-topbar {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 16px;
  direction: ltr;
}

.lesson-progress {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #3b4b55;
}

.lesson-progress span {
  display: block;
  width: 18%;
  height: 100%;
  margin-left: auto;
  border-radius: inherit;
  background: #8ddd00;
  box-shadow: 0 0 0 1px rgba(141, 221, 0, 0.2);
}

.lesson-close {
  position: relative;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lesson-close::before,
.lesson-close::after {
  position: absolute;
  left: 7px;
  top: 16px;
  width: 21px;
  height: 3px;
  border-radius: 999px;
  background: #5c7179;
  content: "";
}

.lesson-close::before {
  transform: rotate(45deg);
}

.lesson-close::after {
  transform: rotate(-45deg);
}

.lesson-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
  color: #bb77ff;
  font-size: 0.86rem;
  font-weight: 900;
}

.lesson-gem {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 65% 34%, #ffffff 0 2px, transparent 3px),
    linear-gradient(135deg, #c996ff, #7f4dff);
}

.lesson-title {
  margin: -2px 0 0;
  text-align: center;
  font-size: clamp(1.26rem, 5.5vw, 1.58rem);
  font-weight: 900;
  line-height: 1.2;
}

.word-prompt {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 9px;
  min-height: 72px;
}

.audio-button {
  position: relative;
  width: 50px;
  height: 50px;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: #4bb3ef;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.audio-button span {
  position: absolute;
  left: 15px;
  top: 17px;
  width: 12px;
  height: 16px;
  border-radius: 3px 0 0 3px;
  background: #102025;
}

.audio-button span::before {
  position: absolute;
  left: 8px;
  top: -4px;
  width: 14px;
  height: 24px;
  border: 4px solid #102025;
  border-left: 0;
  border-radius: 0 18px 18px 0;
  content: "";
}

.word-stack {
  position: relative;
  display: grid;
  justify-items: start;
  min-width: 178px;
  padding-top: 3px;
}

.target-word {
  min-height: 30px;
  padding: 0 3px;
  border: 0;
  border-bottom: 3px solid #8152d9;
  background: transparent;
  color: #c58bff;
  font-size: 1.14rem;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.word-helper,
.word-meaning {
  position: absolute;
  top: 33px;
  left: -6px;
  z-index: 2;
}

.word-helper[hidden],
.word-meaning[hidden] {
  display: none;
}

.word-helper {
  display: flex;
  max-width: 232px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 2px solid #8a5cff;
  border-radius: 999px;
  background: rgba(20, 37, 42, 0.96);
  color: #d6c2ff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
}

.focus-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 3px solid #c58bff;
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(197, 139, 255, 0.15);
  animation: focus-pulse 1.4s ease-in-out infinite;
}

.word-meaning {
  display: grid;
  min-width: 86px;
  justify-items: center;
  gap: 2px;
  padding: 9px 12px;
  border: 2px solid #475b64;
  border-radius: 12px;
  background: #2c3b40;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  font-size: 0.85rem;
}

.word-meaning strong {
  font-size: 1rem;
}

.word-meaning span {
  color: #c9d4d8;
  font-size: 0.74rem;
  font-weight: 800;
}

.answer-grid {
  display: grid;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  direction: ltr;
}

.answer-card {
  display: grid;
  min-height: 174px;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 12px 10px 14px;
  border: 2px solid #31454e;
  border-radius: 14px;
  background: #132227;
  color: #eef7fa;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.03);
  cursor: pointer;
  direction: rtl;
}

.answer-card.is-selected {
  border-color: #50bdf5;
  background: #172a30;
}

.answer-card.is-correct {
  border-color: #8ddd00;
}

.answer-card.is-wrong {
  border-color: #ff6b5d;
}

.answer-art {
  position: relative;
  display: block;
  width: 100px;
  height: 96px;
}

.answer-label {
  min-height: 22px;
  font-size: 1rem;
  line-height: 1.2;
}

.lesson-screen:not(.is-word-revealed) [data-reveal-label] {
  visibility: hidden;
}

.art-tea .cup {
  position: absolute;
  left: 25px;
  top: 28px;
  width: 48px;
  height: 36px;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  border-top: 7px solid #ffce1a;
}

.art-tea .cup::after {
  position: absolute;
  right: -18px;
  top: 7px;
  width: 18px;
  height: 18px;
  border: 6px solid #ffce1a;
  border-left: 0;
  border-radius: 0 18px 18px 0;
  content: "";
}

.art-tea .saucer {
  position: absolute;
  left: 14px;
  top: 68px;
  width: 76px;
  height: 9px;
  border-radius: 0 0 999px 999px;
  background: #ffffff;
  box-shadow: 0 5px 0 #ffce1a;
}

.art-tea .tea-bag {
  position: absolute;
  left: 47px;
  top: 38px;
  width: 18px;
  height: 23px;
  border-radius: 4px;
  background: #ecf4f7;
}

.art-tea .tea-bag::before {
  position: absolute;
  left: 8px;
  top: -25px;
  width: 2px;
  height: 25px;
  background: #c7d4da;
  content: "";
}

.art-sugar .box,
.art-sugar .box-top {
  position: absolute;
  left: 18px;
  width: 62px;
  border-radius: 7px;
  background: #3fa4dc;
}

.art-sugar .box {
  top: 24px;
  height: 62px;
}

.art-sugar .box-top {
  top: 14px;
  height: 18px;
  transform: skewX(-10deg);
}

.art-sugar .cup-mark {
  position: absolute;
  left: 34px;
  top: 48px;
  width: 33px;
  height: 21px;
  border-radius: 0 0 16px 16px;
  background: #ffffff;
}

.art-sugar .cup-mark::after {
  position: absolute;
  right: -9px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 4px solid #ffffff;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  content: "";
}

.art-sugar .cube {
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 3px;
  background: #dce8ee;
}

.art-sugar .cube-one {
  right: 11px;
  bottom: 13px;
}

.art-sugar .cube-two {
  right: 29px;
  bottom: 31px;
}

.art-coffee .pot {
  position: absolute;
  left: 16px;
  top: 35px;
  width: 66px;
  height: 48px;
  border-radius: 12px 12px 22px 22px;
  background: #beeef9;
  overflow: hidden;
}

.art-coffee .coffee-fill {
  position: absolute;
  left: 23px;
  top: 51px;
  width: 52px;
  height: 25px;
  border-radius: 0 0 18px 18px;
  background: #905000;
}

.art-coffee .handle {
  position: absolute;
  right: 8px;
  top: 35px;
  width: 23px;
  height: 31px;
  border: 10px solid #4f5658;
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.art-coffee .lid {
  position: absolute;
  left: 29px;
  top: 18px;
  width: 44px;
  height: 20px;
  border-radius: 4px 4px 0 0;
  background: #52595c;
  transform: rotate(8deg);
}

.art-milk .milk-box {
  position: absolute;
  left: 24px;
  top: 18px;
  width: 43px;
  height: 67px;
  border-radius: 6px;
  background:
    linear-gradient(#e8f8ff 0 21%, transparent 21%),
    linear-gradient(90deg, transparent 0 52%, rgba(0, 0, 0, 0.08) 52%),
    #42aee7;
}

.art-milk .milk-box::after {
  position: absolute;
  left: 14px;
  top: 31px;
  color: #f4fdff;
  font-size: 1.45rem;
  font-weight: 900;
  content: "♛";
}

.art-milk .milk-cap {
  position: absolute;
  left: 36px;
  top: 22px;
  width: 15px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
}

.art-milk .glass {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 31px;
  height: 50px;
  border-radius: 3px 3px 10px 10px;
  background: linear-gradient(rgba(255, 255, 255, 0.66) 0 30%, #c8f6ff 30%);
  transform: skewX(-4deg);
}

.check-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: #4a5f6b;
  color: #18242b;
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
}

.check-action:not(:disabled) {
  background: var(--accent);
  color: #172027;
  box-shadow: 0 5px 0 var(--accent-dark);
}

.lesson-feedback {
  min-height: 20px;
  margin: -4px 0 0;
  color: #d9e6eb;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.activity-stage {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: clamp(18px, 4vh, 30px);
}

.scene-row,
.listening-stage {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.center-art {
  display: flex;
  justify-content: center;
}

.center-art .answer-art {
  width: 154px;
  height: 130px;
  transform: scale(1.28);
}

.speech-bubble {
  position: relative;
  display: inline-flex;
  min-width: 118px;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border: 3px solid #31454e;
  border-radius: 22px;
  color: #eef7fa;
  font-size: clamp(1.12rem, 5vw, 1.55rem);
  font-weight: 800;
  line-height: 1.2;
}

.speech-bubble.compact {
  min-width: 84px;
  min-height: 78px;
  font-size: 1.2rem;
}

.speech-bubble.audio {
  min-width: 190px;
  justify-content: flex-start;
  direction: ltr;
}

.speak-word {
  display: inline;
  padding: 0 1px;
  border-bottom: 2px dotted rgba(197, 139, 255, 0.55);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.speak-word:active {
  color: #c58bff;
}

.lesson-character,
.mini-character {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.lesson-character {
  width: 86px;
  height: 116px;
  border-radius: 44px 44px 36px 36px;
  background: #a9663b;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.13);
}

.lesson-character::before,
.mini-character::before {
  position: absolute;
  left: 50%;
  top: 28%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #111d22;
  box-shadow: 22px 0 0 #111d22;
  content: "";
  transform: translateX(-18px);
}

.lesson-character::after {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 24px;
  height: 46px;
  border-radius: 999px;
  background: #e3a257;
  content: "";
  transform: translateX(-50%);
}

.lesson-character.learner {
  border-bottom: 16px solid #3bd4ec;
}

.mini-character {
  width: 60px;
  height: 72px;
  border-radius: 26px 26px 22px 22px;
  background: #aa6639;
}

.mini-character::after {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 16px;
  height: 28px;
  border-radius: 999px;
  background: #e3a257;
  content: "";
  transform: translateX(-50%);
}

.mini-character.chef {
  background: #9b5a32;
}

.mini-character.chef::before {
  top: 38%;
}

.mini-character.chef::after {
  top: -16px;
  width: 52px;
  height: 28px;
  border-radius: 22px 22px 10px 10px;
  background: #373a3c;
}

.dialog-stage {
  display: grid;
  gap: 36px;
  padding-top: 18px;
}

.dialog-line {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dialog-line.chef {
  justify-content: flex-end;
}

.dialog-line.learner {
  justify-content: flex-start;
}

.choice-list {
  display: grid;
  gap: 12px;
}

.choice-card {
  width: 100%;
  min-height: 58px;
  border: 3px solid #31454e;
  border-radius: 14px;
  background: transparent;
  color: #eef7fa;
  font-size: clamp(1.08rem, 5vw, 1.35rem);
  font-weight: 700;
  cursor: pointer;
}

.choice-card.is-selected,
.token-chip.is-selected,
.token-chip.placed {
  border-color: #8bd52f;
  color: #9ce031;
}

.sentence-line {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-bottom: 3px solid #31454e;
  color: #eef7fa;
  font-size: clamp(1.35rem, 6vw, 1.86rem);
  direction: ltr;
}

.sentence-slot {
  min-width: 78px;
  min-height: 58px;
  padding: 8px 14px;
  border: 3px solid #31454e;
  border-radius: 18px;
}

.token-answer-line {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-bottom: 3px solid #31454e;
  color: #eef7fa;
  font-size: 1.22rem;
}

.empty-line {
  width: 72%;
  border-bottom: 4px solid #31454e;
}

.token-bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.token-chip {
  min-height: 54px;
  padding: 0 17px;
  border: 3px solid #31454e;
  border-radius: 16px;
  background: #102025;
  color: #eef7fa;
  font-size: clamp(1rem, 4.6vw, 1.22rem);
  font-weight: 750;
  cursor: pointer;
}

.token-chip.is-used {
  opacity: 0.25;
}

.listen-card {
  display: grid;
  min-width: 154px;
  min-height: 86px;
  place-items: center;
  border: 3px solid #31454e;
  border-radius: 24px;
}

.speaking-stage {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-top: 22px;
}

.record-button {
  width: min(100%, 280px);
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: #4bb3ef;
  color: #102025;
  font-size: 1.16rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #2b82b2;
}

.record-button.is-done {
  background: #8ddd00;
  box-shadow: 0 5px 0 #65a500;
}

.record-button.secondary-record {
  background: #31454e;
  color: #eef7fa;
  box-shadow: 0 5px 0 #203139;
}

.record-button.secondary-record.is-done {
  background: #8ddd00;
  color: #172027;
  box-shadow: 0 5px 0 #65a500;
}

.speech-hint,
.speech-transcript {
  min-height: 22px;
  margin: 0;
  color: #6f8188;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.speech-transcript {
  color: #eef7fa;
}

.result-panel {
  margin: 0 -8px;
  padding: 18px 20px 22px;
  background: #182d34;
  color: #8bd52f;
  text-align: right;
}

.result-panel[hidden] {
  display: none;
}

.result-panel p {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 6vw, 1.7rem);
  font-weight: 900;
}

.result-panel.is-wrong {
  color: #ffbd45;
}

.next-action {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 16px;
  background: #8ddd00;
  color: #172027;
  font-size: 1.06rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #65a500;
}

.complete-card {
  display: grid;
  min-height: 420px;
  align-content: center;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.complete-card strong {
  color: #8ddd00;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
}

.complete-card p {
  max-width: 300px;
  margin: 0;
  color: #c9d4d8;
  font-weight: 800;
  line-height: 1.5;
}

.complete-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #8ddd00;
  position: relative;
}

.complete-check::after {
  position: absolute;
  left: 23px;
  top: 17px;
  width: 22px;
  height: 34px;
  border: solid #172027;
  border-width: 0 7px 7px 0;
  content: "";
  transform: rotate(45deg);
}

@keyframes mascot-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(2.2%) scale(1.018, 0.986);
  }
}

@keyframes shadow-breathe {
  0%,
  100% {
    opacity: 0.68;
    transform: translateX(-50%) scaleX(1);
  }
  50% {
    opacity: 0.5;
    transform: translateX(-50%) scaleX(0.86);
  }
}

@keyframes body-breathe {
  0%,
  100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(0.8%) scaleY(1.018);
  }
}

@keyframes head-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-1.2%) rotate(-0.8deg);
  }
}

@keyframes tail-idle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(2.2deg);
  }
}

@keyframes tail-wag {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(8deg);
  }
  50% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

@keyframes greeting-wave {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  22% {
    transform: translate(70%, -58%) rotate(35deg);
  }
  48% {
    transform: translate(94%, -88%) rotate(72deg);
  }
  72% {
    transform: translate(74%, -62%) rotate(38deg);
  }
}

@keyframes greeting-dance {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  34% {
    transform: translateY(-7%) rotate(-2deg) scale(1.035, 0.985);
  }
  62% {
    transform: translateY(1.5%) rotate(1.6deg) scale(0.985, 1.02);
  }
}

@keyframes greeting-head {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  35% {
    transform: translateY(-2.2%) rotate(-4deg);
  }
  68% {
    transform: translateY(1%) rotate(3deg);
  }
}

@keyframes bubble-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.92);
  }
  10%,
  83% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -5px) scale(0.96);
  }
}

@keyframes bubble-show {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes confetti-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }
  18% {
    opacity: 1;
  }
  74% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r));
  }
}

@keyframes celebration-pop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  28% {
    transform: translateY(-9%) scale(1.08, 0.96);
  }
  54% {
    transform: translateY(2%) scale(0.96, 1.05);
  }
  74% {
    transform: translateY(-3%) scale(1.025, 0.99);
  }
}

@keyframes celebration-head {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-2.8%) rotate(-5deg);
  }
  58% {
    transform: translateY(1%) rotate(4deg);
  }
  78% {
    transform: translateY(-1%) rotate(-2deg);
  }
}

@keyframes mascot-hop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  44% {
    transform: translateY(-7%) scale(1.035, 0.98);
  }
  72% {
    transform: translateY(1.2%) scale(0.985, 1.02);
  }
}

@keyframes panel-rise {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes focus-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(197, 139, 255, 0.14);
  }
  50% {
    transform: scale(0.86);
    box-shadow: 0 0 0 12px rgba(197, 139, 255, 0.05);
  }
}

@media (max-height: 650px) {
  .hero {
    padding-bottom: 38px;
  }

  .mascot-button {
    width: clamp(198px, 58vw, 246px);
    margin-bottom: 12px;
  }

  .hero p {
    margin-top: 12px;
  }
}

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