.image-like-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  color: #d9d9d9;
  background: #252525;
  border: 1px solid #4a4a4a;
  border-radius: 50%;
  cursor: pointer;
  overflow: visible;
  transition: color .16s ease, background-color .16s ease,
    border-color .16s ease, transform .16s ease;
}

.image-like-button__icon {
  grid-area: 1 / 1;
  color: #fff;
  font-size: 1.1rem;
  pointer-events: none;
}

.image-like-button .image-like-button__icon--on {
  display: none;
}

.image-like-button.is-liked .image-like-button__icon--off {
  display: none;
}

.image-like-button.is-liked .image-like-button__icon--on {
  display: inline-block;
}

.image-like-button:hover,
.image-like-button:focus-visible {
  color: #fff;
  background: #343434;
}

.image-like-button:hover > i {
  animation: image-like-wiggle .34s ease-in-out;
}

.image-like-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(216, 73, 145, .24);
}

.image-like-button.is-liked {
  color: #fff;
  background: #252525;
  border-color: #4a4a4a;
}

.image-like-button.is-liked:hover,
.image-like-button.is-liked:focus-visible {
  color: #fff;
  background: #343434;
  border-color: #4a4a4a;
}

.image-like-button[disabled] {
  cursor: wait;
  opacity: .66;
}

.image-like-button.is-like-success {
  animation: image-like-bounce .42s ease-out;
}

.image-like-button.is-unlike-success {
  animation: image-unlike-shrink .3s ease-out;
}

.image-like-button__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.image-like-error {
  max-width: min(360px, calc(100% - 54px));
  color: #a51d5f;
  font-size: .78rem;
  line-height: 1.4;
  text-align: right;
}

.image-like-confetti {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  background: #f164aa;
  border-radius: 50%;
  pointer-events: none;
  animation: image-like-confetti .45s ease-out forwards;
}

.image-like-confetti:nth-of-type(2) { --confetti-x: 18px; --confetti-y: -17px; }
.image-like-confetti:nth-of-type(3) { --confetti-x: -18px; --confetti-y: -15px; }
.image-like-confetti:nth-of-type(4) { --confetti-x: 20px; --confetti-y: 13px; }
.image-like-confetti:nth-of-type(5) { --confetti-x: -17px; --confetti-y: 15px; }

@keyframes image-like-wiggle {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-10deg); }
  70% { transform: rotate(8deg); }
}

@keyframes image-like-bounce {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.2); }
  72% { transform: scale(.94); }
}

@keyframes image-unlike-shrink {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(.76); }
}

@keyframes image-like-confetti {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--confetti-x, 0px)),
      calc(-50% + var(--confetti-y, -20px))
    ) scale(.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-like-button,
  .image-like-button:hover > i,
  .image-like-button.is-like-success,
  .image-like-button.is-unlike-success,
  .image-like-confetti {
    animation: none !important;
    transition: none !important;
  }

  .image-like-confetti {
    display: none;
  }
}
