/* Baloo 2 (SIL OFL, assets/fonts/OFL.txt), served from here: no request leaves the site, and it works offline. */
@font-face {
  font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(../assets/fonts/baloo2-latin.woff2) format('woff2');
}
:root {
  --bg: #fff4e6;
  --ink: #3d3553;
  --shadow: 0 6px 0 rgba(61, 53, 83, .14);
  --shadow-press: 0 2px 0 rgba(61, 53, 83, .14);
  --good: #52b788;
  --bad: #ef476f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: 'Baloo 2', 'Comic Sans MS', 'Chalkboard SE', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #ffe0ec 0 12%, transparent 13%),
    radial-gradient(circle at 92% 18%, #d7f2ff 0 10%, transparent 11%),
    radial-gradient(circle at 85% 92%, #e5fbe0 0 14%, transparent 15%),
    var(--bg);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.screen { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Menu ---------- */
#menu { overflow-y: auto; padding: 16px 16px 32px; }
.menu-head { text-align: center; }
.menu-head h1 { font-size: clamp(32px, 7vw, 56px); margin: 4px 0 0; line-height: 1.1; }
.menu-sub { margin: 0; font-size: 20px; opacity: .7; }
.star-total {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 18px;
  font-size: 26px;
  font-weight: 800;
  background: #fff;
  border-radius: 99px;
  box-shadow: var(--shadow);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px 12px;
  background: var(--tile);
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .1s;
}
.tile:active { transform: translateY(4px) scale(.97); box-shadow: var(--shadow-press); }
.tile-emoji { font-size: 64px; line-height: 1.15; }
.tile-title { font-size: 22px; font-weight: 800; line-height: 1.1; text-align: center; }
.tile-day { font-size: 13px; padding: 0 10px; background: rgba(255, 255, 255, .65); border-radius: 99px; }

.menu-foot { max-width: 1000px; margin: 0 auto; text-align: center; font-size: 18px; }
.menu-foot input {
  font: inherit;
  width: 180px;
  margin-left: 6px;
  padding: 4px 14px;
  border: 3px solid #ffd6a5;
  border-radius: 99px;
  text-align: center;
}
.voice-info { margin: 8px 0 0; font-size: 15px; opacity: .75; }
.parent-open {
  font: inherit; font-size: 16px; padding: 4px 16px; color: var(--ink); opacity: .7;
  background: rgba(255, 255, 255, .7); border-radius: 99px;
}

/* Play time is up (js/core.js): goodnight over everything, nothing for a child to press. */
.rest {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #4a4e8a, #262848); color: #fff;
}
.rest-moon { font-size: 120px; animation: wobble 6s ease-in-out infinite; }
.rest-zea { font-size: 96px; }
.rest .parent-open { position: absolute; right: 14px; bottom: 14px; background: rgba(255, 255, 255, .15); color: #fff; }

/* Parent corner (js/main.js). */
.parent {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(40, 34, 52, .55); font-size: 17px;
}
.parent-box {
  position: relative; width: min(94vw, 560px); max-height: 92dvh; overflow: auto; padding: 22px 22px 18px;
  background: #fbf6f0; border-radius: 24px; box-shadow: var(--shadow); color: var(--ink);
}
.parent-close { position: absolute; top: 10px; right: 12px; font-size: 22px; }
.parent-gate { text-align: center; }
.parent-gate input, .parent-panel input {
  font: inherit; width: 120px; padding: 4px 12px; border: 3px solid #ffd6a5; border-radius: 99px; text-align: center;
}
.parent-box button:not(.parent-close) {
  font: inherit; font-size: 15px; margin: 3px; padding: 4px 12px; color: var(--ink);
  background: #fff; border: 2px solid #ffd6a5; border-radius: 99px;
}
.parent-box button.on { background: #ffd166; border-color: #ffd166; font-weight: 800; }
.parent-panel { display: flex; flex-direction: column; gap: 10px; }
.parent-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.parent-note { margin: -6px 0 0; font-size: 13px; opacity: .75; }
.parent-days { display: flex; gap: 10px; align-items: flex-end; height: 84px; margin-top: 6px; }
.parent-days span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font-size: 13px; width: 28px; }
.parent-days small { opacity: .6; }
.parent-days i { display: block; width: 18px; min-height: 2px; background: #ef8354; border-radius: 4px 4px 0 0; }
.parent-skills p { margin: 6px 0 0; line-height: 1.3; }
.parent-skills small { opacity: .7; }

/* ---------- Play screen ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.icon-btn {
  flex: none;
  width: 60px;
  height: 60px;
  font-size: 30px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.icon-btn:active { transform: translateY(3px); box-shadow: var(--shadow-press); }
.progress { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: clamp(18px, 5vw, 28px); }
.progress .dot { filter: grayscale(1); opacity: .3; transition: all .3s; }
.progress .dot.done { filter: none; opacity: 1; animation: pop .4s; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 16px 40px;
}

.caption {
  position: fixed;
  left: 50%;
  bottom: 8px;
  max-width: 92vw;
  padding: 4px 16px;
  font-size: 16px;
  text-align: center;
  color: #fff;
  background: rgba(61, 53, 83, .8);
  border-radius: 20px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 50;
}
.caption.show { opacity: 1; }

.big-btn {
  padding: 12px 28px;
  font-size: 26px;
  font-weight: 800;
  background: #ffd166;
  border-radius: 99px;
  box-shadow: var(--shadow);
}
.big-btn.alt { background: #fff; }
.big-btn:active { transform: translateY(4px); box-shadow: var(--shadow-press); }

/* ---------- Choice quiz ---------- */
.quiz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 12px;
  width: 100%;
  max-width: 900px;
  height: 100%;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 110px;
  font-size: clamp(80px, 18vw, 140px);
  line-height: 1.1;
}
.quiz-top:empty { display: none; }
.quiz-top.col { flex-direction: column; }

.options { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 3vw, 28px); width: 100%; }
.options.column { flex-direction: column; align-items: stretch; max-width: 700px; }

.option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: clamp(96px, 26vw, 190px);
  min-height: clamp(96px, 26vw, 190px);
  padding: 10px;
  font-size: clamp(56px, 13vw, 110px);
  line-height: 1.1;
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: transform .1s;
}
.option:active { transform: translateY(4px); box-shadow: var(--shadow-press); }
.option-label { margin-top: 4px; font-size: 18px; font-weight: 700; opacity: .75; }
.option-label::first-letter { text-transform: uppercase; }
.option.wide { min-width: clamp(130px, 38vw, 260px); font-size: clamp(48px, 11vw, 90px); }

.is-correct { animation: bounce .6s; outline: 6px solid var(--good); }
.is-wrong { animation: shake .45s; }

/* ---------- My body ---------- */
.kid { height: min(64vh, 560px); max-width: 92vw; overflow: visible; }
.kid .part { cursor: pointer; }
.kid .hit { fill: transparent; stroke: transparent; }
.kid .part.is-correct { outline: none; animation: glow .45s ease-in-out 6 alternate; filter: drop-shadow(0 0 10px #ffd60a); }
.kid .part.is-wrong { animation: nope .6s; }

/* ---------- Mirror ---------- */
.mirror { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.mirror-frame {
  position: relative;
  width: min(88vw, 480px, 46vh);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #cfe8ff;
  border: 14px solid #ffd166;
  border-radius: 200px 200px 40px 40px;
  box-shadow: var(--shadow);
}
.mirror-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.mirror-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 90px;
  text-align: center;
}
.mirror-fallback p { margin: 0; font-size: 20px; }
.mirror-emoji { position: absolute; right: 10px; bottom: 6px; font-size: 80px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25)); }
.mirror-emoji.pop { animation: pop .5s; }

/* ---------- Letters ---------- */
.letter { font-size: clamp(80px, 20vw, 150px); font-weight: 800; line-height: 1; }
.mystery { animation: wobble 2s ease-in-out infinite; }
.reveal { display: flex; flex-direction: column; align-items: center; animation: pop .5s; }
.reveal-word { font-size: clamp(30px, 7vw, 48px); font-weight: 700; line-height: 1; }
.reveal-word b { color: #e63946; }

/* ---------- Shapes ---------- */
.shape { width: clamp(80px, 20vw, 150px); }
.item { animation: wobble 2s ease-in-out infinite; }
.item.gone { animation: shrink .4s forwards; }
.dropped { position: absolute; top: 50%; left: 50%; font-size: clamp(40px, 9vw, 70px); transform: translate(-50%, -60%); animation: land .5s; }

/* ---------- Pattern ---------- */
.string { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 10px; }
.string::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  background: #b08968;
  border-radius: 3px;
}
.bead { position: relative; font-size: clamp(40px, 10vw, 80px); line-height: 1.1; }
.bead.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  font-weight: 800;
  font-size: clamp(34px, 8.5vw, 68px);
  color: #9b5de5;
  background: #fff;
  border: 4px dashed #9b5de5;
  border-radius: 50%;
  animation: wobble 1.6s ease-in-out infinite;
}
.bead.placed { animation: pop .5s; }

/* ---------- Long and short ---------- */
.option.bar-option { align-items: flex-start; min-height: 90px; padding: 22px 24px; }
.rope {
  display: block;
  height: 26px;
  background: repeating-linear-gradient(45deg, #e76f51 0 12px, #f4a261 12px 24px);
  border-radius: 13px;
}
.snake {
  position: relative;
  display: block;
  height: 40px;
  background: linear-gradient(#80ed99, #38b000);
  border-radius: 20px;
}
.snake-head { position: absolute; top: 50%; right: -4px; font-size: 28px; transform: translateY(-50%); }
.option.height-option { overflow: hidden; justify-content: flex-end; width: min(40vw, 240px); height: min(52vh, 360px); }
.tall { font-size: min(38vh, 230px, 34vw); line-height: 1; }
.short { font-size: min(17vh, 105px, 15vw); line-height: 1; }

/* ---------- Kindness ---------- */
.towel {
  display: inline-block;
  width: 1.1em;
  height: .8em;
  background: repeating-linear-gradient(90deg, #8ecae6 0 .18em, #fff .18em .26em);
  border-radius: .12em;
  box-shadow: inset 0 -.08em 0 rgba(0, 0, 0, .08);
}

/* ---------- Color mixing ---------- */
.mix { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.glass-wrap { position: relative; width: min(56vw, 240px); height: min(36vh, 280px); margin-top: 30px; }
.glass {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .45);
  border: 8px solid #fff;
  border-top: 0;
  border-radius: 0 0 48px 48px;
  box-shadow: var(--shadow);
}
.water { position: absolute; left: 0; right: 0; bottom: 0; height: 74%; transition: background 1.2s; }
.cloud { position: absolute; width: 65%; height: 60%; border-radius: 50%; filter: blur(14px); opacity: 0; transition: opacity .6s; }
.cloud.c1 { left: 0; top: 30%; }
.cloud.c2 { right: 0; top: 12%; }
.cloud.show { opacity: .95; }
.stirring .cloud { animation: swirl 1.6s ease-in-out; }
.spoon { position: absolute; top: -50px; right: 4%; font-size: 76px; transform: rotate(20deg); cursor: pointer; }
.stirring .spoon { animation: stir .4s ease-in-out 4 alternate; }
.drop {
  position: absolute;
  top: -30px;
  left: 45%;
  width: 26px;
  height: 34px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: drip .5s ease-in forwards;
}
.bottles { display: flex; gap: 16px; }
.bottle {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  padding: 10px 0 6px;
  font-size: 20px;
  font-weight: 700;
  text-transform: capitalize;
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.bottle:active { transform: translateY(4px); box-shadow: var(--shadow-press); }
.bottle-dot { width: 60px; height: 60px; background: var(--c); border-radius: 50%; }
.mix-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Triangle ---------- */
.music { display: flex; flex-direction: column; align-items: center; }
.tri-wrap { position: relative; width: min(70vw, 340px, 55vh); transform-origin: 50% 0; }
.tri { width: 100%; display: block; }
.tri-wrap.ring { animation: swing 1.2s ease-out; }
.beater {
  position: absolute;
  top: 40%;
  right: -12%;
  width: 10px;
  height: 45%;
  background: linear-gradient(#adb5bd, #495057);
  border-radius: 5px;
  transform: rotate(35deg);
  transform-origin: 50% 100%;
}
.tri-wrap.ring .beater { animation: hit .25s; }
.notes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.note { position: absolute; bottom: 30%; font-size: 48px; animation: float-up 1.6s ease-out forwards; }
.music-hint { margin: 12px 0 0; font-size: 26px; font-weight: 700; }

/* ---------- Clap the rhythm ---------- */
.clap-demo { font-size: clamp(90px, 20vw, 130px); }
.clap-demo.bump, .clap-btn.bump { animation: bump .25s; }
.clap-dots { display: flex; gap: 14px; }
.clap-dots span { width: 40px; height: 40px; border: 4px dashed #adb5bd; border-radius: 50%; transition: all .15s; }
.clap-dots span.demo { background: #8ecae6; border: 4px solid #1d7fd1; }
.clap-dots span.on { background: #ffd166; border: 4px solid #f77f00; animation: pop .3s; }
.clap-btn {
  width: clamp(160px, 45vw, 220px);
  height: clamp(160px, 45vw, 220px);
  font-size: clamp(80px, 22vw, 120px);
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
  transition: opacity .3s, filter .3s;
}
.clap-btn.waiting { opacity: .45; filter: grayscale(.7); }

/* ---------- Dry leaves ---------- */
.tree-scene { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; }
.tree { position: relative; width: min(88vw, 460px, 56vh); aspect-ratio: 1 / 1.05; }
.canopy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 74%;
  background: radial-gradient(circle at 35% 35%, #95d5b2, #40916c);
  border-radius: 50% 50% 46% 46%;
  box-shadow: var(--shadow);
}
.trunk {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 16%;
  height: 34%;
  background: #8d5a3b;
  border-radius: 12px 12px 6px 6px;
  transform: translateX(-50%);
  z-index: -1;
}
.leaves { position: absolute; top: 0; left: 0; width: 100%; height: 74%; }
.leaf {
  position: absolute;
  padding: 4px;
  font-size: clamp(40px, 9vw, 58px);
  line-height: 1;
  transform: translate(-50%, -50%) rotate(var(--turn));
}
.leaf.falling { transition: transform .85s ease-in; z-index: 5; }
.leaf.is-wrong { animation: leaf-shake .45s; }
.basket { position: relative; font-size: clamp(70px, 16vw, 96px); line-height: 1; }
.basket.bump { animation: bump .3s; }
.basket-count {
  position: absolute;
  top: -4px;
  right: -14px;
  min-width: 44px;
  padding: 0 8px;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  background: #ffd166;
  border-radius: 99px;
  box-shadow: var(--shadow);
}

/* ---------- Plant the seeds ---------- */
.garden { display: flex; flex-direction: column; width: 100%; max-width: 640px; height: 100%; }
.sky { position: relative; flex: 1; min-height: 120px; background: linear-gradient(#bde0fe, #e0f4ff); border-radius: 32px 32px 0 0; }
.sun { position: absolute; top: 12%; right: 12%; font-size: 76px; opacity: .3; filter: grayscale(1); transition: all 1s; }
.sunny .sun { opacity: 1; filter: none; transform: scale(1.3); }
.cloud-emoji { position: absolute; top: 20%; left: 12%; font-size: 64px; }
.ground { position: relative; height: 34%; background: #a1887f; border-radius: 0 0 32px 32px; transition: background 1s; }
.watered .ground { background: #6d4c41; }
.hole {
  position: absolute;
  top: 16%;
  left: 50%;
  width: 120px;
  height: 38px;
  background: #3e2723;
  border-radius: 50%;
  transform: translateX(-50%) scale(0);
  transition: transform .4s;
}
.dug .hole { transform: translateX(-50%) scale(1); }
.seed { position: absolute; top: -120%; left: 50%; font-size: 44px; opacity: 0; transform: translateX(-50%); }
.seeded .seed { animation: seed-drop .7s ease-in forwards; }
.sunny .seed { opacity: 0 !important; transition: opacity 1s; }
.rain { position: absolute; top: -150%; left: 50%; font-size: 40px; opacity: 0; transform: translateX(-50%); }
.watered .rain { animation: rain 1.2s ease-in; }
.plant {
  position: absolute;
  bottom: 70%;
  left: 50%;
  font-size: clamp(130px, 36vw, 200px);
  line-height: 1;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}
.plant.sprout { animation: sprout .8s ease-out; }
.tools { display: flex; justify-content: center; gap: 12px; padding: 14px 0 0; }
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(72px, 20vw, 100px);
  padding: 6px 0;
  font-size: clamp(38px, 10vw, 52px);
  line-height: 1.1;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.tool span { font-size: 16px; font-weight: 700; }
.tool.used { opacity: .4; }

.pulse { animation: pulse 1s ease-in-out infinite; }

/* ---------- Finish ---------- */
.finish { display: flex; flex-direction: column; align-items: center; text-align: center; }
.trophy { font-size: 130px; line-height: 1.1; animation: bounce 1s ease-in-out infinite; }
.finish h2 { margin: 8px 0 20px; font-size: clamp(30px, 7vw, 48px); }
.finish-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Confetti ---------- */
.confetti {
  position: fixed;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 100;
  animation: fall linear forwards;
}

/* ---------- Animations ---------- */
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-18px) scale(1.06); } 70% { transform: translateY(0) scale(.97); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
@keyframes leaf-shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(var(--turn)); }
  25% { transform: translate(-50%, -50%) rotate(calc(var(--turn) - 20deg)); }
  75% { transform: translate(-50%, -50%) rotate(calc(var(--turn) + 20deg)); }
}
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes bump { 50% { transform: scale(1.18); } }
@keyframes pulse { 50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(255, 209, 102, .6); } }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes shrink { to { transform: scale(0); opacity: 0; } }
@keyframes land { 0% { transform: translate(-50%, -260%) scale(1.3); } 100% { transform: translate(-50%, -60%) scale(1); } }
@keyframes glow { from { filter: none; } to { filter: drop-shadow(0 0 12px #ffd60a) drop-shadow(0 0 4px #ffd60a); } }
@keyframes nope { 50% { filter: drop-shadow(0 0 10px var(--bad)); } }
@keyframes drip { to { transform: translateY(min(24vh, 190px)) scale(.6); opacity: 0; } }
@keyframes swirl { 50% { transform: translate(20%, 10%) scale(1.4) rotate(90deg); } 100% { transform: translate(0, 0) scale(1.8); opacity: .3; } }
@keyframes stir { from { transform: translateX(0) rotate(20deg); } to { transform: translateX(-120%) rotate(-10deg); } }
@keyframes swing { 15% { transform: rotate(6deg); } 35% { transform: rotate(-5deg); } 55% { transform: rotate(3deg); } 75% { transform: rotate(-1.5deg); } 100% { transform: rotate(0); } }
@keyframes hit { 50% { transform: rotate(10deg) translateX(-24px); } }
@keyframes float-up { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-40vh) scale(1.3); opacity: 0; } }
@keyframes seed-drop { 0% { top: -120%; opacity: 1; } 100% { top: 8%; opacity: 1; } }
@keyframes rain { 0% { top: -150%; opacity: 1; } 100% { top: 10%; opacity: 0; } }
@keyframes sprout { 0% { transform: translateX(-50%) scale(0); } 70% { transform: translateX(-50%) scale(1.15); } 100% { transform: translateX(-50%) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .mystery, .item, .bead.empty, .trophy, .pulse, .house-goal-away { animation: none; }
}

/* ---------- Zea's House (3D) ---------- */
.stage.game-house { padding: 0; }
.house { position: absolute; inset: 0; overflow: hidden; border-radius: 28px 28px 0 0; }
.house-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.house-actors {
  position: absolute;
  bottom: 14px;
  display: flex;
  gap: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, .55);
  border-radius: 99px;
  backdrop-filter: blur(6px);
}
.house-actors { left: 14px; }
/* The place next door, at the screen edge on its side (js/house/index.js showNeighbours). */
.house-go { position: absolute; z-index: 3; }
.house-go[hidden] { display: none; }
.house-go::after {
  position: absolute; font-size: 22px; font-weight: 800; color: #ef8354; line-height: 1;
}
.house-go.left { left: 14px; top: 50%; translate: 0 -50%; }
.house-go.left::after { content: '◀'; left: -2px; top: 50%; translate: -100% -50%; }
.house-go.right { right: 14px; top: 50%; translate: 0 -50%; }
.house-go.right::after { content: '▶'; right: -2px; top: 50%; translate: 100% -50%; }
.house-go.up { left: 50%; top: 104px; translate: -50% 0; }
.house-go.up::after { content: '▲'; top: -4px; left: 50%; translate: -50% -100%; }
.house-go.down { left: 50%; bottom: 28px; translate: -50% 0; }
.house-go.down::after { content: '▼'; bottom: -4px; left: 50%; translate: -50% 100%; }
.house-go.left, .house-go.right { margin: 0 16px; }
.house-btn {
  width: 72px;
  height: 72px;
  font-size: 40px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.house-btn:active { transform: translateY(3px) scale(.95); box-shadow: var(--shadow-press); }
.house-btn.active { background: #ffd166; transform: scale(1.12); }
/* Sticker book: one picture per surprise found while playing (js/house/outcomes.js). */
.house-book { position: absolute; top: 14px; right: 84px; }
.house-book-count {
  position: absolute; right: -4px; bottom: -4px; min-width: 28px; height: 28px; padding: 0 6px;
  font-size: 18px; line-height: 28px; font-weight: 800; color: #fff; background: #ef8354; border-radius: 99px;
}
.house-stickers {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(68, 57, 70, .45); backdrop-filter: blur(4px); z-index: 5;
}
.house-stickers[hidden] { display: none; }
.house-sticker-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; padding: 22px;
  background: #fbf6f0; border-radius: 28px; box-shadow: var(--shadow); max-width: min(92%, 720px);
  max-height: calc(100% - 24px); overflow: hidden auto;
}
.house-sticker {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  font-size: 44px; border-radius: 18px; background: #ecebde; opacity: .35;
}
.house-sticker.found { opacity: 1; background: #fff; box-shadow: var(--shadow); }
.house-sticker-fly { position: absolute; font-size: 96px; pointer-events: none; z-index: 6; }
.house-loading { margin: auto; font-size: 96px; text-align: center; animation: bounce 1.2s infinite; }
.house-loading p { font-size: 18px; animation: none; }
@media (max-width: 640px) {
  .house-actors { left: 10px; bottom: 14px; gap: 8px; padding: 6px; }
  /* Portrait phones: the room fills the width, so the side buttons go down by the street, off the play. */
  .house-go.left { left: 6px; top: auto; bottom: 96px; translate: none; }
  .house-go.right { right: 6px; top: auto; bottom: 96px; translate: none; }
  .house-go.up { top: 92px; }
  .house-btn { width: 60px; height: 60px; font-size: 32px; }
  .house-book { top: 10px; right: 70px; }
  .house-sticker-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px; }
  .house-sticker { width: 52px; height: 52px; font-size: 32px; }
}

/* Episode goal card (js/house/episodes.js): what to do as pictures, top centre; it fills as it gets done. */
.house-goal {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 10px; padding: 8px 18px;
  background: #fbf6f0; border-radius: 99px; box-shadow: var(--shadow);
  font-size: 40px; line-height: 1;
}
.house-goal[hidden] { display: none; }
.house-goal-number {
  min-width: 52px; height: 52px; line-height: 52px; text-align: center;
  font-size: 38px; font-weight: 800; color: #fff; background: #ef8354; border-radius: 50%;
}
.house-goal-number[hidden] { display: none; }
.house-goal-slots { display: flex; align-items: center; gap: 6px; }
.house-goal-slot { opacity: .35; filter: grayscale(.6); transition: opacity .3s, transform .3s, filter .3s; }
.house-goal-slot.done { opacity: 1; filter: none; transform: scale(1.12); }
.house-goal-slot.now { opacity: 1; filter: none; animation: bounce 1.2s infinite; }
.house-goal-arrow { font-size: 26px; color: #b9a99a; }
.house-goal-stars { font-size: 18px; color: #f6c445; letter-spacing: 1px; }
.house-goal-away {
  width: 56px; height: 56px; line-height: 56px; text-align: center; font-size: 36px;
  background: #fff; border-radius: 50%; box-shadow: 0 0 0 4px #ffd166; animation: bounce 1.2s infinite;
}
.house-goal-away[hidden] { display: none; }
.house-skills {
  grid-column: 1 / -1; display: flex; justify-content: center; gap: 22px; padding-bottom: 6px;
  position: sticky; top: -22px; margin-top: -22px; padding-top: 22px; background: #fbf6f0; z-index: 1;
}
.house-skill { font-size: 26px; color: #f6c445; white-space: nowrap; }
@media (max-width: 640px), (max-height: 500px) {
  /* Left-aligned so the 📖 on the right stays clear. */
  .house-goal { top: 10px; left: 12px; transform: none; gap: 6px; padding: 6px 12px; font-size: 28px; }
  .house-goal-number { min-width: 38px; height: 38px; line-height: 38px; font-size: 26px; }
  .house-goal-stars { display: none; }
  /* Up to 6 donuts between the 🏠 and 📖 buttons. */
  .house-goal-slots { gap: 1px; font-size: 21px; }
  .house-skill { font-size: 20px; }
  .house-skills { top: -14px; margin-top: -14px; padding-top: 14px; }
}
