/* Performance and responsive guardrails shared by the public site. */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

img,
picture,
video,
canvas {
    max-width: 100%;
}

img {
    height: auto;
}

#_ajax_content_ > :is(.hp, .orig-page, .favorites-page, .page-container, .content-wrap),
.hp-section,
.orig-grid,
.favorites-grid,
.nw-wallet-popup,
.pvip-modal,
.pstats-modal {
    content-visibility: auto;
}

.hp-section,
.orig-grid,
.favorites-grid {
    contain-intrinsic-size: 1px 520px;
}

.hp-card,
.orig-card,
.favorite-card,
.gx-game-item,
.gx-w-box {
    contain: layout paint style;
    will-change: transform;
}

.hp-row,
.hp-tabs {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.hp-row {
    scroll-snap-type: x proximity;
}

.hp-card,
.orig-card,
.favorite-card {
    scroll-snap-align: start;
}

.chat__messages {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat__messages[ss-container] {
    padding-top: 20px;
    padding-bottom: 20px;
}

@media (max-width: 1180px) {
    #app > .main main,
    #app > .main > .gx-s > main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-wrap,
    .page-container {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 820px) {
    :root {
        --header-height: 64px;
    }

    #app > .main main,
    #app > .main > .gx-s > main {
        padding: 12px 10px 76px;
    }

    .hp {
        letter-spacing: 0;
    }

    .hp-banners {
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .hp-banner {
        border-radius: 10px !important;
    }

    .hp-banner img {
        aspect-ratio: 16 / 7;
        min-height: 136px !important;
        max-height: 196px !important;
    }

    .hp-tabs {
        width: 100% !important;
        margin-bottom: 22px !important;
    }

    .hp-tab {
        flex: 0 0 auto;
        padding: 9px 14px !important;
        font-size: 13px !important;
    }

    .hp-section {
        margin-bottom: 24px !important;
    }

    .hp-section-head {
        gap: 10px;
    }

    .hp-section-actions {
        gap: 6px !important;
    }

    .hp-see-all {
        padding: 7px 10px !important;
        font-size: 12px !important;
    }

    .hp-nav-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .orig-grid,
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)) !important;
        gap: 12px !important;
    }
}

@media (max-width: 560px) {
    .hp-banners {
        grid-template-columns: 1fr !important;
    }

    .hp-banner img {
        min-height: 128px !important;
    }

    .hp-card {
        flex-basis: 118px !important;
        width: 118px !important;
        height: 166px !important;
        border-radius: 9px !important;
    }

    .hp-card-badge {
        font-size: 8px !important;
        padding: 3px 6px !important;
    }

    .orig-header {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }

    .orig-header-title {
        font-size: 18px !important;
    }

    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 380px) {
    .hp-card {
        flex-basis: 108px !important;
        width: 108px !important;
        height: 151px !important;
    }

    .hp-section-title {
        font-size: 15px !important;
    }
}

@media (prefers-reduced-motion: reduce), (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hp-card:hover,
    .orig-card:hover,
    .favorite-card:hover,
    .gx-game-item:hover,
    .gx-w-box:hover,
    .btn-login:hover,
    .btn-register:hover {
        transform: none !important;
        filter: none !important;
    }

    .hp-card:hover,
    .orig-card:hover,
    .gx-game-item:hover,
    .gx-w-box:hover {
        box-shadow: none !important;
    }
}
