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

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

.stage {
  padding: clamp(8px, 2.4vw, 16px);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 210px;
  max-width: 100%;
}

.tile {
  aspect-ratio: 1/1;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  opacity: 1;
  transform: scale(1);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tile:nth-child(odd) {
  background: linear-gradient(160deg, #fff7e6 0%, #ff4d1f 100%);
}

.tile:nth-child(even) {
  background: linear-gradient(20deg, #17141a 0%, #fff7e6 100%);
}

.tile:hover, .tile:focus-visible, .tile:active {
  transform: scale(1.08);
}

.gallery.is-demo .tile {
  animation: enter-loop 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.gallery.is-demo .tile:nth-child(2) {
  animation-delay: -0.2s;
}

.gallery.is-demo .tile:nth-child(3) {
  animation-delay: -0.4s;
}

.gallery.is-demo .tile:nth-child(4) {
  animation-delay: -0.6s;
}

.gallery.is-demo .tile:nth-child(5) {
  animation-delay: -0.8s;
}

.gallery.is-demo .tile:nth-child(6) {
  animation-delay: -1s;
}

@keyframes enter-loop {
  0% {
    opacity: 0.35;
    transform: scale(0.88);
  }
  16%, 50% {
    opacity: 1;
    transform: scale(1);
  }
  66% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 0.35;
    transform: scale(0.88);
  }
}
@media (hover: none) {
  .tile:active {
    transform: scale(1.08);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
    opacity: 1;
    transform: scale(1);
  }
  .gallery.is-demo .tile {
    animation: none;
  }
}
