:root {
  --bg: #fff8e7;
  --sky: #5aa9ff;
  --sun: #ffd23f;
  --pink: #ff7eb6;
  --green: #4cc38a;
  --ink: #2b2d42;
  --card: #ffffff;
  --muted: #8a8fa3;
  --radius: 28px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: linear-gradient(180deg, #cfe8ff 0%, var(--bg) 45%, #fff3c4 100%);
  color: var(--ink);
  font: 600 18px/1.35 "Nunito", "Avenir Next", system-ui, sans-serif;
  display: flex; flex-direction: column; min-height: 100dvh;
  user-select: none;
}
.top { display: flex; align-items: center; gap: 14px; padding: 16px 16px 0; max-width: 900px; margin: 0 auto; width: 100%; }
@keyframes bob { to { transform: translateY(-6px) rotate(-4deg); } }
.bubble { background: var(--card); border-radius: 22px; padding: 12px 16px; min-height: 52px; flex: 1; box-shadow: 0 4px 0 rgba(0,0,0,.06); font-size: 17px; }
.bubble:empty { visibility: hidden; }
main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 16px; max-width: 900px; width: 100%; margin: 0 auto; }

.big { border: 0; border-radius: 50%; width: 168px; height: 168px; font-size: 72px; cursor: pointer; color: #fff;
  box-shadow: 0 10px 0 rgba(0,0,0,.15); transition: transform .08s, box-shadow .08s; display: grid; place-items: center; }
.big:active { transform: translateY(6px); box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.big.play { background: var(--green); }
.big.host-pick { background: #fff; font-size: 96px; }
.big.host-pick[data-who="female"] { box-shadow: 0 10px 0 var(--pink); }
.big.host-pick[data-who="male"] { box-shadow: 0 10px 0 var(--sky); }
.big.mic { background: var(--pink); }
.big.mic.rec { background: #ff4d6d; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 18px rgba(255,77,109,.2); } }
.big.cam { background: var(--sky); width: 120px; height: 120px; font-size: 52px; }
.row { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; }
.btn { border: 0; border-radius: 20px; padding: 16px 22px; font: inherit; font-size: 20px; cursor: pointer; background: var(--card); box-shadow: 0 6px 0 rgba(0,0,0,.1); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.thumb { font-size: 64px; width: 128px; height: 128px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 8px 0 rgba(0,0,0,.12); }
.thumb.yes { background: #d6f5e3; } .thumb.no { background: #ffe0e6; }

.hero-img { width: min(92vw, 560px); aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); background: #fff; box-shadow: 0 8px 0 rgba(0,0,0,.08); }
.hero-mini { width: 132px; aspect-ratio: 16/9; object-fit: cover; border-radius: 16px; }
.slots { display: flex; gap: 10px; }
.slot { width: 58px; height: 58px; border-radius: 18px; border: 3px dashed #c9cede; display: grid; place-items: center; font-size: 28px; background: rgba(255,255,255,.5); }
.slot.full { border: 0; background: var(--sun); box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.slot.now { border-color: var(--pink); animation: pulse 1.4s infinite; }
.heard { color: var(--muted); font-size: 15px; text-align: center; max-width: 560px; min-height: 20px; }
.spinner { font-size: 80px; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: min(90vw, 520px); height: 26px; background: #fff; border-radius: 99px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sky), var(--sun)); transition: width .8s; border-radius: 99px; }
video { width: min(94vw, 860px); border-radius: var(--radius); background: #000; box-shadow: 0 10px 0 rgba(0,0,0,.12); }

/* Батьківська зона: тут можна текст */
.parent { background: var(--card); border-radius: var(--radius); padding: 22px; width: min(94vw, 560px); box-shadow: 0 8px 0 rgba(0,0,0,.08); font-weight: 500; }
.parent h2 { margin: 0 0 10px; font-size: 22px; }
.parent p { margin: 6px 0; color: #4a4e69; }
.choice { display: grid; gap: 12px; margin-top: 14px; }
.choice button { text-align: left; border: 3px solid #e3e6ef; border-radius: 18px; padding: 14px 16px; background: #fafbff; font: inherit; cursor: pointer; }
.choice button[disabled] { opacity: .45; cursor: not-allowed; }
.choice button b { font-size: 19px; }
.math { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.math button { font: inherit; font-size: 24px; width: 72px; height: 64px; border-radius: 16px; border: 0; background: #eef1fb; cursor: pointer; }
.err { color: #c9184a; font-weight: 700; }
.badge { position: fixed; right: 12px; bottom: 12px; background: #2b2d42; color: #fff; font-size: 13px; padding: 6px 10px; border-radius: 10px; opacity: .8; }
@media (max-width: 520px) {
  .big { width: 136px; height: 136px; font-size: 58px; }
  .host { font-size: 48px; }
  .thumb { width: 104px; height: 104px; font-size: 52px; }
}

/* --- Простір дитини --- */
.kids { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.kid { border: 0; background: #fff; border-radius: 32px; width: 150px; padding: 18px 10px; box-shadow: 0 8px 0 rgba(0,0,0,.1); cursor: pointer; display: grid; gap: 6px; font: inherit; }
.kid span { font-size: 72px; line-height: 1; }
.kid b { font-size: 18px; color: var(--muted); }
.kid.add span { color: var(--muted); }
.me { display: flex; align-items: center; gap: 14px; width: 100%; justify-content: space-between; }
.me-av { font-size: 56px; }
.host-switch { display: flex; gap: 8px; background: #fff; border-radius: 99px; padding: 6px; box-shadow: 0 4px 0 rgba(0,0,0,.06); }
.host-switch button { border: 0; background: none; font-size: 34px; width: 56px; height: 56px; border-radius: 50%; cursor: pointer; opacity: .45; }
.host-switch button.on { opacity: 1; background: #fff3c4; }
.btn.home { font-size: 28px; padding: 10px 14px; }
.big.new { font-size: 56px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; width: 100%; }
.cover { position: relative; border: 0; padding: 0; border-radius: 22px; overflow: hidden; aspect-ratio: 16/9; background: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.1); cursor: pointer; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover span { position: absolute; left: 8px; bottom: 6px; font-size: 30px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.empty { grid-column: 1 / -1; text-align: center; font-size: 48px; opacity: .35; padding: 12px; }
.heroes { display: flex; gap: 10px; overflow-x: auto; width: 100%; padding: 4px 2px 10px; }
.heroes img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 14px; background: #fff; flex: none; }
.ideas { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; width: 100%; }
.idea { border: 0; background: #fff; border-radius: 28px; padding: 18px 12px; box-shadow: 0 8px 0 rgba(0,0,0,.1); cursor: pointer; display: grid; gap: 8px; font: inherit; place-items: center; }
.idea span { font-size: 72px; line-height: 1; }
.idea b { font-size: 17px; color: #4a4e69; }
.idea img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 18px; }
.parent input { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 14px; border: 2px solid #e3e6ef; width: 100%; }

/* Вертепик — маскот студії: скринька-вертеп із зіркою. Стани: hello listen think magic done sleep */
.host { width: 88px; flex: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.host svg { display: block; width: 100%; height: auto; overflow: visible; }
.v-zz, .v-spark { opacity: 0; }
.v-body, .v-star, .v-eyes, .v-mouth { transform-box: fill-box; transform-origin: 50% 50%; }
.v-body { transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .host { animation: v-pop .8s cubic-bezier(.2,1.6,.4,1) both; }
  .v-body { animation: v-breathe 3.6s ease-in-out infinite; }
  .v-eyes { animation: v-blink 4.8s infinite; }
  .v-star { animation: v-sway 4s ease-in-out infinite; }
  .host.talking .v-mouth { animation: v-talk .28s ease-in-out infinite alternate; }
  .host[data-state="listen"] .v-body { animation: v-tilt 1.6s ease-in-out infinite; }
  .host[data-state="listen"] .v-star { animation: v-pulse 1s ease-in-out infinite; }
  .host[data-state="think"] .v-eyes { animation: none; transform: translate(3px,-3px); }
  .host[data-state="think"] .v-star { animation: v-spin 6s linear infinite; }
  .host[data-state="magic"] .v-star { animation: v-spin 1.6s linear infinite; }
  .host[data-state="magic"] .v-spark { animation: v-spark 1.4s ease-in-out infinite; }
  .host[data-state="done"] { animation: v-hop .6s cubic-bezier(.3,1.5,.5,1) 3; }
  .host[data-state="done"] .v-spark { opacity: 1; }
  .host[data-state="sleep"] .v-body { animation: v-breathe 6s ease-in-out infinite; }
  .host[data-state="sleep"] .v-zz { animation: v-zz 3s ease-in-out infinite; }
  .host.hop { animation: v-hop .55s cubic-bezier(.3,1.5,.5,1); }
}
.host[data-state="sleep"] .v-eyes { animation: none; transform: scaleY(.15); }
@media (prefers-reduced-motion: reduce) { .host[data-state="done"] .v-spark, .host[data-state="sleep"] .v-zz { opacity: 1; } }
@keyframes v-pop { 0% { opacity: 0; transform: translateY(18px) scale(.6) rotate(-6deg); } 100% { opacity: 1; transform: none; } }
@keyframes v-breathe { 0%,100% { transform: none; } 50% { transform: translateY(-3px) scale(1.012,.988); } }
@keyframes v-blink { 0%,91%,100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes v-sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes v-spin { to { transform: rotate(360deg); } }
@keyframes v-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes v-tilt { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes v-talk { from { transform: scaleY(1); } to { transform: scaleY(2.2); } }
@keyframes v-spark { 0%,100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes v-zz { 0% { opacity: 0; transform: translateY(4px); } 40%,70% { opacity: .8; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes v-hop { 0%,100% { transform: none; } 40% { transform: translateY(-14px) rotate(-4deg); } 70% { transform: translateY(2px) scale(1.04,.96); } }
@media (max-width: 420px) { .host { width: 70px; } }
