html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.at {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: 24px;
}

.at__card {
  position: relative;
  width: min(100%, 320px);
  background: #231f28;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px 12px 8px;
}

.at__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 0 4px;
}

.at__sym {
  font-weight: 800;
  font-size: clamp(11px, 3vw, 13px);
  color: #fff7e6;
  letter-spacing: 0.04em;
}

.at__cap {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: #9a93a6;
}

.at__priceRow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.at__priceWrap, .at__dirWrap, .at__chipWrap {
  display: grid;
}

.at__dirWrap, .at__chipWrap {
  justify-items: end;
}

.at__price, .at__dir, .at__chip {
  grid-area: 1/1;
  font-variant-numeric: tabular-nums;
}

.at__price {
  font-weight: 800;
  font-size: clamp(15px, 4.4vw, 19px);
  line-height: 1.4;
  color: #fff7e6;
}

.at__dir {
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.5;
}

.at__dir.is-up {
  color: #3ddc97;
}

.at__dir.is-down {
  color: #ff7a5e;
}

.at__chip {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.6;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.at__chip--under {
  color: #9a93a6;
}

.at__chip--over {
  color: #3ddc97;
  opacity: 0;
}

.at__track {
  position: relative;
  height: 18px;
  margin: 0 0 8px;
  overflow: hidden;
}

.at__rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(154, 147, 166, 0.32);
}

.at__lineHolder, .at__dotHolder {
  position: absolute;
  inset: 0;
}

.at__lineHolder {
  transform: translateX(50%);
}

.at__dotHolder {
  transform: translateX(36.8%);
  transition: transform 300ms ease-out;
}

.at__line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #fff7e6;
}

.at__dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #3ddc97;
}

.at__ctrl {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 0 8px;
}

.at__ctrlLabel {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: #9a93a6;
  white-space: nowrap;
}

.at__btn {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #9a93a6;
  border-radius: 8px;
  background: transparent;
  color: #fff7e6;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.at__btn:hover, .at__btn:focus-visible {
  border-color: #3ddc97;
  color: #3ddc97;
}

.at__range {
  width: 100%;
  min-width: 0;
  height: 16px;
  margin: 0;
  accent-color: #3ddc97;
}

.at__ctrlVal {
  font-weight: 800;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #fff7e6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.at__alert {
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.5;
  color: #9a93a6;
}

.at__alertVal {
  font-weight: 800;
  color: #fff7e6;
  font-variant-numeric: tabular-nums;
}

.at__msgWrap {
  display: inline-grid;
  vertical-align: baseline;
}

.at__msg {
  grid-area: 1/1;
  white-space: nowrap;
}

.at__msg--over {
  opacity: 0;
}

.at__alertBox {
  position: absolute;
  top: -10px;
  right: 12px;
}

.at__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(61, 220, 151, 0.8);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.55);
}

.at__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: #3ddc97;
  color: #231f28;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.8;
  white-space: nowrap;
  opacity: 0;
}

.at__bell {
  width: 12px;
  height: 12px;
  font-size: 12px;
  flex: 0 0 auto;
}

.at:not(.is-demo) .at__price--prev, .at:not(.is-demo) .at__dir--prev {
  opacity: 0;
}

.at:not(.is-demo).is-over .at__chip--under, .at:not(.is-demo).is-over .at__msg--under {
  opacity: 0;
}

.at:not(.is-demo).is-over .at__chip--over, .at:not(.is-demo).is-over .at__msg--over,
.at:not(.is-demo).is-over .at__badge {
  opacity: 1;
}

.at.is-fired .at__pulse {
  animation: atPulseOnce 600ms ease-out 1;
}

@keyframes atPulseOnce {
  from {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}
.at.is-demo .at__price--prev, .at.is-demo .at__price--next,
.at.is-demo .at__dir--prev, .at.is-demo .at__dir--next,
.at.is-demo .at__chip--under, .at.is-demo .at__chip--over,
.at.is-demo .at__msg--under, .at.is-demo .at__msg--over,
.at.is-demo .at__badge {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.at.is-demo .at__price--prev, .at.is-demo .at__dir--prev,
.at.is-demo .at__chip--under, .at.is-demo .at__msg--under {
  animation-name: atCutOut;
}

.at.is-demo .at__price--next, .at.is-demo .at__dir--next,
.at.is-demo .at__chip--over, .at.is-demo .at__msg--over,
.at.is-demo .at__badge {
  animation-name: atCutIn;
}

@keyframes atCutIn {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  96% {
    opacity: 0;
  }
}
@keyframes atCutOut {
  0% {
    opacity: 1;
  }
  18% {
    opacity: 0;
  }
  96% {
    opacity: 1;
  }
}
.at.is-demo .at__dotHolder {
  animation-name: atDot;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes atDot {
  0%, 8% {
    transform: translateX(36.8%);
  }
  18% {
    transform: translateX(55.3%);
  }
  96% {
    transform: translateX(64%);
    animation-timing-function: steps(1, end);
  }
  100% {
    transform: translateX(36.8%);
  }
}
.at.is-demo .at__pulse {
  animation-name: atPulse;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes atPulse {
  0%, 18% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  20% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.6);
  }
  46% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
    animation-timing-function: steps(1, end);
  }
  52% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(0.6);
  }
  78%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.6);
  }
}
@media (max-width: 340px) {
  .at {
    padding-top: 20px;
  }
  .at__card {
    padding: 8px;
  }
  .at__priceRow {
    gap: 4px;
    margin: 0 0 4px;
  }
  .at__track {
    height: 16px;
    margin: 0 0 4px;
  }
  .at__ctrl {
    gap: 4px;
    padding: 0 0 4px;
  }
  .at__alertBox {
    right: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .at.is-fired .at__pulse, .at.is-demo .at__pulse {
    animation: none !important;
    opacity: 0 !important;
  }
  .at.is-demo .at__dotHolder {
    animation: none !important;
    transform: translateX(55.3%) !important;
  }
  .at.is-demo .at__price--prev, .at.is-demo .at__dir--prev,
  .at.is-demo .at__chip--under, .at.is-demo .at__msg--under {
    animation: none !important;
    opacity: 0 !important;
  }
  .at.is-demo .at__price--next, .at.is-demo .at__dir--next,
  .at.is-demo .at__chip--over, .at.is-demo .at__msg--over,
  .at.is-demo .at__badge {
    animation: none !important;
    opacity: 1 !important;
  }
}
