@property --shareCount {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
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);
}

.cb {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: clamp(280px, 86vw, 384px);
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.cb__title {
  margin: 0;
  color: #15131a;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  font-family: inherit;
}

.cb__btns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cb__btn {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid #ddd6ca;
  border-radius: 12px;
  background: #fdf8f0;
  color: #15131a;
  cursor: pointer;
  transition: border-color 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.cb__btn:hover, .cb__btn:focus-visible {
  border-color: #477690;
}

.cb__btn:focus-visible {
  outline: 2px solid #477690;
  outline-offset: 2px;
}

.cb__ic {
  display: grid;
  place-items: center;
}

.cb__ic svg {
  display: block;
}

.cb__name {
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  font-family: inherit;
}

.cb__badge {
  position: absolute;
  top: -8px;
  right: -6px;
  box-sizing: border-box;
  min-width: 28px;
  padding: 4px;
  border-radius: 999px;
  background: #15131a;
  color: #ffffff;
  text-align: center;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.2;
  font-family: inherit;
  counter-reset: shareCount var(--shareCount);
}

.cb__badge::after {
  content: counter(shareCount);
}

.cb__badge--a {
  --shareCount: 128;
}

.cb__badge--b {
  --shareCount: 64;
}

.cb__badge--c {
  --shareCount: 39;
}

.cb__total {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #5b5566;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.2;
  font-family: inherit;
}

.cb__totalIc {
  display: grid;
  place-items: center;
  color: #477690;
}

.cb__totalIc svg {
  display: block;
}

.is-demo .cb__badge {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.is-demo .cb__badge--a {
  animation-name: countA;
  animation-delay: 0s;
}

.is-demo .cb__badge--b {
  animation-name: countB;
  animation-delay: 0.12s;
}

.is-demo .cb__badge--c {
  animation-name: countC;
  animation-delay: 0.24s;
}

@keyframes countA {
  0% {
    --shareCount: 0;
    transform: scale(0.86);
  }
  50% {
    --shareCount: 128;
    transform: scale(1);
  }
  58% {
    --shareCount: 128;
    transform: scale(1.2);
  }
  70%, 100% {
    --shareCount: 128;
    transform: scale(1);
  }
}
@keyframes countB {
  0% {
    --shareCount: 0;
    transform: scale(0.86);
  }
  50% {
    --shareCount: 64;
    transform: scale(1);
  }
  58% {
    --shareCount: 64;
    transform: scale(1.2);
  }
  70%, 100% {
    --shareCount: 64;
    transform: scale(1);
  }
}
@keyframes countC {
  0% {
    --shareCount: 0;
    transform: scale(0.86);
  }
  50% {
    --shareCount: 39;
    transform: scale(1);
  }
  58% {
    --shareCount: 39;
    transform: scale(1.2);
  }
  70%, 100% {
    --shareCount: 39;
    transform: scale(1);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .cb {
    gap: 8px;
    padding: 12px;
  }
  .cb__title {
    font-size: 13px;
  }
  .cb__btn {
    padding: 8px 4px;
  }
  .cb__ic svg {
    width: 18px;
    height: 18px;
  }
  .cb__name {
    font-size: 10px;
  }
  .cb__badge {
    min-width: 24px;
    font-size: 10px;
  }
  .cb__total {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .cb__badge {
    animation: none !important;
  }
  .cb__btn {
    transition: none !important;
  }
  .cb__badge {
    transform: scale(1);
  }
}
