:root {
  --add: #ff6b6b;
  --sub: #4d96ff;
  --mul: #ffb400;
  --div: #9b5de5;
  --good: #2ec27e;
  --bad: #ff5d5d;
  --ink: #2d2a4a;
  --muted: #6b6890;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 8px 0 rgba(45, 42, 74, 0.12), 0 14px 30px rgba(45, 42, 74, 0.12);
  font-family: "Baloo 2", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

html { background: linear-gradient(160deg, #ffe29f 0%, #ffa99f 35%, #a29bfe 70%, #74b9ff 100%) fixed #a29bfe; }

body {
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Floating background symbols */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-shapes span {
  position: absolute;
  font-size: 4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  animation: float 14s ease-in-out infinite;
}
.bg-shapes span:nth-child(1) { left: 5%;  top: 10%; animation-delay: 0s; }
.bg-shapes span:nth-child(2) { left: 85%; top: 15%; animation-delay: -2s; }
.bg-shapes span:nth-child(3) { left: 12%; top: 70%; animation-delay: -4s; }
.bg-shapes span:nth-child(4) { left: 78%; top: 75%; animation-delay: -6s; }
.bg-shapes span:nth-child(5) { left: 45%; top: 5%;  animation-delay: -8s; font-size: 3rem; }
.bg-shapes span:nth-child(6) { left: 92%; top: 45%; animation-delay: -3s; font-size: 3rem; }
.bg-shapes span:nth-child(7) { left: 2%;  top: 42%; animation-delay: -7s; font-size: 3rem; }
.bg-shapes span:nth-child(8) { left: 50%; top: 88%; animation-delay: -5s; font-size: 3rem; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(12deg); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.screen { display: none; animation: pop-in 0.35s ease; }
.screen.active { display: block; }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Setup ---------- */
.hero { text-align: center; margin: 8px 0 18px; }
.hero h1 {
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1;
  margin: 4px 0;
  color: #fff;
  text-shadow: 0 4px 0 #6c5ce7, 0 8px 18px rgba(0, 0, 0, 0.2);
}
.hero h1 span { color: #fff176; }
.tagline { margin: 6px 0 0; font-size: 1.2rem; color: #fff; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,0.15); }
.star-bank {
  display: inline-block;
  margin: 10px 0 0;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-weight: 800;
}

.mascot { font-size: 4rem; line-height: 1; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.mascot.big { font-size: 5.5rem; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 6px; font-size: 1.45rem; color: #6c5ce7; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 1rem; }
.error { margin: 10px 0 0; color: var(--bad); font-weight: 800; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.name-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 3px solid #e4e1ff;
  border-radius: 16px;
  font-size: 1.2rem;
  outline: none;
}
.name-row input:focus { border-color: #6c5ce7; }

.mascot-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.mascot-picker button {
  width: 56px; height: 56px;
  font-size: 2rem;
  border-radius: 16px;
  border: 3px solid #e4e1ff;
  background: #f7f6ff;
  transition: transform 0.15s;
}
.mascot-picker button:hover { transform: scale(1.08); }
.mascot-picker button[aria-checked="true"] { border-color: #6c5ce7; background: #ece9ff; transform: scale(1.12); }

/* Operation cards */
.ops-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 420px) { .ops-grid { grid-template-columns: 1fr; } }

.op-card {
  --c: var(--add);
  position: relative;
  border-radius: 20px;
  border: 4px solid var(--c);
  background: #fff;
  padding: 12px;
  text-align: center;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  opacity: 0.65;
}
.op-card.on {
  background: var(--c);
  color: #fff;
  opacity: 1;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 70%, black);
}
.op-card[data-op="add"] { --c: var(--add); }
.op-card[data-op="sub"] { --c: var(--sub); }
.op-card[data-op="mul"] { --c: var(--mul); }
.op-card[data-op="div"] { --c: var(--div); }

.op-toggle {
  width: 100%;
  border: 0;
  background: none;
  padding: 4px 0 8px;
}
.op-toggle .sym {
  display: block;
  font-size: 3rem;
  line-height: 1;
  font-weight: 800;
  color: var(--c);
}
.op-card.on .op-toggle .sym { color: #fff; }
.op-toggle .name { display: block; font-size: 1.25rem; font-weight: 800; }
.op-toggle .tick {
  position: absolute;
  top: 8px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  color: var(--c);
  font-weight: 800;
  display: grid; place-items: center;
  border: 3px solid var(--c);
}
.op-card:not(.on) .op-toggle .tick { color: transparent; }

.range {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.range .upto { font-weight: 700; font-size: 1rem; width: 3.2em; text-align: right; }
.range + .range { margin-top: 6px; }
.range button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.12);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}
.op-card:not(.on) .range button { background: #eee; }
.range input {
  width: 70px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  -moz-appearance: textfield;
}
.range input::-webkit-outer-spin-button,
.range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.op-desc { margin: 6px 0 0; font-size: 0.9rem; min-height: 1.3em; }

/* Options */
.option { margin-top: 12px; }
.option-label { display: block; font-weight: 800; margin-bottom: 8px; font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 3px solid #e4e1ff;
  background: #f7f6ff;
  font-weight: 800;
  font-size: 1.1rem;
  transition: transform 0.15s;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-checked="true"] { background: #6c5ce7; color: #fff; border-color: #6c5ce7; }

.toggles { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.toggle { display: flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: relative;
  flex: none;
  width: 54px; height: 30px;
  border-radius: 999px;
  background: #d9d6f2;
  transition: background 0.2s;
}
.toggle .slider::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle input:checked + .slider { background: var(--good); }
.toggle input:checked + .slider::after { transform: translateX(24px); }
.toggle input:focus-visible + .slider { outline: 3px solid #6c5ce7; outline-offset: 2px; }

/* Buttons */
.btn {
  border: 0;
  border-radius: 20px;
  padding: 14px 28px;
  font-size: 1.5rem;
  font-weight: 800;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:active { transform: translateY(4px); }
.btn-go {
  display: block;
  width: 100%;
  background: var(--good);
  color: #fff;
  font-size: 2rem;
  box-shadow: 0 6px 0 #1e8f5b, 0 12px 24px rgba(0,0,0,0.15);
}
.btn-go:active { box-shadow: 0 2px 0 #1e8f5b; }
.btn-secondary {
  background: #fff;
  color: #6c5ce7;
  border: 3px solid #6c5ce7;
  box-shadow: 0 6px 0 #d4cfff;
}

/* ---------- Quiz ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12);
}
.progress {
  flex: 1;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b6b, #ffb400, #2ec27e, #4d96ff, #9b5de5);
  background-size: 720px 100%;
  transition: width 0.4s ease;
}
.quiz-stats { display: flex; gap: 6px; }
.stat {
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  white-space: nowrap;
}
.streak.hot { animation: pulse 0.8s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

.q-counter { text-align: center; color: #fff; font-weight: 800; font-size: 1.15rem; margin: 14px 0 8px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.question-card {
  --c: var(--add);
  position: relative;
  background: #fff;
  border-radius: 28px;
  border: 6px solid var(--c);
  box-shadow: var(--shadow);
  padding: 22px 16px 14px;
  text-align: center;
}
.question-card.shake { animation: shake 0.45s; }
.question-card.correct { animation: bounce 0.5s; border-color: var(--good); }
@keyframes shake {
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}
@keyframes bounce {
  40% { transform: scale(1.05); }
}

.buddy {
  position: absolute;
  top: -30px; right: -6px;
  font-size: 3rem;
  animation: bob 2.4s ease-in-out infinite;
}
.buddy.cheer { animation: cheer 0.6s ease; }
@keyframes cheer {
  30% { transform: translateY(-24px) rotate(-15deg) scale(1.2); }
  60% { transform: translateY(-6px) rotate(15deg); }
}

.question {
  font-size: clamp(2.6rem, 12vw, 4.6rem);
  font-weight: 800;
  line-height: 1.1;
  word-break: break-word;
}
.question .op { color: var(--c); padding: 0 0.15em; }

.pictures { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; margin: 8px 0; font-size: 1.6rem; }
.pictures:empty { display: none; }
.pictures .group { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 220px; padding: 4px 8px; border-radius: 12px; background: #f7f6ff; }
.pictures .group.mul { flex-wrap: nowrap; max-width: none; }
.pictures .gone { opacity: 0.25; filter: grayscale(1); position: relative; }
.pictures .sign { font-weight: 800; color: var(--c); font-size: 1.8rem; }

.answer-box {
  display: inline-block;
  min-width: 150px;
  margin: 10px auto 4px;
  padding: 4px 24px;
  border-radius: 18px;
  background: #f7f6ff;
  border: 4px dashed #cfc9ff;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  font-weight: 800;
  line-height: 1.2;
}
.answer-box.empty #answer-display { color: #cfc9ff; }
.answer-box.good { border: 4px solid var(--good); background: #e6fbf0; color: var(--good); }
.answer-box.bad { border: 4px solid var(--bad); background: #ffecec; color: var(--bad); }

.feedback { min-height: 1.6em; margin: 6px 0 0; font-size: 1.35rem; font-weight: 800; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.feedback.reveal { color: #6c5ce7; }

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 18px auto 0;
}
.key {
  border: 0;
  border-radius: 18px;
  padding: 12px 0;
  font-size: 2rem;
  font-weight: 800;
  background: #fff;
  box-shadow: 0 6px 0 #d4cfff;
  transition: transform 0.08s, box-shadow 0.08s;
}
.key:active, .key.pressed { transform: translateY(4px); box-shadow: 0 2px 0 #d4cfff; }
.key.del { background: #ffe3e3; box-shadow: 0 6px 0 #ffb3b3; }
.key.ok { background: var(--good); color: #fff; box-shadow: 0 6px 0 #1e8f5b; }
.key:disabled { opacity: 0.5; }

/* Multiple choice */
.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 480px;
  margin: 18px auto 0;
}
.choice {
  border: 0;
  border-radius: 22px;
  padding: 18px 0;
  font-size: 2.3rem;
  font-weight: 800;
  color: #fff;
  transition: transform 0.1s;
}
.choice:nth-child(1) { background: var(--add); box-shadow: 0 6px 0 #c94b4b; }
.choice:nth-child(2) { background: var(--sub); box-shadow: 0 6px 0 #2f6fd0; }
.choice:nth-child(3) { background: var(--mul); box-shadow: 0 6px 0 #c98d00; }
.choice:nth-child(4) { background: var(--div); box-shadow: 0 6px 0 #7140b8; }
.choice:active { transform: translateY(4px); }
.choice.wrong { background: #ccc; box-shadow: 0 6px 0 #aaa; opacity: 0.5; text-decoration: line-through; }
.choice.right { background: var(--good); box-shadow: 0 6px 0 #1e8f5b; animation: bounce 0.5s; }

/* ---------- Results ---------- */
.results-card { text-align: center; }
.results-card h2 { font-size: 2.2rem; }
.stars { font-size: 3.5rem; letter-spacing: 6px; }
.stars span { display: inline-block; animation: star-pop 0.5s ease backwards; }
.stars span:nth-child(2) { animation-delay: 0.25s; }
.stars span:nth-child(3) { animation-delay: 0.5s; }
.stars .dim { filter: grayscale(1); opacity: 0.3; }
@keyframes star-pop {
  from { transform: scale(0) rotate(-180deg); }
  to { transform: none; }
}
.results-score { font-size: 1.6rem; font-weight: 800; margin: 4px 0 12px; }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.results-grid > div { background: #f7f6ff; border-radius: 16px; padding: 8px 4px; }
.results-grid .label { display: block; color: var(--muted); font-size: 0.95rem; }
.results-grid b { font-size: 1.5rem; }

.review { text-align: left; margin: 0 0 18px; }
.review h3 { margin: 0 0 8px; color: #6c5ce7; }
.review ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.review li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fff5f5;
  border-left: 6px solid var(--bad);
  font-size: 1.2rem;
  font-weight: 700;
}
.review li .yours { color: var(--bad); text-decoration: line-through; }
.review li .right { color: var(--good); }
.buttons { justify-content: center; }
.buttons .btn { flex: 1 1 200px; font-size: 1.4rem; }

/* Confetti */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
#confetti i {
  position: absolute;
  top: -20px;
  width: 12px; height: 16px;
  border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Results crew (animated characters) ---------- */
.stage {
  margin: -4px -6px 4px;
  padding: 14px 8px 0;
  border-radius: 20px;
  background: linear-gradient(#bfe9ff, #eaf8ff 70%);
  overflow: hidden;
}

.bubble {
  position: relative;
  margin: 0 6px 16px;
  padding: 10px 14px;
  min-height: 2.8em;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(45, 42, 74, 0.1);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.bubble.show { opacity: 1; transform: none; }
.bubble::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: var(--tail, 50%);
  transform: translateX(-50%);
  border: 12px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.crew {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 4px;
  padding: 0 4px;
}
.crew::before {
  content: "";
  position: absolute;
  left: -10%; right: -10%; bottom: -40px;
  height: 80px;
  border-radius: 50%;
  background: #7ed957;
}

.crew-member {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  justify-self: center;
  width: 100%;
  max-width: 120px;
}
.crew-member .monster { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 100%; }
.crew-member.enter { animation: rise 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) backwards; animation-delay: calc(var(--i) * 0.15s); }
.crew-member.giggle { animation: giggle 0.6s ease; }

@keyframes rise { from { transform: translateY(110%); } }
@keyframes giggle {
  25% { transform: translateY(-20px) rotate(-10deg); }
  50% { transform: translateY(-8px) rotate(10deg); }
  75% { transform: translateY(-14px) rotate(-6deg); }
}

/* Eyes blink and look around */
.lid {
  transform-box: fill-box;
  transform-origin: 50% 0;
  transform: scaleY(0);
  animation: blink 4.5s infinite;
  animation-delay: calc(var(--i) * -1.4s);
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(0); }
  95% { transform: scaleY(1); }
}
.pupil { animation: look 7s ease-in-out infinite; animation-delay: calc(var(--i) * -2s); }
@keyframes look {
  0%, 30%, 100% { transform: translate(0, 0); }
  40%, 55% { transform: translate(-3px, -1px); }
  65%, 85% { transform: translate(3px, -1px); }
}

/* Mouths flap while talking */
.mouth-open { opacity: 0; }
.talking .mouth-open { animation: talk-open 0.26s steps(1) infinite; }
.talking .mouth-closed { animation: talk-closed 0.26s steps(1) infinite; }
@keyframes talk-open { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes talk-closed { 0% { opacity: 1; } 50% { opacity: 0; } }

/* Arms pivot at the shoulder */
.arm { transform-box: fill-box; }
.arm-l { transform-origin: 100% 100%; }
.arm-r { transform-origin: 0% 100%; }
.crew-hoot .arm-l { transform-origin: 70% 10%; }
.crew-hoot .arm-r { transform-origin: 30% 10%; }
@keyframes wave-l { from { transform: rotate(-30deg); } to { transform: rotate(15deg); } }
@keyframes wave-r { from { transform: rotate(30deg); } to { transform: rotate(-15deg); } }

/* Moods (set by how many stars were earned) */
.crew .monster { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.03, 0.97); } }

.mood-party .monster { animation: jump 0.55s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.2s); }
.mood-party .arm-l { animation: wave-l 0.3s ease-in-out infinite alternate; }
.mood-party .arm-r { animation: wave-r 0.3s ease-in-out infinite alternate; animation-delay: -0.15s; }
@keyframes jump {
  from { transform: translateY(0) scale(1.04, 0.94); }
  to { transform: translateY(-20px) rotate(calc((var(--i) - 1) * 6deg)); }
}

.mood-happy .monster { animation: sway 1.2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.4s); }
.mood-happy .speaker .arm-r,
.mood-cheer .speaker .arm-r { animation: wave-r 0.45s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }

.mood-cheer .monster { animation: hop 0.9s ease-in-out infinite; animation-delay: calc(var(--i) * -0.3s); }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }

/* Encouraging: the crew lean in together and nod kindly */
.mood-hug .crew-member:nth-child(1) .monster { --lean: 7deg; }
.mood-hug .crew-member:nth-child(3) .monster { --lean: -7deg; }
.mood-hug .monster { animation: nod 2s ease-in-out infinite; }
.mood-hug .arm-l { transform: rotate(25deg); }
.mood-hug .arm-r { transform: rotate(-25deg); }
@keyframes nod {
  0%, 100% { transform: rotate(var(--lean, 0deg)); }
  50% { transform: rotate(var(--lean, 0deg)) translateY(-4px) scale(1.02); }
}

.btn-hear {
  margin: 12px 0 0;
  border: 0;
  border-radius: 999px;
  padding: 6px 18px;
  background: #6c5ce7;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 4px 0 #4b3fb8;
}
.btn-hear:active { transform: translateY(3px); box-shadow: 0 1px 0 #4b3fb8; }

.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.voice-row .btn-hear { margin: 0; font-size: 0.95rem; padding: 4px 14px; }
.voice-status { margin: 0; color: var(--muted); font-size: 0.95rem; font-weight: 700; }
.voice-status:empty { display: none; }
.results-card .voice-status { margin-top: 6px; }

/* ---------- Cheerleader on the question card ---------- */
.cheer-spot:empty { display: none; }
.cheer-spot {
  position: absolute;
  left: -10px;
  bottom: -12px;
  width: 78px;
  pointer-events: none;
}
.question-card.has-cheer { padding-bottom: 22px; }
.question-card.has-cheer .feedback { padding: 0 56px; }
.cheerleader .monster { display: block; width: 100%; height: auto; overflow: visible; transform-origin: 50% 100%; }
.cheerleader .monster { animation: breathe 2.6s ease-in-out infinite; }
.cheerleader.enter { animation: rise 0.7s cubic-bezier(0.3, 1.5, 0.5, 1) 0.2s backwards; }

/* Right answer: jump and wave */
.cheerleader.yay { animation: cheer-yay 0.8s ease; }
.cheerleader.yay .arm-l { animation: wave-l 0.2s ease-in-out 4 alternate; }
.cheerleader.yay .arm-r { animation: wave-r 0.2s ease-in-out 4 alternate; }
@keyframes cheer-yay {
  35% { transform: translateY(-26px) rotate(-8deg) scale(1.08); }
  60% { transform: translateY(-6px) rotate(6deg); }
}

/* Streak milestone: big spinning jump */
.cheerleader.wow { animation: cheer-wow 1s ease; }
.cheerleader.wow .arm-l { animation: wave-l 0.18s ease-in-out 6 alternate; }
.cheerleader.wow .arm-r { animation: wave-r 0.18s ease-in-out 6 alternate; }
@keyframes cheer-wow {
  40% { transform: translateY(-40px) rotate(180deg) scale(1.15); }
  70% { transform: translateY(-10px) rotate(360deg); }
  100% { transform: rotate(360deg); }
}

/* Wrong answer: a kind, encouraging nod with arms out */
.cheerleader.aww { animation: cheer-aww 1s ease; }
.cheerleader.aww .arm-l { animation: hug-l 1s ease; }
.cheerleader.aww .arm-r { animation: hug-r 1s ease; }
@keyframes cheer-aww {
  25%, 75% { transform: rotate(-6deg) translateY(-3px); }
  50% { transform: rotate(6deg) translateY(-3px); }
}
@keyframes hug-l { 30%, 70% { transform: rotate(30deg); } }
@keyframes hug-r { 30%, 70% { transform: rotate(-30deg); } }

/* ---------- Voice picker ---------- */
.voice-pick { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #f7f6ff; }
.voice-pick .option-label { margin: 0; }
.voice-pick .hint { margin: 0; font-size: 0.9rem; }
.voice-pick select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 3px solid #e4e1ff;
  border-radius: 14px;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.voice-pick select:focus { outline: none; border-color: #6c5ce7; }

/* ---------- Language switch & reveal button ---------- */
.lang-chips { justify-content: center; margin-top: 12px; }
.lang-chips .chip { background: rgba(255, 255, 255, 0.85); border-color: transparent; font-size: 1rem; padding: 4px 16px; }
.lang-chips .chip[aria-checked="true"] { background: #6c5ce7; color: #fff; }
.btn-reveal { margin: 6px 0 0; font-size: 1rem; }
