:root {
    color-scheme: dark;
    --bg: #071411;
    --ink: #f7f4ff;
    --muted: #aab8b3;
    --line: #26463e;
    --panel: #0d1d19;
    --panel-strong: #102820;
    --teal: #18a999;
    --teal-dark: #84e5d8;
    --coral: #ff7068;
    --gold: #d5a642;
    --shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: inherit;
}

.home-page {
    background: var(--bg);
    color: var(--ink);
}

.home-page a {
    text-decoration: none;
}

.home-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 18px clamp(18px, 4vw, 54px);
}

.home-brand {
    color: var(--ink);
    font-weight: 800;
}

.home-login {
    color: rgba(247, 244, 255, 0.68);
    font-weight: 700;
}

.home-shell {
    min-height: calc(100vh - 72px);
    display: grid;
    align-items: center;
    padding: 36px clamp(18px, 4vw, 54px) 96px;
}

.home-hero {
    width: min(980px, 100%);
    display: grid;
    gap: 24px;
}

.home-kicker {
    color: var(--ink);
    font-weight: 800;
    font-size: 1rem;
}

.home-hero h1 {
    max-width: 920px;
    color: #ffffff;
    font-size: 3.2rem;
    line-height: 1.18;
    font-weight: 800;
}

.area-list {
    display: grid;
    gap: 4px;
    width: fit-content;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.area-list li {
    margin: 0;
}

.area-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    width: fit-content;
    color: rgba(247, 244, 255, 0.54);
    font-size: 3rem;
    line-height: 1.18;
    font-weight: 800;
    transition: color 160ms ease, transform 160ms ease;
}

.area-link::before {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 999px;
    background: currentColor;
}

.area-link:hover,
.area-link:focus-visible {
    color: #ffffff;
    transform: translateX(4px);
    outline: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 20, 17, 0.92);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-weight: 800;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.nav a,
.nav button {
    color: var(--muted);
    text-decoration: none;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 28px clamp(16px, 4vw, 48px) 64px;
}

.hero {
    display: grid;
    gap: 16px;
    padding: 24px 0 28px;
}

.date-heading {
    color: var(--ink);
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.eyebrow {
    color: var(--coral);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2.1rem, 9vw, 5rem);
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1rem;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

.grid {
    display: grid;
    gap: 14px;
}

.club-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.area-club-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 245px));
    justify-content: start;
}

.event-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.date-grid {
    grid-template-columns: repeat(8, minmax(108px, 1fr));
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.card-link {
    display: grid;
    gap: 8px;
    text-decoration: none;
    min-height: 132px;
}

.club-card-media {
    width: calc(100% + 36px);
    max-width: none;
    aspect-ratio: 16 / 10;
    margin: -18px -18px 10px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    background: var(--panel-strong);
}

.club-card-image,
.club-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.club-card-image {
    object-fit: cover;
}

.club-card-placeholder {
    background:
        linear-gradient(135deg, rgba(24, 169, 153, 0.28), rgba(255, 112, 104, 0.18)),
        var(--panel-strong);
}

.club-grid .card-link h3 {
    width: 100%;
    text-align: center;
}

.club-image-admin {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.club-image-admin .club-card-media {
    width: 100%;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.club-hero-image {
    display: block;
    width: min(620px, 100%);
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.date-card {
    min-height: 142px;
    min-width: 0;
    padding: 14px;
}

.date-number {
    font-weight: 800;
    font-size: 0.98rem;
    line-height: 1.2;
}

.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
    background: var(--panel-strong);
}

.date-card .status {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.status.active,
.status.recent {
    color: var(--teal-dark);
    border-color: rgba(15, 118, 110, 0.35);
}

.status.upcoming {
    color: var(--gold);
    border-color: rgba(185, 130, 34, 0.38);
}

.status.expired,
.status.cancelled {
    color: var(--coral);
    border-color: rgba(217, 79, 69, 0.35);
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--teal);
    background: var(--teal);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: transparent;
    color: var(--teal-dark);
}

.button.danger {
    background: var(--coral);
    border-color: var(--coral);
}

.button[disabled],
button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.section {
    margin-top: 34px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section .club-grid {
    margin-top: 14px;
}

.flash {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.flash.success {
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--teal-dark);
}

.flash.error {
    border-color: rgba(217, 79, 69, 0.35);
    color: var(--coral);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}

.gallery-button {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 0;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-strong);
    cursor: zoom-in;
}

.gallery-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(3, 9, 8, 0.94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 8px;
}

.lightbox button {
    position: fixed;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
}

.lightbox .close {
    top: 18px;
    right: 18px;
}

.lightbox .prev {
    left: 18px;
}

.lightbox .next {
    right: 18px;
}

.upload-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.upload-dialog {
    width: min(420px, calc(100% - 32px));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: var(--panel);
    color: var(--ink);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.upload-dialog::backdrop {
    background: rgba(3, 9, 8, 0.64);
}

.upload-dialog-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.upload-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.icon-button {
    min-width: 40px;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.upload-choice-form {
    display: grid;
    gap: 14px;
}

.upload-choice-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.upload-choice-button {
    min-height: 56px;
}

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

.upload-zone {
    display: grid;
    gap: 16px;
    border: 2px dashed var(--line);
    border-radius: 8px;
    padding: 24px;
    background: var(--panel);
}

input,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--panel-strong);
    color: var(--ink);
    font: inherit;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.form-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 760px) {
    .form-grid.two {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid.three {
        grid-template-columns: repeat(3, 1fr);
    }
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.86rem;
}

.empty {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(16, 40, 32, 0.72);
    color: var(--muted);
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    min-height: 78px;
    margin-top: 12px;
}

.photo-strip span {
    display: block;
    min-height: 78px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.78), rgba(247, 244, 255, 0.15)),
        linear-gradient(45deg, #111f1b, #d94f45 55%, #b98222);
}

.photo-strip span:nth-child(2) {
    background:
        linear-gradient(135deg, rgba(7, 20, 17, 0.72), rgba(247, 244, 255, 0.1)),
        linear-gradient(45deg, #5f8d77, #f2c879);
}

.photo-strip span:nth-child(3) {
    background:
        linear-gradient(135deg, rgba(217, 79, 69, 0.75), rgba(247, 244, 255, 0.12)),
        linear-gradient(45deg, #101b19, #0f766e);
}

.photo-strip span:nth-child(4) {
    background:
        linear-gradient(135deg, rgba(185, 130, 34, 0.7), rgba(247, 244, 255, 0.16)),
        linear-gradient(45deg, #193229, #d5a642);
}

.photo-strip span:nth-child(5) {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.64), rgba(247, 244, 255, 0.14)),
        linear-gradient(45deg, #0e1714, #d94f45);
}

@media (max-width: 640px) {
    .home-nav {
        min-height: 64px;
    }

    .home-shell {
        min-height: calc(100vh - 64px);
        align-items: end;
        padding-bottom: 64px;
    }

    .home-hero {
        gap: 18px;
    }

    .home-hero h1 {
        font-size: 2.25rem;
    }

    .area-link {
        gap: 16px;
        font-size: 2.2rem;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .button,
    button.button {
        width: 100%;
    }

    .actions {
        width: 100%;
    }

    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .date-grid {
        display: flex;
        flex-direction: column-reverse;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .date-card {
        width: 100%;
        min-height: 116px;
    }

    .area-club-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .upload-bar {
        justify-content: stretch;
    }

    .upload-choice-actions {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .home-hero h1 {
        font-size: 4.2rem;
    }

    .area-link {
        font-size: 3.4rem;
    }
}
