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

.rg-list {
  position: relative;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
}

.rg-tile {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  outline: none;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transition: transform 220ms ease-out;
}
.rg-tile.is-dragging {
  transition: none;
  z-index: 2;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  cursor: grabbing;
}

.rg-tile:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.rg-tile__img {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.rg-tile__img--a {
  background: linear-gradient(155deg, #2f6df6 0%, #17141a 100%);
}

.rg-tile__img--b {
  background: linear-gradient(205deg, #fff7e6 0%, #2f6df6 100%);
}

.rg-tile__img--c {
  background: linear-gradient(115deg, #2f6df6 0%, #fff7e6 60%);
}

.rg-tile__handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  font-size: 9px;
  line-height: 1;
  color: #17141a;
}

.rg-list.is-demo .rg-tile:nth-child(1) {
  animation: swap-a 2s ease-out infinite;
}

.rg-list.is-demo .rg-tile:nth-child(2) {
  animation: swap-b 2s ease-out infinite;
}

@keyframes swap-a {
  0%, 10% {
    transform: translateX(0);
  }
  45%, 65% {
    transform: translateX(72px);
  }
  95%, 100% {
    transform: translateX(0);
  }
}
@keyframes swap-b {
  0%, 10% {
    transform: translateX(0);
  }
  45%, 65% {
    transform: translateX(-72px);
  }
  95%, 100% {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rg-tile {
    transition: none;
  }
  .rg-list.is-demo .rg-tile:nth-child(1),
  .rg-list.is-demo .rg-tile:nth-child(2) {
    animation: none;
  }
}
