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

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

.rc {
  --seg-w: 72px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(300px, 90vw);
  color: #17141a;
}

.rc__seg {
  position: relative;
  display: flex;
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background-color: rgba(23, 20, 26, 0.16);
}

.rc__ind {
  position: absolute;
  left: 4px;
  top: 4px;
  width: var(--seg-w);
  height: 28px;
  border-radius: 999px;
  background-color: #17141a;
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rc__seg[data-m=m] .rc__ind {
  transform: translateX(var(--seg-w));
}

.rc__opt {
  position: relative;
  flex: 0 0 auto;
  width: var(--seg-w);
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  color: #17141a;
  font-size: clamp(12px, 3.6vw, 13px);
  line-height: 28px;
  font-weight: 700;
  cursor: pointer;
}

.rc__opt[aria-checked=true] {
  color: #ffd23f;
}

.rc__opt:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 2px;
}

.rc__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
}

.rc__chip {
  margin: 0;
  padding: 0;
  height: 30px;
  border: 2px solid #17141a;
  border-radius: 999px;
  background-color: transparent;
  color: #17141a;
  font-size: clamp(11px, 3.4vw, 13px);
  line-height: 26px;
  font-weight: 700;
  cursor: pointer;
}

.rc__chip[aria-checked=true] {
  background-color: #17141a;
  color: #ffd23f;
}

.rc__chip:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 2px;
}

.rc__sum {
  position: relative;
  margin: 0;
  width: 100%;
  height: 38px;
}

.rc__cut {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-size: clamp(12px, 3.8vw, 14px);
  line-height: 19px;
  font-weight: 700;
  opacity: 0;
}

.rc__cut[data-k="1"] {
  opacity: 1;
}

.rc.is-demo .rc__ind {
  animation-name: rc-ind;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rc-ind {
  0%, 62% {
    transform: translateX(0);
  }
  70%, 76% {
    transform: translateX(var(--seg-w));
  }
  86%, 100% {
    transform: translateX(0);
  }
}
.rc.is-demo .rc__opt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.rc.is-demo .rc__opt[data-m=w] {
  animation-name: rc-ow;
}

.rc.is-demo .rc__opt[data-m=m] {
  animation-name: rc-om;
}

@keyframes rc-ow {
  0% {
    color: #ffd23f;
  }
  64% {
    color: #17141a;
  }
  78% {
    color: #ffd23f;
  }
  100% {
    color: #ffd23f;
  }
}
@keyframes rc-om {
  0% {
    color: #17141a;
  }
  64% {
    color: #ffd23f;
  }
  78% {
    color: #17141a;
  }
  100% {
    color: #17141a;
  }
}
.rc.is-demo .rc__chip[data-w="4"],
.rc.is-demo .rc__chip[data-w="2"] {
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.rc.is-demo .rc__chip[data-w="4"] {
  animation-name: rc-on4, rc-pop4;
}

.rc.is-demo .rc__chip[data-w="2"] {
  animation-name: rc-on2, rc-pop2;
}

@keyframes rc-on4 {
  0% {
    background-color: transparent;
    color: #17141a;
  }
  20% {
    background-color: #17141a;
    color: #ffd23f;
  }
  74% {
    background-color: transparent;
    color: #17141a;
  }
  100% {
    background-color: transparent;
    color: #17141a;
  }
}
@keyframes rc-on2 {
  0% {
    background-color: transparent;
    color: #17141a;
  }
  40% {
    background-color: #17141a;
    color: #ffd23f;
  }
  82% {
    background-color: transparent;
    color: #17141a;
  }
  100% {
    background-color: transparent;
    color: #17141a;
  }
}
@keyframes rc-pop4 {
  0%, 19% {
    transform: scale(1);
  }
  22% {
    transform: scale(0.86);
  }
  29% {
    transform: scale(1.12);
  }
  36%, 100% {
    transform: scale(1);
  }
}
@keyframes rc-pop2 {
  0%, 39% {
    transform: scale(1);
  }
  42% {
    transform: scale(0.86);
  }
  49% {
    transform: scale(1.12);
  }
  56%, 100% {
    transform: scale(1);
  }
}
.rc.is-demo .rc__cut {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.rc.is-demo .rc__cut[data-k="1"] {
  animation-name: rc-k1;
}

.rc.is-demo .rc__cut[data-k="2"] {
  animation-name: rc-k2;
}

.rc.is-demo .rc__cut[data-k="3"] {
  animation-name: rc-k3;
}

.rc.is-demo .rc__cut[data-k="4"] {
  animation-name: rc-k4;
}

@keyframes rc-k1 {
  0% {
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes rc-k2 {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  40% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes rc-k3 {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  66% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes rc-k4 {
  0% {
    opacity: 0;
  }
  66% {
    opacity: 1;
  }
  86% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.rc.is-demo .rc__sum {
  animation-name: rc-drop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rc-drop {
  0%, 19% {
    transform: translateY(0);
  }
  22% {
    transform: translateY(6px);
  }
  29% {
    transform: translateY(0);
  }
  39% {
    transform: translateY(0);
  }
  42% {
    transform: translateY(6px);
  }
  49% {
    transform: translateY(0);
  }
  65% {
    transform: translateY(0);
  }
  68% {
    transform: translateY(6px);
  }
  75%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .rc {
    --seg-w: 60px;
    gap: 8px;
  }
  .rc__chip {
    height: 28px;
    line-height: 24px;
  }
  .rc__sum {
    height: 36px;
  }
  .rc__cut {
    line-height: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rc.is-demo .rc__ind,
  .rc.is-demo .rc__opt,
  .rc.is-demo .rc__chip,
  .rc.is-demo .rc__cut,
  .rc.is-demo .rc__sum {
    animation: none !important;
  }
  .rc__ind {
    transition: none !important;
  }
  .rc.is-demo .rc__cut[data-k="1"] {
    opacity: 1;
  }
}
