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

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

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

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

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

.cs__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.cs__numWrap {
  display: grid;
}

.cs__num {
  grid-area: 1/1;
  font-weight: 800;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.05;
  color: #17141a;
  font-variant-numeric: tabular-nums;
}

.cs__chip {
  align-self: center;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  color: #0a4fe8;
  background: rgba(47, 109, 246, 0.14);
  border-radius: 999px;
  padding: 4px 8px;
}

.cs__plot {
  position: relative;
}

.cs__svg {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.cs__line {
  fill: none;
  stroke: #2f6df6;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs__dot {
  fill: #2f6df6;
  transform-box: fill-box;
  transform-origin: center;
}

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

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

.cs__tipDay {
  opacity: 0.72;
}

.cs__tipVal {
  font-size: 12px;
}

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

.cs:not(.is-demo) .cs__num--half {
  display: none;
}

.cs.is-demo .cs__line {
  stroke-dasharray: 100;
}

.cs.is-demo .cs__line {
  animation-name: csLine;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes csLine {
  0%, 4% {
    stroke-dashoffset: 100;
  }
  40%, 96% {
    stroke-dashoffset: 0;
  }
  98%, 100% {
    stroke-dashoffset: 100;
  }
}
.cs.is-demo .cs__dot {
  animation-name: csDot;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes csDot {
  0%, 40% {
    transform: scale(0);
  }
  54%, 96% {
    transform: scale(1);
  }
  98%, 100% {
    transform: scale(0);
  }
}
.cs.is-demo .cs__num--half,
.cs.is-demo .cs__num--full {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__num--half {
  animation-name: csNumHalf;
}

@keyframes csNumHalf {
  0%, 20% {
    opacity: 1;
  }
  22%, 96% {
    opacity: 0;
  }
  98%, 100% {
    opacity: 1;
  }
}
.cs.is-demo .cs__num--full {
  animation-name: csNumFull;
}

@keyframes csNumFull {
  0%, 20% {
    opacity: 0;
  }
  22%, 96% {
    opacity: 1;
  }
  98%, 100% {
    opacity: 0;
  }
}
.cs.is-demo .cs__chip,
.cs.is-demo .cs__tip {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__chip {
  animation-name: csChip;
}

@keyframes csChip {
  0%, 24% {
    opacity: 0;
  }
  26%, 96% {
    opacity: 1;
  }
  98%, 100% {
    opacity: 0;
  }
}
.cs.is-demo .cs__tip {
  animation-name: csTip;
}

@keyframes csTip {
  0%, 54% {
    opacity: 0;
  }
  56%, 96% {
    opacity: 1;
  }
  98%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cs__card {
    padding: 8px 12px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs.is-demo .cs__line,
  .cs.is-demo .cs__dot,
  .cs.is-demo .cs__num--half,
  .cs.is-demo .cs__num--full,
  .cs.is-demo .cs__chip,
  .cs.is-demo .cs__tip {
    animation: none !important;
  }
  .cs.is-demo .cs__line {
    stroke-dashoffset: 0 !important;
  }
  .cs.is-demo .cs__dot {
    transform: scale(1) !important;
  }
  .cs.is-demo .cs__num--half {
    opacity: 0 !important;
  }
  .cs.is-demo .cs__num--full,
  .cs.is-demo .cs__chip,
  .cs.is-demo .cs__tip {
    opacity: 1 !important;
  }
}
