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

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

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

.pw__rt {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.pw__cols {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  align-items: end;
}

.pw__col {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.pw__pct {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(23, 20, 26, 0.72);
}

.pw__barwrap {
  position: relative;
  display: block;
  width: 100%;
  height: 56px;
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.07);
  overflow: hidden;
}

.pw__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--h);
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  background: linear-gradient(180deg, #9cb7ce, #2f6df6);
}

.pw__hr {
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  color: rgba(23, 20, 26, 0.72);
}

.pw__wind {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.pw__compass {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.07);
  box-shadow: inset 0 0 0 2px rgba(23, 20, 26, 0.12);
}

.pw__tick {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: rgba(23, 20, 26, 0.72);
}

.pw__tick--n {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.pw__tick--s {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.pw__tick--w {
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.pw__tick--e {
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

.pw__needle {
  position: absolute;
  left: calc(50% - 1px);
  top: calc(50% - 25px);
  width: 2px;
  height: 50px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c2361a 0 50%, rgba(23, 20, 26, 0.35) 50% 100%);
  transform-origin: 50% 50%;
  transform: rotate(315deg);
}

.pw__hub {
  position: absolute;
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #17141a;
}

.pw__wlab {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.pw__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 12px;
  background: #17141a;
  color: #fff7e6;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
}
.pw__btn:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

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

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

@keyframes pw-grow {
  0% {
    transform: scaleY(0);
  }
  40%, 86% {
    transform: scaleY(1);
  }
  88%, 100% {
    transform: scaleY(0);
  }
}
@keyframes pw-va {
  0%, 44% {
    opacity: 1;
  }
  45%, 87% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes pw-vb {
  0%, 44% {
    opacity: 0;
  }
  45%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes pw-swing {
  0%, 30% {
    transform: rotate(315deg);
  }
  55% {
    transform: rotate(45deg);
  }
  88%, 100% {
    transform: rotate(315deg);
  }
}
.pw.is-demo .pw__col:nth-child(1) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0s;
}
.pw.is-demo .pw__col:nth-child(2) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0.08s;
}
.pw.is-demo .pw__col:nth-child(3) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0.16s;
}
.pw.is-demo .pw__col:nth-child(4) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0.24s;
}
.pw.is-demo .pw__col:nth-child(5) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0.32s;
}
.pw.is-demo .pw__col:nth-child(6) .pw__bar {
  animation-name: pw-grow;
  animation-delay: 0.4s;
}
.pw.is-demo .pw__bar {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.pw.is-demo .pw__needle {
  animation-name: pw-swing;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.pw.is-demo .pw__swap .pw__v {
  animation-name: pw-va;
}
.pw.is-demo .pw__swap .pw__alt {
  animation-name: pw-vb;
}
.pw.is-demo .pw__swap .pw__v, .pw.is-demo .pw__swap .pw__alt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .pw {
    padding: 4px;
    gap: 8px;
  }
  .pw__barwrap {
    height: 44px;
  }
  .pw__compass {
    width: 64px;
    height: 64px;
  }
  .pw__needle {
    height: 42px;
    top: calc(50% - 21px);
  }
  .pw__tick {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pw.is-demo .pw__bar,
  .pw.is-demo .pw__needle,
  .pw.is-demo .pw__swap .pw__v,
  .pw.is-demo .pw__swap .pw__alt {
    animation: none !important;
    transform: none !important;
  }
  .pw.is-demo .pw__bar {
    transform: scaleY(1) !important;
  }
  .pw.is-demo .pw__needle {
    transform: rotate(315deg) !important;
  }
  .pw.is-demo .pw__swap .pw__v {
    opacity: 1 !important;
  }
  .pw.is-demo .pw__swap .pw__alt {
    opacity: 0 !important;
  }
}
