:root {
    --chill-orange: #e89c3d;
    --chill-brown: #a35e2d;
    --chill-green: #6ba368;
    --chill-ink: #2b2118;
    --chill-cream: #fff9f2;
}

body {
    color: var(--chill-ink);
}

.navbar-custom {
    background-color: var(--chill-orange);
    padding-top: 1rem;
    padding-bottom: 3rem;
}

.navbar-custom .nav-link,
.navbar-custom .dropdown-toggle {
    color: #fff !important;
}

.navbar-custom .dropdown-menu {
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 12px 28px rgba(103, 58, 28, .22);
}

.navbar-custom .dropdown-item {
    color: #673a1c;
    font-weight: 600;
}

.navbar-custom .dropdown-item:hover,
.navbar-custom .dropdown-item:focus,
.navbar-custom .dropdown-item.active {
    background-color: #fff4e4;
    color: #673a1c;
}

.logo-centered {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 10;
    width: 110px;
    height: 110px;
    transform: translate(-50%, -50%);
}

.contest-main {
    padding-top: 9.5rem;
    min-height: calc(100vh - 64px);
}

.contest-title {
    font-family: 'Cookie', cursive;
    color: var(--chill-brown);
    font-size: clamp(3.3rem, 13vw, 6.5rem);
    line-height: .9;
}

.contest-theme-badge {
    display: inline-block;
    margin-left: .45rem;
    padding: .18rem .55rem;
    border-radius: 8px;
    background: rgba(232, 156, 61, .18);
    color: var(--chill-brown);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1rem, 2.6vw, 1.45rem);
    font-weight: 800;
    line-height: 1.1;
    vertical-align: middle;
}

.contest-card {
    border: 1px solid rgba(163, 94, 45, .16);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(43, 33, 24, .06);
}

.contest-button {
    border: 0;
    background: var(--chill-orange);
    color: #fff;
    font-weight: 700;
}

.contest-button:hover,
.contest-button:focus {
    background: var(--chill-brown);
    color: #fff;
}

.gallery-participation {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.contest-qr-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 8.5rem);
    align-items: center;
    gap: .65rem;
    padding: .45rem .6rem;
    border: 1px solid rgba(163, 94, 45, .16);
    border-radius: 8px;
    background: #fff;
    color: var(--chill-brown);
    font-weight: 800;
    line-height: 1.05;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(43, 33, 24, .06);
}

.contest-qr-card:hover,
.contest-qr-card:focus {
    color: var(--chill-brown);
    background: #fff9f2;
    outline: none;
}

.contest-qr-card img {
    width: 74px;
    height: 74px;
    display: block;
}

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

.gallery-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #eadfce;
}

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

.gallery-open {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-tile-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    gap: .1rem;
    padding: .55rem .65rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(15, 13, 10, .78) 28%, rgba(15, 13, 10, .88));
    color: #fff;
    text-align: left;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
}

.gallery-tile-info strong,
.gallery-tile-info small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-tile-info strong {
    font-size: .9rem;
}

.gallery-tile-info small {
    font-size: .72rem;
    opacity: .88;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 3vw, 2rem);
    background: rgba(15, 13, 10, .92);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox img {
    max-width: min(100%, 1400px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .38);
}

.gallery-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(0, 0, 0, .42);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
}

.gallery-lightbox-nav {
    position: fixed;
    top: 50%;
    z-index: 5001;
    width: clamp(44px, 8vw, 68px);
    height: clamp(56px, 10vw, 88px);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    background: rgba(0, 0, 0, .32);
    color: #fff;
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: .8;
    transform: translateY(-50%);
}

.gallery-lightbox-prev {
    left: max(1rem, env(safe-area-inset-left));
}

.gallery-lightbox-next {
    right: max(1rem, env(safe-area-inset-right));
}

.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus,
.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus {
    background: rgba(232, 156, 61, .86);
    outline: none;
}

.gallery-lightbox-caption {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
}

.gallery-lightbox-credit {
    font-weight: 700;
    color: #ffbd00;
}

.gallery-lightbox-open {
    overflow: hidden;
}

.kiosk-body {
    overflow: hidden;
    background: #0f0d0a;
}

.kiosk-shell {
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    color: #fff;
    background: #050403;
}

.kiosk-shell.is-fullscreen {
    grid-template-rows: 1fr;
}

.kiosk-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    grid-template-rows: 1fr;
}

.kiosk-shell:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    grid-template-rows: 1fr;
}

.kiosk-shell.is-fullscreen .kiosk-header,
.kiosk-shell.is-fullscreen .kiosk-footer,
.kiosk-shell:fullscreen .kiosk-header,
.kiosk-shell:fullscreen .kiosk-footer,
.kiosk-shell:-webkit-full-screen .kiosk-header,
.kiosk-shell:-webkit-full-screen .kiosk-footer {
    display: none;
}

.kiosk-header,
.kiosk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1.2rem;
    background: rgba(15, 13, 10, .9);
}

.kiosk-header img {
    width: 64px;
    height: 64px;
}

.kiosk-title {
    font-family: 'Cookie', cursive;
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1;
    margin: 0;
    color: #ffbd00;
}

.kiosk-theme-badge {
    display: inline-block;
    margin-left: .55rem;
    padding: .15rem .55rem;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
    background: rgba(232, 156, 61, .18);
    color: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.45rem);
    font-weight: 800;
    line-height: 1.15;
    vertical-align: middle;
}

.kiosk-fullscreen-toggle {
    position: fixed;
    top: max(.7rem, env(safe-area-inset-top));
    right: max(.9rem, env(safe-area-inset-right));
    z-index: 30;
    padding: .45rem .75rem;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 8px;
    background: rgba(15, 13, 10, .72);
    color: #fff;
    font-size: .9rem;
    font-weight: 800;
}

.kiosk-fullscreen-toggle:hover,
.kiosk-fullscreen-toggle:focus {
    background: rgba(232, 156, 61, .9);
    outline: none;
}

.kiosk-shell.is-fullscreen .kiosk-fullscreen-toggle,
.kiosk-shell:fullscreen .kiosk-fullscreen-toggle,
.kiosk-shell:-webkit-full-screen .kiosk-fullscreen-toggle {
    opacity: .32;
}

.kiosk-shell.is-fullscreen .kiosk-fullscreen-toggle:hover,
.kiosk-shell.is-fullscreen .kiosk-fullscreen-toggle:focus,
.kiosk-shell:fullscreen .kiosk-fullscreen-toggle:hover,
.kiosk-shell:fullscreen .kiosk-fullscreen-toggle:focus,
.kiosk-shell:-webkit-full-screen .kiosk-fullscreen-toggle:hover,
.kiosk-shell:-webkit-full-screen .kiosk-fullscreen-toggle:focus {
    opacity: 1;
}

.kiosk-slideshow {
    position: relative;
    overflow: hidden;
    background: #050403;
}

.kiosk-qr-panel {
    position: absolute;
    top: clamp(.8rem, 2vw, 1.4rem);
    left: clamp(.8rem, 2vw, 1.4rem);
    z-index: 8;
    display: grid;
    grid-template-columns: clamp(82px, 10vw, 132px);
    justify-items: center;
    gap: .35rem;
    padding: clamp(.45rem, 1vw, .75rem);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    background: rgba(15, 13, 10, .76);
    color: #fff;
    font-size: clamp(.8rem, 1.15vw, 1.05rem);
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .28);
}

.kiosk-qr-panel img {
    width: clamp(82px, 10vw, 132px);
    height: clamp(82px, 10vw, 132px);
    display: block;
    border-radius: 4px;
    background: #fff;
}

.kiosk-qr-panel:hover,
.kiosk-qr-panel:focus {
    color: #fff;
    background: rgba(232, 156, 61, .9);
    outline: none;
}

.kiosk-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    opacity: 0;
    transform: none;
    transition: opacity 900ms ease;
}

.kiosk-slide.is-active {
    opacity: 1;
    transform: none;
}

.kiosk-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(.7rem, 2vh, 1.2rem);
    width: 100%;
    padding: 0 clamp(1rem, 8vw, 9rem);
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .75);
}

.kiosk-caption-panel {
    display: grid;
    gap: .05rem;
    width: 100%;
    padding: clamp(.45rem, 1vw, .7rem) clamp(.8rem, 2vw, 1.4rem);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: rgba(163, 94, 45, .86);
    box-shadow: 0 16px 45px rgba(0, 0, 0, .28);
}

.kiosk-caption-name {
    color: #ffbd00;
    font-weight: 800;
    font-size: clamp(.9rem, 1.15vw, 1.2rem);
}

.kiosk-caption-text {
    font-family: 'Cookie', cursive;
    font-size: clamp(1.35rem, 2.35vw, 2.7rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.kiosk-caption-meta {
    font-size: clamp(.7rem, .95vw, .95rem);
    opacity: .9;
}

.kiosk-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f4d6ad;
    font-size: clamp(1.4rem, 3vw, 3rem);
}

.network-status {
    min-width: 9rem;
    text-align: right;
    color: #f4d6ad;
}

.admin-photo-card {
    position: relative;
}

.admin-photo-card.is-hidden {
    opacity: .55;
}

.admin-badge-row {
    position: absolute;
    left: .5rem;
    top: .5rem;
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.hide-priority {
    background: #b42318;
    color: #fff;
    border: 0;
    font-weight: 800;
}

.voucher-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: clamp(2rem, 7vw, 4rem);
    letter-spacing: .08em;
}

@media (max-width: 640px) {
    .contest-main {
        padding-top: 8.5rem;
    }

    .navbar-custom {
        padding-bottom: 2.6rem;
    }

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

    .gallery-participation {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .contest-qr-card {
        grid-template-columns: 64px 1fr;
        width: 100%;
    }

    .contest-qr-card img {
        width: 64px;
        height: 64px;
    }

    .kiosk-qr-panel {
        grid-template-columns: 76px;
        font-size: .78rem;
    }

    .kiosk-qr-panel img {
        width: 76px;
        height: 76px;
    }
}
