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

.dl {
  display: flex;
  align-items: center;
  gap: 20px;
  user-select: none;
  -webkit-user-select: none;
}

.dl__dial {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
}

.dl__dial:active {
  cursor: grabbing;
}

.dl__dial:focus-visible {
  outline: 3px solid #fff7e6;
  outline-offset: 4px;
}

.dl__gauge {
  position: absolute;
  inset: 0;
  transform: rotate(135deg);
}

.dl__track, .dl__fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.dl__track {
  stroke: rgba(255, 247, 230, 0.45);
  stroke-dasharray: 197.92 66.06;
}

.dl__fill {
  stroke: #17141a;
  stroke-dasharray: 197.92 66.06;
  stroke-dashoffset: 197.92;
  transition: stroke-dashoffset 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dl__knob svg {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dl__knob {
  position: absolute;
  inset: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7e6;
  border-radius: 50%;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  color: #17141a;
  transform: rotate(225deg);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dl__dot {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #ff4d1f;
}

.dl__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dl__value {
  position: relative;
  height: 26px;
  min-width: 72px;
  text-align: center;
}

.dl__n {
  position: absolute;
  right: 18px;
  font-size: 22px;
  line-height: 26px;
  font-weight: 800;
  color: #17141a;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 220ms steps(1, end);
}

.dl__n.is-on {
  opacity: 1;
}

.dl__n--a.is-on {
  opacity: 1;
}

.dl__unit {
  position: absolute;
  right: 0;
  font-size: 12px;
  line-height: 30px;
  font-weight: 700;
  color: #17141a;
}

.dl__btns {
  display: flex;
  gap: 8px;
}

.dl__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 247, 230, 0.6);
  background: rgba(255, 247, 230, 0.12);
  border-radius: 12px;
  color: #fff7e6;
  cursor: pointer;
  transition: background 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dl__btn:hover {
  background: #fff7e6;
  color: #ff4d1f;
}

.dl__btn:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.dl.is-demo .dl__knob {
  animation: dl-turn 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.dl.is-demo .dl__knob svg {
  animation: dl-turn-back 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes dl-turn-back {
  0% {
    transform: rotate(-225deg);
  }
  30%, 40% {
    transform: rotate(-387deg);
  }
  66%, 76% {
    transform: rotate(-481.5deg);
  }
  88%, 100% {
    transform: rotate(-225deg);
  }
}
@keyframes dl-turn {
  0% {
    transform: rotate(225deg);
  }
  30%, 40% {
    transform: rotate(387deg);
  }
  66%, 76% {
    transform: rotate(481.5deg);
  }
  88%, 100% {
    transform: rotate(225deg);
  }
}
.dl.is-demo .dl__fill {
  animation: dl-fill 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes dl-fill {
  0% {
    stroke-dashoffset: 197.92;
  }
  30%, 40% {
    stroke-dashoffset: 79.17;
  }
  66%, 76% {
    stroke-dashoffset: 9.9;
  }
  88%, 100% {
    stroke-dashoffset: 197.92;
  }
}
.dl.is-demo .dl__n {
  transition: none;
}

.dl.is-demo .dl__n--a {
  animation: dl-na 2s steps(1, end) infinite;
}

.dl.is-demo .dl__n--b {
  animation: dl-nb 2s steps(1, end) infinite;
}

.dl.is-demo .dl__n--c {
  animation: dl-nc 2s steps(1, end) infinite;
}

@keyframes dl-na {
  0%, 29% {
    opacity: 1;
  }
  30%, 100% {
    opacity: 0;
  }
}
@keyframes dl-nb {
  0%, 29% {
    opacity: 0;
  }
  30%, 65% {
    opacity: 1;
  }
  66%, 100% {
    opacity: 0;
  }
}
@keyframes dl-nc {
  0%, 65% {
    opacity: 0;
  }
  66%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dl.is-demo .dl__knob,
  .dl.is-demo .dl__fill,
  .dl.is-demo .dl__n {
    animation: none !important;
  }
  .dl.is-demo .dl__n--a {
    opacity: 1;
  }
  .dl.is-demo .dl__n--b, .dl.is-demo .dl__n--c {
    opacity: 0;
  }
  .dl__knob, .dl__fill {
    transition: none;
  }
}
