.play-stage.bunny,
.play-stage.dog {
  height: 410px;
  background: #f4f5e9;
}

.feeding-stage {
  position: absolute;
  inset: 34px 0 29px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(#f4f5e9, #edf2df);
}

.feeding-picture {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.feeding-cue {
  position: absolute;
  top: 8px;
  left: 55%;
  width: 38%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.feeding-cue-caption {
  color: #7c876b;
  font-size: 11px;
  letter-spacing: .5px;
}

.feeding-cue strong {
  display: grid;
  place-items: center;
  min-width: 66px;
  min-height: 66px;
  padding: 4px 16px;
  border: 2px solid #d5cbb2;
  border-radius: 17px 17px 17px 5px;
  background: #fffef5;
  box-shadow: 0 4px 0 #dcd7bd99;
  color: #58734a;
  font: 700 43px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.feeding-cue strong.feeding-target-word {
  font: 700 24px/1.3 "Microsoft YaHei", "PingFang SC", sans-serif;
}

.feeding-cue-detail {
  color: #8d977d;
  font-size: 10px;
}

.feeding-food-status {
  position: absolute;
  left: 15px;
  bottom: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #fffef0d9;
  color: #7d825f;
  font-size: 10px;
}

.feeding-animal-position,
.feeding-food {
  transition: transform 180ms ease-out;
}

.feeding-animal-growth { transition: transform 600ms ease-out; }

.pet-growth { margin: 14px 21px 0; padding: 12px 15px; border: 1px solid #e2e7d5; border-radius: 12px; background: #fafbf6; }
.pet-growth-heading, .pet-growth-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #71865c; font-size: 11px; }
.pet-growth-heading > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.pet-growth-heading > span:last-child { white-space: nowrap; }
.pet-growth-track { height: 6px; border-radius: 10px; background: #e7eddc; margin: 10px 0 8px; overflow: hidden; }
.pet-growth-track i { display: block; height: 100%; background: linear-gradient(90deg, #9bb87d, #739b68); border-radius: inherit; }
.pet-growth-caption { color: #8b9979; font-size: 10px; line-height: 1.8; }
.pet-growth-caption .text-button { flex-shrink: 0; display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: #617f48; }
.friend-portrait .growing-pet { transform: scale(var(--pet-scale, 1)); transform-origin: center bottom; }
.friend-card .pet-growth-note { margin: 0 0 12px; font-size: 10px; color: #708455; }
.friend-card .pet-ending-button { margin-top: 12px; font-size: 11px; color: #698351; }
.pet-result-growth { margin: 12px 0; color: #718c54; font-size: 12px; }
.pet-ending-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.pet-ending-actions .text-button { color: #718c54; }

@media (max-width: 760px) {
  .pet-growth { margin: 10px 11px 0; padding: 10px; }
  .pet-growth-heading { font-size: 10px; gap: 6px; }
  .pet-growth-caption { font-size: 9px; flex-wrap: wrap; gap: 4px; }
  .friend-card .pet-growth-note, .friend-card .pet-ending-button { font-size: 9px; }
}

.feeding-head {
  transform-origin: 405px 222px;
}

.feeding-stage[data-scene="dog"] .feeding-head { transform-origin: 418px 217px; }

.feeding-face:not(.feeding-face-idle),
.feeding-bite-spark,
.feeding-miss-mark,
.feeding-hearts {
  display: none;
}

.feeding-stage[data-phase="bite"] .feeding-face-idle,
.feeding-stage[data-phase="miss"] .feeding-face-idle,
.feeding-stage[data-phase="complete"] .feeding-face-idle {
  display: none;
}

.feeding-stage[data-phase="bite"] .feeding-face-bite,
.feeding-stage[data-phase="miss"] .feeding-face-miss,
.feeding-stage[data-phase="complete"] .feeding-face-complete,
.feeding-stage[data-phase="bite"] .feeding-bite-spark,
.feeding-stage[data-phase="miss"] .feeding-miss-mark,
.feeding-stage[data-phase="complete"] .feeding-hearts {
  display: inline;
}

.feeding-stage[data-phase="bite"] .feeding-head {
  animation: feeding-chew 430ms ease-in-out both;
}

/* Keep the held carrot, both hands and the bite edge in the rabbit's mouth.
   Cropping and feeding it forward update together on each accepted character. */
.feeding-stage[data-scene="bunny"] .feeding-held-carrot {
  transition: none;
}

.feeding-stage[data-scene="bunny"] .feeding-head {
  animation: none;
}

.feeding-rabbit-meal {
  transform-origin: 478px 246px;
}

.feeding-stage[data-scene="bunny"][data-phase="bite"] .feeding-rabbit-meal {
  animation: feeding-rabbit-hold 430ms ease-in-out both;
}

.feeding-stage[data-scene="bunny"][data-phase="bite"] .feeding-rabbit-incisors {
  animation: feeding-rabbit-nibble 430ms ease-in-out both;
}

.feeding-stage[data-scene="bunny"][data-phase="complete"] .feeding-rabbit-incisors {
  display: none;
}

.feeding-stage[data-phase="miss"] .feeding-head {
  animation: feeding-miss 430ms ease-in-out both;
}

.feeding-stage[data-scene="bunny"][data-phase="miss"] .feeding-head {
  animation: none;
}

.feeding-stage[data-phase="bite"] .feeding-bite-spark {
  animation: feeding-spark 430ms ease-out both;
}

.feeding-stage[data-phase="complete"] .feeding-dog-tail {
  transform-origin: 289px 220px;
  animation: feeding-tail .65s ease-in-out 3;
}

.feeding-stage[data-phase="complete"] .feeding-hearts {
  animation: feeding-hearts .6s ease-out both;
}

.feeding-stage[data-phase="miss"] .feeding-cue strong {
  color: #98694f;
  border-color: #dcbea6;
}

.feeding-stage[data-phase="complete"] .feeding-cue strong {
  color: #5d784b;
  background: #f5f8e5;
  border-color: #afbd8f;
}

@keyframes feeding-chew {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(3px, 3px) rotate(1.4deg); }
  48% { transform: translate(1px, -1px) rotate(-.5deg); }
  72% { transform: translate(2px, 2px) rotate(.8deg); }
}

@keyframes feeding-rabbit-hold {
  0%, 100% { transform: rotate(0); }
  24%, 65% { transform: rotate(.55deg); }
  43%, 83% { transform: rotate(-.35deg); }
}

@keyframes feeding-rabbit-nibble {
  0%, 100% { transform: translateY(0); }
  24%, 65% { transform: translateY(1.4px); }
  43%, 83% { transform: translateY(-.4px); }
}

@keyframes feeding-miss {
  0%, 100% { transform: translateX(0) rotate(0); }
  35% { transform: translate(-7px, -2px) rotate(-2deg); }
  65% { transform: translate(-3px, -1px) rotate(-1deg); }
}

@keyframes feeding-spark {
  0%, 100% { opacity: 0; }
  26%, 67% { opacity: 1; }
}

@keyframes feeding-tail {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(12deg); }
}

@keyframes feeding-hearts {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .play-stage.bunny,
  .play-stage.dog { height: 360px; }
  .feeding-cue { top: 12px; left: 52%; width: 44%; gap: 5px; }
  .feeding-cue strong { min-width: 55px; min-height: 55px; font-size: 34px; border-radius: 13px 13px 13px 4px; }
  .feeding-cue strong.feeding-target-word { font-size: 20px; }
  .feeding-cue-caption { font-size: 10px; }
  .feeding-cue-detail { font-size: 9px; }
}

@media (max-width: 440px) {
  .play-stage.bunny,
  .play-stage.dog { height: 310px; }
  .feeding-stage { inset: 38px 0 30px; }
  .feeding-picture { transform: translateY(21px); }
  .feeding-cue { top: 0; }
  .feeding-cue strong { min-width: 45px; min-height: 43px; font-size: 29px; padding: 2px 10px; }
  .feeding-cue strong.feeding-target-word { font-size: 18px; }
  .feeding-cue-caption { font-size: 9px; }
  .feeding-cue-detail { display: none; }
  .feeding-food-status { bottom: 4px; left: 8px; font-size: 9px; }
}

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