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

.dl {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.dl__dial {
  --d: clamp(148px, 44vw, 176px);
  --r: calc(var(--d) / 2 - 16px);
  --ang: 270deg;
  position: relative;
  box-sizing: border-box;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background-color: rgba(255, 247, 230, 0.07);
  box-shadow: inset 0 0 0 2px rgba(255, 247, 230, 0.2);
  touch-action: none;
  cursor: grab;
}

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

.dl__ring {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.dl__tick {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1;
  font-weight: 700;
  color: #fff7e6;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 30deg)) translateY(calc(var(--r) * -1)) rotate(calc(var(--i) * -30deg));
}

.dl__ring[data-ring=min] .dl__tick {
  color: #4cd4a6;
}

.dl:not(.is-demo)[data-stage=h] .dl__ring[data-ring=hour],
.dl:not(.is-demo)[data-stage=m] .dl__ring[data-ring=min] {
  opacity: 1;
}

.dl__hand {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transform: rotate(var(--ang));
}

.dl__hand::after {
  content: "";
  position: absolute;
  left: calc(50% - 3px);
  top: 18%;
  width: 6px;
  height: 26%;
  border-radius: 999px;
  background-color: #2f6df6;
}

.dl__tip {
  position: absolute;
  left: calc(50% - 9px);
  top: calc(18% - 9px);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #2f6df6;
}

.dl[data-stage=m] .dl__hand::after,
.dl[data-stage=m] .dl__tip {
  background-color: #4cd4a6;
}

.dl__read {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background-color: #17141a;
  transform: translate(-50%, -50%);
}

.dl__val {
  display: flex;
  align-items: center;
  color: #fff7e6;
}

.dl__num {
  position: relative;
  display: inline-block;
  width: 1.35em;
  height: 1em;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1;
  font-weight: 800;
}

.dl__d {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  opacity: 0;
}

.dl__d[data-live] {
  opacity: 1;
}

.dl__sep {
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1;
  font-weight: 800;
}

.dl__step {
  position: relative;
  width: 5em;
  height: 13px;
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 13px;
  font-weight: 600;
  color: #4cd4a6;
}

.dl__sv {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
}

.dl__sv[data-live] {
  opacity: 1;
}

.dl.is-demo .dl__ring,
.dl.is-demo .dl__d,
.dl.is-demo .dl__sv {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.dl.is-demo .dl__ring[data-ring=hour] {
  animation-name: dl-ring-h;
}

.dl.is-demo .dl__ring[data-ring=min] {
  animation-name: dl-ring-m;
}

@keyframes dl-ring-h {
  0% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes dl-ring-m {
  0% {
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  84% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.dl.is-demo .dl__d[data-live=h] {
  animation-name: dl-h09;
}

.dl.is-demo .dl__d[data-d=h10] {
  animation-name: dl-h10;
}

.dl.is-demo .dl__d[data-d=h11] {
  animation-name: dl-h11;
}

.dl.is-demo .dl__d[data-d=h12] {
  animation-name: dl-h12;
}

.dl.is-demo .dl__d[data-live=m] {
  animation-name: dl-m30;
}

.dl.is-demo .dl__d[data-d=m45] {
  animation-name: dl-m45;
}

.dl.is-demo .dl__d[data-d=m00] {
  animation-name: dl-m00;
}

@keyframes dl-h09 {
  0% {
    opacity: 1;
  }
  12% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes dl-h10 {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  24% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dl-h11 {
  0% {
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  36% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dl-h12 {
  0% {
    opacity: 0;
  }
  36% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dl-m30 {
  0% {
    opacity: 1;
  }
  58% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes dl-m45 {
  0% {
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  70% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes dl-m00 {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.dl.is-demo .dl__sv[data-live] {
  animation-name: dl-step-h;
}

.dl.is-demo .dl__sv[data-s=m] {
  animation-name: dl-step-m;
}

@keyframes dl-step-h {
  0% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes dl-step-m {
  0% {
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  90% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.dl.is-demo .dl__hand {
  animation-name: dl-hand;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes dl-hand {
  0% {
    transform: rotate(270deg);
  }
  12% {
    transform: rotate(300deg);
  }
  24% {
    transform: rotate(330deg);
  }
  36% {
    transform: rotate(360deg);
  }
  46% {
    transform: rotate(540deg);
  }
  58% {
    transform: rotate(630deg);
  }
  70% {
    transform: rotate(720deg);
  }
  88% {
    transform: rotate(270deg);
  }
  100% {
    transform: rotate(270deg);
  }
}
.dl.is-demo .dl__tip {
  animation-name: dl-tip;
  animation-duration: 500ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes dl-tip {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.28);
  }
  100% {
    transform: scale(1);
  }
}
.dl.is-demo .dl__dial {
  animation-name: dl-pop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes dl-pop {
  0% {
    transform: scale(1);
  }
  44% {
    transform: scale(1);
  }
  48% {
    transform: scale(0.94);
  }
  54% {
    transform: scale(1.02);
  }
  60% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .dl__read {
    gap: 0;
    padding: 0 4px;
  }
  .dl__step {
    height: 12px;
    line-height: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dl.is-demo .dl__ring,
  .dl.is-demo .dl__d,
  .dl.is-demo .dl__sv,
  .dl.is-demo .dl__hand,
  .dl.is-demo .dl__tip,
  .dl.is-demo .dl__dial {
    animation: none !important;
  }
  .dl.is-demo .dl__ring[data-ring=hour] {
    opacity: 1;
  }
}
