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

.dg {
  display: grid;
  justify-items: center;
  gap: 8px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.dg__screen {
  position: relative;
  box-sizing: border-box;
  width: min(280px, 92vw);
  height: 108px;
  border: 1px solid rgba(255, 247, 230, 0.22);
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.05);
  overflow: hidden;
}

.dg__guide {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 0;
  border-left: 2px dashed rgba(255, 247, 230, 0.3);
  opacity: 0;
  transition: opacity 140ms linear;
}

.dg__guide--l {
  left: 8px;
}

.dg__guide--r {
  right: 8px;
}

.dg__read {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  margin: 0;
  color: rgba(255, 247, 230, 0.62);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.dg__fab {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4cd4a6;
  color: #17141a;
  font-size: 26px;
  line-height: 1;
  cursor: grab;
  transform: translateX(212px);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 140ms linear;
  touch-action: none;
  user-select: none;
}

.dg__fab:focus-visible {
  outline: 3px solid #fff7e6;
  outline-offset: 3px;
}

.dg__fab.is-grab {
  cursor: grabbing;
  transition: box-shadow 140ms linear;
  box-shadow: 0 0 0 4px rgba(76, 212, 166, 0.25), 0 14px 24px rgba(23, 20, 26, 0.32);
}

.dg__screen.is-holding .dg__guide {
  opacity: 1;
}

.dg__hint {
  margin: 0;
  color: rgba(255, 247, 230, 0.62);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

@keyframes dg-loop-move {
  0%, 8% {
    transform: translateX(212px);
  }
  12% {
    transform: translateX(212px) scale(1.12);
  }
  42% {
    transform: translateX(0px) scale(1.12);
  }
  46%, 52% {
    transform: translateX(0px) scale(1);
  }
  58% {
    transform: translateX(0px) scale(1.12);
  }
  86% {
    transform: translateX(212px) scale(1.12);
  }
  90%, 100% {
    transform: translateX(212px) scale(1);
  }
}
@keyframes dg-loop-guide-l {
  0%, 11% {
    opacity: 0;
  }
  12%, 44% {
    opacity: 1;
  }
  46%, 100% {
    opacity: 0;
  }
}
@keyframes dg-loop-guide-r {
  0%, 11% {
    opacity: 0;
  }
  12%, 88% {
    opacity: 1;
  }
  90%, 100% {
    opacity: 0;
  }
}
@keyframes dg-loop-read {
  0%, 11% {
    opacity: 1;
  }
  12%, 43% {
    opacity: 0.3;
  }
  44%, 57% {
    opacity: 1;
  }
  58%, 87% {
    opacity: 0.3;
  }
  88%, 100% {
    opacity: 1;
  }
}
.dg.is-demo .dg__fab {
  animation-name: dg-loop-move;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.dg.is-demo .dg__guide--l {
  animation-name: dg-loop-guide-l;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.dg.is-demo .dg__guide--r {
  animation-name: dg-loop-guide-r;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.dg.is-demo .dg__read {
  animation-name: dg-loop-read;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .dg__screen {
    height: 96px;
  }
  .dg__fab {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .dg__read {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dg.is-demo .dg__fab,
  .dg.is-demo .dg__guide--l,
  .dg.is-demo .dg__guide--r,
  .dg.is-demo .dg__read {
    animation: none !important;
    transform: none !important;
  }
  .dg.is-demo .dg__fab {
    transform: translateX(0px) scale(1.12) !important;
  }
  .dg.is-demo .dg__guide--l {
    opacity: 1 !important;
  }
  .dg.is-demo .dg__guide--r {
    opacity: 0 !important;
  }
  .dg.is-demo .dg__read {
    opacity: 1 !important;
  }
}
