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

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

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

.pf__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
}

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

.pf__live {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  color: #3ddc97;
  border: 1px solid #3ddc97;
  border-radius: 999px;
  padding: 0 8px;
  line-height: 1.6;
}

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

.pf__row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: transparent;
}

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

.pf__priceWrap, .pf__chgWrap {
  display: grid;
  justify-items: end;
}

.pf__price, .pf__chg {
  grid-area: 1/1;
  font-variant-numeric: tabular-nums;
}

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

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

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

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

.pf:not(.is-demo) .pf__price--prev, .pf:not(.is-demo) .pf__chg--prev {
  opacity: 0;
}

.pf__row.is-up {
  animation: pfFlashUp 600ms ease-out 1;
}

.pf__row.is-down {
  animation: pfFlashDown 600ms ease-out 1;
}

@keyframes pfFlashUp {
  from {
    background-color: rgba(61, 220, 151, 0.3);
  }
  to {
    background-color: transparent;
  }
}
@keyframes pfFlashDown {
  from {
    background-color: rgba(255, 122, 94, 0.3);
  }
  to {
    background-color: transparent;
  }
}
.pf.is-demo .pf__row {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.pf.is-demo .pf__row[data-row="0"] {
  animation-name: pfRowA;
}

.pf.is-demo .pf__row[data-row="2"] {
  animation-name: pfRowB;
}

.pf.is-demo .pf__row[data-row="1"] {
  animation-name: pfRowC;
}

@keyframes pfRowA {
  0%, 4% {
    background-color: transparent;
  }
  6% {
    background-color: rgba(61, 220, 151, 0.3);
  }
  32%, 100% {
    background-color: transparent;
  }
}
@keyframes pfRowB {
  0%, 32% {
    background-color: transparent;
  }
  34% {
    background-color: rgba(255, 122, 94, 0.3);
  }
  60%, 100% {
    background-color: transparent;
  }
}
@keyframes pfRowC {
  0%, 60% {
    background-color: transparent;
  }
  62% {
    background-color: rgba(61, 220, 151, 0.3);
  }
  88%, 100% {
    background-color: transparent;
  }
}
.pf.is-demo .pf__price--prev, .pf.is-demo .pf__price--next,
.pf.is-demo .pf__chg--prev, .pf.is-demo .pf__chg--next {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.pf.is-demo .pf__row[data-row="0"] .pf__price--prev,
.pf.is-demo .pf__row[data-row="0"] .pf__chg--prev {
  animation-name: pfPrevA;
}

.pf.is-demo .pf__row[data-row="0"] .pf__price--next,
.pf.is-demo .pf__row[data-row="0"] .pf__chg--next {
  animation-name: pfNextA;
}

.pf.is-demo .pf__row[data-row="2"] .pf__price--prev,
.pf.is-demo .pf__row[data-row="2"] .pf__chg--prev {
  animation-name: pfPrevB;
}

.pf.is-demo .pf__row[data-row="2"] .pf__price--next,
.pf.is-demo .pf__row[data-row="2"] .pf__chg--next {
  animation-name: pfNextB;
}

.pf.is-demo .pf__row[data-row="1"] .pf__price--prev,
.pf.is-demo .pf__row[data-row="1"] .pf__chg--prev {
  animation-name: pfPrevC;
}

.pf.is-demo .pf__row[data-row="1"] .pf__price--next,
.pf.is-demo .pf__row[data-row="1"] .pf__chg--next {
  animation-name: pfNextC;
}

.pf.is-demo .pf__row[data-row="3"] .pf__price--prev,
.pf.is-demo .pf__row[data-row="3"] .pf__chg--prev {
  opacity: 0;
}

@keyframes pfPrevA {
  0%, 4% {
    opacity: 1;
  }
  6%, 100% {
    opacity: 0;
  }
}
@keyframes pfNextA {
  0%, 4% {
    opacity: 0;
  }
  6%, 100% {
    opacity: 1;
  }
}
@keyframes pfPrevB {
  0%, 32% {
    opacity: 1;
  }
  34%, 100% {
    opacity: 0;
  }
}
@keyframes pfNextB {
  0%, 32% {
    opacity: 0;
  }
  34%, 100% {
    opacity: 1;
  }
}
@keyframes pfPrevC {
  0%, 60% {
    opacity: 1;
  }
  62%, 100% {
    opacity: 0;
  }
}
@keyframes pfNextC {
  0%, 60% {
    opacity: 0;
  }
  62%, 100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .pf__board {
    padding: 8px 4px 4px;
  }
  .pf__head {
    padding: 0 4px 4px;
  }
  .pf__row {
    gap: 4px;
    padding: 0 4px;
  }
  .pf__chg {
    min-width: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pf__row.is-up, .pf__row.is-down,
  .pf.is-demo .pf__row {
    animation: none !important;
    background-color: transparent !important;
  }
  .pf.is-demo .pf__price--prev, .pf.is-demo .pf__chg--prev {
    animation: none !important;
    opacity: 0 !important;
  }
  .pf.is-demo .pf__price--next, .pf.is-demo .pf__chg--next {
    animation: none !important;
    opacity: 1 !important;
  }
}
