@font-face {
    font-family: "Montserrat";
    src: url("../fonts/Montserrat-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --bg: #070b12;
    --panel: #101722;
    --panel-strong: #141e2c;
    --text: #f8fbff;
    --muted: #aab7c6;
    --line: rgba(255, 255, 255, 0.12);
    --primary: #34ade5;
    --primary-strong: #31fcf2;
    --gold: #d3bb73;
    --danger: #ff7676;
    --success: #80f0c7;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    --shell: min(1480px, calc(100% - 48px));
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    min-height: 100vh;
    color: var(--text);
    font-family: "Montserrat", "Segoe UI", sans-serif;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(140deg, #070b12 0%, #111a28 46%, #0d121c 100%);
    background-size: 78px 78px, 78px 78px, auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

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

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

.party-header,
.party-hero,
.gallery-toolbar,
.gallery-form,
.waiting-section,
.party-footer,
.public-feedback {
    width: var(--shell);
    margin-inline: auto;
}

.party-header {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
}

.party-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.party-brand .kfs-logo {
    width: clamp(150px, 18vw, 230px);
    height: clamp(36px, 4vw, 52px);
    object-fit: contain;
}

.party-brand span {
    width: 1px;
    height: 30px;
    background: var(--line);
}

.arena-logo {
    width: clamp(104px, 12vw, 154px);
    max-height: 50px;
    object-fit: contain;
}

.party-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.party-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.party-nav .lang-link {
    color: #06121d;
    background: var(--primary);
    border-color: var(--primary);
}

.party-hero {
    min-height: auto;
    display: block;
    padding: clamp(42px, 8vh, 86px) 0 clamp(36px, 7vh, 78px);
}

.hero-copy {
    max-width: 860px;
}

.kicker {
    color: var(--primary-strong);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 800;
}

.hero-copy h1 {
    margin-top: 14px;
    font-size: clamp(3rem, 7vw, 6.7rem);
    line-height: 0.92;
    letter-spacing: 0;
}

.hero-lead {
    max-width: 650px;
    margin-top: 22px;
    color: #dce7f4;
    font-size: clamp(1.05rem, 1.6vw, 1.32rem);
    line-height: 1.65;
}

.hero-actions {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0 18px;
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: #04111b;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.public-feedback {
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 16px 18px;
    margin-bottom: 22px;
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

.public-feedback.success {
    border-color: rgba(128, 240, 199, 0.45);
    color: var(--success);
}

.public-feedback.error {
    border-color: rgba(255, 118, 118, 0.45);
    color: var(--danger);
}

.gallery-toolbar {
    padding: 0 0 18px;
}

.gallery-toolbar h2,
.waiting-copy h2,
.download-error h1 {
    margin-top: 8px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
}

.gallery-help {
    max-width: 760px;
    margin-top: 12px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.gallery-form {
    padding-bottom: 70px;
}

.selection-bar {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(52, 173, 229, 0.24);
    border-radius: 8px;
    background: rgba(9, 15, 24, 0.88);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

.select-all,
.consent-line {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dce7f4;
    font-weight: 700;
}

.select-all input,
.consent-line input,
.photo-card input {
    accent-color: var(--primary);
}

.selection-count {
    color: var(--muted);
    font-weight: 700;
}

.selection-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.photo-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
}

.photo-select {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: pointer;
}

.photo-select input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: #0b111c;
}

.photo-card.is-selected {
    border-color: var(--primary-strong);
}

.photo-check {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(7, 11, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: transparent;
}

.photo-card.is-selected .photo-check {
    background: var(--primary);
    color: #06121d;
    border-color: var(--primary);
}

.photo-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    position: relative;
    z-index: 4;
}

.photo-card-actions a,
.photo-card-actions button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.055);
    color: #dce7f4;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.photo-card-actions a:first-child,
.photo-card-actions button:first-child {
    border-color: rgba(49, 252, 242, 0.28);
}

body.modal-open {
    overflow: hidden;
}

.photo-modal[hidden] {
    display: none !important;
}

.photo-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 12px;
    padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(3, 7, 13, 0.92);
    backdrop-filter: blur(14px);
}

.photo-modal-figure {
    min-width: 0;
    width: min(100%, 1120px);
    max-height: calc(100vh - 48px);
    justify-self: center;
    display: grid;
    gap: 14px;
}

.photo-modal-figure img {
    width: 100%;
    max-height: calc(100vh - 132px);
    object-fit: contain;
    border-radius: 8px;
    background: #050911;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.photo-modal-figure figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #dce7f4;
    font-weight: 800;
}

.photo-modal-figure figcaption > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-modal-close,
.photo-modal-nav {
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
    background: rgba(255, 255, 255, 0.075);
    cursor: pointer;
}

.photo-modal-close {
    position: absolute;
    z-index: 4;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.photo-modal-nav {
    position: relative;
    z-index: 2;
    width: 56px;
    height: 72px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.photo-modal-nav.is-prev {
    justify-self: end;
}

.photo-modal-nav.is-next {
    justify-self: start;
}

.waiting-section {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.7fr);
    gap: clamp(22px, 4vw, 54px);
    align-items: start;
    padding: 0 0 80px;
}

.waiting-copy p:not(.kicker) {
    margin-top: 18px;
    color: var(--muted);
    line-height: 1.75;
    font-size: 1.06rem;
}

.notify-form {
    display: grid;
    gap: 15px;
    padding: clamp(18px, 3vw, 30px);
    border: 1px solid rgba(52, 173, 229, 0.24);
    border-radius: 8px;
    background: rgba(16, 23, 34, 0.9);
    box-shadow: var(--shadow);
}

.notify-form label:not(.consent-line) {
    display: grid;
    gap: 8px;
}

.notify-form label > span:first-child {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.notify-form input[type="email"] {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    outline: none;
}

.notify-form input[type="email"]:focus {
    border-color: var(--primary);
}

.consent-line {
    align-items: flex-start;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    font-weight: 600;
}

.consent-line input {
    margin-top: 4px;
}

.party-footer {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.party-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.download-error-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.download-error {
    width: min(540px, 100%);
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.download-error p {
    margin: 16px 0 22px;
    color: var(--muted);
    line-height: 1.7;
}

.legal-page {
    width: var(--shell);
    margin: 0 auto;
    padding: 34px 0 74px;
}

.legal-card {
    max-width: 920px;
    padding: clamp(20px, 4vw, 42px);
    border: 1px solid rgba(52, 173, 229, 0.2);
    border-radius: 8px;
    background: rgba(16, 23, 34, 0.92);
    box-shadow: var(--shadow);
}

.legal-card h1 {
    margin: 10px 0 28px;
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    line-height: 1;
}

.legal-card h2 {
    margin: 30px 0 10px;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.legal-card h3 {
    margin: 22px 0 8px;
    color: #e8f4ff;
    font-size: 1rem;
}

.legal-card p,
.legal-card li {
    color: #c8d5e4;
    line-height: 1.75;
}

.legal-card a {
    color: var(--primary-strong);
    word-break: break-word;
}

@media (max-width: 880px) {
    .party-header,
    .waiting-section,
    .party-footer {
        grid-template-columns: 1fr;
    }

    .party-header,
    .party-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .party-hero {
        min-height: auto;
        padding-top: 34px;
    }

    .selection-bar {
        position: static;
        grid-template-columns: 1fr;
    }

    .selection-actions {
        justify-content: stretch;
    }

    .selection-actions .button {
        width: 100%;
    }
}

@media (max-width: 560px) {
    :root {
        --shell: min(100% - 20px, 1480px);
    }

    .party-header {
        min-height: auto;
        gap: 14px;
        padding: 12px 0 10px;
    }

    .party-brand {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .party-brand .kfs-logo {
        width: min(46vw, 168px);
        height: 38px;
    }

    .arena-logo {
        width: min(38vw, 122px);
        max-height: 42px;
    }

    .party-brand span {
        display: none;
    }

    .party-nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .party-nav a {
        justify-content: center;
        min-height: 44px;
        padding: 0 9px;
        font-size: 0.82rem;
    }

    .party-nav a:not(:first-child):not(.lang-link) {
        display: none;
    }

    .party-footer {
        min-height: auto;
        gap: 12px;
        padding: 22px 4px max(34px, calc(env(safe-area-inset-bottom) + 28px));
    }

    .party-footer nav {
        width: 100%;
        gap: 10px 18px;
    }

    .party-footer nav a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .party-hero {
        gap: 22px;
        padding: 24px 0 34px;
    }

    .hero-copy h1 {
        font-size: clamp(2.6rem, 18vw, 4.4rem);
        overflow-wrap: anywhere;
    }

    .hero-lead {
        font-size: 1rem;
        line-height: 1.55;
    }

    .hero-actions {
        margin-top: 22px;
    }

    .gallery-form {
        padding-bottom: 42px;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    .photo-card {
        min-height: auto;
    }

    .photo-card-actions {
        grid-template-columns: 1fr;
    }

    .photo-modal {
        grid-template-columns: 1fr;
        padding: max(64px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
    }

    .photo-modal-figure {
        width: 100%;
        max-height: calc(100vh - 90px);
    }

    .photo-modal-figure img {
        max-height: calc(100vh - 190px);
    }

    .photo-modal-figure figcaption {
        align-items: stretch;
        flex-direction: column;
    }

    .photo-modal-nav {
        position: absolute;
        z-index: 3;
        top: 50%;
        width: 44px;
        height: 58px;
        transform: translateY(-50%);
        background: rgba(3, 7, 13, 0.72);
    }

    .photo-modal-nav.is-prev {
        left: 8px;
    }

    .photo-modal-nav.is-next {
        right: 8px;
    }

    .button {
        width: 100%;
    }
}
