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

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

.vp-demo-frame {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1px;
  border-radius: 16px;
  background: linear-gradient(145deg, #d286e8, #754b98 36%, #422453 65%, #b663c2);
  box-shadow: 0 16px 42px #0b0619b0, 0 0 26px #8d55bd34;
}

.vp-demo-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 15px;
  background: #0b0811;
  touch-action: pan-y pinch-zoom;
}

.vp-demo-layer {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: #0b0811;
}

.vp-demo-layer.is-outgoing,
.vp-demo-layer.is-active {
  z-index: 0;
  opacity: 1;
}

.vp-demo-layer.is-active {
  z-index: 1;
  pointer-events: auto;
}

.vp-demo-layer.is-entering {
  animation: vp-demo-crossfade 320ms cubic-bezier(.2,.65,.2,1) both;
}

@keyframes vp-demo-crossfade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.vp-demo-video {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

.vp-demo-layer.has-frame .vp-demo-video {
  opacity: 1;
}

.vp-demo-layer.is-active.has-frame .vp-demo-video {
  pointer-events: auto;
}

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

.vp-demo-indicator {
  position: absolute;
  z-index: 2;
  inset: 11px auto auto 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  max-width: calc(100% - 66px);
  padding: 4px 10px;
  border: 1px solid #b283c96e;
  border-radius: 999px;
  background: #140d1de8;
  color: #f4e8fb;
  font-size: .79rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.vp-demo-indicator::before {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #b794ce;
  content: "";
}

.vp-demo-indicator.is-playing::before {
  background: #ffdc8e;
  box-shadow: 0 0 8px #ffbc5daa;
}

.vp-demo-play,
.vp-demo-arrow,
.vp-demo-rotation {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #a980bc;
  border-radius: 11px;
  background: #21152eef;
  color: #f6eaff;
  cursor: pointer;
  transition: transform 170ms ease, background-color 170ms ease, border-color 170ms ease;
}

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

.vp-demo-play:active,
.vp-demo-arrow:active,
.vp-demo-rotation:active {
  transform: scale(.93);
}

.vp-demo-play:focus-visible,
.vp-demo-arrow:focus-visible,
.vp-demo-rotation:focus-visible {
  outline-offset: -4px;
}

.vp-demo-play {
  position: absolute;
  z-index: 2;
  right: 11px;
  bottom: 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px 0 10px;
  border-color: #e4c180;
  color: #ffe4ac;
  font-size: .84rem;
  font-weight: 700;
}

.vp-demo-rotation {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 9px;
}

.vp-demo-rotation::before {
  width: 0;
  height: 0;
  margin-inline-start: 2px;
  border-block: 6px solid transparent;
  border-inline-start: 9px solid currentColor;
  content: "";
}

.vp-demo-rotation.is-rotating::before {
  width: 10px;
  height: 12px;
  margin: 0;
  border: 3px solid currentColor;
  border-block: 0;
}

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

.vp-demo-arrow {
  pointer-events: auto;
}

.vp-demo-arrow svg {
  transition: transform 170ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .vp-demo-arrows { opacity: .75; transition: opacity 180ms ease; }
  .vp-demo-frame:hover .vp-demo-arrows,
  .vp-demo-frame:focus-within .vp-demo-arrows { opacity: 1; }
  .vp-demo-arrow[data-step="-1"]:hover svg { transform: translateX(-2px); }
  .vp-demo-arrow[data-step="1"]:hover svg { transform: translateX(2px); }
}

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

@media (scripting: enabled) {
  .vp-demo-rail[hidden] {
    display: grid !important;
    visibility: hidden;
  }
}

.vp-demo-thumb {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 3px 7px;
  border: 1px solid #775291;
  border-radius: 11px;
  background: #1c1129e8;
  color: #f4eafd;
  font-size: clamp(.69rem, .92vw, .84rem);
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

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

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

.voidpulse-gallery:lang(de) .vp-demo-thumb span {
  display: grid;
  place-items: center;
  min-height: 2.3em;
}

.vp-demo-thumb-progress {
  position: absolute;
  inset: auto 4px 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e5a05a, #ffe1a4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms linear;
  pointer-events: none;
}

.vp-demo-thumb[aria-pressed="false"] .vp-demo-thumb-progress {
  opacity: 0;
}

.vp-demo-thumb:hover {
  border-color: #d094eb;
  background: #332046;
}

.vp-demo-thumb:active { transform: scale(.97); }

.vp-demo-thumb[aria-pressed="true"] {
  border-color: #ffdb87;
  background: #32203c;
  color: #fff8e9;
  box-shadow: inset 0 0 0 1px #ffd58a75;
}

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

.vp-demo-caption {
  margin-top: 7px;
  font-size: .85rem;
  line-height: 1.4;
}

.vp-demo-copy {
  min-height: 2.8em;
}

.vp-demo-copy p,
.vp-demo-status {
  margin: 0;
  color: var(--soft);
}

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

@media (max-width: 1100px) {
  .vp-demo-copy { min-height: 4.2em; }
}

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

@media (max-width: 520px) {
  .vp-demo-indicator {
    inset: 7px auto auto 8px;
    font-size: .75rem;
  }

  .vp-demo-rotation { inset: 6px 6px auto auto; }

  .vp-demo-rail {
    grid-template-columns: none;
    grid-auto-columns: clamp(96px, 29%, 118px);
  }
}

@media (max-width: 374px) {
  .voidpulse-gallery:lang(de) .vp-demo-copy { min-height: 5.6em; }
}

@media (prefers-reduced-motion: reduce) {
  .voidpulse-gallery .vp-demo-layer { animation: none; }
  .voidpulse-gallery :is(video, button, button svg, .vp-demo-thumb-progress, .vp-demo-arrows) {
    transition: none;
  }
}
