.gallery-page { padding-block: 36px 64px; }
.gallery-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 24px; margin-bottom: 28px; }
.gallery-heading h1 { font-size: clamp(30px, 4.2vw, 52px); line-height: 1.12; overflow-wrap: anywhere; }
.gallery-heading p:not(.eyebrow) { color: var(--body); margin: 14px 0 0; max-width: 58ch; }
.gallery-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.gallery-back { display: inline-flex; margin-bottom: 24px; color: var(--body); text-underline-offset: 4px; }
.gallery-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.gallery-filters label { display: grid; gap: 8px; flex: 1 1 170px; min-width: 0; font-size: 13px; font-weight: 600; }
.gallery-filters label:first-of-type { flex-basis: 220px; }
.gallery-filters select, .gallery-field input, .gallery-field select, .gallery-field textarea { width: 100%; min-width: 0; border: 1px solid var(--line-2); border-radius: 0; background: var(--field); color: var(--text); padding: 12px; font: 400 14px/1.5 var(--sans); }
.gallery-filters select { min-height: 46px; }
.gallery-reset { padding: 12px 4px; font-size: 13px; text-underline-offset: 4px; }
.gallery-count { display: flex; justify-content: space-between; gap: 16px; color: var(--body); font-size: 13px; padding-block: 12px; }
.screenshot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.screenshot-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.screenshot-image { display: block; aspect-ratio: 16 / 10; background: var(--field); overflow: hidden; }
.screenshot-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.screenshot-image:focus-visible { outline-offset: -4px; }
.screenshot-content { padding: 20px; }
.screenshot-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--body); }
.screenshot-meta > span:first-child { color: var(--gold-soft); font-weight: 600; }
.screenshot-content h2 { margin-block: 12px; font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.screenshot-content h2 a { text-decoration: none; }
.screenshot-content h2 a:hover { color: var(--gold-soft); }
.screenshot-author { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--body); font-size: 13px; margin: 0; }
.screenshot-author img { flex: none; object-fit: cover; border: 1px solid var(--line-2); }
.screenshot-author span { min-width: 0; overflow-wrap: anywhere; }
.screenshot-author time { margin-left: auto; font-size: 12px; color: var(--body); }
.screenshot-mods { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--body); }
.screenshot-mods a { color: var(--gold-soft); text-underline-offset: 4px; }
.gallery-pagination { margin-top: 32px; }
.gallery-empty { padding: clamp(28px, 6vw, 72px); margin-top: 24px; text-align: center; border: 1px solid var(--line); background: var(--surface); }
.gallery-empty h2 { font-size: 24px; line-height: 1.3; }
.gallery-empty p { max-width: 58ch; margin: 16px auto 24px; color: var(--body); }
.gallery-upload { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.gallery-drop { display: grid; align-content: center; justify-items: center; gap: 16px; padding: clamp(24px, 4vw, 48px); min-height: 290px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); }
.gallery-drop.is-dragging { border-color: var(--gold); background: var(--surface-2); }
.gallery-drop strong { font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
.gallery-drop > span:not(.gallery-upload-label) { color: var(--body); font-size: 13px; }
.gallery-upload-label { color: var(--gold-soft); font-size: 13px; font-weight: 600; }
.gallery-drop input { width: 100%; max-width: 340px; color: var(--body); font: 13px var(--sans); }
.gallery-drop input::file-selector-button { min-height: 44px; padding: 10px 14px; margin-right: 10px; border: 1px solid var(--line-2); background: var(--field); color: var(--text); font: 500 13px var(--sans); }
.gallery-upload-preview { display: block; margin-top: 20px; width: 100%; height: auto; max-height: 520px; object-fit: contain; background: var(--field); }
.gallery-upload-preview[hidden], .gallery-errors[hidden], .gallery-mod-options label[hidden] { display: none; }
.gallery-upload-details { display: grid; gap: 24px; min-width: 0; }
.gallery-field { display: grid; gap: 8px; color: var(--text); font-size: 14px; font-weight: 600; }
.gallery-field textarea { resize: vertical; min-height: 110px; }
.gallery-help { font-size: 13px; line-height: 1.7; color: var(--body); margin: 12px 0; }
.gallery-optional { font-size: 12px; font-weight: 400; color: var(--body); }
.gallery-mod-picker { margin: 0; padding: 16px; border: 1px solid var(--line-2); min-width: 0; }
.gallery-mod-picker legend { padding-inline: 8px; font-size: 14px; font-weight: 600; }
.gallery-mod-options { display: grid; gap: 4px; }
.gallery-mod-options label, .gallery-check { display: flex; align-items: start; gap: 12px; padding: 10px 8px; font-size: 13px; line-height: 1.7; color: var(--body); }
.gallery-mod-options label:has(:checked) { background: var(--surface-2); color: var(--text); }
.gallery-mod-options input, .gallery-check input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; margin: 3px 0 0; }
.gallery-check { padding: 0; }
.gallery-errors, .gallery-hidden { padding: 16px; border: 1px solid var(--bad); background: var(--surface); color: var(--text); margin-block: 20px; }
.gallery-errors h2 { font-size: 18px; line-height: 1.4; }
.gallery-errors ul { margin: 12px 0 0; }
.gallery-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
.gallery-photo { min-width: 0; background: var(--field); border: 1px solid var(--line); }
.gallery-photo img { display: block; width: 100%; height: auto; max-height: 760px; object-fit: contain; }
.gallery-photo > a { display: block; }
.gallery-expand { width: 100%; border: 0; border-top: 1px solid var(--line); padding: 12px 20px; color: var(--body); background: var(--surface); text-align: right; font-size: 13px; }
.gallery-detail-side { display: grid; gap: 24px; min-width: 0; }
.gallery-attribution { display: grid; gap: 8px; }
.gallery-attribution time { color: var(--body); font-size: 12px; }
.gallery-caption { white-space: pre-line; overflow-wrap: anywhere; color: var(--body); margin: 0; }
.gallery-linked-mods, .gallery-rating { padding-top: 24px; border-top: 1px solid var(--line); }
.gallery-detail-side h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.4; }
.gallery-mod-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none; padding: 14px 16px; margin-top: 8px; border: 1px solid var(--line-2); color: var(--gold-soft); font-size: 14px; }
.gallery-mod-link:hover { background: var(--surface-2); }
.gallery-text-link { color: var(--gold-soft); font-size: 13px; text-underline-offset: 4px; }
.gallery-rating > p { color: var(--body); font-size: 13px; }
.gallery-rating strong { font-size: 20px; color: var(--text); }
.gallery-rating-options { padding: 0; margin: 20px 0 16px; border: 0; }
.gallery-rating-options legend { color: var(--body); margin-bottom: 12px; font-size: 13px; }
.gallery-rating-options > div { display: flex; gap: 8px; }
.gallery-rating-options label { position: relative; }
.gallery-rating-options input { position: absolute; opacity: 0; }
.gallery-rating-options label > span { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; }
.gallery-rating-options input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.gallery-rating-options input:focus-visible + span { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.gallery-manage { border-top: 1px solid var(--line); padding-top: 20px; }
.gallery-manage summary { font-size: 13px; color: var(--body); cursor: pointer; min-height: 32px; }
.gallery-manage form { display: grid; gap: 16px; margin-top: 12px; }
.gallery-lightbox { position: fixed; inset: 0; width: calc(100% - 24px); max-width: 1800px; height: calc(100% - 24px); max-height: none; padding: 16px; border: 1px solid var(--line-2); color: var(--text); background: var(--bg); }
.gallery-lightbox::backdrop { background: rgb(0 0 0 / .92); }
.gallery-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
.gallery-lightbox .btn { align-self: end; flex: none; }
.gallery-lightbox img { min-height: 0; width: 100%; height: 100%; object-fit: contain; }
.gallery-page .btn:disabled { opacity: .55; cursor: wait; }
.gallery-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 980px) { .screenshot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gallery-detail { grid-template-columns: minmax(0, 1fr); } .gallery-upload { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 580px) { .gallery-page { padding-block: 24px 40px; } .screenshot-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } .gallery-filters { padding: 16px; } .gallery-filters label { flex-basis: 100%; } .gallery-count { flex-wrap: wrap; gap: 0; } .gallery-heading { gap: 20px; } .gallery-heading .gallery-actions { width: 100%; } .gallery-upload-details { gap: 20px; } .gallery-field input, .gallery-field textarea, .gallery-field select, .gallery-filters select { font-size: 16px; } .gallery-detail { gap: 24px; } .gallery-upload { gap: 24px; } }
@media (prefers-reduced-motion: reduce) { .gallery-page *, .gallery-lightbox * { scroll-behavior: auto; transition: none; animation: none; } }
