:root {
    --bg: #0d0a10;
    --card: #1b151f;
    --card2: #241b27;
    --border: #3b2c3d;
    --text: #fff7ed;
    --muted: #b5a8b7;
    --orange: #ff7518;
    --gold: #ffb000;
    --purple: #8d5cff;
    --green: #52d273;
    --red: #ff5264;
    --shadow: 0 18px 55px #0008
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: radial-gradient(circle at 80% 0, #281528, transparent 32%), var(--bg);
    color: var(--text);
    font: 15px/1.55 Segoe UI, Arial, sans-serif;
    min-height: 100vh
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .06;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 32px 32px
}

.topbar {
    height: 74px;
    border-bottom: 1px solid var(--border);
    background: #0d0a10dd;
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(20px, calc((100vw - 1180px)/2));
    position: sticky;
    top: 0;
    z-index: 20
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px
}

.brand strong {
    display: block;
    letter-spacing: .08em
}

.brand span {
    display: block;
    font-size: 11px;
    color: var(--muted)
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #ff9b31, #d94d00);
    border-radius: 12px
}

.admin-link {
    color: var(--muted);
    text-decoration: none
}

.container {
    width: min(1180px, calc(100% - 36px));
    margin: 34px auto 70px
}

.hero {
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(110deg, #171018, #2a1720);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    box-shadow: var(--shadow)
}

.hero-copy {
    padding: 64px 60px
}

.eyebrow,
.section-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
    color: #ff9b4a
}

.hero h1 {
    font-size: clamp(42px, 6vw, 72px);
    line-height: .98;
    margin: 15px 0 20px;
    letter-spacing: -.045em
}

.hero h1 span {
    color: var(--orange)
}

.hero p {
    max-width: 560px;
    color: var(--muted);
    font-size: 17px
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px
}

.btn {
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    padding: 12px 17px;
    border-radius: 11px;
    font-weight: 750;
    cursor: pointer
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), #e94f0b);
    border: 0
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px
}

.btn-danger {
    color: #ff8b97;
    background: #ff52641a
}

.full {
    width: 100%
}

.status-pill {
    display: inline-flex;
    color: #8bf0a5;
    background: #52d27314;
    border: 1px solid #52d27340;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750
}

.status-pill.closed {
    color: #ff8a8a;
    background: #ff525214;
    border: 1px solid #ff525240;
}

.hero-art {
    position: relative;
    background: #17101e
}

.moon {
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: #ffdf8a;
    right: 85px;
    top: 46px;
    box-shadow: 0 0 70px #ffb0004d
}

.bat {
    position: absolute;
    font-size: 34px;
    opacity: .75
}

.bat-a {
    left: 70px;
    top: 58px
}

.bat-b {
    right: 38px;
    top: 150px
}

.pumpkin-art {
    position: absolute;
    width: 240px;
    height: 175px;
    left: 50%;
    bottom: 62px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 38%, #ff9a25 0 45%, #e55a0b 72%);
    border-radius: 48% 48% 43% 43%;
    box-shadow: inset 20px -15px 30px #70220059, 0 25px 45px #0007
}

.pumpkin-art:before {
    content: "";
    position: absolute;
    left: 50%;
    top: -22px;
    width: 30px;
    height: 35px;
    border-radius: 9px;
    background: #56702a;
    transform: translateX(-50%)
}

.pumpkin-art span {
    position: absolute;
    inset: 48px 0 auto;
    text-align: center;
    font-size: 68px;
    color: #1a0c12;
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: #0a080d
}

.countdown-card {
    margin-top: 20px;
    padding: 22px 25px;
    border: 1px solid var(--border);
    background: #1b151fe8;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px
}

.countdown-card h2 {
    font-size: 16px;
    margin: 5px 0
}

.countdown {
    display: flex;
    gap: 9px
}

.countdown>div {
    min-width: 70px;
    padding: 9px 10px;
    text-align: center;
    background: #100d13;
    border: 1px solid var(--border);
    border-radius: 11px
}

.countdown b {
    display: block;
    font-size: 25px;
    color: var(--gold)
}

.countdown small {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase
}

.gallery-section {
    margin-top: 48px
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px
}

.section-heading h2,
.panel h2 {
    font-size: 27px;
    margin: 5px 0
}

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

.tools input,
input,
textarea {
    border: 1px solid var(--border);
    background: #100c13;
    color: var(--text);
    padding: 11px 12px;
    border-radius: 10px;
    outline: none;
    font: inherit
}

.tools input {
    width: 235px
}

.entry-count {
    color: var(--muted);
    font-size: 12px
}

.notice {
    margin: 18px 0 20px;
    padding: 12px 15px;
    border: 1px solid #453347;
    background: #8d5cff12;
    border-radius: 12px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    font-size: 12px
}

.notice strong {
    color: var(--text)
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px
}

.entry-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 17px;
    overflow: hidden;
    box-shadow: 0 9px 30px #0003
}

.entry-photo {
    aspect-ratio: 4/3;
    background: #100b12;
    cursor: zoom-in;
    overflow: hidden
}

.entry-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.entry-body {
    padding: 15px
}

.entry-body h3 {
    margin: 0 0 3px;
    font-size: 17px
}

.contestant {
    color: #ff9b4a;
    font-size: 12px
}

.description {
    color: var(--muted);
    font-size: 12px;
    min-height: 38px
}

.vote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 12px
}

.vote-count {
    font-size: 12px;
    color: var(--muted)
}

.vote-count strong {
    color: var(--gold);
    font-size: 18px;
    margin-right: 3px
}

.vote-btn.voted {
    background: #52d2731f;
    color: #8bf0a5
}

.vote-btn:disabled {
    cursor: not-allowed;
    opacity: .55
}

.empty {
    text-align: center;
    padding: 55px;
    color: var(--muted)
}

footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    color: #817584;
    font-size: 11px
}

.modal[hidden] {
    display: none
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: #000b;
    backdrop-filter: blur(5px)
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #1a141c;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 27px
}

.modal-card.small {
    width: min(430px, 100%)
}

.modal-card h2 {
    margin: 7px 0
}

.modal-card p {
    color: var(--muted);
    font-size: 13px
}

.modal-card form {
    display: grid;
    gap: 15px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

label {
    display: grid;
    gap: 7px;
    color: #d8ceda;
    font-size: 12px;
    font-weight: 700
}

textarea {
    min-height: 90px;
    resize: vertical
}

.close {
    position: absolute;
    right: 15px;
    top: 11px;
    border: 0;
    background: none;
    color: #aa9dab;
    font-size: 29px;
    cursor: pointer
}

.demo-code {
    padding: 10px;
    margin: 10px 0;
    background: #100c13;
    border: 1px dashed #664e6a;
    border-radius: 9px;
    text-align: center;
    color: var(--muted)
}

.demo-code strong {
    color: var(--gold);
    font-size: 19px
}

.demo-note {
    font-size: 10px !important;
    color: #857987 !important
}

.lightbox-card {
    position: relative;
    z-index: 1;
    max-width: 94vw;
    max-height: 92vh;
    display: grid;
    place-items: center
}

.lightbox-card img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 12px
}

.light-nav {
    position: absolute;
    z-index: 3;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #67576b;
    background: #0f0a12cc;
    color: #fff;
    font-size: 30px;
    cursor: pointer
}

.light-nav.prev {
    left: -55px
}

.light-nav.next {
    right: -55px
}

.light-info {
    text-align: center;
    background: #140e17eb;
    padding: 10px 20px;
    border-radius: 10px;
    margin-top: 10px
}

.light-info h3 {
    margin: 0;
    font-size: 16px
}

.light-info p {
    margin: 2px 0;
    color: var(--muted);
    font-size: 11px
}

.toast {
    position: fixed;
    z-index: 200;
    right: 22px;
    bottom: 22px;
    max-width: 360px;
    padding: 12px 15px;
    border: 1px solid #5d4b61;
    background: #1d1720;
    border-radius: 11px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: .2s
}

.toast.show {
    transform: none;
    opacity: 1
}

@media(max-width:850px) {
    .hero {
        grid-template-columns: 1fr
    }

    .hero-art {
        height: 230px
    }

    .hero-copy {
        padding: 43px 32px
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr)
    }

    .countdown-card,
    .section-heading {
        align-items: flex-start;
        flex-direction: column
    }

    .tools {
        width: 100%
    }

    .tools input {
        flex: 1;
        width: auto
    }
}

@media(max-width:560px) {
    .container {
        width: calc(100% - 22px);
        margin-top: 15px
    }

    .hero-copy {
        padding: 34px 22px
    }

    .hero h1 {
        font-size: 46px
    }

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

    .gallery {
        grid-template-columns: 1fr
    }

    .countdown {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr)
    }

    .countdown>div {
        min-width: 0
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .light-nav.prev {
        left: 4px
    }

    .light-nav.next {
        right: 4px
    }
}