::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4B5563;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

/* Solid bar: backdrop-filter on sticky headers forces costly repaints while scrolling */
.glass {
    background: rgba(26, 34, 53, 0.94);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* Game card overlay: title above MAINKAN / POLA AI (line-clamp fallback for CDN Tailwind) */
.game-card-overlay-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* While scrolling: pause decorative motion (RTP bars + hero dot) */
html.page-scrolling #gamesGrid .rtp-chevron-seg--on {
    animation-play-state: paused;
}

html.page-scrolling .hero-live-pulse {
    animation-play-state: paused;
}

/* Search refresh: keep old cards visible until new data arrives (no empty flash) */
#gamesGrid.games-grid--refreshing {
    opacity: 0.65;
    pointer-events: none;
    filter: saturate(0.9);
    transition: opacity 0.22s ease, filter 0.22s ease;
}

@media (prefers-reduced-motion: reduce) {
    #gamesGrid.games-grid--refreshing {
        transition: none;
    }
}

/* Hero banner: square carousel, drag (mouse) + native scroll (touch) */
.hero-banner-viewport {
    touch-action: manipulation;
}

.hero-banner-scroll {
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.hero-banner-scroll.hero-banner-scroll--dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.hero-banner-slide {
    scroll-snap-align: start;
}

/* Square side = min(slot width, slot height): matches row height with left column, fits remaining width */
.hero-banner-viewport.hero-banner-match {
    width: min(100%, 20rem);
    max-width: 100%;
    aspect-ratio: 1;
    height: auto;
}

/* cqmin needs a sized grid cell; on mobile stack use fixed max width only */
@supports (width: 1cqmin) {
    @media (min-width: 768px) {
        .hero-banner-viewport.hero-banner-match {
            width: min(100%, 100cqmin);
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-banner-scroll {
        scroll-behavior: auto;
        scroll-snap-type: proximity;
    }
}

/* Provider carousel: smooth inertial feel + snap */
.provider-carousel {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}

@media (prefers-reduced-motion: reduce) {
    .provider-carousel {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
}

.provider-carousel-item {
    scroll-snap-align: start;
}

/* Mobile: two equal columns + fixed logo box so images don’t change chip width */
@media (max-width: 767px) {
    #providerScroll {
        gap: 0.75rem;
    }

    #providerScroll .provider-carousel-item {
        flex: 0 0 calc((100% - 0.75rem) / 2);
        max-width: calc((100% - 0.75rem) / 2);
        min-width: 0;
    }

    #providerScroll .provider-logo-box {
        height: 3.25rem;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #providerScroll .provider-logo-box img {
        max-height: 2.5rem;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
}

@media (min-width: 768px) {
    #providerScroll .provider-carousel-item {
        flex: 0 0 auto;
        max-width: none;
    }
}

/* RTP: thick chevron segments with visible gaps (like >>>>) */
/* Inactive chevrons: neutral slate so “off” reads clearly vs tier color */
.rtp-strip.rtp-tier-high {
    --rtp-seg-active: #22c55e;
    --rtp-seg-inactive: rgba(71, 85, 105, 0.55);
    --rtp-track-border: rgba(34, 197, 94, 0.65);
    --rtp-pct-color: #4ade80;
    --rtp-glow: rgba(34, 197, 94, 0.45);
    --rtp-seg-sheen: #86efac;
}

.rtp-strip.rtp-tier-mid {
    --rtp-seg-active: #eab308;
    --rtp-seg-inactive: rgba(71, 85, 105, 0.55);
    --rtp-track-border: rgba(250, 204, 21, 0.65);
    --rtp-pct-color: #facc15;
    --rtp-glow: rgba(250, 204, 21, 0.4);
    --rtp-seg-sheen: #fde047;
}

.rtp-strip.rtp-tier-low {
    --rtp-seg-active: #ef4444;
    --rtp-seg-inactive: rgba(71, 85, 105, 0.55);
    --rtp-track-border: rgba(248, 113, 113, 0.65);
    --rtp-pct-color: #f87171;
    --rtp-glow: rgba(248, 113, 113, 0.4);
    --rtp-seg-sheen: #fca5a5;
}

/*
 * Shimmer: only animate background-position (compositor-friendly).
 * Avoid animating filter() here — with many cards × segments it tanks scroll FPS.
 */
@keyframes rtpShimmerLR {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.rtp-chevron-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
    margin: 0 0.4rem 0.15rem;
    padding: 8px 8px;
    border: 1px solid var(--rtp-track-border);
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.85);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    min-width: 0;
}

/*
 * Interlocking chevron: concave left (notch →), convex right tip.
 * Matches “pushed together they’d mesh” look; small gap separates segments.
 */
.rtp-chevron-seg {
    flex: 1 1 0;
    min-width: 0;
    height: 14px;
    background: var(--rtp-seg-inactive);
    clip-path: polygon(
        0% 0%,
        18% 50%,
        0% 100%,
        78% 100%,
        100% 50%,
        78% 0%
    );
    transition: background 0.2s ease, filter 0.2s ease;
}

.rtp-chevron-seg--on {
    background: linear-gradient(
        100deg,
        var(--rtp-seg-active) 0%,
        var(--rtp-seg-active) 36%,
        var(--rtp-seg-sheen) 50%,
        var(--rtp-seg-active) 64%,
        var(--rtp-seg-active) 100%
    );
    background-size: 260% 100%;
    filter: drop-shadow(0 0 3px var(--rtp-glow));
    animation: rtpShimmerLR 2.35s ease-in-out infinite;
    animation-delay: var(--rtp-sh-delay, 0s);
}

.rtp-value-below {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--rtp-pct-color);
    line-height: 1.2;
    margin-top: 2px;
}

@media (min-width: 768px) {
    .rtp-chevron-track {
        gap: 3px;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        padding: 9px 11px;
    }

    .rtp-chevron-seg {
        height: 16px;
    }

    .rtp-value-below {
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rtp-chevron-seg--on {
        animation: none;
        background: var(--rtp-seg-active);
        filter: drop-shadow(0 0 3px var(--rtp-glow));
    }
}
