.page-width { width: min(100% - 48px, 68rem); margin-inline: auto; }
.gallery-art { position: relative; overflow: hidden; margin-top: 32px; border-radius: 16px; }
.gallery-art img { display: block; width: 100%; height: auto; }
.gallery-art figcaption { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 56px); color: #fff; background: linear-gradient(90deg, rgb(4 25 40 / .9), rgb(4 25 40 / .64) 42%, transparent 78%); opacity: 0; }
.gallery-art h2 { margin: 0 0 12px; font-size: clamp(1.75rem, 3.5vw, 2.75rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 650; }
.gallery-art p { margin: 0; max-width: 25rem; font-size: clamp(1rem, 1.75vw, 1.25rem); line-height: 1.5; }
.gallery-art .art-credit { margin-bottom: 12px; }
.gallery-art:hover figcaption, .gallery-art:focus figcaption { opacity: 1; }
.gallery-art:focus-visible { outline: 2px solid var(--ice-blue); outline-offset: 5px; }
.gameplay-gallery { padding: 48px 0 40px; }
.chapter-heading { margin-bottom: 20px; }
.chapter-heading h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -.04em; font-weight: 650; }
.gallery-rail { display: flex; align-items: start; gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 10px 4px 16px; scrollbar-width: none; }
.gallery-rail::-webkit-scrollbar { display: none; }
.shot-card { flex: 0 0 min(78vw, 19rem); min-width: 0; scroll-snap-align: start; transform-origin: center; }
.gallery-shot { display: block; overflow: hidden; border-radius: 14px; background: #edf5f7; cursor: zoom-in; }
.gallery-shot img { display: block; width: 100%; height: auto; }
.shot-card figcaption { padding: 18px 2px 0; }
.shot-card h3 { margin: 0; font-size: 1rem; line-height: 1.3; font-weight: 600; color: var(--ice-blue); }
.shot-detail { margin-top: 6px; font-size: .9375rem; line-height: 1.4; color: var(--secondary); }
.rail-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.rail-controls[hidden] { display: none; }
.gallery-dots, .gallery-arrows { display: flex; gap: 6px; }
.gallery-dots button { display: grid; place-items: center; width: 28px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.gallery-dots button::after { content: ''; width: 6px; height: 6px; border-radius: 8px; background: #a5bdc5; }
.gallery-dots button[aria-current="true"]::after { width: 20px; background: var(--ice-blue); }
.gallery-arrows button, .viewer-controls button, .viewer-close { border: 0; width: 44px; height: 44px; border-radius: 50%; background: #edf3f5; color: #153b48; font-size: 1.25rem; cursor: pointer; }
.gallery-arrows button:hover { background: #ddebf0; }
.gallery-arrows button:disabled { opacity: .3; cursor: default; }
#screenshot-viewer { width: min(100% - 24px, 70rem); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: 52px 24px 16px; background: #f3f7f8; color: #153b48; }
#screenshot-viewer::backdrop { background: rgb(4 18 29 / .85); }
.viewer-close { position: absolute; right: 8px; top: 8px; }
#viewer-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 220px); margin: auto; }
#viewer-caption { margin-top: 16px; font-size: .9375rem; line-height: 1.5; text-align: center; }
.viewer-controls { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 12px; }
#viewer-position { min-width: 4rem; text-align: center; font-size: .875rem; font-variant-numeric: tabular-nums; }
html:has(#screenshot-viewer[open]) { overflow: hidden; }
@media (hover: hover) and (pointer: fine) {
  .shot-detail { opacity: 0; transform: translateY(4px); }
  .shot-card:hover, .shot-card:focus-within { transform: translateY(-4px) scale(1.008); }
  .shot-card:hover .gallery-shot, .shot-card:focus-within .gallery-shot { box-shadow: 0 6px 16px rgb(12 69 90 / .12); }
  .shot-card:hover .shot-detail, .shot-card:focus-within .shot-detail { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .gallery-art, .gallery-art figcaption, .shot-card, .gallery-shot, .gallery-shot img, .shot-detail { transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease; }
}
@media (max-width: 760px) {
  .page-width { width: calc(100% - 40px); }
  .gallery-art { border-radius: 10px; }
  .gameplay-gallery { padding-top: 36px; }
  .gallery-rail { gap: 18px; }
}

@media (max-width: 600px), (hover: none) {
  .gallery-art figcaption { position: static; padding: 24px; background: #0b293b; opacity: 1; }
  .gallery-art h2 { font-size: 1.75rem; }
  .gallery-art p { font-size: 1rem; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .gallery-art:hover { transform: scale(1.015); }
}
