/* The credit heart (heart.js): a red heart that plays a random effect when pressed. The same in
   dream-chamber (public/heart.css). */
.credit-heart {
  position: relative;
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.17em;
  color: #ff4458;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.credit-heart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.credit-heart.is-beat > svg { animation: credit-heart-beat 700ms ease-in-out; }
.credit-heart.is-spin > svg { animation: credit-heart-spin 650ms ease-in-out; }
.credit-heart.is-wobble > svg { animation: credit-heart-wobble 650ms ease-in-out; }
.credit-heart.is-hop > svg { animation: credit-heart-hop 600ms ease-out; }
.credit-heart.is-wash > svg { animation: credit-heart-wash 1200ms ease-in-out; }
.credit-heart.is-burst > svg { animation: credit-heart-pop 350ms ease-out; }

@keyframes credit-heart-beat {
  0%, 30%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.35); }
  45% { transform: scale(1.22); }
}
@keyframes credit-heart-spin { to { transform: rotateY(360deg); } }
@keyframes credit-heart-wobble {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-16deg); }
  40% { transform: rotate(13deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(4deg); }
}
@keyframes credit-heart-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  15% { transform: translateY(0) scale(1.15, 0.85); }
  45% { transform: translateY(-9px) scale(0.92, 1.08); }
  80% { transform: translateY(0) scale(1.08, 0.92); }
}
/* A purple wash: red to purple and back. */
@keyframes credit-heart-wash { 40%, 60% { color: #a855f7; } }
@keyframes credit-heart-pop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(0.8); }
  70% { transform: scale(1.18); }
}

/* The burst's small hearts. */
.credit-heart-bit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: credit-heart-float 900ms ease-out both;
}
@keyframes credit-heart-float {
  from { transform: translate(0, 0) scale(0.7) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) scale(0.45) rotate(var(--r)); opacity: 0; }
}
