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

.carousel {
  position: relative;
  width: 300px;
}

.viewport {
  position: relative;
  width: 300px;
  height: 168px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  background: #17141a;
  outline: none;
}

.slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 300ms ease-out;
}
.slide.isActive {
  opacity: 1;
  z-index: 2;
}
.slide .num {
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
}

.card--0 {
  background: linear-gradient(160deg, #ff9ebb, #d97fa0);
}
.card--0 .num {
  color: #17141a;
}

.card--1 {
  background: linear-gradient(160deg, #0a4fe8, #475690);
}
.card--1 .num {
  color: #fff7e6;
}

.card--2 {
  background: linear-gradient(160deg, #4cd4a6, #63b299);
}
.card--2 .num {
  color: #17141a;
}

.card--3 {
  background: linear-gradient(160deg, #b9a0ff, #bdb3da);
}
.card--3 .num {
  color: #17141a;
}

.card--4 {
  background: linear-gradient(160deg, #6ec8ff, #9cb8ce);
}
.card--4 .num {
  color: #17141a;
}

.progressTrack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 247, 230, 0.18);
  z-index: 3;
}

.progressFill {
  height: 100%;
  width: 0%;
  background: #fff7e6;
}

.navBtn {
  position: absolute;
  top: 50%;
  margin-top: -18px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 26, 0.6);
  color: #fff7e6;
  cursor: pointer;
  z-index: 4;
}
.navBtn:focus-visible {
  outline: 2px solid #ff9ebb;
  outline-offset: 2px;
}

.navBtn--prev {
  left: -12px;
}

.navBtn--next {
  right: -12px;
}

.playBtn {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  display: grid;
  place-items: center;
  background: rgba(23, 20, 26, 0.6);
  color: #fff7e6;
  cursor: pointer;
  z-index: 4;
}
.playBtn:focus-visible {
  outline: 2px solid #ff9ebb;
  outline-offset: 2px;
}
.playBtn .icon.isHidden {
  display: none;
}

.readout {
  position: absolute;
  left: 12px;
  bottom: 18px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.6);
  color: rgba(255, 247, 230, 0.9);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  z-index: 4;
}

@media (max-width: 340px) {
  .carousel {
    width: 220px;
  }
  .viewport {
    width: 220px;
    height: 106px;
  }
  .slide .num {
    font-size: 36px;
  }
  .navBtn {
    width: 28px;
    height: 28px;
    margin-top: -14px;
  }
  .playBtn {
    width: 24px;
    height: 24px;
  }
  .readout {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .progressTrack, .playBtn {
    display: none;
  }
  .slide {
    transition: none;
  }
  .navBtn {
    transition: none;
  }
}
