html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.heart {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 2.6vw, 12px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.heart__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.heart__icon {
  position: relative;
  width: 34px;
  height: 30px;
  flex: none;
}
.heart__shape {
  position: absolute;
  inset: 0;
}
.heart__shape::before {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 80%;
  border-radius: 50% 50% 0 0;
  background: currentColor;
  left: 50%;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}
.heart__shape::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 80%;
  border-radius: 50% 50% 0 0;
  background: currentColor;
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
.heart__shape--outline {
  color: rgba(255, 247, 230, 0.3);
}
.heart__shape--fill {
  color: #fff7e6;
  opacity: 0;
  transform: scale(0.4) rotate(-8deg);
  transition: opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.heart__particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.heart__particle--heart {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: #fff7e6;
  clip-path: path("M6 11 1 6.5C-.5 5 .0 2.5 2 2 3.5 1.5 5 2.5 6 4 7 2.5 8.5 1.5 10 2 12 2.5 12.5 5 11 6.5Z");
}
.heart__particle--star {
  background: #fff7e6;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.heart__label {
  font-weight: 600;
  font-size: clamp(15px, 4.2vw, 18px);
  line-height: 1;
  font-family: inherit;
  color: #fff7e6;
}
.heart__input:checked ~ .heart__icon .heart__shape--fill {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.heart.is-demo .heart__icon .heart__shape--fill {
  animation: heart-pop-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes heart-pop-loop {
  0%, 15% {
    opacity: 0;
    transform: scale(0.4) rotate(-8deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.15) rotate(6deg);
  }
  55%, 80% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.4) rotate(-8deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .heart__shape--fill {
    transition: opacity 1ms;
  }
  .heart__particle {
    display: none;
  }
  .heart.is-demo .heart__icon .heart__shape--fill {
    animation: none !important;
    opacity: 1;
  }
}
