/* Capstar MC — Gallery feature assets.
 * Float layer is position:fixed to the viewport only — it must NEVER affect
 * document height or page overflow (that broke About/Players scroll).
 */

/* ----- Files card UI ----- */
#gallery-card .gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
#gallery-card .gallery-toolbar .gallery-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
}
#gallery-float-toggle {
    flex: 0 0 auto;
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #bae6fd;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
}
#gallery-float-toggle:hover {
    border-color: rgba(125, 211, 252, 0.65);
    background: rgba(56, 189, 248, 0.12);
}
#gallery-float-toggle.is-on {
    border-color: rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
}
#gallery-float-toggle.is-off {
    border-color: rgba(148, 163, 184, 0.35);
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.45);
}
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.55rem;
    min-height: 2.5rem;
    /* Pages instead of a tall scrolling strip */
    overflow: visible;
}
/* Pager above thumbs — stays put when the last page has fewer rows */
#gallery-pager {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 0.55rem;
    margin-bottom: 0.15rem;
    flex-wrap: wrap;
}
#gallery-pager.is-visible {
    display: flex;
}
#gallery-pager .gallery-page-btn {
    flex: 0 0 auto;
    font-size: 0.72rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #bae6fd;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
#gallery-pager .gallery-page-btn:hover:not(:disabled) {
    border-color: rgba(125, 211, 252, 0.65);
    background: rgba(56, 189, 248, 0.12);
}
#gallery-pager .gallery-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
#gallery-pager .gallery-page-label {
    font-size: 0.72rem;
    color: rgba(186, 230, 253, 0.75);
    min-width: 5.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
#gallery-grid .gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: rgba(186, 230, 253, 0.55);
    font-size: 0.78rem;
    padding: 0.75rem 0.25rem;
}
#gallery-grid .gallery-cell {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.22);
    background: rgba(15, 23, 42, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#gallery-grid .gallery-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
#gallery-grid .gallery-cell:hover img {
    transform: scale(1.04);
}
#gallery-grid .gallery-del {
    position: absolute;
    top: 0.28rem;
    right: 0.28rem;
    left: auto;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(251, 113, 133, 0.55);
    background: rgba(127, 29, 29, 0.82);
    color: #fecdd3;
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, width 0.12s ease, background 0.12s ease;
    z-index: 2;
    padding: 0;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.01em;
}
#gallery-grid .gallery-cell:hover .gallery-del,
#gallery-grid .gallery-del:focus,
#gallery-grid .gallery-del.is-confirm {
    opacity: 1;
}
#gallery-grid .gallery-del:hover {
    background: rgba(185, 28, 28, 0.95);
}
/* Second-click confirm: ✕ → “sure?” */
#gallery-grid .gallery-del.is-confirm {
    width: auto;
    min-width: 2.6rem;
    padding: 0 0.4rem;
    font-size: 0.62rem;
    background: rgba(185, 28, 28, 0.95);
    border-color: rgba(253, 164, 175, 0.75);
    color: #fff1f2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
#gallery-status {
    min-height: 1.1rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: rgba(186, 230, 253, 0.7);
}

/* Lightbox — single scroller (page locked while open to avoid double bars) */
#gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(2, 6, 23, 0.88);
    /* Outer shell does not scroll — .gallery-lightbox-scroll does */
    overflow: hidden;
    pointer-events: auto;
    cursor: zoom-out;
}
#gallery-lightbox.is-open {
    display: block;
}
#gallery-lightbox[hidden] {
    display: none !important;
}
/* Image + meta stack — date top-left, credit top-right, both above the photo */
#gallery-lightbox .gallery-lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 auto;
    max-width: 100%;
}
#gallery-lightbox .gallery-lightbox-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin: 0 0 0.45rem 0;
    padding: 0 0.1rem;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
}
#gallery-lightbox .gallery-lightbox-taken {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.3;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
}
#gallery-lightbox .gallery-lightbox-taken:empty {
    /* spacer when no date — keeps credit pushed right */
    flex: 1 1 auto;
}
#gallery-lightbox .gallery-lightbox-taken .glt-label {
    color: rgba(255, 255, 255, 0.52);
    font-weight: 500;
}
#gallery-lightbox .gallery-lightbox-taken .glt-date {
    color: #ffffff;
    font-weight: 650;
    letter-spacing: 0.01em;
}
#gallery-lightbox .gallery-lightbox-credit {
    flex: 0 0 auto;
    margin: 0 0 0 auto; /* always hug the right edge of the image */
    padding: 0;
    font-size: 0.8rem;
    line-height: 1.3;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
    text-align: right;
    white-space: nowrap;
}
#gallery-lightbox .gallery-lightbox-credit .glc-label {
    color: rgba(255, 255, 255, 0.52);
    font-weight: 500;
}
#gallery-lightbox .gallery-lightbox-credit .glc-name {
    color: #ffffff;
    font-weight: 650;
    letter-spacing: 0.01em;
}
/* Kill document scroll while lightbox is open (no twin bars).
   Keep scrollbar-gutter: stable (from panel_shell) — switching to auto removed the
   reserved track and shifted the whole page sideways when opening an image. */
html:has(body.gallery-lightbox-open),
body.gallery-lightbox-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}
html:has(body.gallery-lightbox-open) {
    scrollbar-gutter: stable !important;
}

/* One scrollport for pan when zoomed */
#gallery-lightbox .gallery-lightbox-scroll {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
    /* Subtle dark chrome (site UI), not OS-white and not bright sky-blue */
    scrollbar-width: thin;
    scrollbar-color: #475569 #0f172a;
}
#gallery-lightbox .gallery-lightbox-scroll::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
#gallery-lightbox .gallery-lightbox-scroll::-webkit-scrollbar-corner {
    background: #0f172a;
}
#gallery-lightbox .gallery-lightbox-scroll::-webkit-scrollbar-track {
    background: #0f172a;
}
#gallery-lightbox .gallery-lightbox-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 6px;
    border: 2px solid #0f172a;
    background-clip: padding-box;
    min-height: 32px;
}
#gallery-lightbox .gallery-lightbox-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    border: 2px solid #0f172a;
    background-clip: padding-box;
}

#gallery-lightbox img {
    display: block;
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    object-fit: contain;
    /* Zoom-in only when hovering the photo itself */
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: auto;
    flex: 0 0 auto;
    /* No size transition — breaks click-to-center if layout is mid-animation */
    transition: none;
    transform-origin: center center;
}
/* Zoomed: natural pixel size; pan via the scrollport */
#gallery-lightbox img.is-zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}
/* When zoomed, figure grows with the image so credit stays on its top-right */
#gallery-lightbox.is-zoomed-view .gallery-lightbox-figure {
    width: max-content;
    max-width: none;
}
/*
 * Zoomed: flex-start + half-viewport padding so ANY click point (including
 * image corners) can be scrolled to the geometric center of the view.
 */
#gallery-lightbox.is-zoomed-view .gallery-lightbox-scroll {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 50vh 50vw;
    cursor: default;
}
#gallery-lightbox.is-zoomed-view .gallery-lightbox-scroll:active {
    cursor: grabbing;
}

/*
 * FIXED viewport layer — zero effect on document scroll height.
 * Lives inside .app-root so stacking can be:
 *   content (default) < float (25) < sticky Navigate (40) < status bar (50)
 * Host/stage/wrap are pointer-events:none — only the img captures hover/click,
 * so empty space still reaches buttons/cards underneath.
 * overflow:visible so images slide under the status bar (no hard clip).
 */
/* Mobile: no floating gallery images at all */
@media (max-width: 768px) {
    #gallery-float-host,
    #gallery-float-toggle {
        display: none !important;
    }
    body.gallery-float-mobile #gallery-float-host {
        display: none !important;
    }
}

#gallery-float-host.gallery-float-host {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    /* Above page cards, under sticky nav (40) and status bar (50) */
    z-index: 25;
    pointer-events: none;
    overflow: visible;
    /* No opacity/filter transition — lightbox dim must snap, not ease */
    transition: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
#gallery-float-host.is-off,
body.gallery-float-off #gallery-float-host {
    display: none !important;
}

/* Lightbox open: dim floaters instantly (no gradual fade) */
body.gallery-lightbox-open #gallery-float-host {
    opacity: 0.22;
    filter: brightness(0.55) saturate(0.85);
    pointer-events: none !important;
    transition: none !important;
}
body.gallery-lightbox-open #gallery-float-host .gallery-float-img,
body.gallery-lightbox-open #gallery-float-host .gallery-float-par,
body.gallery-lightbox-open #gallery-float-host .gallery-float-wrap {
    pointer-events: none !important;
    /* Kill per-image filter/opacity transitions so dim/restore is a snap */
    transition: none !important;
}

.gallery-float-stage {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

/*
 * Liquid depth: --depth 0..1 (near), --far 1-depth, --liquid ~0.48..1.0.
 * Theme tints match .bg-aero layers. Colors interpolate on site switch
 * (0.9s — same as .bg-aero .bg-layer opacity crossfade).
 */
@property --liquid-c1 {
    syntax: '<color>';
    inherits: true;
    initial-value: rgba(56, 189, 248, 0.62);
}
@property --liquid-c2 {
    syntax: '<color>';
    inherits: true;
    initial-value: rgba(14, 116, 144, 0.5);
}
@property --liquid-c3 {
    syntax: '<color>';
    inherits: true;
    initial-value: rgba(8, 47, 73, 0.55);
}

.gallery-float-wrap {
    /* top:0 origin; JS sets transform: translate3d(0, screenY, 0) each rAF
     * screenY = project(worldY - rise, depth, scrollY) — multiplane camera */
    position: absolute;
    top: 0;
    left: 0;
    bottom: auto;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    --depth: 0.7;
    --far: 0.3;
    --liquid: 0.2;
    /* Default = dashboard teal/sky */
    --liquid-c1: rgba(56, 189, 248, 0.62);
    --liquid-c2: rgba(14, 116, 144, 0.5);
    --liquid-c3: rgba(8, 47, 73, 0.55);
    /* Match bg-aero layer crossfade */
    transition:
        --liquid-c1 0.9s ease,
        --liquid-c2 0.9s ease,
        --liquid-c3 0.9s ease;
    box-sizing: border-box;
    will-change: transform;
}

/* Theme liquid tints — sampled from each .bg-layer-* sky */
body.theme-dashboard .gallery-float-wrap {
    --liquid-c1: rgba(56, 189, 248, 0.62);
    --liquid-c2: rgba(14, 116, 144, 0.5);
    --liquid-c3: rgba(15, 23, 42, 0.55);
}
body.theme-players .gallery-float-wrap {
    --liquid-c1: rgba(192, 132, 252, 0.58);
    --liquid-c2: rgba(109, 40, 217, 0.48);
    --liquid-c3: rgba(30, 27, 75, 0.55);
}
body.theme-console .gallery-float-wrap {
    --liquid-c1: rgba(74, 222, 128, 0.55);
    --liquid-c2: rgba(22, 101, 52, 0.5);
    --liquid-c3: rgba(5, 46, 22, 0.55);
}
/* Files: bright yellow wash over amber/brown base (matches .bg-layer-files) */
body.theme-files .gallery-float-wrap {
    --liquid-c1: rgba(254, 240, 138, 0.7);
    --liquid-c2: rgba(245, 158, 11, 0.58);
    --liquid-c3: rgba(69, 26, 3, 0.62);
}
/* Settings: mostly cool water (yellow is only a thin top sky band) */
body.theme-settings .gallery-float-wrap {
    --liquid-c1: rgba(125, 211, 252, 0.5);
    --liquid-c2: rgba(56, 189, 248, 0.45);
    --liquid-c3: rgba(7, 20, 34, 0.58);
}
/* About: blue water only — no yellow/gold wash on floaters */
body.theme-about .gallery-float-wrap {
    --liquid-c1: rgba(125, 211, 252, 0.55);
    --liquid-c2: rgba(56, 189, 248, 0.48);
    --liquid-c3: rgba(12, 40, 80, 0.55);
}
body.theme-advanced .gallery-float-wrap {
    --liquid-c1: rgba(167, 139, 250, 0.58);
    --liquid-c2: rgba(99, 102, 241, 0.48);
    --liquid-c3: rgba(12, 10, 26, 0.55);
}

.gallery-float-wrap.is-pending {
    opacity: 0;
    visibility: hidden;
}
.gallery-float-wrap.is-live {
    opacity: 1;
    visibility: visible;
    /* Motion is JS rAF (scroll projection + rise) — not CSS keyframes */
    animation: none;
}

.gallery-float-par {
    pointer-events: none;
    display: block;
    max-width: 100%;
    position: relative;
    isolation: isolate;
    border-radius: 0.55rem;
    overflow: hidden;
    /* (3) Edge murk: soft inset falloff stronger when far */
    box-shadow:
        inset 0 0 calc(10px + var(--liquid, 0.6) * 26px)
            calc(1px + var(--liquid, 0.6) * 8px)
            color-mix(in srgb, var(--liquid-c3) calc(22% + var(--liquid, 0.6) * 40%), transparent);
}
.gallery-float-par::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    background:
        /* (5) Specular glass sheen — near only (fades with --liquid) */
        linear-gradient(
            155deg,
            rgba(255, 255, 255, calc(0.55 * (1 - var(--liquid, 0.6)))) 0%,
            rgba(255, 255, 255, calc(0.12 * (1 - var(--liquid, 0.6)))) 26%,
            transparent 46%
        ),
        radial-gradient(120% 90% at 30% 15%, var(--liquid-c1), transparent 55%),
        linear-gradient(165deg, var(--liquid-c1), var(--liquid-c2) 48%, var(--liquid-c3));
    mix-blend-mode: soft-light;
    opacity: calc(0.3 + var(--liquid, 0.6) * 0.28);
    transition: opacity 0.18s ease, background 0.9s ease;
}
/* Extra color wash so images pick up liquid hue at every depth */
.gallery-float-par::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--liquid-c1) 70%, transparent),
        color-mix(in srgb, var(--liquid-c3) 85%, transparent)
    );
    mix-blend-mode: color;
    opacity: calc(0.2 + var(--liquid, 0.6) * 0.28);
    transition: opacity 0.18s ease, background 0.9s ease;
}

.gallery-float-img {
    display: block;
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 42vh;
    object-fit: contain;
    object-position: center center;
    border-radius: 0.55rem;
    pointer-events: auto !important;
    cursor: pointer;
    /* Never select / ghost-drag floaters with the cursor */
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;

    /* (3) Edge softness: center stays solid; far feathers more at rims */
    -webkit-mask-image: radial-gradient(
        ellipse 92% 90% at 50% 48%,
        #000 calc(72% - var(--liquid, 0.6) * 28%),
        transparent 100%
    );
    mask-image: radial-gradient(
        ellipse 92% 90% at 50% 48%,
        #000 calc(72% - var(--liquid, 0.6) * 28%),
        transparent 100%
    );
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    opacity: calc(1 - var(--liquid, 0.6) * 0.08);
    /*
     * (1) Far: lower contrast / flatter midtones (black crush-ish)
     * (8) Far: tiny R/B fringe (underwater CA) via drop-shadow
     * Soft global blur kept mild
     */
    filter:
        blur(calc(0.12px + var(--liquid, 0.6) * 0.42px))
        brightness(calc(1 - var(--liquid, 0.6) * 0.07))
        /* Far: more desaturated (was ~0.14×liquid; now ~0.28×) */
        saturate(calc(1 - var(--liquid, 0.6) * 0.28))
        contrast(calc(1 - var(--liquid, 0.6) * 0.16))
        drop-shadow(
            calc(var(--liquid, 0.6) * 0.7px) 0 0
            rgba(255, 90, 70, calc(var(--liquid, 0.6) * 0.28))
        )
        drop-shadow(
            calc(var(--liquid, 0.6) * -0.7px) 0 0
            rgba(70, 140, 255, calc(var(--liquid, 0.6) * 0.28))
        );
    box-shadow:
        0 8px 28px rgba(0, 0, 0, calc(0.16 + (1 - var(--liquid, 0.6)) * 0.16)),
        /* (5) near: crisp specular rim; far: matte */
        inset 0 1px 0 rgba(255, 255, 255, calc(0.5 * (1 - var(--liquid, 0.6)))),
        inset 0 -10px 18px rgba(0, 0, 0, calc(0.08 + var(--liquid, 0.6) * 0.1)),
        0 0 0 1px rgba(255, 255, 255, calc(0.08 + (1 - var(--liquid, 0.6)) * 0.14));
    transition:
        box-shadow 0.18s ease,
        filter 0.18s ease,
        opacity 0.18s ease,
        transform 0.18s ease,
        -webkit-mask-image 0.18s ease,
        mask-image 0.18s ease;
}

/*
 * Bubble layers sit on the wrap (outside overflow:hidden wash).
 * Ambient layer matches the photo box (inset 0) so % seats cover full width/height.
 * Pop layer is padded outward for hover bursts around the edges.
 */
.gallery-float-bubbles {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    overflow: visible;
}
/* Fade the whole ambient group — not each bubble (keyframes own opacity).
 * (7) Density/visibility scales with nearness: --bubble-vis from JS (0.35–1). */
.gallery-float-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    opacity: var(--bubble-vis, 0.75);
    transition: opacity 0.4s ease;
}
.gallery-float-wrap.is-hovering .gallery-float-ambient {
    opacity: 0;
}
/* Hover pops may sit slightly outside the photo */
.gallery-float-pops {
    position: absolute;
    inset: -20px -16px -12px -16px;
    pointer-events: none;
    overflow: visible;
}
.gallery-float-bubble {
    position: absolute;
    border-radius: 50%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background:
        radial-gradient(circle at 30% 26%,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.35) 38%,
            rgba(186, 230, 253, 0.2) 62%,
            rgba(125, 211, 252, 0.08) 78%,
            transparent 86%);
    box-shadow:
        0 0 4px rgba(186, 230, 253, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.55);
    pointer-events: none;
    will-change: transform, opacity;
}
/* Ambient: slow rise across the full image face */
.gallery-float-bubble.is-ambient {
    animation: gallery-img-bubble linear infinite;
}
/* Hover pop: single play, one synchronized burst (not looping / re-firing) */
.gallery-float-bubble.is-pop {
    animation-name: gallery-bubble-pop;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-delay: 0s;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 0 6px rgba(125, 211, 252, 0.55),
        inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

/* Hover/focus: surface through the liquid so you can aim the click */
.gallery-float-wrap:has(.gallery-float-img:hover) .gallery-float-par,
.gallery-float-wrap:has(.gallery-float-img:focus-visible) .gallery-float-par {
    box-shadow: inset 0 0 0 0 transparent;
}
.gallery-float-wrap:has(.gallery-float-img:hover) .gallery-float-par::before,
.gallery-float-wrap:has(.gallery-float-img:focus-visible) .gallery-float-par::before,
.gallery-float-wrap:has(.gallery-float-img:hover) .gallery-float-par::after,
.gallery-float-wrap:has(.gallery-float-img:focus-visible) .gallery-float-par::after {
    opacity: 0.08;
}
.gallery-float-img:hover,
.gallery-float-img:focus-visible {
    opacity: 1;
    filter: brightness(1.05) saturate(1.05) blur(0);
    transform: scale(1.02);
    -webkit-mask-image: none;
    mask-image: none;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.7),
        0 0 0 2px rgba(125, 211, 252, 0.4);
    outline: none;
    z-index: 5;
}

/* Ambient drift — rise distance in px so it crosses the photo, not just bubble height */
@keyframes gallery-img-bubble {
    0% {
        transform: translate3d(0, 4px, 0) scale(0.85);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    75% {
        opacity: 0.45;
    }
    100% {
        transform: translate3d(var(--bx, 0px), calc(-1 * var(--amb-rise, 56px)), 0) scale(1.05);
        opacity: 0;
    }
}

/* One-shot hover pop — smooth fade, no mid-cycle blink */
@keyframes gallery-bubble-pop {
    0% {
        transform: translate3d(0, 0, 0) scale(0.4);
        opacity: 0;
    }
    18% {
        opacity: 0.95;
        transform: translate3d(calc(var(--bx, 0px) * 0.12), -6px, 0) scale(1);
    }
    70% {
        opacity: 0.55;
    }
    100% {
        transform: translate3d(var(--bx, 0px), var(--by, -36px), 0) scale(1.1);
        opacity: 0;
    }
}
