:root {
  color-scheme: light;
  --ink: #090c09;
  --muted: #60675f;
  --paper: #f4f7f0;
  --surface: #f4f7f0;
  --surface-strong: #ffffff;
  --leaf: #9dcc3f;
  --leaf-dark: #173b22;
  --moss: #b9e653;
  --sun: #b9e653;
  --coral: #ee7d62;
  --sky: #65a979;
  --clay: #b66f46;
  --line: #ded8c8;
  --shadow: 0 18px 50px rgba(32, 33, 31, 0.12);
}
* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.entry-screen {
  display: none;
}

body.needs-entry .topbar,
body.needs-entry .game-layout {
  display: none;
}

body.needs-entry .entry-screen {
  min-height: calc(100vh - 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 28px;
  align-items: center;
}

.entry-hero {
  display: grid;
  gap: 18px;
}

.entry-kicker {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(63, 143, 86, 0.13);
  color: var(--leaf-dark);
  font-size: 0.86rem;
  font-weight: 850;
}

.entry-hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 0.94;
  font-weight: 900;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
}

.entry-legal-link,
.purchase-policy-link {
  color: #5b6656;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration-color: #aab5a4;
  text-underline-offset: 3px;
}

.entry-legal-link {
  display: inline-block;
  margin-top: 20px;
}

.purchase-policy-link {
  display: block;
  margin-top: 10px;
  text-align: center;
}

.entry-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border 160ms ease, box-shadow 160ms ease;
}

.entry-card:hover,
.entry-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--leaf);
  box-shadow: 0 22px 55px rgba(32, 33, 31, 0.16);
}

.entry-card strong {
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1;
}

.entry-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.entry-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--leaf-dark);
  color: #fffaf0;
  font-weight: 900;
}

.entry-card-zh .entry-icon {
  background: var(--sun);
  color: var(--ink);
}

.entry-side {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}

.entry-orbit {
  position: absolute;
  top: 30px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: rotate(6deg);
}

.entry-orbit span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.entry-orbit strong {
  font-size: 1.7rem;
}

.entry-sloth {
  position: relative;
  width: 240px;
  height: 285px;
  transform-origin: 50% 20%;
  animation: entrySlothFloat 4.2s ease-in-out infinite;
}

.entry-sloth-real {
  width: min(100%, 250px);
  filter: drop-shadow(0 18px 28px rgba(32, 33, 31, 0.18));
  transform-origin: 50% 18%;
  animation: entrySlothFloat 4.2s ease-in-out infinite;
}

.entry-snack-leaf path:first-child {
  fill: var(--leaf);
  stroke: var(--leaf-dark);
  stroke-width: 2;
}

.entry-snack-leaf path:last-child {
  fill: none;
  stroke: var(--leaf-dark);
  stroke-linecap: round;
  stroke-width: 2;
}

.entry-body {
  position: absolute;
  left: 42px;
  bottom: 18px;
  width: 156px;
  height: 172px;
  border-radius: 46% 46% 42% 42%;
  background: #9b7657;
  box-shadow: inset 0 -16px rgba(109, 79, 59, 0.18);
}

.entry-face {
  position: absolute;
  left: 26px;
  top: 38px;
  width: 188px;
  height: 154px;
  border-radius: 48% 48% 44% 44%;
  background: #9b7657;
  box-shadow: 0 20px 42px rgba(32, 33, 31, 0.18);
}

.entry-face::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 23px;
  width: 138px;
  height: 108px;
  border-radius: 48% 48% 44% 44%;
  background: #eadcc8;
}

.entry-face i {
  position: absolute;
  z-index: 1;
  top: 66px;
  width: 40px;
  height: 48px;
  border-radius: 50%;
  background: #6d4f3b;
}

.entry-face i:first-child {
  left: 52px;
}

.entry-face i:nth-child(2) {
  right: 52px;
}

.entry-face i::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #201713;
  box-shadow: 3px -3px 0 -1px #fffdf7;
}

.entry-face b {
  position: absolute;
  z-index: 1;
  left: 80px;
  top: 98px;
  width: 28px;
  height: 17px;
  border-radius: 0 0 18px 18px;
  border-bottom: 5px solid #201713;
}

.entry-ear {
  position: absolute;
  top: 36px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #8b6245;
}

.entry-ear.left {
  left: 22px;
}

.entry-ear.right {
  right: 22px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--leaf-dark);
  color: #fffaf0;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.track-switch {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 8px 25px rgba(32, 33, 31, 0.06);
}

.track-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.track-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(63, 143, 86, 0.12);
  color: var(--leaf-dark);
  font-weight: 800;
}

.track-button small {
  font-size: 0.78rem;
  white-space: nowrap;
}

.track-button.is-active {
  background: var(--ink);
  color: #fffdf7;
}

.track-button.is-active span {
  background: var(--sun);
  color: var(--ink);
}

.wallet {
  position: relative;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
  justify-content: flex-end;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 8px 25px rgba(32, 33, 31, 0.08);
  font-weight: 800;
}

.wallet small {
  color: var(--muted);
  font-weight: 600;
}

.wallet-help {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid rgba(63, 143, 86, 0.28);
  border-radius: 999px;
  background: rgba(63, 143, 86, 0.1);
  color: var(--leaf-dark);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.wallet-help:hover,
.wallet-help:focus-visible {
  background: var(--leaf);
  color: #fffaf0;
  outline: 2px solid rgba(63, 143, 86, 0.24);
  outline-offset: 2px;
}

.wallet-tip {
  position: absolute;
  z-index: 5;
  top: calc(100% + 10px);
  right: 0;
  width: min(270px, calc(100vw - 34px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 14px 36px rgba(32, 33, 31, 0.2);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.wallet-tip::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 15px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.wallet:hover .wallet-tip,
.wallet:focus-within .wallet-tip {
  opacity: 1;
  transform: translateY(0);
}

.wallet.is-spending {
  animation: spendPulse 620ms ease;
}

.leaf-icon {
  width: 18px;
  height: 18px;
  border-radius: 18px 0 18px 0;
  background: var(--leaf);
  transform: rotate(-28deg);
  box-shadow: inset -4px -2px rgba(0, 0, 0, 0.08);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.stage,
.sidebar section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.88);
  box-shadow: var(--shadow);
}

.stage {
  padding: 18px;
}

.level-row {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mascot-health {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 52px;
}

.health-leaf {
  width: 13px;
  height: 20px;
  border: 2px solid var(--leaf-dark);
  border-radius: 72% 16% 72% 16%;
  background: var(--leaf);
  transform: rotate(18deg);
  transition: opacity 220ms ease, transform 220ms ease, filter 220ms ease;
}

.health-leaf.is-empty {
  opacity: 0.18;
  filter: grayscale(1);
  transform: rotate(18deg) scale(0.82);
}

.level-pill,
.round-count,
#rankBadge,
#paymentMode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(63, 143, 86, 0.13);
  color: var(--leaf-dark);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.progress-shell {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(32, 33, 31, 0.09);
}

.progress-shell span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--leaf);
  transition: width 360ms ease;
}

.mascot-scene {
  display: grid;
  grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 12px 4px 18px;
}

.mascot-card {
  display: grid;
  place-items: center;
  min-height: 260px;
  position: relative;
}

.sloth {
  width: min(100%, 260px);
  filter: drop-shadow(0 18px 26px rgba(32, 33, 31, 0.16));
  transform-origin: 50% 18%;
}

.vine,
.arm {
  fill: none;
  stroke: var(--leaf-dark);
  stroke-linecap: round;
  stroke-width: 14;
}

.arm {
  stroke: #8b6245;
  stroke-width: 18;
}

.leg {
  fill: none;
  stroke: #8b6245;
  stroke-linecap: round;
  stroke-width: 20;
}

.fur-tuft {
  fill: none;
  stroke: #6d4f3b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  opacity: 0.58;
}

.vine-leaf,
.belly-leaf,
.tuft {
  fill: var(--moss);
  stroke: var(--leaf-dark);
  stroke-linejoin: round;
  stroke-width: 2;
}

.paw {
  fill: #8b6245;
  stroke: #6d4f3b;
  stroke-width: 3;
}

.ear,
.foot {
  fill: #8b6245;
  stroke: #6d4f3b;
  stroke-width: 3;
}

.claw {
  fill: none;
  stroke: #eadcc8;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.body,
.head {
  fill: #9b7657;
  stroke: #6d4f3b;
  stroke-width: 3;
}

.sloth .body,
.sloth .belly {
  transform-box: fill-box;
  transform-origin: center;
}

.sloth .body {
  transform: scaleX(var(--chub-scale, 1));
}

.sloth .belly {
  transform: scaleX(var(--belly-scale, 1));
}

.belly,
.face-mask {
  fill: #eadcc8;
}

.eye-patch {
  fill: #6d4f3b;
  transform-origin: center;
}

.brow {
  fill: none;
  stroke: #4a3326;
  stroke-linecap: round;
  stroke-width: 5;
  transform-origin: center;
}

.eye,
.nose {
  fill: #201713;
}

.sloth .eye,
.sloth .eye-shine,
.sloth .brow,
.sloth .blush,
.sloth .mouth {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms ease, opacity 220ms ease, fill 220ms ease;
}

.face-expression {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 240ms ease;
}

.eye-shine,
.tiny-tooth {
  fill: #fffdf7;
}

.happy-eye {
  fill: none;
  stroke: #201713;
  stroke-linecap: round;
  stroke-width: 5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.faint-eye {
  fill: none;
  stroke: #201713;
  stroke-linecap: round;
  stroke-width: 5;
  opacity: 0;
}

.eyelid,
.mouth-fold {
  fill: none;
  stroke: #201713;
  stroke-linecap: round;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms ease, opacity 220ms ease;
}

.eyelid {
  stroke-width: 5;
}

.mouth-fold {
  stroke-width: 3;
}

.cheek-puff {
  fill: #f1a18d;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.smirk-tooth {
  fill: #fffdf7;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.hungry-drool {
  fill: #72b9d3;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: top center;
}

.chew-mouth {
  fill: #201713;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center top;
}

.chew-tongue {
  fill: #ee7d62;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.chew-tooth {
  fill: #fffdf7;
  opacity: 0;
}

.tongue {
  fill: #ee7d62;
  opacity: 0;
}

.mouth {
  fill: none;
  stroke: #201713;
  stroke-linecap: round;
  stroke-width: 5;
}

.expression-drop {
  fill: #72b9d3;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.snack-leaf {
  fill: var(--leaf);
  opacity: 0.92;
  transform-origin: 204px 124px;
}

.snack-leaf path:last-child {
  fill: none;
  stroke: var(--leaf-dark);
  stroke-linecap: round;
  stroke-width: 2;
}

.snack-crumbs {
  fill: var(--leaf);
  opacity: 0;
}

.spark {
  fill: var(--sun);
  opacity: 0;
  transform-origin: center;
}

.heart {
  fill: var(--coral);
  opacity: 0;
  transform-origin: center;
}

.blush {
  fill: var(--coral);
  opacity: 0.48;
}

.sloth.state-correct .spark,
.sloth.state-low .spark-two {
  opacity: 1;
  animation: sparkPop 650ms ease;
}

.sloth.state-correct .heart {
  opacity: 1;
  animation: heartPop 800ms ease both;
}

.sloth.state-correct {
  animation: slothCheer 1280ms ease;
}

.sloth.state-correct .snack-leaf {
  animation: leafBite 1180ms linear both;
}

.sloth.state-correct .snack-crumbs {
  animation: crumbPop 1180ms ease both;
}

.sloth.state-correct .tongue {
  animation: tonguePop 1180ms ease both;
}

.sloth.state-correct .eye,
.sloth.state-correct .eye-shine,
.sloth.state-correct .mouth {
  opacity: 0;
}

.sloth.state-correct .happy-eye {
  animation: happySquint 1280ms ease both;
}

.sloth.state-correct .chew-mouth {
  animation: satisfiedChew 1280ms ease both;
}

.sloth.state-correct .chew-tongue {
  animation: happyTongue 1280ms ease both;
}

.sloth.state-correct .chew-tooth {
  animation: toothPeek 1280ms ease both;
}

.sloth.state-correct .blush {
  animation: blushBloom 1280ms ease both;
}

.sloth.state-correct .cheek-puff {
  animation: cheekPuff 1280ms ease both;
}

.sloth.state-correct .brow-left {
  animation: browJoyLeft 1280ms ease both;
}

.sloth.state-correct .brow-right {
  animation: browJoyRight 1280ms ease both;
}

.sloth.state-correct .body {
  animation: bodyChub 1280ms ease both;
}

.sloth.state-correct .belly {
  animation: bellyChub 1280ms ease both;
}

.sloth.state-correct .face-expression {
  animation: faceNibble 1280ms ease both;
}

.sloth.state-wrong .eye-left,
.sloth.state-wrong .shine-left {
  transform: translate(3px, 4px) scale(0.86);
}

.sloth.state-wrong .eye-right,
.sloth.state-wrong .shine-right {
  transform: translate(-3px, 4px) scale(0.86);
}

.sloth.state-wrong .brow-left {
  transform: translateY(7px) rotate(-10deg);
}

.sloth.state-wrong .brow-right {
  transform: translateY(7px) rotate(10deg);
}

.sloth.state-wrong .blush {
  opacity: 0.26;
}

.sloth.state-wrong .face-expression {
  transform: translateY(2px) rotate(1deg);
}

.sloth.state-wrong .expression-drop {
  animation: awkwardDrop 900ms ease both;
}

.sloth.state-wrong .eyelid {
  opacity: 0.68;
}

.sloth.state-wrong .eyelid-left {
  transform: translate(2px, 4px) rotate(8deg) scaleX(0.88);
}

.sloth.state-wrong .eyelid-right {
  transform: translate(-2px, 4px) rotate(-8deg) scaleX(0.88);
}

.sloth.state-wrong .mouth-fold {
  opacity: 0.58;
  transform: translateY(2px);
}

.sloth.state-wrong .eye-shine {
  opacity: 0.42;
}

.sloth.state-low .face-mask {
  fill: #f1d0bb;
}

.sloth.state-low .brow-left,
.sloth.state-low .brow-right {
  transform: translateY(8px);
}

.sloth.state-low .eye,
.sloth.state-low .eye-shine {
  transform: translateY(4px) scale(0.82);
}

.sloth.state-low .blush {
  opacity: 0.18;
}

.sloth.state-low .face-expression {
  transform: translateY(3px);
}

.sloth.state-low .eyelid {
  opacity: 0.9;
  transform: translateY(5px) scaleX(1.04);
}

.sloth.state-low .mouth-fold {
  opacity: 0.4;
  transform: translateY(1px) scaleX(0.82);
}

.sloth.state-hungry {
  animation: hungryWiggle 1.6s ease-in-out infinite;
}

.sloth.state-hungry .belly-leaf {
  animation: tummyRumble 700ms ease-in-out infinite;
}

.sloth.state-hungry .eye,
.sloth.state-hungry .eye-shine {
  transform: scale(1.32);
}

.sloth.state-hungry .eye-shine {
  opacity: 1;
}

.sloth.state-hungry .brow-left {
  transform: translateY(4px) rotate(8deg);
}

.sloth.state-hungry .brow-right {
  transform: translateY(4px) rotate(-8deg);
}

.sloth.state-hungry .tongue {
  animation: hungryTongue 1.6s ease-in-out infinite;
}

.sloth.state-hungry .hungry-drool {
  animation: hungryDrool 1.6s ease-in-out infinite;
}

.sloth.state-taunt .brow-left {
  transform: translateY(-1px) rotate(8deg);
}

.sloth.state-taunt .brow-right {
  transform: translateY(2px) rotate(-10deg);
}

.sloth.state-taunt .face-expression {
  transform: rotate(-3deg);
}

.sloth.state-taunt .eye,
.sloth.state-taunt .eye-shine {
  transform: translate(-4px, -1px) scale(0.9);
}

.sloth.state-taunt .eyelid-left {
  opacity: 0.92;
  transform: translate(-4px, 2px) rotate(-8deg) scaleX(1.08);
}

.sloth.state-taunt .eyelid-right {
  opacity: 0.34;
  transform: translate(-4px, -2px) rotate(5deg) scaleX(0.8);
}

.sloth.state-taunt .smirk-tooth {
  opacity: 1;
  transform: translate(-1px, -1px) rotate(-7deg);
}

.sloth.state-taunt .mouth-fold-right {
  opacity: 0.72;
  transform: translate(-2px, -3px) rotate(-10deg);
}

.sloth.state-taunt .blush-left {
  opacity: 0.28;
}

.sloth.state-taunt .blush-right {
  opacity: 0.62;
}

.sloth.state-fainted {
  animation: faintSink 680ms ease both;
  filter: grayscale(0.38) drop-shadow(0 12px 18px rgba(32, 33, 31, 0.12));
}

.sloth.state-fainted .eye,
.sloth.state-fainted .eye-shine,
.sloth.state-fainted .mouth,
.sloth.state-fainted .happy-eye {
  opacity: 0;
}

.sloth.state-fainted .faint-eye {
  opacity: 0.88;
}

.sloth.state-fainted .tongue {
  opacity: 0.72;
  transform: translate(5px, 4px) rotate(-16deg) scale(0.86);
}

.sloth.state-fainted .brow-left {
  transform: translateY(8px) rotate(12deg);
}

.sloth.state-fainted .brow-right {
  transform: translateY(8px) rotate(-12deg);
}

.family-roost {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 1px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  width: min(100%, 268px);
  min-height: 70px;
  pointer-events: none;
  transform: translateX(-50%);
}

.family-sloth {
  position: relative;
  display: block;
  flex: 0 0 43px;
  width: 43px;
  height: 64px;
  transform-origin: bottom center;
  animation: familyAdventure 3.7s calc(var(--family-index, 0) * -410ms) ease-in-out infinite;
}

.family-sloth:nth-child(even) {
  animation-name: familyClimb;
  animation-duration: 4.2s;
}

.family-sloth.is-baby {
  flex-basis: 34px;
  width: 34px;
  transform: translateY(7px) scale(0.82);
}

.family-body {
  position: absolute;
  left: 9px;
  top: 22px;
  width: 27px;
  height: 36px;
  border: 2px solid #6d4f3b;
  border-radius: 48% 48% 42% 42%;
  background: #9b7657;
  box-shadow: 0 5px 9px rgba(32, 33, 31, 0.13);
}

.family-arm,
.family-leg {
  position: absolute;
  z-index: 0;
  display: block;
  width: 8px;
  border: 3px solid #6d4f3b;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  transform-origin: top center;
}

.family-arm {
  top: 25px;
  height: 27px;
}

.family-arm-left { left: 5px; transform: rotate(34deg); }
.family-arm-right { right: 4px; transform: rotate(-38deg); animation: familyWave 1.45s ease-in-out infinite; }

.family-leg {
  top: 50px;
  height: 16px;
}

.family-leg-left { left: 11px; transform: rotate(18deg); }
.family-leg-right { right: 9px; transform: rotate(-22deg); }

.family-snack {
  position: absolute;
  z-index: 4;
  right: -1px;
  top: 35px;
  width: 13px;
  height: 18px;
  border: 2px solid var(--leaf-dark);
  border-radius: 85% 18% 85% 18%;
  background: var(--moss);
  transform: rotate(22deg);
  animation: familyNibble 1.1s ease-in-out infinite;
}

.family-mask {
  position: absolute;
  z-index: 3;
  left: 5px;
  top: 2px;
  width: 35px;
  height: 31px;
  border: 2px solid #6d4f3b;
  border-radius: 50%;
  background: #eadcc8;
}

.family-mask::before,
.family-mask::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 13px;
  height: 14px;
  border-radius: 60% 40% 60% 40%;
  background: #6d4f3b;
}

.family-mask::before { left: 2px; transform: rotate(14deg); }
.family-mask::after { right: 2px; transform: rotate(-14deg); }

.family-mask b {
  position: absolute;
  z-index: 2;
  top: 13px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #201713;
}

.family-mask b:first-child { left: 9px; }
.family-mask b:nth-child(2) { right: 9px; }

.family-mask em {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 4px;
  width: 7px;
  height: 4px;
  border-bottom: 2px solid #201713;
  border-radius: 50%;
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: no-preference) {
  .sloth.state-idle {
    animation: slothFloat 4.6s ease-in-out infinite;
  }

  .sloth.state-idle .leaf-a,
  .sloth.state-idle .leaf-b {
    animation: leafWiggle 3.8s ease-in-out infinite;
  }
}

.mascot-bubble {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 24px 26px;
  border-left: 4px solid var(--leaf);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 8px;
}

.mascot-bubble strong {
  max-width: 28ch;
  font-size: 1.55rem;
  line-height: 1.36;
  font-weight: 720;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.mascot-bubble span {
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.challenge {
  padding: 18px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.challenge-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.round-timer {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 32px;
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf7;
}

.round-timer strong {
  min-width: 20px;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.round-timer small {
  margin-left: 2px;
  font-size: 0.7rem;
  line-height: 1;
}

.round-timer.is-urgent {
  border-color: var(--coral);
  color: #a13f2d;
  animation: timerPulse 640ms ease-in-out infinite;
}

.challenge h1 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.12;
  font-weight: 800;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice {
  min-height: 64px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  text-align: center;
  font-size: 1.08rem;
  font-weight: 750;
  overflow-wrap: anywhere;
  transition: transform 160ms ease, border 160ms ease, background 160ms ease;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-1px);
  border-color: var(--leaf);
}

.choice.is-correct {
  background: rgba(63, 143, 86, 0.15);
  border-color: var(--leaf);
}

.choice.is-wrong {
  background: rgba(238, 125, 98, 0.15);
  border-color: var(--coral);
}

.choice:disabled {
  cursor: default;
}

.feedback {
  min-height: 34px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.feedback strong {
  color: var(--ink);
}

.explanation-panel {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.explanation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.explanation-heading strong {
  color: var(--ink);
  font-size: 1rem;
}

.explanation-preview,
.explanation-detail-wrap p {
  margin: 10px 0 0;
  line-height: 1.65;
}

.explanation-preview {
  color: var(--ink);
  font-weight: 700;
}

.explanation-detail-wrap {
  position: relative;
  min-height: 82px;
}

.explanation-detail-wrap.is-locked p {
  max-height: 54px;
  overflow: hidden;
  color: var(--muted);
  filter: blur(4px);
  opacity: 0.56;
  user-select: none;
}

.explanation-lock {
  position: absolute;
  inset: 18px 0 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
}

.explanation-lock button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--leaf-dark);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.explanation-detail-wrap:not(.is-locked) .explanation-lock {
  display: none;
}

.explanation-lock[hidden] {
  display: none;
}

.continue-button,
.refill-shortcut,
.level-up-offer {
  min-height: 52px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.continue-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--leaf-dark);
  background: var(--leaf);
  color: #fff;
}

.result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.refill-shortcut {
  min-width: 126px;
  border: 1px solid var(--line);
  background: #fffdf7;
  color: var(--ink);
  font-weight: 800;
}

.level-up-offer {
  display: grid;
  gap: 3px;
  border: 1px solid #c58d18;
  background: rgba(244, 201, 93, 0.2);
  color: var(--ink);
  text-align: left;
}

.level-up-offer span {
  color: #8a5e00;
  font-size: 0.74rem;
}

.result-actions[hidden],
.level-up-offer[hidden],
.explanation-panel[hidden] {
  display: none;
}

.sidebar {
  display: grid;
  gap: 14px;
}

.sidebar section {
  padding: 14px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-strip div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(63, 143, 86, 0.1);
}

.stat-strip span,
.section-heading span,
.leaderboard small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.stat-strip strong {
  overflow-wrap: anywhere;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.leaderboard ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.leaderboard li.is-player {
  outline: 2px solid rgba(244, 201, 93, 0.78);
}

.leaderboard li.is-rank-up {
  animation: rankRise 780ms ease both;
}

.leaderboard li.is-rank-down {
  animation: rankDip 780ms ease both;
}

.rank-motion {
  min-height: 18px;
  margin: -4px 0 9px;
  color: var(--leaf-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.rank-motion.is-down {
  color: #b35645;
}

.leaderboard b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-summary,
.revive-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(23, 27, 23, 0.72);
  backdrop-filter: blur(10px);
}

.round-summary[hidden],
.revive-screen[hidden] {
  display: none;
}

.summary-shell,
.revive-shell {
  width: min(100%, 620px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 28px 80px rgba(15, 18, 15, 0.34);
  text-align: center;
  animation: summaryArrive 460ms ease both;
}

.summary-kicker {
  color: var(--leaf-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-shell h2,
.revive-shell h2 {
  margin: 8px 0 6px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.06;
}

.summary-family {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  margin: 8px auto 2px;
}

.summary-family .family-sloth {
  position: relative;
}

.summary-percentile {
  margin: 16px 0 2px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
}

.summary-percentile strong {
  color: #d75f4b;
  font-size: 1.55em;
}

.summary-benchmark {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0 14px;
}

.summary-metrics div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f5ec;
}

.summary-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.summary-metrics strong {
  overflow-wrap: anywhere;
  font-size: 1.18rem;
}

.summary-rank,
.summary-growth {
  margin-top: 9px;
  padding: 11px 13px;
  border-left: 4px solid var(--sun);
  background: rgba(244, 201, 93, 0.14);
  text-align: left;
  font-weight: 750;
}

.summary-growth {
  border-left-color: var(--leaf);
  background: rgba(63, 143, 86, 0.09);
}

.summary-next,
.revive-refill {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: #fffdf7;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.revive-refill {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.revive-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 126px;
  height: 96px;
  margin: 0 auto 12px;
  border: 5px solid #6d4f3b;
  border-radius: 48%;
  background: #eadcc8;
  color: #201713;
  font-size: 1.6rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

.revive-face i {
  width: 12px;
  height: 9px;
  border-radius: 50%;
  background: #201713;
}

.revive-shell p {
  margin: 12px auto 0;
  max-width: 440px;
  color: var(--muted);
  line-height: 1.6;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pack-grid > :only-child,
.pay-methods > :only-child {
  grid-column: 1 / -1;
}

.pay-methods.is-single-method button:not([hidden]) {
  grid-column: 1 / -1;
}

.pack {
  display: grid;
  gap: 5px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-strong);
  text-align: left;
}

.pack.is-selected {
  border-color: var(--leaf);
  box-shadow: inset 0 0 0 1px var(--leaf);
}

.pack strong {
  font-size: 1rem;
}

.pack small {
  color: var(--muted);
  font-weight: 700;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.payer-confirmation {
  align-items: flex-start;
  color: #555f52;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 9px;
  line-height: 1.5;
  margin: 14px 0 10px;
}

.payer-confirmation input {
  accent-color: var(--leaf-dark);
  flex: 0 0 auto;
  height: 17px;
  margin: 1px 0 0;
  width: 17px;
}

.pay-methods button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
}

.pay-methods button:nth-child(2) {
  background: var(--sky);
  color: #102327;
}

.pay-methods button:nth-child(3) {
  background: var(--leaf);
  color: #f7fff6;
}

.pay-methods button:nth-child(4) {
  background: var(--sun);
  color: #2a2110;
}

.pay-message {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.refill-panel.is-needed {
  animation: refillGlow 900ms ease;
}

@keyframes spendPulse {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-2px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes sparkPop {
  0% { transform: scale(0.7) rotate(-8deg); }
  50% { transform: scale(1.14) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes heartPop {
  0% { transform: translateY(8px) scale(0.55); opacity: 0; }
  42% { transform: translateY(-8px) scale(1.08); opacity: 1; }
  100% { transform: translateY(-14px) scale(0.92); opacity: 0; }
}

@keyframes slothCheer {
  0% { transform: rotate(0deg) translateY(0); }
  30% { transform: rotate(-4deg) translateY(-6px); }
  58% { transform: rotate(3deg) translateY(1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

@keyframes faceNibble {
  0%, 36% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(2px) rotate(-1.5deg); }
  62% { transform: translateY(5px) rotate(1.5deg); }
  74% { transform: translateY(2px) rotate(-1deg); }
  88%, 100% { transform: translateY(3px) rotate(0); }
}

@keyframes leafBite {
  0% { opacity: 0.92; transform: translate(0, 0) rotate(0) scale(1); }
  18% { opacity: 1; transform: translate(-10px, 4px) rotate(-5deg) scale(1.04); }
  55% { opacity: 1; transform: translate(-74px, 5px) rotate(-16deg) scale(0.62); }
  76% { opacity: 1; transform: translate(-91px, 7px) rotate(-20deg) scale(0.52); }
  90% { opacity: 1; transform: translate(-94px, 8px) rotate(-22deg) scale(0.44); }
  96% { opacity: 0.86; transform: translate(-95px, 8px) rotate(-23deg) scale(0.32); }
  100% { opacity: 0; transform: translate(-95px, 8px) rotate(-24deg) scale(0.08); }
}

@keyframes crumbPop {
  0%, 50% { opacity: 0; transform: translate(5px, 1px) scale(0.6); }
  68% { opacity: 1; transform: translate(-7px, -5px) scale(1); }
  100% { opacity: 0; transform: translate(-8px, 6px) scale(0.7); }
}

@keyframes tonguePop {
  0%, 40%, 100% { opacity: 0; transform: scaleY(0.5); }
  58%, 72% { opacity: 1; transform: scaleY(1); }
}

@keyframes happySquint {
  0%, 34% { opacity: 0; transform: scaleX(0.72) translateY(2px); }
  48% { opacity: 1; transform: scaleX(1.08) translateY(-1px); }
  63% { opacity: 1; transform: scaleX(0.9) translateY(1px); }
  78%, 100% { opacity: 1; transform: scaleX(1) translateY(0); }
}

@keyframes satisfiedChew {
  0%, 36% { opacity: 0; transform: scale(0.72, 0.35); }
  48% { opacity: 1; transform: scale(1.05, 1.12); }
  58% { opacity: 1; transform: scale(0.96, 0.62); }
  68% { opacity: 1; transform: scale(1.03, 1.03); }
  78% { opacity: 1; transform: scale(0.98, 0.7); }
  88%, 100% { opacity: 1; transform: scale(1, 0.82); }
}

@keyframes happyTongue {
  0%, 62% { opacity: 0; transform: translateY(-2px) scale(0.55); }
  73% { opacity: 1; transform: translateY(0) scale(1.08); }
  88%, 100% { opacity: 1; transform: translateY(-1px) scale(0.9); }
}

@keyframes toothPeek {
  0%, 43% { opacity: 0; }
  52%, 100% { opacity: 1; }
}

@keyframes blushBloom {
  0%, 35% { opacity: 0.38; transform: scale(0.8); }
  58% { opacity: 0.88; transform: scale(1.22); }
  78%, 100% { opacity: 0.72; transform: scale(1.05); }
}

@keyframes cheekPuff {
  0%, 40% { opacity: 0; transform: scale(0.58); }
  55% { opacity: 0.34; transform: scale(1.14, 0.94); }
  68% { opacity: 0.78; transform: scale(1.32, 1.12); }
  82% { opacity: 0.52; transform: scale(1.08, 0.92); }
  100% { opacity: 0.42; transform: scale(1.16, 1); }
}

@keyframes browJoyLeft {
  0%, 35% { transform: translateY(0) rotate(0); }
  55%, 100% { transform: translateY(-4px) rotate(-7deg); }
}

@keyframes browJoyRight {
  0%, 35% { transform: translateY(0) rotate(0); }
  55%, 100% { transform: translateY(-4px) rotate(7deg); }
}

@keyframes bodyChub {
  0%, 58% { transform: scaleX(var(--chub-before, 1)); }
  78% { transform: scaleX(calc(var(--chub-scale, 1) + 0.055)); }
  100% { transform: scaleX(var(--chub-scale, 1)); }
}

@keyframes bellyChub {
  0%, 58% { transform: scaleX(var(--belly-before, 1)); }
  78% { transform: scaleX(calc(var(--belly-scale, 1) + 0.075)); }
  100% { transform: scaleX(var(--belly-scale, 1)); }
}

@keyframes hungryWiggle {
  0%, 100% { transform: rotate(-1deg) translateY(0); }
  50% { transform: rotate(1deg) translateY(3px); }
}

@keyframes tummyRumble {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

@keyframes awkwardDrop {
  0% { opacity: 0; transform: translateY(-5px) scale(0.7); }
  28%, 72% { opacity: 0.9; transform: translateY(0) scale(1); }
  100% { opacity: 0.42; transform: translateY(4px) scale(0.88); }
}

@keyframes hungryTongue {
  0%, 100% { opacity: 0.25; transform: translateY(-1px) scale(0.74); }
  50% { opacity: 0.9; transform: translateY(2px) scale(1); }
}

@keyframes hungryDrool {
  0%, 18%, 100% { opacity: 0; transform: translateY(-3px) scale(0.55); }
  42% { opacity: 0.84; transform: translateY(0) scale(0.92); }
  70% { opacity: 0.58; transform: translateY(4px) scale(1); }
}

@keyframes faintSink {
  0% { transform: rotate(0) translateY(0); opacity: 1; }
  45% { transform: rotate(5deg) translateY(5px); opacity: 0.92; }
  100% { transform: rotate(8deg) translateY(12px); opacity: 0.78; }
}

@keyframes familyPop {
  0% { opacity: 0; transform: translateY(12px) scale(0.5); }
  72% { opacity: 1; transform: translateY(-2px) scale(1.08); }
  100% { opacity: 1; }
}

@keyframes summaryArrive {
  0% { opacity: 0; transform: translateY(22px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rankRise {
  0% { opacity: 0.45; transform: translateY(18px); }
  55% { opacity: 1; transform: translateY(-4px); background: rgba(183, 211, 107, 0.34); }
  100% { transform: translateY(0); }
}

@keyframes rankDip {
  0% { transform: translateY(-12px); }
  100% { transform: translateY(0); background: rgba(238, 125, 98, 0.12); }
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@keyframes slothFloat {
  0%, 100% { transform: rotate(-1deg) translateY(0); }
  50% { transform: rotate(1.5deg) translateY(-5px); }
}

@keyframes leafWiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(6deg); }
}

@keyframes entrySlothFloat {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-9px); }
}

@keyframes refillGlow {
  0% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 4px rgba(244, 201, 93, 0.42), var(--shadow); }
  100% { box-shadow: var(--shadow); }
}

@media (max-width: 900px) {
  body.needs-entry .entry-screen {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 26px 0;
  }

  .entry-side {
    min-height: 270px;
    order: -1;
  }

  .entry-sloth {
    width: 190px;
    height: 225px;
  }

  .entry-sloth-real {
    width: 205px;
  }

  .entry-body {
    left: 33px;
    width: 124px;
    height: 136px;
  }

  .entry-face {
    left: 20px;
    top: 30px;
    width: 150px;
    height: 124px;
  }

  .entry-face::before {
    left: 20px;
    top: 18px;
    width: 110px;
    height: 88px;
  }

  .entry-face i {
    top: 54px;
    width: 32px;
    height: 38px;
  }

  .entry-face i:first-child {
    left: 41px;
  }

  .entry-face i:nth-child(2) {
    right: 41px;
  }

  .entry-face i::before {
    left: 13px;
    top: 14px;
  }

  .entry-face b {
    left: 63px;
    top: 79px;
  }

  .entry-orbit {
    top: 10px;
    right: max(8px, 12vw);
    width: 82px;
    height: 82px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .track-switch {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .track-button {
    flex: 1;
    justify-content: center;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .wallet {
    min-width: 116px;
    padding: 9px;
  }

  .wallet-tip {
    right: -4px;
  }

  .track-button small {
    display: none;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  .entry-card {
    min-height: 104px;
  }

  .stage {
    padding: 12px;
  }

  .level-row {
    grid-template-columns: auto minmax(62px, 1fr) auto auto;
    gap: 7px;
  }

  .mascot-health {
    min-width: 44px;
    gap: 3px;
  }

  .health-leaf {
    width: 10px;
    height: 16px;
  }

  .mascot-scene {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mascot-card {
    min-height: 210px;
  }

  .sloth {
    width: min(230px, 84vw);
  }

  .family-roost {
    bottom: -2px;
    transform: translateX(-50%) scale(0.9);
  }

  .mascot-bubble {
    gap: 9px;
    padding: 17px 18px;
  }

  .mascot-bubble strong {
    max-width: none;
    font-size: 1.24rem;
    line-height: 1.3;
  }

  .mascot-bubble span {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .choice-grid,
  .pay-methods,
  .pack-grid {
    grid-template-columns: 1fr;
  }

  .challenge {
    padding: 14px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .refill-shortcut {
    width: 100%;
  }

  .round-summary,
  .revive-screen {
    align-items: end;
    padding: 10px;
  }

  .summary-shell,
  .revive-shell {
    padding: 24px 16px max(18px, env(safe-area-inset-bottom));
  }

  .summary-metrics {
    gap: 5px;
  }

  .summary-metrics div {
    padding: 10px 5px;
  }
}

/* Compact play surface and explicit pronunciation controls */
.entry-profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 620px;
}

.entry-profile-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.entry-profile-fields input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
}

.entry-profile-fields input:focus {
  border-color: var(--leaf-dark);
  box-shadow: 0 0 0 3px rgba(63, 143, 86, 0.12);
}

.entry-profile-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.entry-profile-skip {
  padding: 9px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  font-size: 0.76rem;
  font-weight: 800;
}

.mascot-scene {
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 12px;
  padding: 2px 4px 8px;
}

.mascot-card {
  min-height: 210px;
}

.sloth {
  width: min(100%, 220px);
}

.mascot-bubble {
  gap: 8px;
  padding: 18px 20px;
}

.mascot-bubble-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 900;
}

.music-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-toggle.is-on {
  color: var(--leaf-dark);
  background: rgba(63, 143, 86, 0.08);
  border-color: rgba(63, 143, 86, 0.24);
}

.mascot-bubble .mascot-name {
  color: var(--leaf-dark);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.mascot-bubble strong {
  font-size: 1.25rem;
  line-height: 1.34;
}

.mascot-bubble span:not(.mascot-name) {
  font-size: 0.88rem;
  line-height: 1.5;
}

.challenge {
  padding: 15px 17px;
}

.challenge h1 {
  margin-bottom: 14px;
  font-size: 1.82rem;
  line-height: 1.15;
}

.choice-wrap {
  position: relative;
  min-width: 0;
}

.choice-wrap .choice {
  width: 100%;
}

.choice-wrap:has(.choice-speaker) .choice {
  padding-right: 52px;
}

.choice-speaker {
  position: absolute;
  top: 50%;
  right: 9px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--leaf-dark);
  background: rgba(63, 143, 86, 0.08);
  border: 1px solid rgba(63, 143, 86, 0.24);
  border-radius: 50%;
  opacity: 1;
  transform: translateY(-50%);
}

.choice-speaker::after {
  content: none;
}

.choice-speaker svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-speaker:hover,
.choice-speaker:focus-visible {
  color: #fffdf7;
  background: var(--leaf-dark);
  outline: 2px solid rgba(63, 143, 86, 0.2);
  outline-offset: 2px;
}

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

@keyframes familyAdventure {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  25% { transform: translateY(-7px) rotate(5deg); }
  50% { transform: translateY(-2px) rotate(-4deg); }
  75% { transform: translateY(-10px) rotate(3deg); }
}

@keyframes familyClimb {
  0%, 100% { transform: translateY(3px) rotate(3deg); }
  35% { transform: translateY(-12px) rotate(-5deg); }
  68% { transform: translateY(-5px) rotate(5deg); }
}

@keyframes familyWave {
  0%, 100% { transform: rotate(-38deg); }
  50% { transform: rotate(-74deg); }
}

@keyframes familyNibble {
  0%, 100% { transform: translate(0, 0) rotate(22deg) scale(1); }
  50% { transform: translate(-3px, -2px) rotate(14deg) scale(0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .family-sloth,
  .family-arm-right,
  .family-snack {
    animation: none;
  }
}

@media (max-width: 640px) {
  .entry-profile-fields {
    grid-template-columns: 1fr;
  }

  .entry-profile-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .entry-profile-actions .entry-start {
    width: 100%;
  }

  .mascot-scene {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .mascot-card {
    min-height: 190px;
  }

  .sloth {
    width: min(205px, 78vw);
  }

  .mascot-bubble {
    padding: 15px 16px;
  }

  .challenge h1 {
    font-size: 1.42rem;
  }
}

/* 2026 black-and-green game refresh */
.entry-kicker {
  padding: 0 0 11px;
  color: var(--leaf-dark);
  background: transparent;
  border-bottom: 1px solid var(--leaf-dark);
  border-radius: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.entry-kicker span {
  color: var(--muted);
  font-weight: 700;
}

.entry-step {
  position: relative;
  display: grid;
  gap: 18px;
}

.entry-step-number {
  margin: 0;
  color: var(--leaf-dark);
  font-size: 0.7rem;
  font-weight: 900;
}

.entry-card {
  border-color: rgba(9, 12, 9, 0.2);
  border-radius: 4px;
  box-shadow: none;
}

.entry-card:hover,
.entry-card:focus-visible {
  color: var(--moss);
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}

.entry-card:hover small,
.entry-card:focus-visible small {
  color: rgba(255, 255, 255, 0.68);
}

.entry-icon,
.entry-card-zh .entry-icon {
  color: var(--ink);
  background: var(--moss);
  border-radius: 3px;
}

.entry-goal-copy {
  max-width: 540px;
  margin: -4px 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.entry-goals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.entry-goal {
  position: relative;
  min-height: 86px;
  padding: 18px 34px 18px 14px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 850;
  transition: color 180ms ease, background-color 180ms ease;
}

.entry-goal:nth-child(2n) {
  border-right: 0;
}

.entry-goal::after {
  content: "";
  position: absolute;
  top: 18px;
  right: 14px;
  width: 10px;
  height: 10px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.entry-goal small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.entry-goal.is-selected,
.entry-goal:hover,
.entry-goal:focus-visible {
  color: var(--moss);
  background: var(--ink);
}

.entry-goal.is-selected small,
.entry-goal:hover small,
.entry-goal:focus-visible small {
  color: rgba(255, 255, 255, 0.64);
}

.entry-goal.is-selected::after {
  background: var(--moss);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.entry-back {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 1.1rem;
}

.entry-start {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  width: min(100%, 300px);
  min-height: 52px;
  padding: 0 17px;
  color: var(--ink);
  background: var(--moss);
  border: 1px solid var(--moss);
  font-size: 0.82rem;
  font-weight: 900;
}

.entry-start:hover,
.entry-start:focus-visible {
  color: var(--moss);
  background: var(--ink);
  border-color: var(--ink);
}

.entry-orbit {
  border-radius: 50%;
  box-shadow: none;
  transform: none;
}

.topbar-tools {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sound-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.sound-toggle span {
  position: relative;
  width: 9px;
  height: 13px;
  background: var(--muted);
  border-radius: 2px 0 0 2px;
}

.sound-toggle span::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 7px;
  width: 9px;
  height: 11px;
  border: 2px solid var(--muted);
  border-left: 0;
  border-radius: 0 10px 10px 0;
}

.sound-toggle::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 1px;
  background: var(--coral);
  transform: rotate(-45deg);
}

.sound-toggle.is-on span {
  background: var(--leaf-dark);
}

.sound-toggle.is-on span::before {
  border-color: var(--leaf-dark);
}

.sound-toggle.is-on::after {
  display: none;
}

.choice {
  position: relative;
  display: grid;
  place-items: center;
  gap: 5px;
}

.choice-word {
  font-size: 1.08rem;
  font-weight: 800;
}

.choice-pinyin {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.choice-speaker {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 10px;
  background: var(--leaf-dark);
  border-radius: 1px;
  opacity: 0.56;
}

.choice-speaker::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 6px;
  width: 6px;
  height: 8px;
  border: 1px solid var(--leaf-dark);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.result-actions {
  justify-content: start;
  grid-template-columns: auto auto;
  margin: 4px 0 16px;
}

.continue-button {
  width: auto;
  min-width: 190px;
  color: var(--ink);
  background: var(--moss);
  border-color: var(--leaf-dark);
}

.refill-shortcut {
  min-width: 112px;
}

.explanation-panel {
  margin-top: 8px;
}

.sad-tear {
  fill: #70b8d4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: top center;
}

.sloth.state-wrong .sad-tear-left {
  animation: sadTearLeft 1.25s ease both;
}

.sloth.state-wrong .sad-tear-right {
  animation: sadTearRight 1.25s ease 120ms both;
}

.sloth.state-wrong .expression-drop {
  opacity: 0;
  animation: none;
}

@keyframes sadTearLeft {
  0%, 12% { opacity: 0; transform: translateY(-4px) scale(0.6); }
  30%, 70% { opacity: 0.95; transform: translateY(2px) scale(1); }
  100% { opacity: 0; transform: translate(-2px, 16px) scale(0.82); }
}

@keyframes sadTearRight {
  0%, 12% { opacity: 0; transform: translateY(-4px) scale(0.6); }
  30%, 70% { opacity: 0.95; transform: translateY(2px) scale(1); }
  100% { opacity: 0; transform: translate(2px, 16px) scale(0.82); }
}

@media (max-width: 900px) {
  .topbar-tools {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 640px) {
  .entry-goals {
    grid-template-columns: 1fr;
  }

  .entry-goal,
  .entry-goal:nth-child(2n) {
    border-right: 0;
  }

  .sound-toggle {
    width: 38px;
    height: 38px;
  }

  .topbar-tools {
    min-width: 0;
  }

  .wallet {
    min-width: 110px;
  }

  .result-actions {
    grid-template-columns: 1fr 1fr;
  }

  .continue-button,
  .refill-shortcut {
    width: 100%;
    min-width: 0;
  }
}

/* Keep the pronunciation control independent from the answer button. */
.choice-wrap {
  position: relative;
  min-width: 0;
}

.choice-wrap .choice {
  width: 100%;
}

.choice-wrap:has(.choice-speaker) .choice {
  padding-right: 52px;
}

.choice-speaker {
  position: absolute;
  top: 50%;
  right: 9px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--leaf-dark);
  background: rgba(63, 143, 86, 0.08);
  border: 1px solid rgba(63, 143, 86, 0.24);
  border-radius: 50%;
  opacity: 1;
  transform: translateY(-50%);
}

.choice-speaker::after {
  content: none;
}

.choice-speaker svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-speaker:hover,
.choice-speaker:focus-visible {
  color: #fffdf7;
  background: var(--leaf-dark);
  outline: 2px solid rgba(63, 143, 86, 0.2);
  outline-offset: 2px;
}
