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

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 74px);
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  perspective: 700px;
}

.tile {
  width: 74px;
  height: 74px;
}

.tile__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.tile__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  backface-visibility: hidden;
}

.tile__face--front {
  background: #fff7e6;
}

.tile__face--back {
  background: #0a4fe8;
  color: #fff7e6;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  transform: rotateY(180deg);
}

.gallery.is-demo .tile:nth-child(1) .tile__inner {
  animation: flip 2s ease-out infinite;
}

.gallery.is-demo .tile:nth-child(2) .tile__inner {
  animation: flip 2s ease-out infinite;
  animation-delay: 0.15s;
}

.gallery.is-demo .tile:nth-child(3) .tile__inner {
  animation: flip 2s ease-out infinite;
  animation-delay: 0.3s;
}

.gallery.is-demo .tile:nth-child(4) .tile__inner {
  animation: flip 2s ease-out infinite;
  animation-delay: 0.45s;
}

@keyframes flip {
  0%, 15% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(180deg);
  }
  85%, 100% {
    transform: rotateY(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery.is-demo .tile__inner {
    animation: none;
    transform: rotateY(180deg);
  }
}
