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

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

.like {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: clamp(8px, 2.6vw, 10px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.like__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.like__heart {
  display: inline-block;
  width: 18px;
  height: 18px;
  align-self: center;
  background: rgba(255, 247, 230, 0.4);
  clip-path: path("M9 17 1.5 10C-1 7.5 0 3.5 3 3 5.5 2.5 7.5 4 9 6 10.5 4 12.5 2.5 15 3 18 3.5 19 7.5 16.5 10Z");
  transition: background 220ms cubic-bezier(0.2, 1.4, 0.4, 1), transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.like__input:checked ~ .like__heart {
  background: #fff7e6;
  transform: scale(1.15);
}
.like__spark {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #fff7e6;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.like__spark--heart {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  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");
}
.like__spark--star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.like__count {
  font-weight: 700;
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1;
  font-family: inherit;
  color: #fff7e6;
}
.like__num.is-pop {
  animation: count-pop 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.like.is-demo .like__heart {
  animation: heart-fill-loop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes count-pop {
  0% {
    display: inline-block;
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes heart-fill-loop {
  0%, 20% {
    background: rgba(255, 247, 230, 0.4);
    transform: scale(1);
  }
  35%, 60% {
    background: #fff7e6;
    transform: scale(1.15);
  }
  80%, 100% {
    background: rgba(255, 247, 230, 0.4);
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .like__heart {
    transition: background 1ms;
  }
  .like__num.is-pop {
    animation: none !important;
  }
  .like__spark {
    display: none;
  }
  .like.is-demo .like__heart {
    animation: none !important;
  }
}
