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

@property --split {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
.sg {
  --split: 50%;
  width: min(304px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sg__box {
  position: relative;
  display: grid;
  grid-template-columns: var(--split) 10px 1fr;
  height: 124px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
}

.sg__pane {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
}

.sg__ln {
  flex: 0 0 auto;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 247, 230, 0.38);
}

.sg__ln--s {
  width: 56%;
}

.sg__pane--l {
  background: rgba(76, 212, 166, 0.2);
}

.sg__pane--r {
  background: rgba(185, 160, 255, 0.18);
}

.sg__guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg.is-drag .sg__guides {
  opacity: 1;
}

.sg__g {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-1px);
  background: rgba(255, 247, 230, 0.34);
}

.sg__g--a {
  left: 25%;
}

.sg__g--b {
  left: 50%;
}

.sg__g--c {
  left: 75%;
}

.sg__bar {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(255, 247, 230, 0.18);
  cursor: col-resize;
  touch-action: none;
  transition: background 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg__grip {
  display: block;
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: #fff7e6;
}

.sg__bar:hover,
.sg.is-drag .sg__bar {
  background: #4cd4a6;
}

.sg.is-snapped .sg__bar {
  background: #4cd4a6;
}

.sg__bar:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: -2px;
}

.sg__cap {
  margin: 0;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  color: rgba(255, 247, 230, 0.58);
  text-align: center;
}

.sg.is-demo {
  animation: sg-move 2s ease-out infinite;
}

@keyframes sg-move {
  0%, 6% {
    --split: 50%;
  }
  22% {
    --split: 30%;
  }
  26%, 40% {
    --split: 25%;
  }
  60% {
    --split: 70%;
  }
  64%, 78% {
    --split: 75%;
  }
  88%, 100% {
    --split: 50%;
  }
}
.sg.is-demo .sg__guides {
  animation: sg-guides 2s steps(1, end) infinite;
}

@keyframes sg-guides {
  0%, 7% {
    opacity: 0;
  }
  8%, 84% {
    opacity: 1;
  }
  85%, 100% {
    opacity: 0;
  }
}
.sg.is-demo .sg__g--a {
  animation: sg-hit-a 2s steps(1, end) infinite;
}

.sg.is-demo .sg__g--c {
  animation: sg-hit-c 2s steps(1, end) infinite;
}

@keyframes sg-hit-a {
  0%, 25% {
    width: 2px;
    background: rgba(255, 247, 230, 0.34);
  }
  26%, 40% {
    width: 4px;
    background: #4cd4a6;
  }
  41%, 100% {
    width: 2px;
    background: rgba(255, 247, 230, 0.34);
  }
}
@keyframes sg-hit-c {
  0%, 63% {
    width: 2px;
    background: rgba(255, 247, 230, 0.34);
  }
  64%, 78% {
    width: 4px;
    background: #4cd4a6;
  }
  79%, 100% {
    width: 2px;
    background: rgba(255, 247, 230, 0.34);
  }
}
.sg.is-demo .sg__bar {
  animation: sg-hot 2s steps(1, end) infinite;
}

@keyframes sg-hot {
  0%, 25% {
    background: rgba(255, 247, 230, 0.18);
  }
  26%, 40% {
    background: #4cd4a6;
  }
  41%, 63% {
    background: rgba(255, 247, 230, 0.18);
  }
  64%, 78% {
    background: #4cd4a6;
  }
  79%, 100% {
    background: rgba(255, 247, 230, 0.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg.is-demo,
  .sg.is-demo .sg__guides,
  .sg.is-demo .sg__g--a,
  .sg.is-demo .sg__g--c,
  .sg.is-demo .sg__bar {
    animation: none !important;
  }
  .sg__guides, .sg__bar {
    transition: none;
  }
}
@media (max-width: 340px) {
  .sg__box {
    height: 108px;
  }
  .sg__grip {
    height: 24px;
  }
}
