.screenshot-gallery {
  --gallery-slide-width: clamp(168px, 20vw, 238px);
  width: 100%;
}

.screenshot-gallery__stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 22% 0%, color-mix(in srgb, var(--gallery-accent, #f2994a) 30%, transparent), transparent 65%),
    linear-gradient(135deg, var(--gallery-bg-start, #642159), var(--gallery-bg-end, #2c113f));
  box-shadow: 0 20px 45px rgba(20, 29, 48, 0.18);
}

.screenshot-gallery__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 110%, rgba(255, 255, 255, 0.07), transparent 55%);
  pointer-events: none;
}

.screenshot-gallery__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-start: 72px;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  padding-inline-start: 72px;
  padding-inline-end: 72px;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

.screenshot-gallery__viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.screenshot-gallery__viewport::-webkit-scrollbar {
  display: none;
}

.screenshot-gallery__track {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 30px);
  width: max-content;
  padding-block: 28px;
}

.screenshot-gallery__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: block;
  width: var(--gallery-slide-width);
  aspect-ratio: var(--gallery-slide-ratio, 9 / 16);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 21px;
  overflow: hidden;
  background: #101729;
  box-shadow: 0 16px 32px rgba(1, 4, 13, 0.32);
  opacity: 0.6;
  filter: saturate(0.75);
  transform: scale(0.92);
  transition: opacity 250ms ease, filter 250ms ease, transform 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
  cursor: inherit;
}

.screenshot-gallery__item:hover {
  opacity: 0.92;
  filter: none;
}

.screenshot-gallery__item[aria-pressed="true"] {
  opacity: 1;
  filter: none;
  transform: scale(1.015);
  border-color: color-mix(in srgb, var(--gallery-accent, var(--color-brand-bright)) 72%, white 28%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.44), 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.screenshot-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.screenshot-gallery__arrow,
.gallery-lightbox__arrow {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(249, 251, 255, 0.17);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 180ms ease, transform 180ms ease;
}

.screenshot-gallery__arrow:hover,
.gallery-lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.06);
}

.screenshot-gallery__arrow svg,
.gallery-lightbox__arrow svg {
  width: 22px;
  height: 22px;
}

.screenshot-gallery__arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
}

.screenshot-gallery__arrow:hover {
  transform: translateY(-50%) scale(1.06);
}

.screenshot-gallery__arrow--prev {
  right: 18px;
}

.screenshot-gallery__arrow--next {
  left: 18px;
}

.screenshot-gallery__controls {
  display: flex;
  justify-content: center;
  margin-block-start: 16px;
}

.gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 10px;
  border: 1px solid rgba(86, 100, 125, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 16px rgba(31, 42, 62, 0.08);
}

.gallery-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
}

.gallery-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aeb8c7;
  transition: transform 180ms ease, background-color 180ms ease;
}

.gallery-dot[aria-pressed="true"]::before {
  transform: scale(1.4);
  background: var(--gallery-accent, var(--color-brand-bright));
}

.gallery-dot:focus-visible,
.screenshot-gallery__item:focus-visible,
.screenshot-gallery__arrow:focus-visible,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

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

.gallery-modal-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: rgba(3, 5, 10, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
}

.gallery-lightbox::backdrop {
  background: rgba(3, 5, 10, 0.35);
}

.gallery-lightbox__content {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-lightbox__figure {
  position: absolute;
  inset: 64px 72px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.gallery-lightbox__figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(70dvh, 680px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.3);
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

.gallery-lightbox__figure img.is-dragging {
  cursor: grabbing;
}

.gallery-lightbox__close,
.gallery-lightbox__count,
.gallery-lightbox__arrow {
  position: absolute;
  z-index: 2;
}

.gallery-lightbox__close {
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gallery-lightbox__close svg {
  width: 20px;
  height: 20px;
}

.gallery-lightbox__count {
  top: 23px;
  right: 24px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}

.gallery-lightbox__arrow {
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.17);
}

.gallery-lightbox__arrow:hover {
  transform: translateY(-50%) scale(1.06);
}

.gallery-lightbox__arrow--prev {
  right: 17px;
}

.gallery-lightbox__arrow--next {
  left: 17px;
}

@media (max-width: 600px) {
  .screenshot-gallery {
    --gallery-slide-width: clamp(158px, 46vw, 210px);
  }

  .screenshot-gallery__stage {
    border-radius: 20px;
  }

  .screenshot-gallery__viewport {
    scroll-padding-inline-start: 50px;
    padding-inline-start: 50px;
    padding-inline-end: 50px;
  }

  .screenshot-gallery__track {
    gap: 12px;
    padding-block: 22px;
  }

  .screenshot-gallery__item {
    border-radius: 16px;
  }

  .screenshot-gallery__arrow {
    width: 38px;
    height: 38px;
  }

  .screenshot-gallery__arrow--prev {
    right: 8px;
  }

  .screenshot-gallery__arrow--next {
    left: 8px;
  }

  .gallery-lightbox__figure {
    inset: 60px 42px 24px;
  }

  .gallery-lightbox__arrow {
    width: 34px;
    height: 34px;
  }

  .gallery-lightbox__arrow--prev {
    right: 4px;
  }

  .gallery-lightbox__arrow--next {
    left: 4px;
  }

  .gallery-lightbox__arrow svg {
    width: 19px;
    height: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screenshot-gallery__item,
  .screenshot-gallery__arrow,
  .gallery-lightbox__arrow {
    transition: none;
  }
}
