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

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

.ms {
  position: relative;
  box-sizing: border-box;
  width: clamp(232px, 72vw, 272px);
  height: 216px;
  overflow: hidden;
  border-radius: 16px;
  background: #fdf8f0;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.ms__screen {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.ms__title {
  margin: 0;
  color: #15131a;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  font-family: inherit;
}

.ms__row {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e3ddd2;
}

.ms__row--full {
  width: 100%;
}

.ms__row--wide {
  width: 86%;
}

.ms__row--mid {
  width: 60%;
}

.ms__open {
  align-self: flex-start;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #15131a;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.ms__open:focus-visible {
  outline: 2px solid #15131a;
  outline-offset: 2px;
}

.ms__ic {
  display: grid;
  place-items: center;
}

.ms__ic svg {
  display: block;
}

.ms__scrim {
  position: absolute;
  inset: 0;
  background: rgba(21, 19, 26, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ms__sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 12px;
  border-radius: 16px 16px 0 0;
  background: #ffffff;
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ms__grip {
  align-self: center;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #ddd6ca;
}

.ms__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.ms__pick {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  border: 0;
  border-radius: 12px;
  background: #fdf8f0;
  color: #15131a;
  cursor: pointer;
  transform: translateY(10px);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ms__pick:hover, .ms__pick:focus-visible {
  background: #f0e9dd;
}

.ms__pick:focus-visible {
  outline: 2px solid #477690;
  outline-offset: 1px;
}

.ms__pickIc {
  display: grid;
  place-items: center;
  color: #477690;
}

.ms__pickIc svg {
  display: block;
}

.ms__pickName {
  font-weight: 600;
  font-size: 10px;
  line-height: 1.1;
  font-family: inherit;
}

.ms__close {
  box-sizing: border-box;
  height: 32px;
  border: 0;
  border-radius: 12px;
  background: #fdf8f0;
  color: #5b5566;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.ms__close:focus-visible {
  outline: 2px solid #477690;
  outline-offset: 1px;
}

.ms.is-open .ms__scrim {
  opacity: 1;
  pointer-events: auto;
}

.ms.is-open .ms__sheet {
  transform: translateY(0);
}

.ms.is-open .ms__pick {
  transform: translateY(0);
}

.ms.is-open .ms__pick:nth-child(1) {
  transition-delay: 60ms;
}

.ms.is-open .ms__pick:nth-child(2) {
  transition-delay: 100ms;
}

.ms.is-open .ms__pick:nth-child(3) {
  transition-delay: 140ms;
}

.ms.is-open .ms__pick:nth-child(4) {
  transition-delay: 180ms;
}

.is-demo .ms__sheet {
  animation-name: msRise;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

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

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

.is-demo .ms__pick:nth-child(1) {
  animation-delay: 0.14s;
}

.is-demo .ms__pick:nth-child(2) {
  animation-delay: 0.22s;
}

.is-demo .ms__pick:nth-child(3) {
  animation-delay: 0.3s;
}

.is-demo .ms__pick:nth-child(4) {
  animation-delay: 0.38s;
}

@keyframes msRise {
  0%, 6% {
    transform: translateY(100%);
  }
  34%, 100% {
    transform: translateY(0);
  }
}
@keyframes msDim {
  0%, 37.4% {
    opacity: 0;
  }
  37.5%, 100% {
    opacity: 1;
  }
}
@keyframes msPop {
  0% {
    transform: translateY(10px);
  }
  30%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .ms {
    height: 168px;
  }
  .ms__screen {
    gap: 4px;
    padding: 12px;
  }
  .ms__title {
    font-size: 13px;
  }
  .ms__row {
    height: 6px;
  }
  .ms__open {
    margin-top: 0;
    height: 32px;
    padding: 0 8px;
  }
  .ms__sheet {
    gap: 4px;
    padding: 4px 8px 8px;
  }
  .ms__pick {
    padding: 4px 0;
  }
  .ms__pickIc svg {
    width: 16px;
    height: 16px;
  }
  .ms__pickName {
    font-size: 9px;
  }
  .ms__close {
    height: 28px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .ms__sheet, .is-demo .ms__scrim, .is-demo .ms__pick {
    animation: none !important;
  }
  .ms__sheet, .ms__scrim, .ms__pick {
    transition: none !important;
  }
  .ms.is-open .ms__sheet {
    transform: translateY(0);
  }
  .ms.is-open .ms__pick {
    transform: translateY(0);
  }
}
