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

.cs {
  display: flex;
  justify-content: center;
  width: 100%;
}

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

.cs__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(154, 147, 166, 0.28);
}

.cs__left, .cs__right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cs__ic {
  width: 12px;
  height: 12px;
  font-size: 12px;
  flex: 0 0 auto;
  color: #9a93a6;
}

.cs__dotWrap {
  position: relative;
  width: 20px;
  height: 10px;
  flex: 0 0 auto;
  color: #3ddc97;
}

.cs__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
}

.cs__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
}

.cs__stateWrap {
  display: grid;
}

.cs__state {
  grid-area: 1/1;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.6;
  opacity: 0;
}

.cs__state--live {
  color: #3ddc97;
}

.cs__state--lost {
  color: #ff7a5e;
}

.cs__state--retry {
  color: #9a93a6;
}

.cs__dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.cs__dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation-name: csTypeDot;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.cs__dots i:nth-child(2) {
  animation-delay: 150ms;
}

.cs__dots i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes csTypeDot {
  0%, 60%, 100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}
.cs__right {
  color: #9a93a6;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.6;
}

.cs__lagText {
  white-space: nowrap;
}

.cs__lagWrap {
  display: inline-grid;
  justify-items: end;
}

.cs__lag {
  grid-area: 1/1;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #fff7e6;
}

.cs__lag--d0, .cs__lag--d1, .cs__lag--d2, .cs__lag--d3 {
  opacity: 0;
}

.cs__cap {
  margin: 8px 0 4px;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: #9a93a6;
}

.cs__rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.cs__sym {
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #9a93a6;
  letter-spacing: 0.04em;
}

.cs__price {
  font-weight: 800;
  font-size: clamp(12px, 3.4vw, 15px);
  line-height: 1.5;
  color: #fff7e6;
  font-variant-numeric: tabular-nums;
}

.cs__chg {
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.5;
  min-width: 62px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

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

.cs:not(.is-demo).is-live .cs__state--live,
.cs:not(.is-demo).is-lost .cs__state--lost,
.cs:not(.is-demo).is-retry .cs__state--retry {
  opacity: 1;
}

.cs:not(.is-demo).is-lost .cs__dotWrap {
  color: #ff7a5e;
}

.cs:not(.is-demo).is-retry .cs__dotWrap {
  color: #9a93a6;
}

.cs:not(.is-demo).is-lost .cs__halo {
  animation: none;
  opacity: 0;
}

.cs__halo {
  animation-name: csHalo;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes csHalo {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.6);
  }
  70%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.4);
  }
}
.cs__dot {
  animation-name: csBreath;
  animation-duration: 1s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes csBreath {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
  }
}
.cs.is-demo .cs__lag--now {
  opacity: 0;
}

.cs.is-demo .cs__lag--d0, .cs.is-demo .cs__lag--d1,
.cs.is-demo .cs__lag--d2, .cs.is-demo .cs__lag--d3,
.cs.is-demo .cs__state--live, .cs.is-demo .cs__state--retry,
.cs.is-demo .cs__dotWrap {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__lag--d0 {
  animation-name: csD0;
}

.cs.is-demo .cs__lag--d1 {
  animation-name: csD1;
}

.cs.is-demo .cs__lag--d2 {
  animation-name: csD2;
}

.cs.is-demo .cs__lag--d3 {
  animation-name: csD3;
}

.cs.is-demo .cs__state--live {
  animation-name: csCutOut;
}

.cs.is-demo .cs__state--retry {
  animation-name: csCutIn;
}

.cs.is-demo .cs__dotWrap {
  animation-name: csHue;
}

@keyframes csD0 {
  0% {
    opacity: 1;
  }
  24% {
    opacity: 0;
  }
  96% {
    opacity: 1;
  }
}
@keyframes csD1 {
  0% {
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  48% {
    opacity: 0;
  }
}
@keyframes csD2 {
  0% {
    opacity: 0;
  }
  48% {
    opacity: 1;
  }
  72% {
    opacity: 0;
  }
}
@keyframes csD3 {
  0% {
    opacity: 0;
  }
  72% {
    opacity: 1;
  }
  96% {
    opacity: 0;
  }
}
@keyframes csCutOut {
  0% {
    opacity: 1;
  }
  72% {
    opacity: 0;
  }
  96% {
    opacity: 1;
  }
}
@keyframes csCutIn {
  0% {
    opacity: 0;
  }
  72% {
    opacity: 1;
  }
  96% {
    opacity: 0;
  }
}
@keyframes csHue {
  0% {
    color: #3ddc97;
  }
  72% {
    color: #9a93a6;
  }
  96% {
    color: #3ddc97;
  }
}
@media (max-width: 340px) {
  .cs__board {
    padding: 8px;
  }
  .cs__bar {
    gap: 4px;
    padding: 0 0 4px;
  }
  .cs__cap {
    margin: 4px 0 0;
  }
  .cs__row {
    gap: 4px;
  }
  .cs__chg {
    min-width: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs__halo {
    animation: none !important;
    opacity: 0 !important;
  }
  .cs__dot {
    animation: none !important;
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .cs__dots i {
    animation: none !important;
    opacity: 0.6 !important;
  }
  .cs.is-demo .cs__lag--now {
    opacity: 1 !important;
  }
  .cs.is-demo .cs__lag--d0, .cs.is-demo .cs__lag--d1,
  .cs.is-demo .cs__lag--d2, .cs.is-demo .cs__lag--d3 {
    animation: none !important;
    opacity: 0 !important;
  }
  .cs.is-demo .cs__state--live {
    animation: none !important;
    opacity: 1 !important;
  }
  .cs.is-demo .cs__state--retry {
    animation: none !important;
    opacity: 0 !important;
  }
  .cs.is-demo .cs__dotWrap {
    animation: none !important;
    color: #3ddc97 !important;
  }
}
