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

.pal {
  box-sizing: border-box;
  width: min(264px, 88vw);
  padding: 8px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
}

.pal__bar {
  position: relative;
  box-sizing: border-box;
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(23, 20, 26, 0.05);
}

.pal__mag {
  display: inline-flex;
  color: rgba(23, 20, 26, 0.42);
}

.pal__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #17141a;
}

.pal__input:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
  border-radius: 4px;
}

.pal.is-demo .pal__input::placeholder {
  color: transparent;
}

.pal__ghost {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: #17141a;
  opacity: 0;
  pointer-events: none;
}

.pal__box {
  box-sizing: border-box;
  height: 100px;
  margin: 8px 0 0;
  overflow: hidden;
}

.pal__list {
  padding: 0;
}

.pal__opt {
  box-sizing: border-box;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
}

.pal__opt.is-at {
  background: rgba(47, 109, 246, 0.12);
}

.pal__name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(23, 20, 26, 0.82);
  white-space: nowrap;
}

.pal__m {
  position: relative;
  z-index: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
}

.pal__m::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 4px;
  background: rgba(255, 210, 63, 0.9);
  opacity: 0;
}

.pal__m.is-on::before {
  opacity: 1;
}

.pal.is-demo .pal__ghost,
.pal.is-demo .pal__m::before {
  animation: cut-in 2s steps(1, end) infinite;
}

.pal.is-demo .pal__opt--out {
  animation: cut-out 2s steps(1, end) infinite;
}

.pal.is-demo .pal__opt--hit {
  animation: rise 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes cut-in {
  0%, 17% {
    opacity: 0;
  }
  18%, 82% {
    opacity: 1;
  }
  83%, 100% {
    opacity: 0;
  }
}
@keyframes cut-out {
  0%, 17% {
    opacity: 1;
  }
  18%, 82% {
    opacity: 0;
  }
  83%, 100% {
    opacity: 1;
  }
}
@keyframes rise {
  0%, 18% {
    transform: translateY(0);
  }
  42%, 62% {
    transform: translateY(-48px);
  }
  83%, 100% {
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pal.is-demo .pal__ghost,
  .pal.is-demo .pal__m::before,
  .pal.is-demo .pal__opt--out,
  .pal.is-demo .pal__opt--hit {
    animation: none !important;
  }
  .pal__ghost {
    opacity: 0;
  }
}
