/* Keep the image, caption and thumbnails within a comfortable desktop viewport. */
.game-gallery{max-width:min(1200px,calc(64svh * 16 / 9))}
.gallery-stage{position:relative;display:block;width:100%;aspect-ratio:16/9;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#05090b;touch-action:pan-y pinch-zoom;user-select:none;cursor:zoom-in}
.gallery-stage .gallery-image{width:100%;height:100%;object-fit:contain;transition:opacity .18s ease}
.game-gallery.is-loading .gallery-image{opacity:.45}
.gallery-stage:focus-visible{border-color:var(--lime)}
.gallery-expand{position:absolute;right:18px;bottom:18px;display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid #ffffff40;border-radius:5px;background:#080c0edb;color:var(--paper);font-size:11px;line-height:1.4}
.gallery-expand svg{width:18px;height:18px}
.gallery-meta{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:28px;padding-block:20px}
.gallery-caption{display:flex;align-items:center;max-width:760px;min-height:3.4em;color:#c6ceca;font-size:14px;line-height:1.7}
.gallery-tools,.gallery-controls{display:flex;align-items:center;gap:10px}
.gallery-position,.gallery-dialog-position{color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums;letter-spacing:.1em;white-space:nowrap}
.gallery-position{margin-right:10px;min-width:58px}
.gallery-controls button,.gallery-dialog-controls button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;line-height:1;border:1px solid #52605b;border-radius:50%;background:var(--surface);color:var(--paper);transition:background .2s,border-color .2s}
.gallery-controls button:is(:hover,:focus-visible),.gallery-dialog-controls button:is(:hover,:focus-visible){background:#253019;border-color:var(--lime)}
.gallery-controls button svg,.gallery-dialog-controls button svg{display:block;width:20px;height:20px;margin:0;flex:none}
.gallery-previous svg{transform:rotate(180deg)}
.gallery-thumbnails{position:relative;display:flex;gap:12px;overflow-x:auto;padding:2px 0 12px;scrollbar-width:thin;scrollbar-color:#536333 var(--surface);overscroll-behavior-x:contain}
.gallery-thumbnail{display:block;flex:1 0 104px;aspect-ratio:16/9;overflow:hidden;border:2px solid transparent;border-radius:5px;opacity:.55;background:var(--surface);transition:opacity .18s,border-color .18s}
.gallery-thumbnail img{width:100%;height:100%;object-fit:cover}
.gallery-thumbnail:is(:hover,:focus-visible),.gallery-thumbnail.is-active{opacity:1;border-color:var(--lime)}
.gallery-status,.gallery-dialog-status{padding-top:12px;color:var(--paper);font-size:13px}
html.gallery-modal-open{overflow:hidden;scrollbar-gutter:stable}
.game-gallery-dialog{position:fixed;inset:0;margin:auto;width:1400px;max-width:calc(100vw - 32px);max-height:calc(100svh - 24px);overflow:auto;overscroll-behavior:contain;padding:18px;border:1px solid #52605b;border-radius:10px;background:var(--night);color:var(--paper)}
.game-gallery-dialog[open]{display:grid;gap:16px}
.game-gallery-dialog::backdrop{background:#030607ef}
.gallery-dialog-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px}
.gallery-dialog-controls{display:flex;gap:8px}
.gallery-dialog-media{background:#05090b;touch-action:pan-y pinch-zoom;user-select:none}
.gallery-dialog-image{display:block;width:100%;max-height:calc(100svh - 190px);height:auto;object-fit:contain}
.gallery-dialog-caption{color:#c6ceca;font-size:13px;line-height:1.6}
@media(max-width:700px){.gallery-section .section-heading h2{font-size:32px}.gallery-stage{border-radius:6px}.gallery-expand{right:10px;bottom:10px;padding:7px 9px;font-size:10px}.gallery-expand svg{width:16px;height:16px}.gallery-meta{grid-template-columns:1fr;gap:12px;padding-block:16px}.gallery-caption{font-size:13px;min-height:3.4em}.gallery-tools{justify-content:space-between}.gallery-position{font-size:11px}.gallery-thumbnail{flex:0 0 104px}.gallery-thumbnails{gap:9px}.game-gallery-dialog{max-width:calc(100vw - 16px);padding:10px;border-radius:6px;gap:12px}.gallery-dialog-controls{gap:6px}.gallery-dialog-caption{font-size:12px}.gallery-dialog-image{max-height:calc(100svh - 180px)}}
@media(prefers-reduced-motion:reduce){.gallery-stage .gallery-image,.gallery-thumbnail{transition:none}}
