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

.hg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.hg__top {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.hg__frame {
  position: relative;
  flex: 0 0 auto;
  height: clamp(76px, 36vh, 122px);
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.hg__view {
  display: block;
  width: 100%;
  height: 100%;
}

.hg__chart {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hg__cap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 800;
  font-size: clamp(8px, 2.2vw, 10px);
  color: #17141a;
}

.hg__ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.hg__plot {
  position: relative;
  flex: 1 1 auto;
  min-height: 52px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
}

.hg__hist {
  display: block;
  width: 100%;
  height: 100%;
}

.hg__bars {
  display: none;
  position: absolute;
  inset: 0;
  grid-template-columns: repeat(16, 1fr);
  align-items: end;
}

.hg__gb {
  width: 72%;
  height: 100%;
  justify-self: center;
  background: linear-gradient(90deg, #2f6df6 0 33.33%, #2b9d74 33.33% 66.66%, #c2361a 66.66% 100%);
  border-radius: 0;
  transform-origin: bottom;
  transform: scaleY(var(--h));
}

.hg__ctl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hg__lab {
  font-weight: 800;
  font-size: clamp(8px, 2.2vw, 10px);
  color: #17141a;
}

.hg__track {
  position: relative;
  display: block;
  width: 100px;
  height: 6px;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.2);
}

.hg__track:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 4px;
}

.hg__thumb {
  position: absolute;
  top: 50%;
  left: 40%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: translate(-50%, -50%);
}

.hg.is-demo .hg__hist {
  visibility: hidden;
}

.hg.is-demo .hg__bars {
  display: grid;
}

.hg.is-demo .hg__gb {
  animation-name: hgPulse;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: calc(var(--i) * -125ms);
}

@keyframes hgPulse {
  0%, 100% {
    transform: scaleY(var(--h));
  }
  50% {
    transform: scaleY(calc(var(--h) * 0.4));
  }
}
.hg.is-demo .hg__view {
  animation-name: hgLift;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes hgLift {
  0%, 6% {
    filter: brightness(1);
  }
  40%, 74% {
    filter: brightness(1.42);
  }
  88%, 100% {
    filter: brightness(1);
  }
}
.hg.is-demo .hg__thumb {
  animation-name: hgThumb;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes hgThumb {
  0%, 6% {
    transform: translate(-50%, -50%);
  }
  40%, 74% {
    transform: translate(-50%, -50%) translateX(42px);
  }
  88%, 100% {
    transform: translate(-50%, -50%);
  }
}
@media (max-width: 340px) {
  .hg__top {
    gap: 4px;
  }
  .hg__track {
    width: 84px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hg.is-demo .hg__gb,
  .hg.is-demo .hg__view,
  .hg.is-demo .hg__thumb {
    animation: none !important;
  }
  .hg.is-demo .hg__view {
    filter: brightness(1.42) !important;
  }
  .hg.is-demo .hg__thumb {
    transform: translate(-50%, -50%) translateX(42px) !important;
  }
}
