@font-face {
    font-family: 'Amatic SC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/font-01.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Amatic SC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/font-05.woff2') format('woff2');
}

@font-face {
    font-family: 'Amatic SC';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/font-06.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Amatic SC';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/font-10.woff2') format('woff2');
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/font-11.woff2') format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/font-12.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/font-15.woff2') format('woff2');
}

@font-face {
    font-family: 'Marck Script';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/font-16.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: 'Marck Script';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/font-18.woff2') format('woff2');
}

:root {
    color-scheme: light;
    --bg: #f1deca;
    --paper: #fff4e6;
    --paper-soft: #fffaf3;
    --text: #312a26;
    --muted: #74665e;
    --accent: #8e2d30;
    --accent-dark: #6f2025;
    --accent-light: #bd6d66;
    --line: #dec9b6;
    --success: #3e7160;
    --error: #a52c38;
    --shadow: rgba(70, 44, 30, 0.12);
    --header-height: 68px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background-color: var(--bg);
    background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0.08) 1px, transparent 1px, transparent 5px);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

body.lightbox-open,
body:has(dialog[open]) {
    overflow: hidden;
}

button,
input,
label {
    font: inherit;
    letter-spacing: 0;
}

button,
a,
label {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button {
    border: 0;
}

a {
    color: inherit;
}

img,
video {
    display: block;
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.browser-warning {
    width: min(900px, calc(100% - 28px));
    margin: 18px auto 0;
    padding: 14px 16px;
    border: 1px solid rgba(165, 44, 56, 0.3);
    border-radius: 8px;
    color: var(--error);
    background: rgba(255, 250, 243, 0.9);
    box-shadow: 0 12px 30px rgba(70, 44, 30, 0.08);
}

.browser-warning strong,
.browser-warning span {
    display: block;
}

.browser-warning strong {
    font-family: 'Amatic SC', sans-serif;
    font-size: 26px;
    line-height: 1.05;
}

.browser-warning span {
    margin-top: 4px;
    color: var(--text);
    font-size: 17px;
    line-height: 1.35;
}

.browser-helper {
    width: min(900px, calc(100% - 28px));
    margin: 12px auto 0;
    padding: 12px 14px;
    border: 1px solid rgba(142, 45, 48, 0.18);
    border-radius: 8px;
    background: rgba(255, 244, 230, 0.86);
    color: var(--muted);
    text-align: center;
}

.browser-helper p {
    margin: 0 0 10px;
    font-size: 17px;
}

.browser-helper div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.browser-helper .secondary-button {
    min-height: 46px;
    padding-right: 16px;
    padding-left: 16px;
    font-size: 21px;
    background: var(--paper-soft);
}

.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    min-height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px max(18px, env(safe-area-inset-left)) 10px max(18px, env(safe-area-inset-right));
    border-bottom: 1px solid rgba(142, 45, 48, 0.16);
    background: rgba(255, 244, 230, 0.88);
    backdrop-filter: blur(12px);
}

.brand {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    color: var(--accent);
    font-family: 'Marck Script', cursive;
    font-size: 25px;
    white-space: nowrap;
}

.brand-date {
    display: none;
    color: var(--muted);
    font-size: 15px;
}

.header-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 3px 6px 12px;
    color: var(--accent);
    font-family: 'Amatic SC', sans-serif;
    font-size: 23px;
    font-weight: 700;
    text-decoration: none;
}

.header-link:focus-visible,
.brand:focus-visible,
button:focus-visible,
a.primary-button:focus-visible,
a.secondary-button:focus-visible,
input:focus-visible,
.upload-picker-button:focus-visible {
    outline: 3px solid rgba(142, 45, 48, 0.3);
    outline-offset: 3px;
}

main {
    display: block;
}

.upload-hero {
    display: grid;
    width: min(1180px, 100%);
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    margin: 0 auto;
    padding: 42px 18px 60px;
    gap: 34px;
    align-content: start;
}

.hero-copy {
    text-align: center;
}

.kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-family: 'Amatic SC', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: break-word;
}

h1,
h2 {
    letter-spacing: 0;
}

.hero-copy h1 {
    margin: 0;
    color: var(--accent);
    font-family: 'Marck Script', cursive;
    font-size: 48px;
    font-weight: 400;
    line-height: 1.02;
}

.hero-lead {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text);
    font-size: 20px;
    line-height: 1.42;
}

.event-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 17px;
}

.event-stats span:not(.stat-divider) {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.event-stats strong {
    color: var(--accent);
    font-size: 25px;
    font-weight: 600;
    line-height: 1;
}

.stat-divider {
    width: 1px;
    height: 22px;
    background: var(--line);
}

.uploader {
    position: relative;
    width: min(540px, 100%);
    margin: 20px auto 0;
    padding: 24px 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
    box-shadow: 0 20px 60px var(--shadow);
}

.uploader::before {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(142, 45, 48, 0.1);
    border-radius: 18px;
    content: '';
    pointer-events: none;
}

.uploader-content {
    position: relative;
    z-index: 2;
}

.uploader h2 {
    margin: 0 0 18px;
    text-align: center;
    font-family: 'Amatic SC', sans-serif;
    font-size: 34px;
    line-height: 1.05;
}

.upload-actions {
    display: grid;
    gap: 10px;
}

.upload-picker-button {
    position: relative;
    overflow: hidden;
}

.upload-picker-button > span {
    pointer-events: none;
}

.upload-picker-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

body.is-unsupported .upload-picker-button {
    opacity: 0.58;
    cursor: default;
}

body.is-unsupported .upload-picker-input {
    display: none;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Amatic SC', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.primary-button {
    width: 100%;
    color: #fffaf3;
    background: var(--accent);
    box-shadow: 0 10px 24px rgba(111, 32, 37, 0.23);
}

.primary-button:hover {
    background: var(--accent-dark);
    box-shadow: 0 12px 28px rgba(111, 32, 37, 0.28);
    transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
    transform: translateY(1px);
}

.primary-button.compact {
    width: auto;
    min-width: 180px;
}

.button-icon {
    font-family: Arial, sans-serif;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
}

.secondary-button {
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.secondary-button:hover {
    color: #fffaf3;
    background: var(--accent);
}

.upload-choice-button {
    width: 100%;
    background: var(--paper-soft);
}

.format-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.queue-section,
.complete-banner {
    width: min(900px, calc(100% - 36px));
    margin: 0 auto 72px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2,
.complete-banner h2,
.gallery-empty h2 {
    margin: 0;
    font-family: 'Amatic SC', sans-serif;
    font-size: 34px;
    line-height: 1.05;
}

.queue-summary {
    flex: none;
    color: var(--muted);
    font-size: 16px;
}

.upload-queue {
    display: grid;
    gap: 10px;
}

.queue-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 44px;
    min-height: 76px;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 250, 243, 0.78);
}

.queue-thumb {
    position: relative;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border-radius: 6px;
    background: #e7d4c3;
}

.queue-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-thumb.video::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: white;
    background: rgba(49, 42, 38, 0.72);
    content: '▶';
    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 26px;
    text-align: center;
    transform: translate(-50%, -50%);
}

.queue-details {
    min-width: 0;
}

.queue-name {
    display: block;
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.queue-status span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-status span:last-child {
    flex: none;
}

.queue-item.is-error .queue-status {
    color: var(--error);
}

.queue-item.is-done .queue-status {
    color: var(--success);
}

.progress-track {
    display: block;
    width: 100%;
    height: 4px;
    margin-top: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: #ead9ca;
    appearance: none;
    -webkit-appearance: none;
}

.progress-track::-webkit-progress-bar {
    border-radius: 4px;
    background: #ead9ca;
}

.progress-track::-webkit-progress-value {
    border-radius: 4px;
    background: var(--accent);
    transition: width 120ms linear;
}

.progress-track::-moz-progress-bar {
    border-radius: 4px;
    background: var(--accent);
}

.queue-item.is-done .progress-track::-webkit-progress-value,
.queue-item.is-done .progress-track::-moz-progress-bar {
    background: var(--success);
}

.queue-action {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 21px;
}

.queue-action:hover {
    background: rgba(142, 45, 48, 0.08);
}

.queue-action.done {
    color: var(--success);
    cursor: default;
}

.complete-banner {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 244, 230, 0.55);
}

.complete-banner img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.complete-banner .secondary-button {
    margin-top: 16px;
}

.noscript {
    margin: 30px auto;
    padding: 16px;
    color: var(--error);
    text-align: center;
}

.site-footer {
    display: flex;
    min-height: 170px;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 30px 18px max(28px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(142, 45, 48, 0.12);
    background: var(--paper);
    color: var(--muted);
    text-align: center;
}

.site-footer img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.site-footer p {
    margin: 0;
    font-family: 'Marck Script', cursive;
    font-size: 20px;
}

.gallery-main {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 46px 12px 80px;
}

.gallery-intro {
    max-width: 720px;
    margin: 0 auto 40px;
    padding: 0 12px;
    text-align: center;
}

.gallery-intro h1 {
    margin: 0;
    color: var(--accent);
    font-family: 'Marck Script', cursive;
    font-size: 47px;
    font-weight: 400;
    line-height: 1.08;
}

.gallery-intro > p:not(.kicker) {
    margin: 12px auto 0;
    color: var(--muted);
    font-size: 19px;
}

.admin-toolbar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
    padding: 7px 8px 7px 14px;
    border: 1px solid rgba(142, 45, 48, 0.28);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(255, 250, 243, 0.9);
    font-size: 14px;
}

.admin-filter select {
    min-height: 32px;
    padding: 4px 26px 4px 10px;
    border: 1px solid rgba(142, 45, 48, 0.25);
    border-radius: 999px;
    color: var(--accent);
    background: #fffaf3;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.admin-toolbar[hidden] {
    display: none;
}

.admin-toolbar button {
    padding: 5px 10px;
    border-radius: 999px;
    color: #fffaf3;
    background: var(--accent);
    cursor: pointer;
    font-size: 13px;
}

.gallery-grid {
    column-count: 2;
    column-gap: 8px;
}

.media-card,
.gallery-skeleton {
    display: inline-block;
    width: 100%;
    margin: 0 0 8px;
    break-inside: avoid;
    vertical-align: top;
}

.media-card {
    position: relative;
    min-height: 160px;
    overflow: hidden;
    padding: 0;
    border-radius: 7px;
    background: #e3cdb9;
    box-shadow: 0 4px 14px rgba(70, 44, 30, 0.08);
    cursor: zoom-in;
}

.admin-media-actions {
    display: none;
    position: absolute;
    z-index: 5;
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 7px;
    align-items: flex-start;
    justify-content: space-between;
    pointer-events: none;
}

.admin-media-action {
    display: inline-flex;
    min-height: 34px;
    padding: 7px 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 999px;
    color: #fffaf3;
    background: rgba(49, 42, 38, 0.86);
    box-shadow: 0 4px 12px rgba(49, 42, 38, 0.3);
    cursor: pointer;
    pointer-events: auto;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
}

.admin-media-action.destructive {
    margin-left: auto;
    background: rgba(142, 45, 48, 0.96);
}

.admin-media-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

body.admin-mode .admin-media-actions {
    display: flex;
}

body.admin-mode .media-card.is-hidden {
    outline: 3px dashed rgba(142, 45, 48, 0.65);
    outline-offset: -3px;
}

body.admin-mode .media-card.is-hidden img {
    opacity: 0.35;
    filter: grayscale(0.8);
}

body.admin-mode .media-card.is-hidden::before {
    position: absolute;
    z-index: 4;
    right: 8px;
    bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    color: white;
    background: rgba(49, 42, 38, 0.82);
    content: 'Скрыто';
    font-size: 12px;
}

.media-card img {
    width: 100%;
    height: auto;
    min-height: 160px;
    object-fit: cover;
}

.media-card.placeholder {
    aspect-ratio: 4 / 5;
    background: var(--paper);
}

.media-placeholder {
    display: flex;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: 'Amatic SC', sans-serif;
    font-size: 23px;
    font-weight: 700;
}

.media-card::after {
    position: absolute;
    inset: auto 0 0;
    height: 48px;
    background: linear-gradient(transparent, rgba(31, 24, 20, 0.5));
    content: '';
    opacity: 0;
    transition: opacity 160ms ease;
}

.media-card:hover::after,
.media-card:focus-visible::after {
    opacity: 1;
}

.media-type-badge {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: rgba(49, 42, 38, 0.72);
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.gallery-skeleton {
    min-height: 210px;
    border-radius: 7px;
    background: linear-gradient(100deg, #e1ccb8 30%, #f3e2d1 50%, #e1ccb8 70%);
    background-size: 300% 100%;
    animation: shimmer 1.5s infinite;
}

.gallery-skeleton.tall {
    min-height: 310px;
}

.gallery-skeleton.wide {
    min-height: 170px;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.gallery-empty {
    max-width: 560px;
    margin: 40px auto 80px;
    text-align: center;
}

.gallery-empty img {
    width: 130px;
    height: 130px;
    margin: 0 auto 8px;
    object-fit: contain;
}

.gallery-empty p {
    margin: 8px 0 20px;
    color: var(--muted);
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 0 0;
}

.lightbox {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: white;
    background: rgba(30, 24, 21, 0.96);
}

.lightbox::backdrop {
    background: rgba(30, 24, 21, 0.86);
}

.admin-dialog {
    width: min(430px, calc(100% - 28px));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 24px 70px rgba(49, 42, 38, 0.35);
}

.admin-dialog::backdrop {
    background: rgba(49, 42, 38, 0.7);
    backdrop-filter: blur(3px);
}

.admin-form {
    position: relative;
    padding: 30px 24px 24px;
}

.admin-form h2 {
    margin: 0 0 22px;
    color: var(--accent);
    font-family: 'Marck Script', cursive;
    font-size: 36px;
    font-weight: 400;
}

.admin-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 15px;
}

.admin-form input {
    width: 100%;
    min-height: 50px;
    padding: 10px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: white;
    font: inherit;
}

.admin-form input:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(142, 45, 48, 0.12);
}

.admin-error {
    min-height: 22px;
    margin: 8px 0;
    color: var(--error);
    font-size: 14px;
}

.admin-dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 28px;
}

.lightbox.is-open,
.lightbox[open] {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.lightbox-stage {
    display: flex;
    position: relative;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: max(62px, calc(env(safe-area-inset-top) + 56px)) 12px 10px;
    touch-action: pan-y;
}

.lightbox-stage img,
.lightbox-stage video {
    max-width: 100%;
    max-height: calc(100vh - 126px);
    max-height: calc(100dvh - 126px);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-stage img {
    transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.lightbox-stage.is-switching img {
    transform: translateX(8px);
}

.lightbox-photo {
    display: grid;
    width: 100%;
    height: calc(100vh - 126px);
    height: calc(100dvh - 126px);
    place-items: center;
}

.lightbox-photo > * {
    grid-area: 1 / 1;
    min-width: 0;
    min-height: 0;
}

.lightbox-stage .lightbox-preview,
.lightbox-stage .lightbox-original {
    width: 100%;
    height: 100%;
}

.lightbox-photo .lightbox-original {
    z-index: 1;
    opacity: 1;
    transition: opacity 180ms ease;
}

.lightbox-photo .lightbox-original.is-pending {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .lightbox-photo .lightbox-original { transition: none; }
}

.lightbox-stage video {
    width: min(1100px, 100%);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.lightbox-close {
    position: fixed;
    z-index: 4;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    font-size: 30px;
    font-weight: 300;
}

.lightbox-nav {
    position: fixed;
    z-index: 4;
    top: 50%;
    width: 44px;
    height: 44px;
    font-size: 34px;
    transform: translateY(-50%);
}

.lightbox-nav.previous {
    left: max(8px, env(safe-area-inset-left));
}

.lightbox-nav.next {
    right: max(8px, env(safe-area-inset-right));
}

.lightbox-caption {
    min-height: 54px;
    padding: 10px 66px max(14px, env(safe-area-inset-bottom));
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    text-align: center;
}

.gallery-footer {
    min-height: 150px;
}

@media (min-width: 561px) {
    .brand-date {
        display: inline;
    }

    .upload-hero {
        padding-right: 30px;
        padding-left: 30px;
    }

    .uploader {
        padding-right: 34px;
        padding-bottom: 32px;
        padding-left: 34px;
    }

    .gallery-main {
        padding-right: 20px;
        padding-left: 20px;
    }

    .gallery-grid {
        column-gap: 12px;
    }

    .media-card,
    .gallery-skeleton {
        margin-bottom: 12px;
    }
}

@media (min-width: 760px) {
    .site-header {
        padding-right: 36px;
        padding-left: 36px;
    }

    .hero-copy h1 {
        font-size: 58px;
    }

    .queue-item {
        grid-template-columns: 64px minmax(0, 1fr) 48px;
        padding: 12px;
    }

    .queue-thumb {
        width: 64px;
        height: 64px;
    }

    .gallery-grid {
        column-count: 3;
    }

    .gallery-intro h1 {
        font-size: 58px;
    }

    .lightbox-stage {
        padding: 70px 74px 12px;
    }
}

@media (min-width: 980px) {
    .upload-hero {
        grid-template-columns: minmax(0, 1fr) minmax(440px, 0.82fr);
        align-items: center;
        padding-top: 64px;
        padding-bottom: 76px;
    }

    .hero-copy {
        text-align: left;
    }

    .hero-copy h1 {
        font-size: 66px;
    }

    .hero-lead {
        margin-left: 0;
        font-size: 22px;
    }

    .hero-copy .event-stats {
        justify-content: flex-start;
    }

    .uploader {
        margin-top: 34px;
    }

    .gallery-main {
        padding-top: 58px;
    }

    .gallery-grid {
        column-count: 4;
        column-gap: 14px;
    }

    .media-card,
    .gallery-skeleton {
        margin-bottom: 14px;
    }
}

@media (min-width: 1320px) {
    .gallery-grid {
        column-count: 5;
    }
}

@media (max-width: 560px) {
    :root {
        --header-height: 58px;
    }

    .site-header {
        gap: 10px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .brand-mark {
        font-size: 23px;
    }

    .header-link {
        min-height: 44px;
        padding-left: 8px;
        font-size: 22px;
    }

    .upload-hero {
        min-height: auto;
        padding: 20px 14px 38px;
        gap: 22px;
    }

    .kicker {
        margin-bottom: 5px;
        font-size: 20px;
    }

    .hero-copy h1 {
        font-size: 38px;
    }

    .hero-lead {
        font-size: 17px;
        line-height: 1.32;
    }

    .event-stats {
        margin-top: 12px;
    }

    .uploader {
        margin-top: 10px;
        padding: 18px 14px;
        border-radius: 20px;
    }

    .uploader::before {
        border-radius: 15px;
    }

    .uploader h2 {
        margin-bottom: 12px;
        font-size: 30px;
    }

    .primary-button,
    .secondary-button {
        min-height: 52px;
        padding-right: 18px;
        padding-left: 18px;
        font-size: 23px;
    }

    .queue-section,
    .complete-banner {
        width: min(900px, calc(100% - 24px));
    }

    .section-heading {
        align-items: start;
        margin-bottom: 12px;
    }

    .queue-item {
        grid-template-columns: 50px minmax(0, 1fr) 44px;
        gap: 8px;
        min-height: 70px;
        padding: 8px;
    }

    .queue-thumb {
        width: 50px;
        height: 50px;
    }

    .complete-banner {
        grid-template-columns: 88px minmax(0, 1fr);
        padding: 18px 8px;
    }

    .complete-banner img {
        width: 88px;
        height: 88px;
    }

    .complete-banner .secondary-button {
        width: 100%;
        padding-right: 14px;
        padding-left: 14px;
        font-size: 21px;
    }

    .lightbox-nav {
        top: auto;
        bottom: max(8px, env(safe-area-inset-bottom));
        width: 48px;
        height: 48px;
        transform: none;
    }

    .lightbox-close {
        width: 48px;
        height: 48px;
    }

    .lightbox-caption {
        padding-right: 58px;
        padding-left: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Upload controls and explicit original quality access. */
.queue-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.upload-hint { color: var(--muted, #736363); font-size: 14px; line-height: 1.55; margin: 8px 0 16px; }
.uploader.is-dragging { outline: 3px dashed #8e2d30; outline-offset: 6px; }
.queue-status { flex-wrap: wrap; gap: 4px 12px; }
.queue-status > span:first-child { overflow-wrap: anywhere; }
.lightbox.is-open, .lightbox[open] { grid-template-rows: minmax(0, 1fr) auto auto; }
.lightbox-tools { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 4px 66px max(14px, env(safe-area-inset-bottom)); color: #fff; font: 14px/1.45 sans-serif; }
.lightbox-tools a { color: #fff; text-decoration: underline; text-underline-offset: 3px; padding: 8px 4px; }
.lightbox-tools select { font: inherit; color: #fff; background: #342c2c; border: 1px solid #b4a6a6; border-radius: 8px; padding: 8px; }
.lightbox-tools p { flex-basis: 100%; text-align: center; margin: 0; color: #eee; }
.lightbox-caption { min-height: 30px; padding-top: 4px; padding-bottom: 4px; }
.lightbox-stage { overflow: hidden; }
.lightbox-stage img, .lightbox-stage video { max-height: 100%; }
.lightbox-photo { height: 100%; }
@media (max-width: 600px) {
    .lightbox-tools { padding: 4px 14px 68px; font-size: 13px; gap: 5px 12px; }
}


/* Stable masonry: natural card heights, append-only shortest-column placement. */
.gallery-grid { --masonry-columns: 2; --masonry-gap: 8px; }
.gallery-grid.is-masonry {
    position: relative;
    display: block;
    column-count: auto;
}
.gallery-grid.is-masonry > .media-card {
    position: absolute;
    display: block;
    min-width: 0;
    min-height: 0;
    margin: 0;
    aspect-ratio: auto;
}
.gallery-grid.is-masonry > .media-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: contain;
}
@media (min-width: 561px) { .gallery-grid { --masonry-gap: 12px; } }
@media (min-width: 760px) { .gallery-grid { --masonry-columns: 3; } }
@media (min-width: 980px) { .gallery-grid { --masonry-columns: 4; --masonry-gap: 14px; } }
@media (min-width: 1320px) { .gallery-grid { --masonry-columns: 5; } }
