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

.cg {
  width: min(260px, 82vw);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cg__cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.cg__sk {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 247, 230, 0.22);
  animation: cgSkeleton 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  animation-delay: var(--delay, 0ms);
}

.cg__real {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #c2361a;
  opacity: 0;
  transform: scale(0.92);
  transform-origin: center;
  animation: cgReveal 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  animation-delay: var(--delay, 0ms);
}

.cg__reload {
  display: block;
  margin: 16px auto 0;
  appearance: none;
  border: none;
  cursor: pointer;
  background: rgba(255, 247, 230, 0.9);
  color: #17141a;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
}

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

@keyframes cgSkeleton {
  0% {
    opacity: 1;
  }
  16% {
    opacity: 1;
  }
  30% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes cgReveal {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  16% {
    opacity: 0;
    transform: scale(0.92);
  }
  34% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92);
  }
}
@media (max-width: 340px) {
  .cg {
    width: min(160px, 76vw);
    gap: 4px;
  }
  .cg__reload {
    margin-top: 8px;
    font-size: 11px;
    padding: 4px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cg__sk {
    animation: none;
    opacity: 0;
  }
  .cg__real {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}
