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

.db {
  position: relative;
  box-sizing: border-box;
  width: min(300px, 92vw);
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  overflow: hidden;
}

.db__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 0;
}

.db__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.db__live {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: #c93000;
  font-weight: 700;
}

.db__view {
  box-sizing: border-box;
  height: 132px;
  margin: 8px 8px 0;
  padding-right: 8px;
  overflow-y: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent);
}
.db__view::-webkit-scrollbar {
  display: none;
}
.db__view:focus-visible {
  outline: 2px solid #c93000;
  outline-offset: 2px;
}

.db__pad {
  display: grid;
  gap: 8px;
  padding: 4px 4px 104px;
}

.db__lede {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.db__line {
  height: 8px;
  margin: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.12);
}

.db__pad .db__line:nth-child(3) {
  width: 94%;
}

.db__pad .db__line:nth-child(4) {
  width: 82%;
}

.db__pad .db__line:nth-child(5) {
  width: 90%;
}

.db__pad .db__line:nth-child(6) {
  width: 70%;
}

.db__pad .db__line:nth-child(7) {
  width: 86%;
}

.db__tail {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(23, 20, 26, 0.72);
}

.db__foot {
  position: relative;
  margin: 0 8px 8px;
  padding: 8px 0 0;
}

.db__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  gap: 8px;
}

.db__chip {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.1);
  color: rgba(23, 20, 26, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transition: background 140ms steps(1, end), color 140ms steps(1, end);
}

.db__chip.is-on {
  background: #c93000;
  color: #fff;
  animation-name: db-pop;
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: 1;
}

@keyframes db-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}
.db__fill {
  display: block;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.1);
  overflow: hidden;
}
.db__fill::after {
  content: "";
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #c93000;
  transform: scaleX(0);
  transform-origin: left center;
}

.db.is-demo .db__fill::after {
  animation-name: db-fill;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes db-fill {
  0% {
    transform: scaleX(0);
  }
  88% {
    transform: scaleX(1);
  }
  90%, 100% {
    transform: scaleX(0);
  }
}
@keyframes db-cut-1 {
  0%, 21% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
  22%, 88% {
    background: #c93000;
    color: #fff;
  }
  89%, 100% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
}
@keyframes db-cut-2 {
  0%, 41% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
  42%, 88% {
    background: #c93000;
    color: #fff;
  }
  89%, 100% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
}
@keyframes db-cut-3 {
  0%, 61% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
  62%, 88% {
    background: #c93000;
    color: #fff;
  }
  89%, 100% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
}
@keyframes db-cut-4 {
  0%, 81% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
  82%, 88% {
    background: #c93000;
    color: #fff;
  }
  89%, 100% {
    background: rgba(23, 20, 26, 0.1);
    color: rgba(23, 20, 26, 0.72);
  }
}
@keyframes db-hop-1 {
  0%, 21% {
    transform: scale(1);
  }
  24% {
    transform: scale(1.22);
  }
  30%, 100% {
    transform: scale(1);
  }
}
@keyframes db-hop-2 {
  0%, 41% {
    transform: scale(1);
  }
  44% {
    transform: scale(1.22);
  }
  50%, 100% {
    transform: scale(1);
  }
}
@keyframes db-hop-3 {
  0%, 61% {
    transform: scale(1);
  }
  64% {
    transform: scale(1.22);
  }
  70%, 100% {
    transform: scale(1);
  }
}
@keyframes db-hop-4 {
  0%, 81% {
    transform: scale(1);
  }
  84% {
    transform: scale(1.22);
  }
  90%, 100% {
    transform: scale(1);
  }
}
@keyframes db-say {
  0%, 21% {
    opacity: 1;
  }
  22%, 41% {
    opacity: 0.4;
  }
  42%, 61% {
    opacity: 1;
  }
  62%, 81% {
    opacity: 0.4;
  }
  82%, 88% {
    opacity: 1;
  }
  89%, 100% {
    opacity: 0.4;
  }
}
.db.is-demo .db__chip[data-milestone="25"] {
  animation-name: db-hop-1;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}
.db.is-demo .db__chip[data-milestone="50"] {
  animation-name: db-hop-2;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}
.db.is-demo .db__chip[data-milestone="75"] {
  animation-name: db-hop-3;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}
.db.is-demo .db__chip[data-milestone="100"] {
  animation-name: db-hop-4;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.db.is-demo .db__chip[data-milestone="25"] {
  animation-name: db-hop-1, db-cut-1;
  animation-duration: 2s, 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
  animation-iteration-count: infinite, infinite;
}

.db.is-demo .db__chip[data-milestone="50"] {
  animation-name: db-hop-2, db-cut-2;
  animation-duration: 2s, 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
  animation-iteration-count: infinite, infinite;
}

.db.is-demo .db__chip[data-milestone="75"] {
  animation-name: db-hop-3, db-cut-3;
  animation-duration: 2s, 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
  animation-iteration-count: infinite, infinite;
}

.db.is-demo .db__chip[data-milestone="100"] {
  animation-name: db-hop-4, db-cut-4;
  animation-duration: 2s, 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
  animation-iteration-count: infinite, infinite;
}

.db.is-demo .db__live {
  animation-name: db-say;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .db__view {
    height: 84px;
  }
  .db__chip {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .db.is-demo .db__chip,
  .db.is-demo .db__fill::after,
  .db.is-demo .db__live {
    animation: none !important;
  }
  .db.is-demo .db__chip[data-milestone="25"],
  .db.is-demo .db__chip[data-milestone="50"] {
    background: #c93000 !important;
    color: #fff !important;
  }
  .db.is-demo .db__fill::after {
    transform: scaleX(0.5) !important;
  }
}
