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

.uv {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  width: min(296px, 92vw);
  padding: 12px 8px 8px;
  border-radius: 16px;
  background: #17141a;
  color: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.uv * {
  box-sizing: border-box;
}

.uv__dial {
  position: relative;
  width: 120px;
  height: 64px;
}

.uv__disc {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(from 270deg at 50% 50%, #aace9b 0 36deg, #dcd6b7 36deg 72deg, #c8b48f 72deg 108deg, #c39b86 108deg 144deg, #bd7881 144deg 180deg, rgba(255, 247, 230, 0) 180deg 360deg);
  clip-path: inset(0 0 60px 0);
}

.uv__needle {
  position: absolute;
  left: calc(50% - 1px);
  bottom: 4px;
  width: 2px;
  height: 50px;
  border-radius: 999px;
  background: #fff7e6;
  transform-origin: 50% calc(100% - 1px);
  transform: rotate(8deg);
  box-shadow: 0 0 0 2px rgba(23, 20, 26, 0.35);
}

.uv__hub {
  position: absolute;
  left: calc(50% - 5px);
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff7e6;
  box-shadow: 0 0 0 2px rgba(23, 20, 26, 0.35);
}

.uv__panel {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.uv__value {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.uv__grade {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.uv__advice {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(255, 247, 230, 0.72);
}

.uv__lab {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(255, 247, 230, 0.58);
}

.uv__range {
  width: 100%;
  margin: 0;
  accent-color: #ffd23f;
}
.uv__range:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.uv__swap {
  position: relative;
  display: inline-block;
}

.uv__alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  white-space: nowrap;
}

@keyframes uv-swing {
  0%, 12% {
    transform: rotate(8deg);
  }
  34% {
    transform: rotate(-68deg);
  }
  50% {
    transform: rotate(-20deg);
  }
  62% {
    transform: rotate(-68deg);
  }
  74% {
    transform: rotate(-45deg);
  }
  86% {
    transform: rotate(-68deg);
  }
  88%, 100% {
    transform: rotate(8deg);
  }
}
@keyframes uv-va {
  0%, 44% {
    opacity: 1;
  }
  45%, 87% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes uv-vb {
  0%, 44% {
    opacity: 0;
  }
  45%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
.uv.is-demo .uv__needle {
  animation-name: uv-swing;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.uv.is-demo .uv__swap .uv__v {
  animation-name: uv-va;
}
.uv.is-demo .uv__swap .uv__alt {
  animation-name: uv-vb;
}
.uv.is-demo .uv__swap .uv__v, .uv.is-demo .uv__swap .uv__alt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .uv {
    padding: 8px 4px 4px;
    gap: 8px;
  }
  .uv__dial {
    width: 96px;
    height: 52px;
  }
  .uv__disc {
    width: 96px;
    height: 96px;
    clip-path: inset(0 0 44px 0);
  }
  .uv__needle {
    height: 40px;
  }
  .uv__value {
    font-size: 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .uv.is-demo .uv__needle,
  .uv.is-demo .uv__swap .uv__v,
  .uv.is-demo .uv__swap .uv__alt {
    animation: none !important;
    transform: none !important;
  }
  .uv.is-demo .uv__needle {
    transform: rotate(8deg) !important;
  }
  .uv.is-demo .uv__swap .uv__v {
    opacity: 1 !important;
  }
  .uv.is-demo .uv__swap .uv__alt {
    opacity: 0 !important;
  }
  .uv__needle {
    transition: none !important;
  }
}
