.pswp .pswp__custom-caption {
    position: fixed;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: none;
    opacity: 0;
    visibility: hidden;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: var(--caption-size, 14px);
    line-height: 1.4;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.pswp .pswp__custom-caption.is-positioned {
    opacity: 1;
    visibility: visible;
}

.pswp .pswp__button--nintenduo-zoom {
    color: var(--pswp-icon-color);
    text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
}

.pswp .pswp__button--nintenduo-zoom .pswp__icn {
    fill: var(--pswp-icon-color);
    color: var(--pswp-icon-color-secondary);
}

.pswp .pswp__custom-thumbs {
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 10001;
    width: min(960px, calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.pswp .pswp__custom-thumbs-track {
    display: flex;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: contain;
    scroll-behavior: auto;
    width: max-content;
    max-width: 100%;
    touch-action: pan-x;
    pointer-events: auto;
}

.pswp .pswp__custom-thumbs-track.has-overflow {
    justify-content: flex-start;
    width: 100%;
}

.pswp .pswp__custom-thumb {
    flex: 0 0 auto;
    width: 76px;
    height: 44px;
    padding: 2px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.18);
    opacity: 0.72;
    overflow: hidden;
    scroll-snap-align: center;
}

.pswp .pswp__custom-thumb img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 4px;
}

.pswp .pswp__custom-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pswp .pswp__custom-thumb.is-active,
.pswp .pswp__custom-thumb.is-preview {
    opacity: 1;
    background: var(
        --nintenduo-gallery-thumb-gradient,
        linear-gradient(135deg, #ff2222 0%, #ff7f1f 45%, #0082fc 100%)
    );
}

.pswp .pswp__custom-thumb:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    opacity: 1;
}

@media (max-width: 767px) {
    .pswp .pswp__custom-thumb {
        width: 64px;
        height: 38px;
    }
}

.pswp .pswp__video-wrapper,
.pswp .pswp__embed-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.pswp .pswp__video,
.pswp .pswp__embed-iframe {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border: 0;
    background: #000;
}

.nintenduo-pswp-embed-container {
    position: relative;
}

.nintenduo-pswp-embed-trigger {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    border: 0;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.nintenduo-pswp-embed-trigger:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .pswp .pswp__custom-thumb:hover {
        opacity: 0.9;
        transform: translateY(-1px);
    }

    .nintenduo-pswp-embed-trigger:hover {
        background: rgba(0, 0, 0, 0.9);
    }
}
