/* AI Prompt Hub performance layer
 * Loaded after the legacy theme to reduce mobile paint/compositing work
 * without changing the established visual layout.
 */
html {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}
body.gallery-body {
    text-rendering: optimizeSpeed;
}
.gallery-screen,
.category-prompts-screen {
    contain: layout style;
}
.gallery-filters {
    scroll-snap-type: x proximity;
    touch-action: pan-x pan-y;
}
.gallery-filter {
    scroll-snap-align: start;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.22) !important;
    transition: transform .14s ease, border-color .14s ease, background .14s ease !important;
}
.gallery-filter.active {
    box-shadow: 0 0 0 1px rgba(151,71,255,.28), 0 10px 22px rgba(0,0,0,.28) !important;
}
.gallery-grid {
    align-items: start;
    contain: layout style;
}
.gallery-card {
    content-visibility: auto;
    contain: layout paint style;
    contain-intrinsic-size: 180px 241px;
    transform: none !important;
    box-shadow: 0 7px 18px rgba(0,0,0,.24) !important;
    transition: transform .12s ease, border-color .12s ease !important;
    touch-action: manipulation;
}
.gallery-card::after {
    background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,.36) 100%) !important;
}
.gallery-img {
    transform: none !important;
    transition: opacity .18s ease !important;
    backface-visibility: hidden;
}
.gallery-card.loaded .gallery-img {
    transform: none !important;
}
.gallery-card.loaded .image-skeleton {
    display: none !important;
}
.gallery-card .image-skeleton {
    animation-duration: 1.8s !important;
}
.views-chip,
.gallery-fav-btn {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.28) !important;
    background: rgba(5,10,20,.72) !important;
}
.gallery-fav-btn {
    transition: transform .12s ease, background .12s ease !important;
}
.gallery-loader {
    contain: content;
}
.app-tabbar {
    transform: translate3d(-50%, 0, 0);
}
@media (hover: hover) and (pointer: fine) {
    .gallery-card:hover {
        transform: translateY(-2px) !important;
    }
}
@media (hover: none), (pointer: coarse) {
    html { scroll-behavior: auto !important; }
    .gallery-card:active { transform: scale(.985) !important; }
    .gallery-filter:hover,
    .tab-link:hover { transform: none !important; }
}
@media (max-width: 760px) {
    .gallery-body .web-main {
        box-shadow: none !important;
    }
    .gallery-card {
        contain-intrinsic-size: 112px 150px;
        box-shadow: 0 5px 12px rgba(0,0,0,.20) !important;
    }
    .gallery-fav-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .views-chip {
        min-height: 25px !important;
        padding: 4px 7px !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
