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

.rb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.rb__hint {
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.35;
  color: #17141a;
  text-align: center;
}

.rb__field {
  position: relative;
  width: clamp(180px, 42vw, 220px);
  height: clamp(150px, 36vw, 178px);
  display: grid;
  place-items: center;
  border-radius: 8px;
  outline: none;
}

.rb__field:focus-visible {
  box-shadow: 0 0 0 2px rgba(23, 20, 26, 0.5);
}

.rb__world {
  position: relative;
  transform-style: preserve-3d;
  width: 1px;
  height: 1px;
}

.rb__floor {
  position: absolute;
  left: 0;
  top: 0;
  width: 84px;
  height: 84px;
  transform: translate3d(-50%, -50%, 0);
  background: #2f6df6;
  border: 1px solid rgba(23, 20, 26, 0.3);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.rb__wall {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 46px;
  transform-origin: bottom center;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0ms);
  border: 1px solid rgba(23, 20, 26, 0.3);
  border-radius: 4px;
}

.rb__wall--left {
  background: #6ec8ff;
  transform: translate3d(-46px, -10px, 0) scaleY(0.06);
}

.rb__wall--right {
  background: #4cd4a6;
  transform: translate3d(2px, -10px, 0) scaleY(0.06);
}

.rb__field.is-open .rb__wall--left {
  transform: translate3d(-46px, -10px, 0) scaleY(1);
}

.rb__field.is-open .rb__wall--right {
  transform: translate3d(2px, -10px, 0) scaleY(1);
}

.rb__roof {
  position: absolute;
  left: 0;
  top: 0;
  width: 92px;
  height: 92px;
  transform: translate3d(-50%, -50%, 120px);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0ms);
  background: #c93000;
  border: 1px solid rgba(23, 20, 26, 0.3);
  border-radius: 4px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.rb__field.is-open .rb__roof {
  transform: translate3d(-50%, -50%, 58px);
}

.rb__meta {
  margin: 0;
  font-size: clamp(9px, 2.4vw, 11px);
  color: rgba(23, 20, 26, 0.82);
}

.rb__meta b {
  font-weight: 800;
  color: #17141a;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 340px) {
  .rb {
    gap: 4px;
  }
  .rb__field {
    width: 156px;
    height: 124px;
  }
  .rb__hint {
    font-size: 8px;
  }
  .rb__meta {
    font-size: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rb.is-still .rb__wall,
  .rb.is-still .rb__roof {
    transition: none;
  }
}
