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

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

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

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

.ob__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
}

.ob__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.5;
  color: #fff7e6;
}

.ob__sym {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.5;
  color: #9a93a6;
  letter-spacing: 0.04em;
}

.ob__legend, .ob__cell, .ob__mid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
}

.ob__legend {
  padding: 0 4px;
}

.ob__legend span {
  font-weight: 700;
  font-size: clamp(8px, 2vw, 9px);
  line-height: 1.6;
  color: #9a93a6;
}

.ob__legend span:nth-child(2) {
  text-align: center;
}

.ob__legend span:nth-child(3) {
  text-align: right;
}

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

.ob__row {
  position: relative;
}

.ob__cell {
  position: relative;
  width: 100%;
  padding: 0 4px;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ob__cell:focus-visible {
  outline: 2px solid #9a93a6;
  outline-offset: -2px;
}

.ob__bar {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  right: 0;
  transition: transform 220ms ease-out;
}

.ob__bar--ask {
  transform-origin: 100% 50%;
  background: rgba(255, 122, 94, 0.3);
  border-radius: 4px 0 0 4px;
}

.ob__bar--bid {
  transform-origin: 0 50%;
  background: rgba(61, 220, 151, 0.3);
  border-radius: 0 4px 4px 0;
}

.ob__price, .ob__qty, .ob__cum {
  position: relative;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

.ob__cell--ask .ob__price {
  color: #ff7a5e;
}

.ob__cell--bid .ob__price {
  color: #3ddc97;
}

.ob__qty {
  color: #fff7e6;
  text-align: center;
}

.ob__cum {
  color: #9a93a6;
  text-align: right;
}

.ob__mid {
  padding: 0 4px;
  border-top: 1px solid rgba(154, 147, 166, 0.35);
  border-bottom: 1px solid rgba(154, 147, 166, 0.35);
}

.ob__nowWrap {
  display: grid;
  grid-column: span 2;
}

.ob__now {
  grid-area: 1/1;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  color: #fff7e6;
}

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

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

.ob__spread {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px;
}

.ob__spreadK {
  font-weight: 700;
  font-size: clamp(8px, 2vw, 9px);
  line-height: 1.6;
  color: #9a93a6;
}

.ob__spreadV {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.6;
  color: #fff7e6;
  font-variant-numeric: tabular-nums;
}

.ob:not(.is-demo) .ob__now--b {
  opacity: 0;
}

.ob.is-demo .ob__bar {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.ob.is-demo .ob__row[data-lv="1"] .ob__bar {
  animation-name: obBar1;
}

.ob.is-demo .ob__row[data-lv="2"] .ob__bar {
  animation-name: obBar2;
}

.ob.is-demo .ob__row[data-lv="3"] .ob__bar {
  animation-name: obBar3;
}

.ob.is-demo .ob__row[data-lv="4"] .ob__bar {
  animation-name: obBar4;
}

@keyframes obBar1 {
  0%, 10% {
    transform: scaleX(0.26);
  }
  22%, 46% {
    transform: scaleX(0.35);
  }
  58%, 82% {
    transform: scaleX(0.19);
  }
  92%, 100% {
    transform: scaleX(0.26);
  }
}
@keyframes obBar2 {
  0%, 4% {
    transform: scaleX(0.48);
  }
  16%, 40% {
    transform: scaleX(0.39);
  }
  52%, 76% {
    transform: scaleX(0.57);
  }
  88%, 100% {
    transform: scaleX(0.48);
  }
}
@keyframes obBar3 {
  0%, 16% {
    transform: scaleX(0.66);
  }
  28%, 50% {
    transform: scaleX(0.79);
  }
  62%, 82% {
    transform: scaleX(0.59);
  }
  94%, 100% {
    transform: scaleX(0.66);
  }
}
@keyframes obBar4 {
  0%, 8% {
    transform: scaleX(0.92);
  }
  20%, 44% {
    transform: scaleX(0.83);
  }
  56%, 78% {
    transform: scaleX(1);
  }
  90%, 100% {
    transform: scaleX(0.92);
  }
}
.ob.is-demo .ob__now {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ob.is-demo .ob__now--a {
  animation-name: obNowA;
}

.ob.is-demo .ob__now--b {
  animation-name: obNowB;
}

@keyframes obNowA {
  0%, 46% {
    opacity: 1;
  }
  48%, 92% {
    opacity: 0;
  }
  94%, 100% {
    opacity: 1;
  }
}
@keyframes obNowB {
  0%, 46% {
    opacity: 0;
  }
  48%, 92% {
    opacity: 1;
  }
  94%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .ob__board {
    padding: 4px;
  }
  .ob__head {
    padding-bottom: 4px;
  }
  .ob__legend {
    padding: 0;
  }
  .ob__cell {
    padding: 0;
  }
  .ob__mid {
    padding: 0;
  }
  .ob__row[data-lv="4"] {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ob__bar {
    transition: none !important;
  }
  .ob.is-demo .ob__bar {
    animation: none !important;
  }
  .ob.is-demo .ob__now--a {
    animation: none !important;
    opacity: 1 !important;
  }
  .ob.is-demo .ob__now--b {
    animation: none !important;
    opacity: 0 !important;
  }
}
