.voidpulse-gallery {
  grid-area: gallery;
  min-width: 0;
}

.voidpulse-gallery h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.vp-demo-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid #be45d2;
  border-radius: 14px;
  background: #1c1129;
  box-shadow: 0 14px 36px #0b0619aa, 0 0 19px #8d55bd36;
}

.vp-demo-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0811;
  touch-action: pan-y pinch-zoom;
}

.vp-demo-media:has(video:not([hidden])) {
  touch-action: auto;
}

.vp-demo-media :is(img, video) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.vp-demo-still {
  z-index: 1;
  pointer-events: none;
}

.vp-demo-media video:focus-visible {
  outline-offset: -3px;
}

.vp-demo-indicator {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 26px);
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #a479b99e;
  border-radius: 999px;
  background: #140e1ada;
  color: #fff8ff;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.1;
  pointer-events: none;
}

.vp-demo-indicator:not(:has(svg))::before {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #ffdc8e;
  content: "";
}

.vp-demo-indicator svg {
  width: 12px;
  height: 12px;
  color: #ffdc8e;
}

.vp-demo-play {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border: 1px solid #dbbd91;
  border-radius: 8px;
  background: #171021ef;
  color: #ffe9c6;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
}

.vp-demo-caption {
  margin-top: 4px;
}

.vp-demo-copy h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.vp-demo-copy p, .vp-demo-status {
  margin: 0;
  color: var(--soft);
  font-size: .83rem;
  line-height: 1.3;
}

.vp-demo-status { color: var(--accent-light); }

.vp-demo-arrows {
  position: absolute;
  z-index: 3;
  inset: 50% 7px auto;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}

.vp-demo-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #a980bc;
  border-radius: 8px;
  background: #21152edf;
  color: #f4e7ff;
  cursor: pointer;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .vp-demo-arrows { opacity: 0; }
  .vp-demo-frame:hover .vp-demo-arrows, .vp-demo-frame:focus-within .vp-demo-arrows { opacity: 1; }
}

.vp-demo-arrow:focus-visible {
  outline-offset: -3px;
}

.vp-demo-play:hover, .vp-demo-arrow:hover {
  background: #3c2850;
}

.vp-demo-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: clamp(5px, .7vw, 11px);
  margin: 6px -3px 0;
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #9265ab transparent;
  scroll-snap-type: x proximity;
}

.vp-demo-thumb {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 3px;
  min-width: 0;
  padding: 2px 2px 4px;
  border: 1px solid #775291;
  border-radius: 10px;
  background: #1c1129e8;
  color: #f4eafd;
  font-size: clamp(.66rem, .9vw, .82rem);
  font-weight: 650;
  line-height: 1.14;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}

.vp-demo-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.45;
  border-radius: 7px 7px 3px 3px;
  background: #110d1b;
  object-fit: cover;
}

.vp-demo-thumb span {
  align-self: center;
  padding-inline: 2px;
  overflow-wrap: anywhere;
}

.vp-demo-thumb:hover {
  border-color: #ba89cf;
  background: #2b193c;
}

.vp-demo-thumb[aria-pressed="true"] {
  border-color: #ffdb87;
  background: #2d1c38;
  color: #fff8e9;
  box-shadow: inset 0 0 0 1px #ffeab5be, 0 0 5px #efb95d8a;
}

.vp-demo-thumb:focus-visible {
  outline-offset: -2px;
}

@media (min-width: 1024px) {
  .vp-demo-media { aspect-ratio: 2.4; }
  .vp-demo-media :is(img, video) { object-fit: cover; }
  .voidpulse-gallery:has([data-demo="resource-panel"][aria-pressed="true"]) .vp-demo-media :is(img, video:not(:fullscreen)) {
    object-fit: fill;
  }
  .voidpulse-gallery:has([data-demo="minimap-markers"][aria-pressed="true"], [data-demo="camera-tracking"][aria-pressed="true"]) .vp-demo-media :is(img, video) { object-fit: contain; }
  .voidpulse-gallery .vp-demo-media video:fullscreen { object-fit: contain; }
}

@media (max-width: 520px) {
  .vp-demo-indicator {
    top: 8px;
    left: 8px;
    padding: 6px 9px;
    font-size: .74rem;
  }

  .vp-demo-rail {
    grid-template-columns: none;
    grid-auto-columns: clamp(91px, 27%, 114px);
  }

}
