/* ============================================
   StreamSprite — Pet Sprite Styles (V3)
   ============================================ */

#pet-sprite {
  width: var(--sprite-size);
  height: var(--sprite-size);
  image-rendering: pixelated;          /* crisp pixel art */
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
  transition: transform 0.15s ease;
  cursor: pointer;
}

/* Idle breathing animation */
#pet-sprite.idle {
  animation: petBreathe 3s ease-in-out infinite;
}

@keyframes petBreathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Action bounce */
#pet-sprite.action {
  animation: petBounce 0.5s ease;
}

@keyframes petBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.12) translateY(-6px); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Emote container — supports both emoji text and image emotes */
#pet-emote {
  position: absolute;
  top: -16px;
  right: -8px;
  font-size: 22px;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 20;
}

#pet-emote.hidden {
  opacity: 0;
  transform: translateY(8px);
}

#pet-emote.show {
  animation: emoteFloat 2.5s ease forwards;
}

@keyframes emoteFloat {
  0%   { opacity: 0; transform: translateY(8px) scale(0.5); }
  15%  { opacity: 1; transform: translateY(0) scale(1); }
  75%  { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-24px) scale(0.8); }
}

/* Custom emote bubble — thought-bubble style background */
#pet-emote.bubble {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  padding: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
}

#pet-emote.bubble::before,
#pet-emote.bubble::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
}

/* Thought bubble tail dots */
#pet-emote.bubble::before {
  width: 10px;
  height: 10px;
  bottom: -8px;
  left: 8px;
}

#pet-emote.bubble::after {
  width: 6px;
  height: 6px;
  bottom: -16px;
  left: 4px;
}

/* Custom emote image inside bubble */
#pet-emote .emote-img {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#pet-emote.bubble.show {
  animation: bubbleFloat 3s ease forwards;
}

@keyframes bubbleFloat {
  0%   { opacity: 0; transform: translateY(4px) scale(0.3); }
  12%  { opacity: 1; transform: translateY(-4px) scale(1.1); }
  18%  { transform: translateY(0) scale(1); }
  70%  { opacity: 1; transform: translateY(-8px) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.6); }
}
