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

.ch {
  width: min(190px, 66vw);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

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

.ch__sk {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(23, 20, 26, 0.1);
  animation: chSkeleton 2s ease-out infinite;
}

.ch__real {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.9);
  transform-origin: center;
  animation: chReveal 2s ease-out infinite;
}

.ch__real--b0 {
  background: #2f6df6;
}

.ch__real--b1 {
  background: #c2361a;
}

.ch__real--b2 {
  background: #2b9d74;
}

.ch__real--b3 {
  background: #8a5cd6;
}

.ch__reload {
  display: block;
  margin: 12px auto 0;
  appearance: none;
  border: none;
  cursor: pointer;
  background: #17141a;
  color: #fff7e6;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
}

.ch__reload:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

@keyframes chSkeleton {
  0% {
    opacity: 1;
  }
  10% {
    opacity: 1;
  }
  22% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes chReveal {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  10% {
    opacity: 0;
    transform: scale(0.9);
  }
  26% {
    opacity: 1;
    transform: scale(1);
  }
  92% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}
@media (max-width: 340px) {
  .ch {
    width: min(128px, 56vw);
    gap: 4px;
  }
  .ch__reload {
    margin-top: 4px;
    font-size: 10px;
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ch__sk {
    animation: none;
    opacity: 0;
  }
  .ch__real {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}
