/* ==========================================================================
   W1LD KAEF GAMES — screenshot viewer
   Loaded only on the game page. The gallery links remain usable without JS;
   this layer adds a modal, keyboard navigation and large local images.
   ========================================================================== */

.screenshot-card > a {
  cursor: zoom-in;
}

html.is-viewer-open {
  overflow: hidden;
}

.image-viewer {
  width: min(1180px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100svh - 28px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.image-viewer::backdrop {
  background: rgba(8, 34, 24, 0.82);
  backdrop-filter: blur(5px);
}

.image-viewer__shell {
  display: flex;
  position: relative;
  flex-direction: column;
  width: 100%;
  height: min(88svh, 860px);
  max-height: calc(100svh - 28px);
  border: 2px solid rgba(255, 250, 240, 0.32);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

dialog[open] .image-viewer__shell {
  animation: viewerIn 0.25s var(--ease-out);
}

@keyframes viewerIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.image-viewer__stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(12px, 2.2vw, 22px) clamp(58px, 7vw, 92px);
  background:
    radial-gradient(circle at 50% 15%, rgba(82, 159, 123, 0.2), transparent 55%),
    #0f3226;
}

.image-viewer__stage::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 250, 240, 0.09) 0.6px, transparent 0.6px);
  background-size: 18px 18px;
  content: "";
  pointer-events: none;
}

.image-viewer__image {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  border-radius: 9px;
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.image-viewer__image.is-loading {
  opacity: 0.28;
}

.image-viewer__stage.is-loading::after {
  position: absolute;
  z-index: 2;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--ink);
  content: "Загрузка…";
  font-size: 0.74rem;
  font-weight: 700;
  pointer-events: none;
}

.image-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(21, 62, 47, 0.18);
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease;
}

.image-viewer__close:hover {
  background: var(--sun-light);
  transform: rotate(5deg) scale(1.03);
}

.image-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.image-viewer__nav:hover {
  background: var(--sun-light);
  transform: translateY(-50%) scale(1.06);
}

.image-viewer__nav--prev {
  left: 12px;
}

.image-viewer__nav--next {
  right: 12px;
}

.image-viewer__meta {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 3vw, 32px) 18px;
  background: var(--paper);
}

.image-viewer__copy {
  min-width: 0;
}

.image-viewer__kicker {
  margin-bottom: 3px;
  color: var(--coral-deep);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.image-viewer__title {
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.image-viewer__caption {
  max-width: 650px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}

.image-viewer__aside {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.image-viewer__counter {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.image-viewer__original {
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.image-viewer__original:hover {
  color: var(--coral-deep);
}

html:not(.js) .image-viewer {
  display: none;
}

/* New screenshot in the “game world” split block. */
.split-feature__art--screenshot {
  margin: 0;
  padding: clamp(10px, 1.4vw, 16px);
  border: 2px solid var(--ink);
  border-radius: 30px 18px 30px 30px;
  background: var(--paper);
  box-shadow: 12px 14px 0 rgba(21, 62, 47, 0.1), 0 24px 50px rgba(21, 62, 47, 0.13);
  transform: rotate(-1.2deg);
}

.split-feature__art--screenshot::before {
  display: none;
}

.split-feature__art--screenshot img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 22px 12px 22px 22px;
  filter: none;
}

.split-feature__screen-tag {
  display: inline-flex;
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid rgba(21, 62, 47, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  color: var(--ink);
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.3;
  backdrop-filter: blur(6px);
}

@media (max-width: 700px) {
  .image-viewer {
    width: calc(100vw - 18px);
    max-height: calc(100svh - 18px);
  }

  .image-viewer__shell {
    height: min(92svh, 760px);
    max-height: calc(100svh - 18px);
    border-radius: 22px;
  }

  .image-viewer__stage {
    padding: 54px 12px 12px;
  }

  .image-viewer__close {
    top: 8px;
    right: 8px;
    width: 41px;
    height: 41px;
  }

  .image-viewer__nav {
    top: auto;
    bottom: 12px;
    width: 42px;
    height: 42px;
    transform: none;
  }

  .image-viewer__nav:hover {
    transform: scale(1.04);
  }

  .image-viewer__nav--prev {
    left: 12px;
  }

  .image-viewer__nav--next {
    right: 12px;
  }

  .image-viewer__meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 13px 15px 16px;
  }

  .image-viewer__aside {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .split-feature__art--screenshot {
    transform: rotate(-0.6deg);
  }

  .split-feature__screen-tag {
    right: 16px;
    bottom: 16px;
    font-size: 0.57rem;
  }
}

@media (max-width: 700px) {
  .screenshots-more .button {
    width: 100%;
  }
}
.game-gallery-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 11px;
}

.screenshots-more {
  margin-top: 26px;
}
