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);
}

.cn {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 8px;
}

.cn__card {
  width: min(100%, 400px);
  background: #fff7e6;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px 16px;
}

.cn__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cn__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  color: #17141a;
}

.cn__chip {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: rgba(23, 20, 26, 0.66);
  border: 1px solid rgba(23, 20, 26, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
}

.cn__body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cn__plot {
  position: relative;
  flex: none;
}

.cn__svg {
  display: block;
  width: 168px;
  height: auto;
  touch-action: none;
}

.cn__slice {
  fill: none;
  stroke-width: 26;
}

.cn__slice:nth-child(1) {
  stroke: #2f6df6;
}

.cn__slice:nth-child(2) {
  stroke: #c2361a;
}

.cn__slice:nth-child(3) {
  stroke: #2b9d74;
}

.cn__slice:nth-child(4) {
  stroke: #8a5cd6;
}

.cn__sumLabel {
  fill: rgba(23, 20, 26, 0.72);
  font-weight: 700;
  font-size: 10px;
  text-anchor: middle;
}

.cn__sumVal {
  fill: #17141a;
  font-weight: 800;
  font-size: 21px;
  text-anchor: middle;
}

.cn__legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cn__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cn__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.cn__item:nth-child(1) .cn__dot {
  background: #2f6df6;
}

.cn__item:nth-child(2) .cn__dot {
  background: #c2361a;
}

.cn__item:nth-child(3) .cn__dot {
  background: #2b9d74;
}

.cn__item:nth-child(4) .cn__dot {
  background: #8a5cd6;
}

.cn__name {
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12.5px);
  color: #17141a;
}

.cn__pct {
  margin-left: auto;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12.5px);
  color: rgba(23, 20, 26, 0.66);
  font-variant-numeric: tabular-nums;
}

.cn__tip {
  position: absolute;
  transform: translate(-50%, -130%);
  display: flex;
  align-items: baseline;
  gap: 4px;
  pointer-events: none;
  background: #17141a;
  color: #fff7e6;
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
}

.cn__tip.is-on {
  opacity: 1;
  transition: opacity 220ms ease-out;
}

.cn__tipCh {
  opacity: 0.72;
}

.cn__tipVal {
  font-size: 12px;
}

.cn__sr {
  position: fixed;
  top: 0;
  left: -640px;
  width: 320px;
  margin: 0;
}

.cn.is-demo .cn__slice {
  stroke-dasharray: 100;
}

.cn.is-demo .cn__slice {
  animation-name: cnDraw;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-delay: var(--d, 0s);
  animation-fill-mode: backwards;
  animation-iteration-count: infinite;
}

@keyframes cnDraw {
  0%, 4% {
    stroke-dashoffset: 100;
  }
  16%, 96% {
    stroke-dashoffset: 0;
  }
  98%, 100% {
    stroke-dashoffset: 100;
  }
}
.cn.is-demo .cn__item,
.cn.is-demo .cn__sumLabel,
.cn.is-demo .cn__sumVal {
  animation-name: cnReveal;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes cnReveal {
  0%, 52% {
    opacity: 0;
  }
  54%, 96% {
    opacity: 1;
  }
  98%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cn__svg {
    width: 122px;
  }
  .cn__card {
    padding: 8px 12px;
  }
  .cn__body {
    gap: 12px;
  }
  .cn__legend {
    gap: 4px;
  }
  .cn__head {
    margin-bottom: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cn.is-demo .cn__slice,
  .cn.is-demo .cn__item,
  .cn.is-demo .cn__sumLabel,
  .cn.is-demo .cn__sumVal {
    animation: none !important;
  }
  .cn.is-demo .cn__slice {
    stroke-dashoffset: 0 !important;
  }
  .cn.is-demo .cn__item,
  .cn.is-demo .cn__sumLabel,
  .cn.is-demo .cn__sumVal {
    opacity: 1 !important;
  }
}
