:root {
    --gallery-teal: #27bcb4;
    --gallery-ink: #1a1a1a;
    --gallery-paper: #fffef8;
    --gallery-yellow: #ffe566;
    --gallery-cartoon-shadow: 4px 4px 0 var(--gallery-ink);
}

.gallery-body {
    min-height: 100dvh;
    background-color: var(--gallery-teal);
    background-image:
        radial-gradient(circle at 12px 12px, rgba(255, 255, 255, 0.16) 2px, transparent 2.5px),
        radial-gradient(circle at 36px 40px, rgba(0, 0, 0, 0.06) 2px, transparent 2.5px);
    background-size: 48px 52px;
    font-family: Urbanist, ui-sans-serif, system-ui, sans-serif;
    color: #fff;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--gallery-teal);
    box-shadow: 0 0 48px 48px var(--gallery-teal);
    position: relative;
}

.gallery-title {
    font-family: "Passion One", sans-serif;
    color: #fff;
    font-size: clamp(2.4rem, 8vw, 5rem);
    line-height: 0.95;
    text-shadow:
        3px 3px 2px #000,
        -3px 3px 2px #000,
        -3px -3px 0 #000,
        3px -3px 0 #000;
    transform: rotate(-12deg);
    display: inline-block;
}

.gallery-title-sm {
    font-family: "Passion One", sans-serif;
    color: #fff;
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 0.95;
    text-shadow:
        3px 3px 0 #000,
        -2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000;
    transform: rotate(-3deg);
    display: inline-block;
}

.gl-cartoon-label {
    font-family: "Passion One", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: var(--gallery-ink);
}

.gl-cartoon-label--light {
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.gl-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.gl-meta-chip {
    display: inline-block;
    font-family: "Passion One", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--gallery-ink);
    background: var(--gallery-yellow);
    border: 3px solid var(--gallery-ink);
    border-radius: 999px;
    padding: 0.2rem 0.85rem;
    box-shadow: 3px 3px 0 var(--gallery-ink);
    transform: rotate(-1deg);
}

.gl-meta-chip--light {
    background: #fff;
}

.gl-section-head {
    margin: 0 0.75rem 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 12px;
    box-shadow: var(--gallery-cartoon-shadow);
    transform: rotate(-0.5deg);
}

.gl-section-title {
    font-family: "Passion One", sans-serif;
    font-size: 1.15rem;
    color: var(--gallery-ink);
    line-height: 1.1;
}

.gl-section-code {
    font-family: "Passion One", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #2d6a66;
    margin-top: 0.15rem;
}

.gl-section-count {
    font-family: "Passion One", sans-serif;
    font-size: 0.9rem;
    color: var(--gallery-ink);
    background: var(--gallery-yellow);
    border: 2px solid var(--gallery-ink);
    border-radius: 999px;
    padding: 0.15rem 0.65rem;
    box-shadow: 2px 2px 0 var(--gallery-ink);
    white-space: nowrap;
}

.gl-empty-bubble {
    font-family: "Passion One", sans-serif;
    font-size: 1.35rem;
    color: var(--gallery-ink);
    background: #fff;
    border: 4px solid var(--gallery-ink);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 6px 6px 0 var(--gallery-ink);
    transform: rotate(-2deg);
    max-width: 20rem;
}

.gl-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-family: "Passion One", sans-serif;
    font-size: 2rem;
    line-height: 1;
    color: var(--gallery-ink);
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 50%;
    box-shadow: 3px 3px 0 var(--gallery-ink);
    text-decoration: none;
    transition: transform 150ms ease;
}

.gl-close-btn:hover {
    transform: scale(1.06) rotate(4deg);
}

.gl-btn-cartoon {
    display: inline-block;
    font-family: "Passion One", sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    color: var(--gallery-ink);
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    box-shadow: 3px 3px 0 var(--gallery-ink);
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.gl-btn-cartoon:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--gallery-ink);
}

.gl-btn-cartoon:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--gallery-ink);
}

.gl-btn-cartoon--primary {
    background: var(--gallery-yellow);
}

.gl-btn-cartoon--ghost {
    background: transparent;
    color: #fff;
    border-color: #fff;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
}

.gl-btn-cartoon:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.gl-btn-cartoon--block {
    display: block;
    width: 100%;
    text-align: center;
}

.gl-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 0.25rem 0;
    padding: 0 0.5rem 7rem;
}

.gl-frame {
    display: inline-block;
    min-height: 340px;
    padding: 0.75rem;
    position: relative;
    z-index: 0;
}

.gl-frame.is-picked {
    z-index: 2;
}

.gl-polaroid-wrap {
    position: relative;
    width: fit-content;
    margin: auto;
    transition: transform 350ms;
}

.gl-frame.is-picked .gl-polaroid-wrap {
    transform: rotate(0deg) scale(1.18) !important;
}

.gl-polaroid {
    background: var(--gallery-paper);
    width: fit-content;
    margin: auto;
    border: 4px solid var(--gallery-ink);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    box-shadow: 6px 6px 0 var(--gallery-ink);
    padding: 10px 10px 0;
    transition: box-shadow 220ms ease, border-color 220ms ease;
}

.gl-frame.is-picked .gl-polaroid {
    transform: none;
    border-color: var(--gallery-yellow);
    box-shadow:
        6px 6px 0 var(--gallery-ink),
        0 0 0 3px var(--gallery-yellow);
}

.gl-thumb-frame {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    border: 3px solid var(--gallery-ink);
    border-radius: 8px;
    overflow: hidden;
    background: #ddd6cb;
    line-height: 0;
}

.gl-polaroid img,
.gl-polaroid video {
    max-width: 300px;
    max-height: 300px;
    margin: 0;
    display: block;
    pointer-events: none;
    object-fit: cover;
    width: 100%;
}

.gl-grid.is-solo .gl-polaroid img,
.gl-grid.is-solo .gl-polaroid video {
    max-width: 480px;
    max-height: 480px;
}

.gl-polaroid-caption {
    display: block;
    font-family: "Passion One", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: var(--gallery-ink);
    text-align: center;
    padding: 0.55rem 0.35rem 0.65rem;
    min-height: 2.35rem;
    line-height: 1.1;
}

.gl-frame.is-picked .gl-polaroid-caption {
    color: #9a6b00;
}

.gl-badge {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Passion One", sans-serif;
    font-size: clamp(2.2rem, 9vw, 3.25rem);
    letter-spacing: 0.1em;
    color: #fff;
    text-shadow:
        3px 3px 0 #000,
        -2px 2px 0 #000,
        -2px -2px 0 #000,
        2px -2px 0 #000;
    pointer-events: none;
}

.gl-badge::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

.gl-tick {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    z-index: 5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.gl-tick--indicator {
    pointer-events: none;
}

.gl-tick-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #1a1a1a;
    box-shadow: 4px 4px 0 #1a1a1a;
    transform: scale(0.92) rotate(-10deg);
    transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.gl-tick--checkbox .gl-tick-bubble:hover {
    transform: scale(0.98) rotate(-4deg);
}

.gl-tick-input:checked + .gl-tick-bubble,
.gl-tick-bubble.is-on {
    background: #ffe566;
    transform: scale(1.08) rotate(4deg);
    box-shadow: 5px 5px 0 #1a1a1a;
}

.gl-tick-mark {
    font-family: "Passion One", sans-serif;
    font-size: 2.15rem;
    line-height: 1;
    color: #1a1a1a;
    opacity: 0;
    transform: scale(0.2) rotate(-20deg);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gl-tick-input:checked + .gl-tick-bubble .gl-tick-mark,
.gl-tick-bubble.is-on .gl-tick-mark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

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

.gl-frame.is-picked .gl-tick--indicator .gl-tick-bubble {
    animation: gl-tick-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gl-tick-pop {
    0% {
        transform: scale(0.4) rotate(-18deg);
    }
    70% {
        transform: scale(1.15) rotate(6deg);
    }
    100% {
        transform: scale(1.08) rotate(4deg);
    }
}

.gl-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

.gl-toolbar-inner {
    margin: auto;
    width: 300px;
    text-align: center;
    transition: transform 300ms;
}

.gl-toolbar.is-hidden .gl-toolbar-inner {
    transform: translateY(95%);
    pointer-events: none;
}

.gl-icon {
    display: inline-block;
    width: 82px;
    height: 82px;
    text-decoration: none;
    background-repeat: no-repeat;
    background-size: contain;
}

.gl-icon-view {
    background-image: url("/assets/gallery/view-1.svg");
}

.gl-icon-view:hover {
    background-image: url("/assets/gallery/view-2.svg");
}

.gl-icon-view:active {
    background-image: url("/assets/gallery/view-3.svg");
}

.gl-icon-download {
    background-image: url("/assets/gallery/download-1.svg");
}

.gl-icon-download:hover {
    background-image: url("/assets/gallery/download-2.svg");
}

.gl-icon-download:active {
    background-image: url("/assets/gallery/download-3.svg");
}

.gl-hint {
    pointer-events: none;
    padding: 0 1rem calc(5.5rem + env(safe-area-inset-bottom));
    transition: opacity 500ms;
}

.gl-hint-bubble {
    display: inline-block;
    font-family: "Passion One", sans-serif;
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: var(--gallery-ink);
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 16px;
    padding: 0.65rem 1.1rem;
    box-shadow: 4px 4px 0 var(--gallery-ink);
    transform: rotate(-1deg);
    max-width: 22rem;
}

.gl-viewer-counter {
    font-family: "Passion One", sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: var(--gallery-ink);
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 999px;
    padding: 0.25rem 0.9rem;
    box-shadow: 3px 3px 0 var(--gallery-ink);
}

.gl-viewer-download {
    display: inline-block;
    font-family: "Passion One", sans-serif;
    font-size: 1.65rem;
    letter-spacing: 0.04em;
    color: var(--gallery-ink);
    background: var(--gallery-yellow);
    border: 4px solid var(--gallery-ink);
    border-radius: 999px;
    padding: 0.45rem 1.35rem;
    box-shadow: 4px 4px 0 var(--gallery-ink);
    text-decoration: none;
    transition: transform 150ms ease;
}

.gl-viewer-download:hover {
    transform: scale(1.04) rotate(-2deg);
}

.gl-viewer-note {
    font-family: "Passion One", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 0.65rem;
}

.gl-viewer {
    background: rgba(0, 0, 0, 0.78);
}

.gl-entry-card {
    background: #fff;
    border: 4px solid var(--gallery-ink);
    border-radius: 14px;
    box-shadow: 5px 5px 0 var(--gallery-ink);
}

.gl-entry-copy {
    font-family: Urbanist, ui-sans-serif, system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.gl-entry-divider {
    font-family: "Passion One", sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    color: #fff;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.gl-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    background: #fff;
    border: 3px solid var(--gallery-ink);
    border-radius: 999px;
    box-shadow: 3px 3px 0 var(--gallery-ink);
}

.gl-lang-toggle-link {
    display: inline-block;
    font-family: "Passion One", sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--gallery-ink);
    text-decoration: none;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    line-height: 1;
    transition: transform 150ms ease, background 150ms ease;
}

.gl-lang-toggle-link:hover {
    transform: scale(1.05);
}

.gl-lang-toggle-link.is-active {
    background: var(--gallery-yellow);
    box-shadow: inset 0 0 0 2px var(--gallery-ink);
}

@media (max-width: 992px) {
    .gallery-shell {
        max-width: 100vw;
        overflow-x: hidden;
        box-shadow: none;
    }

    .gl-frame {
        margin-bottom: 1rem;
    }
}
