/* =========================================================
   Bunny's Talking Adventures — styles
   Pastel, big touch targets, rounded everything.
   ========================================================= */
:root {
  --pink: #ffd6e7;   --pink-d: #ff8fb8;
  --mint: #c8f4e0;   --mint-d: #5fd3a0;
  --sky: #d4ecff;    --sky-d: #6bb8f5;
  --lemon: #fff2b3;  --lemon-d: #ffcf3f;
  --lilac: #e7dcff;  --lilac-d: #a98bf5;
  --peach: #ffe2cc;
  --ink: #5a4a63;
  --shadow: 0 5px 0 rgba(90, 74, 99, .10), 0 10px 22px rgba(90, 74, 99, .12);
  --font: 'Fredoka', 'Arial Rounded MT Bold', ui-rounded, system-ui, -apple-system, sans-serif;
  --emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

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

html, body {
  margin: 0; height: 100%; overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation; /* no double-tap zoom */
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, #fff0f6 0%, #eef6ff 55%, #effff6 100%);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}

#app { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
.screen.active { display: flex; animation: fadeIn .35s ease; }

button {
  font-family: inherit; color: inherit;
  border: none; cursor: pointer; padding: 0;
  touch-action: manipulation;
  transition: transform .12s ease, filter .2s ease;
}
button:active { transform: scale(.92); }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 8px; min-height: 56px; flex-shrink: 0; }
.spacer { flex: 1; }
.spacer.center { display: flex; justify-content: center; }
.icon-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  font-size: 27px; display: grid; place-items: center;
  font-family: var(--emoji); flex-shrink: 0;
}
.icon-btn.off { filter: grayscale(1); opacity: .65; }
.stars {
  display: flex; align-items: center; gap: 4px;
  background: #fff; border-radius: 999px; padding: 6px 12px;
  box-shadow: var(--shadow); font-size: 22px; font-weight: 700;
  min-height: 46px;
}
.star-ico { font-family: var(--emoji); }
.stars.bump { animation: bump .5s ease; }
.dots { display: flex; gap: 7px; align-items: center; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: #f3dbe7; transition: all .3s; }
.dot.done { background: var(--mint-d); }
.dot.now { background: var(--pink-d); transform: scale(1.35); }

/* ---------- bunny ---------- */
.bunny-slot { aspect-ratio: 200 / 240; flex-shrink: 0; }
.bunny-slot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bunny-xl { width: min(46vw, 34vh, 220px); }
.bunny-lg { width: min(40vw, 28vh, 180px); }
.bunny-md { width: min(26vw, 15vh, 120px); }
.bunny-sm { width: min(20vw, 11vh, 86px); }

.bunny .ear, .bunny .head, .bunny .eyes, .bunny .mouth-open, .bunny .paw, .bunny .bow {
  transform-box: fill-box;
}
.bunny .ear { transform-origin: 50% 95%; transition: transform .35s ease; }
.bunny .ear-l { animation: earL 5s ease-in-out infinite; }
.bunny .ear-r { animation: earR 5s ease-in-out infinite 1.3s; }
.bunny .head { transform-origin: 50% 90%; transition: transform .35s ease; }
.bunny .eyes { transform-origin: center; animation: blink 4.6s infinite; }
.bunny .mouth-open { transform-origin: 50% 0; transform: scaleY(0); }
.bunny .paw { transform-origin: 50% 50%; }

.idle svg { animation: breathe 3.2s ease-in-out infinite; transform-origin: 50% 100%; }

.talking .bunny .mouth-open { animation: talk .26s ease-in-out infinite alternate; }
.talking .bunny .mouth-smile { opacity: 0; }
.talking .bunny .head { animation: nod 1.1s ease-in-out infinite; }

.listening .bunny .ear-l { animation: none; transform: rotate(-16deg); }
.listening .bunny .ear-r { animation: none; transform: rotate(16deg); }
.listening .bunny .head { transform: rotate(-7deg); }

.happy svg { animation: jump .55s ease 2 !important; }
.waving .bunny .paw-r { animation: wave .7s ease-in-out infinite alternate; }

/* ---------- speech bubble ---------- */
.bubble {
  position: relative; flex: 1;
  background: #fff; border-radius: 24px;
  padding: 10px 50px 10px 16px;
  font-size: clamp(17px, 4.6vw, 23px); font-weight: 600; line-height: 1.25;
  box-shadow: var(--shadow); min-height: 62px;
  display: flex; align-items: center;
}
.bubble::before {
  content: ''; position: absolute; left: -11px; top: 50%;
  transform: translateY(-50%);
  border-style: solid; border-width: 11px 12px 11px 0;
  border-color: transparent #fff transparent transparent;
}
.bubble { padding-right: 16px; }
body.no-voice .bubble { font-size: clamp(20px, 5.6vw, 28px); background: #fffbe6; }

/* big "hear it again" speaker button */
.speak-btn {
  width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(180deg, #9fd2ff, var(--sky-d));
  box-shadow: 0 6px 0 #4a9ad8, 0 12px 24px rgba(74, 154, 216, .3);
  display: grid; place-items: center;
}
.speak-btn svg { width: 62%; height: 62%; overflow: visible; }
.speak-btn .wave { opacity: .95; }
.speak-btn.speaking .w1 { animation: waveA 1s ease-in-out infinite; }
.speak-btn.speaking .w2 { animation: waveA 1s ease-in-out infinite .25s; }
.speak-btn.attention { animation: pulse 1.2s ease-in-out infinite; box-shadow: 0 0 0 8px rgba(107, 184, 245, .35), 0 6px 0 #4a9ad8; }
body.no-voice .speak-btn { filter: saturate(.5); }
.icon-btn.nudge { animation: wiggle .55s ease 3; }
@keyframes waveA { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.bubble-home { flex: 0 1 auto; padding-right: 18px; font-size: clamp(20px, 5.5vw, 28px); }
.bubble.pop { animation: popIn .3s ease; }
.replay {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sky); font-size: 19px; font-family: var(--emoji);
}
.replay:active { transform: translateY(-50%) scale(.9); }

/* ---------- start ---------- */
.start-wrap, .bye-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; text-align: center;
}
.title {
  margin: 0; font-size: clamp(28px, 8vw, 46px); line-height: 1.1;
  color: #e86b9c; text-shadow: 0 3px 0 #fff;
}
.btn-play {
  width: 130px; height: 130px; border-radius: 50%;
  background: linear-gradient(180deg, #8ee8bf, var(--mint-d));
  box-shadow: 0 8px 0 #3fb383, 0 16px 30px rgba(63, 179, 131, .35);
  display: grid; place-items: center;
  animation: pulse 1.6s ease-in-out infinite;
}
.btn-play svg { width: 62%; height: 62%; }

/* ---------- home ---------- */
.home-hello { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 12px; flex-shrink: 0; }
.mode-list {
  flex: 1; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px; justify-content: center;
}
.mode-btn {
  flex: 1; max-height: 150px; min-height: 84px;
  border-radius: 32px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  font-size: clamp(21px, 6vw, 30px); font-weight: 700; text-align: left;
  border: 4px solid rgba(255, 255, 255, .8);
}
.mode-pic { font-family: var(--emoji); font-size: clamp(46px, 13vw, 70px); line-height: 1; flex-shrink: 0; }
.mode-look     { background: linear-gradient(135deg, var(--sky), #e9f5ff); }
.mode-happened { background: linear-gradient(135deg, var(--lemon), #fff9de); }
.mode-why      { background: linear-gradient(135deg, var(--pink), #fff0f6); }
.mode-btn:nth-child(1) .mode-pic { animation: bob 2.4s ease-in-out infinite; }
.mode-btn:nth-child(2) .mode-pic { animation: bob 2.4s ease-in-out infinite .4s; }
.mode-btn:nth-child(3) .mode-pic { animation: bob 2.4s ease-in-out infinite .8s; }

/* ---------- play ---------- */
.play-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.stage-wrap {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding-top: 8px;
}
.stage {
  position: relative; overflow: hidden;
  width: 320px; height: 240px; /* real size is set by script.js */
  border-radius: 30px; border: 6px solid #fff;
  box-shadow: var(--shadow);
  background: #f4f0ff;
}
.stage.enter { animation: popIn .45s ease; }

/* scene items */
.item {
  position: absolute; line-height: 1;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scaleX(var(--fx, 1));
  font-family: var(--emoji);
  cursor: pointer;
}
.item .t { display: inline-block; }
.item .t.boing { animation: boing .5s ease; }
.item .e { display: inline-block; }

/* picture cards (Tell Bunny Why) */
.stage.pick { display: flex; align-items: center; justify-content: space-evenly; padding: 0 2%; }
.pick-card {
  position: relative;
  width: 29%; aspect-ratio: 1; border-radius: 22%;
  background: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center;
  font-family: var(--emoji); font-size: 1em;
  border: .08em solid transparent;
  transition: transform .25s ease, border-color .25s ease, opacity .25s;
}
.pick-card .e { font-size: 2.15em; line-height: 1; display: inline-block; }
.pick-card.chosen { border-color: var(--pink-d); transform: scale(1.1); }
.pick-card.chosen::after {
  content: '💖'; position: absolute; top: -.25em; right: -.2em; font-size: .7em;
  animation: popIn .35s ease;
}
.pick-card.dim { opacity: .55; }
.pick-card.nudge { animation: wiggle .5s ease 3; }

/* help choices overlay */
.choices {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; gap: 18px; padding: 10px 16px;
  background: rgba(255, 255, 255, .88);
  border-radius: 30px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: slideUp .35s ease;
  z-index: 5;
}
.choice {
  width: clamp(78px, 22vw, 104px); aspect-ratio: 1;
  border-radius: 26px; background: #fff;
  box-shadow: var(--shadow); border: 4px solid var(--lilac);
  display: grid; place-items: center;
  font-family: var(--emoji); font-size: clamp(42px, 12vw, 58px); line-height: 1;
}
.choice.picked { border-color: var(--pink-d); background: #fff4f9; }
.swatch {
  width: 64%; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid #fff; box-shadow: 0 0 0 3px #eadcf0;
}

/* talk area */
.talk-area { flex-shrink: 0; }
.bunny-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 8px; }
.controls {
  display: flex; justify-content: center; align-items: center;
  gap: clamp(18px, 7vw, 40px); padding: 2px 0 4px;
}
.ctl {
  width: 76px; height: 76px; border-radius: 50%;
  font-size: 36px; font-family: var(--emoji);
  box-shadow: var(--shadow);
  display: grid; place-items: center; position: relative;
}
.ctl-help { background: var(--lemon); }
.ctl-next { background: var(--mint); }
.ctl-talk {
  width: 104px; height: 104px; font-size: 50px;
  background: linear-gradient(180deg, #ffc1d8, var(--pink-d));
  box-shadow: 0 6px 0 #e9739f, 0 12px 26px rgba(233, 115, 159, .35);
}
.ctl-talk.invite { animation: pulse 1.5s ease-in-out infinite; }
.ctl-talk.listening { background: linear-gradient(180deg, #ff9f9f, #ff5f7e); }
.ctl-talk.listening::before, .ctl-talk.listening::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 5px solid rgba(255, 95, 126, .45);
  animation: ripple 1.4s ease-out infinite;
}
.ctl-talk.listening::after { animation-delay: .7s; }
.ctl-talk.manual { background: linear-gradient(180deg, #a6efc9, var(--mint-d)); box-shadow: 0 6px 0 #3fb383, 0 12px 26px rgba(63,179,131,.35); }
.ctl.nudge { animation: wiggle .55s ease 3; }
.ctl-help.glow { box-shadow: 0 0 0 6px rgba(255, 207, 63, .45), var(--shadow); }

/* ---------- what Bunny heard ---------- */
.heard {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  max-width: calc(100% - 16px); z-index: 6;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px; padding: 5px 6px 5px 14px;
  box-shadow: var(--shadow); font-size: 17px; font-weight: 600;
  animation: popIn .25s ease;
}
.heard-ico { font-family: var(--emoji); }
.heard-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.heard-retry {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--lemon); font-family: var(--emoji); font-size: 20px;
}
.heard-live { background: #fff0f3; box-shadow: 0 0 0 3px rgba(255, 95, 126, .35), var(--shadow); padding-right: 14px; }
.heard-live .heard-ico { animation: pulse 1s ease-in-out infinite; }
.heard-none, .heard-off { color: #9a8aa3; }
.ears-off {
  position: absolute; right: 6px; bottom: 4px; z-index: 4;
  background: #fff7d6; border-radius: 999px; padding: 6px 12px;
  font-size: 14px; font-weight: 700; box-shadow: var(--shadow);
}

/* recording state + "grown-up mode" badge on the mic */
.ctl-talk.listening #talk-ico { font-size: 44px; color: #fff; font-family: var(--font); }
.ctl-talk.no-ears::after {
  content: '👪'; position: absolute; right: -4px; top: -4px;
  width: 36px; height: 36px; border-radius: 50%; background: #fff7d6;
  display: grid; place-items: center; font-size: 20px; font-family: var(--emoji);
  box-shadow: var(--shadow);
}

/* grown-up panel + info dialog */
.sheet, .dialog {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(90, 74, 99, .35);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  animation: fadeIn .2s ease;
}
.dialog { align-items: center; }
.sheet-card, .dialog-card {
  position: relative; width: 100%; max-width: 520px;
  background: #fff; border-radius: 28px; padding: 18px 16px 16px;
  box-shadow: 0 10px 40px rgba(90, 74, 99, .3);
  animation: slideUpCard .3s ease;
  -webkit-user-select: text; user-select: text;
}
.sheet-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; padding-right: 40px; }
.sheet-why { font-size: 15px; color: #7c6c86; margin-bottom: 12px; line-height: 1.35; }
.sheet-close { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: #f4eef8; font-size: 18px; }
.sheet-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.judge {
  border-radius: 20px; padding: 12px 6px; min-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 15px; font-weight: 700; box-shadow: var(--shadow);
}
.judge-ico { font-size: 32px; font-family: var(--emoji); line-height: 1; }
.judge-good { background: var(--mint); }
.judge-short { background: var(--lemon); }
.judge-unclear { background: var(--lilac); }
.type-form { display: flex; gap: 8px; margin-top: 12px; }
.type-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  padding: 12px 14px; border-radius: 16px; border: 2px solid #eadcf0; outline: none;
}
.type-form input:focus { border-color: var(--lilac-d); }
.type-form button { padding: 0 18px; border-radius: 16px; background: var(--sky); font-weight: 700; font-size: 16px; }
.dialog-card p { font-size: 16px; line-height: 1.45; margin: 8px 0 14px; }
.dialog-ok { width: 100%; padding: 14px; border-radius: 18px; background: var(--mint); font-size: 18px; font-weight: 700; }
.bye-summary { font-size: 14px; color: #8a7a94; max-width: 360px; line-height: 1.4; }
@keyframes slideUpCard { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- grown-up progress ---------- */
.grownup-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); font-family: var(--emoji); font-size: 20px;
  display: grid; place-items: center; opacity: .7;
}
.grownup-btn span { position: relative; }
.hold-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--lilac-d); stroke-width: 4; stroke-dasharray: 120; stroke-dashoffset: 120; }
.grownup-btn.holding { opacity: 1; }
.grownup-btn.holding .hold-ring circle { transition: stroke-dashoffset 1.2s linear; stroke-dashoffset: 0; }
.grownup-btn.hint::after {
  content: 'Grown-ups: hold'; position: absolute; left: 0; top: 48px; white-space: nowrap;
  font-family: var(--font); font-size: 12px; font-weight: 600; background: #fff; padding: 3px 8px;
  border-radius: 8px; box-shadow: var(--shadow); color: #7c6c86;
}

.progress-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fbf8ff; -webkit-user-select: text; user-select: text; }
.p-wrap { width: 100%; max-width: 680px; margin: 0 auto; padding-bottom: 40px; font-size: 16px; line-height: 1.45; }
.p-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.p-head h1 { font-size: 22px; margin: 0; }
.p-close { background: #fff; border-radius: 999px; padding: 10px 16px; font-size: 15px; font-weight: 700; box-shadow: var(--shadow); }
.progress-screen h2 { font-size: 18px; margin: 22px 0 8px; }
.p-note { background: #fff; border-radius: 14px; padding: 10px 14px; margin: 0 0 10px; }
.p-warn { background: #fff4e0; border: 2px solid #ffd59a; }
.p-small { font-size: 14px; color: #7c6c86; margin: 6px 0; }
.p-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .p-cards { grid-template-columns: repeat(4, 1fr); } }
.p-card { background: #fff; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); border-top: 6px solid var(--pink-d); }
.p-card.c-ind { border-top-color: var(--mint-d); }
.p-card.c-hint { border-top-color: var(--lemon-d); }
.p-card.c-ex { border-top-color: var(--lilac-d); }
.p-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.p-label { font-size: 14px; color: #7c6c86; }
.p-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #eee6f3; margin: 14px 0 4px; }
.p-bar span { display: block; height: 100%; }
.p-bar .b-ind { background: var(--mint-d); } .p-bar .b-hint { background: var(--lemon-d); } .p-bar .b-ex { background: var(--lilac-d); }
.p-table-wrap { overflow-x: auto; }
.p-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; font-size: 15px; }
.p-table th, .p-table td { padding: 9px 10px; text-align: center; border-bottom: 1px solid #f0e8f5; }
.p-table th { background: #f4eef8; font-size: 13px; }
.p-table td:first-child, .p-table th:first-child { text-align: left; }
.p-examples { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.p-examples li { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 8px rgba(90,74,99,.08); }
.p-examples .ex-q { font-size: 13px; color: #7c6c86; }
.p-examples .ex-a { font-size: 17px; font-weight: 600; margin: 2px 0; }
.p-examples .ex-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f4eef8; margin-right: 6px; }
.p-examples .ex-empty { color: #7c6c86; box-shadow: none; background: transparent; padding: 0; }
.p-check { display: flex; gap: 8px; align-items: center; font-size: 15px; margin-top: 6px; }
.p-check input { width: 22px; height: 22px; }
.p-list { padding-left: 20px; margin: 4px 0; }
.p-list li { margin: 4px 0; }
.p-reset { margin-top: 24px; background: #fff; color: #c2415f; border: 2px solid #f3b7c6; border-radius: 16px; padding: 12px 18px; font-size: 16px; font-weight: 700; }
.p-done { color: #2f9e6e; font-weight: 600; }
.p-dialog-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p-cancel { padding: 14px; border-radius: 16px; background: #f4eef8; font-size: 17px; font-weight: 700; }
.p-confirm { padding: 14px; border-radius: 16px; background: #ff8fa8; color: #fff; font-size: 17px; font-weight: 700; }

/* ---------- overlays & bye ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(255, 240, 247, .94);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.overlay.show { display: flex; animation: fadeIn .3s ease; }
.done-stars { font-family: var(--emoji); font-size: 46px; letter-spacing: 6px; animation: popIn .5s ease; }
.row { display: flex; gap: clamp(14px, 5vw, 30px); }
.big-btn {
  width: clamp(84px, 25vw, 112px); height: clamp(84px, 25vw, 112px); border-radius: 50%;
  font-size: clamp(40px, 12vw, 52px); font-family: var(--emoji);
  box-shadow: var(--shadow); display: grid; place-items: center;
}
.big-home { background: var(--sky); }
.big-again { background: var(--lemon); }
.big-next { background: var(--mint); animation: pulse 1.5s ease-in-out infinite; }
.bye-wave { font-family: var(--emoji); font-size: 64px; animation: wave .7s ease-in-out infinite alternate; transform-origin: 70% 80%; }
.bye-stars {
  font-family: var(--emoji); font-size: 34px; max-width: 420px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
}
.bye-stars span { animation: popIn .4s ease both; }

/* confetti & floating star */
.confetti {
  position: fixed; top: -60px; z-index: 40; pointer-events: none;
  font-family: var(--emoji); animation: confetti linear forwards;
}
.fly-star {
  position: fixed; z-index: 40; pointer-events: none;
  font-family: var(--emoji); font-size: 44px;
  animation: flyStar .9s ease forwards;
}

/* ---------- scene backgrounds ---------- */
.bg-forest  { background: linear-gradient(#cfe8ff 0%, #eaf6ff 52%, #b9e6a8 52%, #9fd88d 100%); }
.bg-park    { background: linear-gradient(#cfe8ff 0%, #eaf6ff 55%, #c3ecb0 55%, #a8df94 100%); }
.bg-farm    { background: linear-gradient(#d6edff 0%, #f1f9ff 50%, #d9f0a6 50%, #c3e58a 100%); }
.bg-garden  { background: linear-gradient(#e1f1ff 0%, #f6fbff 55%, #c9f0b6 55%, #b0e39b 100%); }
.bg-jungle  { background: linear-gradient(#d2f2e4 0%, #eafaf2 55%, #9fdc9a 55%, #84cf85 100%); }
.bg-autumn  { background: linear-gradient(#ffe9d4 0%, #fff6ec 55%, #f6d59c 55%, #eec27c 100%); }
.bg-pond    {
  background:
    radial-gradient(ellipse 46% 24% at 50% 78%, #9fdcf7 0 96%, #b9e6a8 100%),
    linear-gradient(#cfe8ff 0%, #eaf6ff 46%, #b9e6a8 46%, #a4dc92 100%);
}
.bg-lake    { background: linear-gradient(#ffe3ec 0%, #fff4e6 45%, #a8def6 45%, #86cff0 100%); }
.bg-sea     { background: linear-gradient(#d4ecff 0%, #eef8ff 40%, #8fd5f5 40%, #5fbfe9 100%); }
.bg-river   { background: linear-gradient(#d4ecff 0%, #eef8ff 46%, #b9e6a8 46%, #b9e6a8 58%, #8fd5f5 58%, #7ccbef 88%, #b9e6a8 88%); }
.bg-snow    { background: linear-gradient(#d9ecff 0%, #eef6ff 55%, #ffffff 55%, #eef5ff 100%); }
.bg-road    { background: linear-gradient(#d4ecff 0%, #eef8ff 52%, #b9e6a8 52%, #b9e6a8 60%, #c9c6d8 60%, #b4b1c6 92%, #b9e6a8 92%); }
.bg-rain    { background: linear-gradient(#d7dfea 0%, #eaeff5 55%, #b7dcae 55%, #9ccc93 100%); }
.bg-room    { background: linear-gradient(#ffe7f0 0%, #fff3f7 64%, #f2d3b8 64%, #e8c3a2 100%); }
.bg-kitchen {
  background:
    repeating-linear-gradient(90deg, transparent 0 9%, rgba(255,255,255,.55) 9% 10%),
    linear-gradient(#fff6d8 0%, #fffbea 64%, #d9ccf3 64%, #c9b8ef 100%);
}
.bg-bath    {
  background:
    repeating-linear-gradient(90deg, transparent 0 11%, rgba(255,255,255,.6) 11% 11.6%),
    repeating-linear-gradient(0deg, transparent 0 14%, rgba(255,255,255,.6) 14% 14.8%),
    linear-gradient(#dff1ff 0%, #eef8ff 66%, #cfe5f6 66%, #bcdaf0 100%);
}
.a-floaty { animation: floaty 3s ease-in-out infinite; }
.bg-pick    { background: radial-gradient(circle at 50% 40%, #fff 0%, #ffeef6 55%, #f2e8ff 100%); }

/* ---------- item animations ---------- */
.a-bob    { animation: bob 2.2s ease-in-out infinite; }
.a-hop    { animation: hop 1.4s ease-in-out infinite; }
.a-wiggle { animation: wiggle 1.8s ease-in-out infinite; }
.a-float  { animation: floaty 3s ease-in-out infinite; }
.a-drift  { animation: drift 7s ease-in-out infinite; }
.a-spin   { animation: spin 14s linear infinite; }
.a-buzz   { animation: buzz 2.4s ease-in-out infinite; }
.a-swim   { animation: swim 3.4s ease-in-out infinite; }
.a-sway   { animation: sway 3s ease-in-out infinite; transform-origin: 50% 100%; }
.a-fall   { animation: fall 3.2s linear infinite; }
.a-pulse  { animation: pulse 1.4s ease-in-out infinite; }
.a-swing  { animation: swingy 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.a-drive  { animation: drive 1s ease-in-out infinite; }

/* ---------- keyframes ---------- */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn   { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slideUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes pulse   { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes bump    { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25); } }
@keyframes wiggle  { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes boing   { 0% { transform: scale(1); } 35% { transform: scale(1.3, .8); } 65% { transform: scale(.9, 1.15); } 100% { transform: scale(1); } }
@keyframes ripple  { from { transform: scale(1); opacity: 1; } to { transform: scale(1.45); opacity: 0; } }
@keyframes jump    { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-18%); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03, .98); } }
@keyframes blink   { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes talk    { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@keyframes nod     { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(3deg); } }
@keyframes earL    { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-10deg); } 95% { transform: rotate(4deg); } }
@keyframes earR    { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-4deg); } }
@keyframes wave    { from { transform: rotate(-12deg); } to { transform: rotate(16deg); } }
@keyframes bob     { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7%); } }
@keyframes hop     { 0%, 55%, 100% { transform: translateY(0); } 25% { transform: translateY(-22%); } }
@keyframes floaty  { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14%) rotate(3deg); } }
@keyframes drift   { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(40%); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes buzz    { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(25%, -15%) rotate(8deg); } 50% { transform: translate(-10%, 10%) rotate(-6deg); } 75% { transform: translate(-25%, -10%) rotate(4deg); } }
@keyframes swim    { 0%, 100% { transform: translateX(0) rotate(0); } 50% { transform: translateX(-12%) rotate(-4deg); } }
@keyframes sway    { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes fall    { 0% { transform: translateY(-40%); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(160%); opacity: 0; } }
@keyframes swingy  { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes drive   { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-2%, -2%); } 75% { transform: translate(2%, 1%); } }
@keyframes confetti { to { transform: translateY(115vh) rotate(540deg); } }
@keyframes flyStar { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.4); opacity: 1; } 100% { transform: translateY(-120px) scale(.8); opacity: 0; } }

/* ---------- landscape phones & tablets ---------- */
@media (orientation: landscape) and (max-height: 620px) {
  .play-main { flex-direction: row; gap: 14px; }
  .stage-wrap { padding-top: 4px; }
  .talk-area { width: min(44%, 380px); display: flex; flex-direction: column; justify-content: center; }
  .bunny-sm { width: 64px; }
  .speak-btn { width: 64px; height: 64px; }
  .mode-list { flex-direction: row; max-width: 900px; }
  .mode-btn { flex-direction: column; justify-content: center; text-align: center; max-height: none; padding: 10px; }
  .home-hello { margin: 0 0 8px; }
  .bunny-md { width: min(15vh * 1.2, 90px); }
  .bunny-xl { width: min(30vh, 160px); }
  .title { font-size: 30px; }
  .btn-play { width: 104px; height: 104px; }
}

@media (min-width: 700px) and (min-height: 700px) {
  .ctl { width: 92px; height: 92px; font-size: 44px; }
  .ctl-talk { width: 124px; height: 124px; font-size: 60px; }
  .bunny-sm { width: 110px; }
  .speak-btn { width: 92px; height: 92px; }
}

@media (max-width: 370px) {
  .topbar { gap: 5px; }
  .icon-btn { width: 46px; height: 46px; font-size: 23px; }
  .stars { padding: 4px 9px; font-size: 19px; min-height: 40px; }
  .dots { gap: 5px; }
  .dot { width: 10px; height: 10px; }
  .speak-btn { width: 62px; height: 62px; }
  .bunny-row { gap: 10px; }
}

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