.category-gallery {
  --scene-edge-x: clamp(14px, 3.2vw, 42px);
  --scene-edge-y: clamp(14px, 2.3vh, 24px);
  display: none;
  position: relative;
  min-height: 100svh;
  background: #fff;
}

.stair-home.gallery-open .category-gallery { display: block; }
.stair-home.gallery-open :is(.scenes-section, .words-section, .voice-invitation, footer, .content-back) { display: none; }

.gallery-back {
  position: absolute;
  top: max(var(--scene-edge-y), env(safe-area-inset-top));
  right: max(var(--scene-edge-x), env(safe-area-inset-right));
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid #171717;
  background: transparent;
  color: #171717;
  font: 12px/1.4 'Fusion Pixel', 'PingFang SC', sans-serif;
  cursor: pointer;
}

.geography-section-label,
.geography-scene-frame,
.food-section-label,
.food-scene-frame,
.leisure-section-label,
.leisure-scene-frame,
.people-section-label,
.people-scene-frame { display: none; }

.category-gallery:is([data-category="place"], [data-category="food"], [data-category="leisure"], [data-category="people"]) {
  height: 100svh;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.category-gallery:is([data-category="place"], [data-category="food"], [data-category="leisure"], [data-category="people"]) .gallery-back {
  z-index: 2;
  padding: 8px 12px;
  border: 1px solid #ffffff55;
  background: #101010c9;
  color: #fff;
}

.category-gallery[data-category="place"] .geography-section-label,
.category-gallery[data-category="food"] .food-section-label,
.category-gallery[data-category="leisure"] .leisure-section-label,
.category-gallery[data-category="people"] .people-section-label {
  display: block;
  position: absolute;
  z-index: 2;
  top: max(var(--scene-edge-y), env(safe-area-inset-top));
  left: max(var(--scene-edge-x), env(safe-area-inset-left));
  padding: 4px 8px;
  background: #101010c9;
  color: #eee;
  font: 12px/1.4 'Fusion Pixel', 'PingFang SC', sans-serif;
  pointer-events: none;
}

.category-gallery[data-category="place"] .geography-scene-frame,
.category-gallery[data-category="food"] .food-scene-frame,
.category-gallery[data-category="leisure"] .leisure-scene-frame,
.category-gallery[data-category="people"] .people-scene-frame {
  display: block;
  width: 100%;
  height: 100svh;
  border: 0;
  background: #000;
}

.scene-word-open .category-gallery :is(.gallery-back, .geography-section-label, .food-section-label, .leisure-section-label, .people-section-label) {
  visibility: hidden;
}
