/* =======================================================================
   SPARSHITAA'S SANCTUARY - KEYFRAME ANIMATIONS & MICRO-INTERACTIONS
   ======================================================================= */

/* Wax Seal Break */
@keyframes sealCrack {
  0% { transform: scale(1); }
  40% { transform: scale(1.15) rotate(5deg); }
  70% { transform: scale(0.9) rotate(-5deg); filter: brightness(1.4); }
  100% { transform: scale(1.3) rotate(0deg); opacity: 0; }
}

.wax-seal-btn.broken {
  animation: sealCrack 0.5s forwards ease-in-out;
}

/* Floating Sky Lantern */
@keyframes lanternFloatUp {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(-80px) scale(1.05) rotate(2deg);
  }
  50% {
    transform: translateY(-350px) scale(0.85) rotate(-3deg);
  }
  80% {
    opacity: 0.85;
    transform: translateY(-650px) scale(0.55) rotate(2deg);
  }
  100% {
    transform: translateY(-1000px) scale(0.2) rotate(0deg);
    opacity: 0;
  }
}

.floating-sky-lantern {
  position: absolute;
  bottom: 20px;
  animation: lanternFloatUp 6.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  pointer-events: none;
  z-index: 20;
}

.lantern-body {
  position: relative;
  width: 54px;
  height: 70px;
  background: radial-gradient(circle at center, #ffd166 20%, #f48c06 80%, #d00000 100%);
  border-radius: 12px 12px 18px 18px;
  box-shadow: 0 0 25px rgba(255, 209, 102, 0.8), 0 0 50px rgba(244, 140, 6, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
}

.lantern-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  filter: blur(4px);
}

.lantern-tag {
  font-size: 0.55rem;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* Audio Visualizer Bar Jump */
@keyframes barJump {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* Situps Avatar Bobbing */
@keyframes situpBob {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(14px) scaleY(0.85); }
}

/* Floating Emoji Particle */
@keyframes floatUpFade {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translateY(-80px) scale(1.3);
    opacity: 0;
  }
}

.floating-emoji-particle {
  position: absolute;
  font-size: 1.6rem;
  pointer-events: none;
  animation: floatUpFade 1.2s ease-out forwards;
  z-index: 10;
}

/* Burst Particles */
@keyframes burstOut {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.2);
    opacity: 0;
  }
}

.burst-particle {
  position: absolute;
  font-size: 1.8rem;
  pointer-events: none;
  animation: burstOut 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 15;
}

/* Pop In & Pulse Bounce */
@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.pop-in {
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pulseBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25) rotate(6deg); }
}

.pulse-bounce {
  animation: pulseBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes fadeTextIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-text-in {
  animation: fadeTextIn 0.35s ease forwards;
}

/* Jar Shake */
@keyframes jarShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg) scale(1.04); }
  40% { transform: rotate(8deg) scale(1.04); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

.jar-shake {
  animation: jarShake 0.6s ease-in-out;
}

/* Calm Glow on Card */
@keyframes calmGlowPulse {
  0% { box-shadow: 0 0 20px rgba(247, 178, 189, 0.2); }
  50% { box-shadow: 0 0 50px rgba(247, 178, 189, 0.8), 0 0 80px rgba(255, 207, 210, 0.5); }
  100% { box-shadow: 0 0 20px rgba(247, 178, 189, 0.2); }
}

.calm-glow {
  animation: calmGlowPulse 2.2s ease-in-out;
}
