/* Screenshot gallery inside its panel: the shots already carry the game's own frame, so they sit in a dark well. */
.gameplay-gallery { scroll-margin-top: 110px; }

.gallery-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.gallery-intro p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 17px; }
.gallery-count { flex: none; color: var(--smoke); font: 800 20px/1 var(--display); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .06em; }

.gallery-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: stretch; }

.gallery-main { min-width: 0; background: #050404; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

.gallery-stage { position: relative; isolation: isolate; aspect-ratio: 2; overflow: hidden; background: #050404; }
.gallery-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: 3; pointer-events: none; background: linear-gradient(transparent, rgba(8, 4, 2, .82)); }

.gallery-slide {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 680ms var(--ease-out), opacity 220ms ease;
}
.gallery-slide.is-previous, .gallery-slide.is-entering, .gallery-slide.is-active { visibility: visible; opacity: 1; }
.gallery-slide.is-previous { z-index: 1; clip-path: inset(0); }
.gallery-slide.is-entering { z-index: 2; }
.gallery-slide.is-active { z-index: 2; clip-path: inset(0); }
.gallery-slide img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; background: #050404; }

.gallery-slide figcaption { position: absolute; z-index: 4; left: clamp(16px, 3vw, 34px); right: 20px; bottom: clamp(14px, 2.5vw, 28px); display: grid; gap: 4px; max-width: 45ch; color: var(--text); text-shadow: 0 2px 6px rgba(0, 0, 0, .85); }
.gallery-slide figcaption strong { font: 800 clamp(19px, 2.2vw, 27px)/1.1 var(--display); color: var(--text); letter-spacing: -.02em; }
.gallery-slide figcaption span { color: var(--text); font-size: clamp(14px, 1.5vw, 17px); font-weight: 500; }

.gallery-controls { display: flex; gap: 10px; justify-content: space-between; padding: 12px; background: var(--well); border-top: 1px solid var(--line-soft); }
.gallery-controls button {
  min-height: 44px;
  min-width: 92px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 138, 61, .05);
  box-shadow: 0 0 0 1px var(--line) inset;
  color: var(--gold-hi);
  font: 700 14px/1.1 var(--display);
  letter-spacing: .03em;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s var(--ease-out);
}
.gallery-controls button:hover { background: rgba(255, 138, 61, .11); box-shadow: 0 0 0 1px var(--gold) inset; }
.gallery-controls button:active { transform: translateY(1px); }
.gallery-controls button[data-gallery-toggle] { color: var(--text); }

.gallery-scenes { display: grid; grid-template-rows: repeat(5, 1fr); gap: 10px; min-height: 0; }
.gallery-scenes button {
  position: relative;
  display: flex;
  align-items: end;
  min-width: 0;
  min-height: 0;
  padding: 12px 14px 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #050404;
  color: var(--text);
  text-align: left;
  font: 700 14px/1.2 var(--display);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s var(--ease-out);
}
.gallery-scenes button:hover { border-color: var(--gold); transform: translateX(-3px); }
.gallery-scenes button.is-current { border-color: var(--gold); color: var(--gold); }
.gallery-scenes button::after { content: ""; position: absolute; inset: 20% 0 0; background: linear-gradient(transparent, rgba(8, 4, 2, .92)); pointer-events: none; }
.gallery-scenes img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.gallery-scenes button.is-current img { opacity: 1; }
.gallery-scenes span { position: relative; z-index: 1; min-width: 0; text-shadow: 0 2px 4px #000; }
.gallery-scenes small { display: block; margin-top: 3px; color: var(--muted); font: 500 13px/1.2 var(--body); }

@media (max-width: 960px) {
  .gallery-layout { grid-template-columns: 1fr; }
  .gallery-scenes { display: flex; overflow-x: auto; padding: 0 0 10px; scroll-snap-type: x proximity; }
  .gallery-scenes button { flex: 0 0 200px; min-height: 108px; scroll-snap-align: start; }
  .gallery-scenes button:hover { transform: none; }
}
@media (max-width: 600px) {
  .gallery-intro { align-items: start; }
  .gallery-intro p { font-size: 15px; }
  .gallery-count { padding-top: 4px; font-size: 18px; }
  /* phones: still wide enough to keep the game's HUD strip out of the frame; the title stays, its line goes */
  .gallery-stage { aspect-ratio: 1.85; }
  .gallery-slide figcaption span { display: none; }
  .gallery-slide figcaption { left: 14px; bottom: 12px; }
  .gallery-slide figcaption span { max-width: 28ch; }
  .gallery-controls button { min-width: 0; min-height: 46px; padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-slide { clip-path: none; transition: opacity 150ms ease; }
  .gallery-slide.is-entering, .gallery-slide.is-active, .gallery-slide.is-previous { clip-path: none; }
  .gallery-controls button, .gallery-scenes button { transition: none; }
}
[hidden] { display: none !important; }

/* the home page (6.1.0): the gallery is a band across the whole width, not a third boxed panel, a little further
   from the fire than the hero and set on a cooler ground */
.page > .gameplay-gallery {
  margin-inline: calc(50% - 50vw);
  padding: clamp(40px, 6vw, 72px) max(16px, calc((100vw - 1160px) / 2));
  background: #0d0d0e;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  box-shadow: none;
}
/* the band closes the home: the footer follows it directly, no empty strip of night between them */
.page:has(> .gameplay-gallery:last-child) { padding-bottom: 0; }
.page:has(> .gameplay-gallery:last-child) + .site-foot { margin-top: 0; border-top: 0; }
/* the caption sits on a smoke scrim: bright hand-drawn forests behind it would swallow the line */
.gallery-slide figcaption { justify-self: start; width: fit-content; padding: 10px 14px 11px; border-radius: 10px; background: rgba(10, 9, 8, .72); text-shadow: none; }
@media (max-width: 600px) { .gallery-slide figcaption { padding: 7px 11px 8px; } }
