/* Shared responsive polish for every page that uses the site header. */
:where(img, video, canvas, iframe) { max-width: 100%; }
:where(input, select, textarea, button) { font: inherit; }
:where(input, select, textarea) { min-width: 0; }
:where(pre, code) { overflow-wrap: anywhere; }

/* Keep collection sorting and creation actions paired at every viewport width. */
.collection-toolbar-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    flex: 0 1 390px;
    min-width: max-content;
    gap: 10px;
}
.collection-toolbar-controls select { grid-column: 1; width: 100% !important; min-width: 0 !important; }
.collection-toolbar-controls > .btn:not(.collection-toolbar-clear),
.collection-toolbar-controls > .collection-max-notice { grid-column: 2; white-space: nowrap; }

/* Keep all three Top Users podium cards in one row and let them shrink as needed. */
.users-podium-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(5px, 1.8vw, 18px);
    width: 100%;
    min-width: 0;
}
.users-podium-card {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 270px;
    padding-inline: clamp(5px, 2vw, 18px) !important;
}
.users-podium-info, .users-podium-title, .users-podium-username { min-width: 0; max-width: 100%; }
.users-podium-title, .users-podium-username { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-header { container-type: inline-size; }
@container (max-width: 680px) {
    .profile-external-actions { display: none !important; }
}

@media (max-width: 900px) {
    html { overflow-x: clip; }
    body { overflow-x: clip; }
    main, section, article, .container, .reviews-container { min-width: 0; }
    .container, .reviews-container { width: min(100% - 32px, 100%); }
    .table-responsive, .trending-list-container, .admin-games-list, .ranking-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
    .modal, .modal-content, .collection-modal-box, .market-dialog, .avatar-detail-dialog,
    .playtime-rank-modal, .settings-modal, .dialog-content {
        box-sizing: border-box;
        max-width: min(94vw, 760px);
        max-height: min(88dvh, 900px);
        overflow-y: auto;
    }
    .profile-main-layout, .profile-layout, .profile-content-grid,
    .avatar-detail-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .profile-left-column, .profile-right-column { width: 100%; min-width: 0; }
    .profile-tab-panel { min-width: 0; overflow-wrap: anywhere; }
    .games-grid, .recommended-grid, .all-games-grid, .users-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(190px, 44vw), 1fr)) !important;
    }
    #section-library .all-games-grid {
        grid-template-columns: repeat(var(--effective-games-columns, var(--games-columns, 5)), minmax(min(140px, 100%), 1fr)) !important;
    }
    .market-grid, .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(min(170px, 42vw), 1fr)) !important; }
    #market-panel-all-items .market-grid {
        grid-template-columns: repeat(var(--market-effective-columns, var(--market-columns, 8)), minmax(min(150px, 100%), 1fr)) !important;
    }
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(min(170px, 42vw), 1fr)) !important; }
    .filter-main-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .marketplace-page, .graphics-page, .users-page, .profile-page-container,
    .collection-page-container { max-width: 100%; }
}

@media (max-width: 650px) {
    /* Keep the brand and account controls visible while giving navigation its own scroll row. */
    header {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
    }
    .logo-container { order: 0; flex: 0 0 auto; }
    .logo-container .logo img { height: 40px !important; }
    .user-profile-wrapper { order: 2; flex: 0 0 auto; align-self: center; margin: 0 !important; }
    .header-mobile-account-badge {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .header-mobile-account-badge .header-mobile-account-action {
        display: inline-flex !important;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 10px !important;
        background: transparent !important;
        transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }
    .header-mobile-account-badge .header-mobile-account-action:active { transform: scale(.94); }
    .header-mobile-account-badge .header-profile-link {
        position: relative;
        display: flex !important;
        flex: 0 0 46px;
        width: 46px !important;
        height: 46px;
        align-items: center;
        justify-content: center;
        padding: 2px !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        box-shadow: none;
    }
    .header-mobile-account-badge .header-profile-avatar { width: 42px !important; height: 42px !important; flex: 0 0 42px !important; border-radius: 50% !important; }
    .header-mobile-account-badge .header-profile-name { display: none !important; }
    .header-mobile-account-badge .header-notification { top: -3px !important; right: -3px !important; left: auto !important; }
    .nav-links {
        order: 1;
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
        max-width: none;
        align-self: center;
        justify-content: flex-start !important;
        gap: 5px !important;
        padding: 2px 0 !important;
        scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-text-link { flex: 0 0 auto; min-height: 36px !important; padding: 7px 9px !important; font-size: 12px !important; }
    .nav-more-toggle {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-height: 36px !important;
        padding: 7px 9px !important;
        border: 0 !important;
        border-radius: 8px !important;
        color: #f1f5f9 !important;
        background: transparent !important;
        font: inherit !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        cursor: pointer;
    }
    .nav-more-toggle:hover, .nav-more-toggle[aria-expanded="true"] { color: var(--accent, #40a2fa) !important; background: transparent !important; }
    .nav-more-menu {
        position: absolute;
        top: calc(100% + 7px);
        right: 12px;
        z-index: 1010;
        display: grid;
        gap: 4px;
        width: min(220px, calc(100vw - 24px));
        padding: 8px;
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 13px;
        background: rgb(20 25 34 / 75%);
        box-shadow: 0 16px 42px rgba(0,0,0,.32);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }
    .nav-more-menu[hidden] { display: none !important; }
    .nav-more-link {
        display: flex;
        align-items: center;
        min-height: 40px;
        padding: 9px 11px;
        border-radius: 8px;
        color: #eef4fc;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
    }
    .nav-more-link:hover, .nav-more-link.active { background: rgba(255,255,255,.1); text-decoration: none; }

    .container, .reviews-container { width: calc(100% - 24px); padding-inline: 0; margin-block: 14px; }
    .marketplace-page, .graphics-page, .users-page, .profile-page-container,
    .collection-page-container { width: calc(100% - 24px) !important; margin-inline: auto !important; }
    .profile-container, .glass-box, .settings-card, .graphics-card { padding: 14px !important; }

    /* Show game tiles at a stable size and let the row scroll instead of squeezing them. */
    .games-grid:not(.users-grid), .recommended-grid, .all-games-grid, .game-grid {
        display: flex !important;
        width: 100%;
        min-width: 0;
        flex-wrap: nowrap !important;
        align-items: stretch;
        gap: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden;
        padding: 2px 2px 12px;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .games-grid:not(.users-grid) > .game-card,
    .all-games-grid > .game-card-custom,
    .recommended-grid > .game-card-custom,
    .recommended-grid > .for-you-card,
    .game-grid > .game-card-col,
    .game-grid > .add-game-card {
        box-sizing: border-box;
        flex: 0 0 clamp(150px, 58vw, 205px) !important;
        width: clamp(150px, 58vw, 205px) !important;
        min-width: clamp(150px, 58vw, 205px) !important;
        max-width: clamp(150px, 58vw, 205px) !important;
        scroll-snap-align: start;
    }
    .recommended-grid > .for-you-card { flex-basis: 150px !important; width: 150px !important; min-width: 150px !important; max-width: 150px !important; }
    .users-grid, .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    #market-panel-all-items .market-grid {
        grid-template-columns: repeat(var(--market-effective-columns, 1), minmax(min(150px, 100%), 1fr)) !important;
        gap: 10px !important;
    }
    .filter-main-row, .market-filters, .market-toolbar, .avatar-toolbar,
    .profile-playtime-toolbar, .collection-header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 9px;
    }
    .filter-main-row > *, .market-filters > *, .market-toolbar > *, .avatar-toolbar > * { min-width: 0; max-width: 100%; }
    .filter-main-row input, .filter-main-row select, .market-filters input,
    .market-filters select, .market-toolbar input, .avatar-toolbar input { width: 100%; }
    .filter-panel .filter-main-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100%;
    }
    .filter-panel .search-input-wrapper { grid-column: 1 / -1; }
    .filter-panel .search-input-wrapper,
    .filter-panel .category-multiselect,
    .filter-panel .filter-main-row > div:last-child {
        width: 100% !important;
        min-width: 0 !important;
    }
    .filter-panel #filterSearch,
    .filter-panel #catMultiSelectBtn,
    .filter-panel #filterSort { width: 100% !important; }
    .filter-actions { align-items: stretch; }
    .filter-actions > *, .market-apply { width: 100%; }

    .profile-tabs, .users-switcher, .switcher-bar, .marketplace-switcher {
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .profile-tabs {
        overflow-x: hidden !important;
        scrollbar-width: none;
    }
    .profile-tabs::-webkit-scrollbar { display: none; }
    .profile-tabs .profile-tab {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding-inline: clamp(2px, 1.1vw, 10px) !important;
        font-size: clamp(9px, 1.45vw, 12px) !important;
        text-align: center;
        white-space: nowrap;
    }
    .switcher-bar, .users-switcher, .marketplace-switcher {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        gap: 4px !important;
        justify-content: center !important;
        overflow: hidden !important;
    }
    .switcher-bar .switch-btn, .users-switcher .switch-btn, .marketplace-switcher .switch-btn {
        flex: 1 1 0 !important;
        width: 0;
        min-width: 0;
        padding: 10px 4px !important;
        font-size: clamp(10px, 2.8vw, 13px) !important;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }
    .profile-tabs {
        display: flex;
        width: 100%;
        justify-content: stretch;
        overflow: hidden;
    }
    .profile-tab {
        flex: 1 1 0 !important;
        min-width: 0;
        padding-inline: clamp(4px, 1.8vw, 12px) !important;
        text-align: center;
        white-space: nowrap;
    }

    .trending-list-container, .table-responsive { overflow-x: auto; }
    .trending-list-header, .trending-list-item { min-width: 520px; }
    .user-ranking-header, .user-ranking-item { grid-template-columns: 40px minmax(0, 1fr) 68px !important; gap: 6px !important; }
    .users-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .game-details-grid, .game-info-grid, .graphics-settings-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .comparison-grid, .comp-grid-row { grid-template-columns: minmax(0, 1fr) !important; }
    .comp-grid-row { text-align: center; }
    .grid-col-g2 { text-align: center !important; }

    .profile-header, .market-heading, .market-avatar-heading, .currently-playing-inner,
    .currently-playing-left { align-items: flex-start !important; flex-direction: column !important; }
    .profile-header { gap: 12px; }
    .profile-avatar { flex: 0 0 auto; }
    .profile-info, .market-heading > *, .market-avatar-heading > * { min-width: 0; max-width: 100%; }
    .current-user-rank { flex-wrap: wrap; gap: 8px; }
    .current-user-rank > span:last-child { margin-left: 0 !important; }

    button, .btn, .nav-btn, .rdash-select-wrap, input, select, textarea { max-width: 100%; }
    input, select, textarea, .rdash-select-wrap { min-height: 42px; }
    textarea { min-height: 92px; }
    .modal, .modal-content, .collection-modal-box, .market-dialog, .avatar-detail-dialog,
    .playtime-rank-modal, .settings-modal, .dialog-content {
        width: calc(100vw - 24px) !important;
        max-width: 560px !important;
        max-height: calc(100dvh - 24px) !important;
        margin: auto !important;
        padding: 18px !important;
        overflow-y: auto !important;
        border-radius: 16px;
    }
    .modal-backdrop, .modal-overlay, .dialog-overlay { padding: 12px !important; }
    .slide img { height: clamp(160px, 48vw, 250px); }
    .slide-info { padding: 14px; }
    .slider-container { margin-inline: -12px; }
    .mini-gallery { overflow-x: auto; flex-wrap: nowrap; }
    .mini-gallery img { flex: 0 0 auto; }

    /* The game library remains a regular card grid on phones. */
    #section-library .all-games-grid {
        display: grid !important;
        grid-template-columns: repeat(var(--effective-games-columns, 2), minmax(min(140px, 100%), 1fr)) !important;
        gap: 10px !important;
        overflow: visible !important;
        padding: 0 !important;
        scroll-snap-type: none;
    }
    #section-library .all-games-grid > .game-card-custom {
        flex: initial !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        scroll-snap-align: none;
    }

    /* Favorites and collection contents use vertical tile grids on mobile. */
    .games-grid.favorites-grid,
    .collection-page-container .game-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        overflow: visible !important;
        padding: 0 !important;
        scroll-snap-type: none;
    }
    .games-grid.favorites-grid > .game-card,
    .collection-page-container .game-grid > .game-card-col,
    .collection-page-container .game-grid > .add-game-card {
        flex: initial !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        scroll-snap-align: none;
    }
    .games-grid.favorites-grid > .game-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

@media (min-width: 651px) {
    .nav-more-toggle, .nav-more-menu { display: none !important; }
}

@media (max-width: 390px) {
    .container, .reviews-container, .marketplace-page, .graphics-page, .users-page,
    .profile-page-container, .collection-page-container { width: calc(100% - 18px) !important; }
    .games-grid:not(.users-grid), .recommended-grid, .all-games-grid, .game-grid { gap: 9px !important; }
    .games-grid:not(.users-grid) > .game-card,
    .all-games-grid > .game-card-custom,
    .recommended-grid > .game-card-custom,
    .game-grid > .game-card-col,
    .game-grid > .add-game-card { flex-basis: 148px !important; width: 148px !important; min-width: 148px !important; max-width: 148px !important; }
    .games-grid.favorites-grid > .game-card { flex: initial !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
    .nav-text-link { padding-inline: 7px !important; font-size: 11px !important; }
    .user-card { padding: 9px 5px !important; }
    .modal, .modal-content, .collection-modal-box, .market-dialog, .avatar-detail-dialog,
    .playtime-rank-modal, .settings-modal, .dialog-content { padding: 14px !important; }
}

@media (max-width: 650px) {
    a, button, input, select, textarea, summary, [role="button"] {
        -webkit-tap-highlight-color: transparent;
    }
    .library-advanced-search > summary { max-width: 100%; }
    .library-advanced-meta { gap: 9px !important; }
    .library-advanced-meta .results-count { flex: 1 0 100%; }
    .library-advanced-meta .games-per-row-control { display: none !important; }
    .library-advanced-meta .btn-reset-filters { flex: 0 0 auto; }
    .mobile-nav-hide { display: none !important; }
    .users-podium-card { max-width: 33.333% !important; }
    .collection-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }
    .collection-toolbar > input[type="search"] { width: 100% !important; min-width: 0 !important; }
    .collection-toolbar-controls {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) max-content !important;
        grid-auto-flow: column !important;
        align-items: center;
        flex: 0 1 auto;
        min-width: 0;
        width: 100%;
        gap: 8px !important;
    }
    .collection-toolbar-controls select {
        grid-column: 1;
        width: 100% !important;
        min-width: 0 !important;
    }
    .collection-toolbar-controls > .btn:not(.collection-toolbar-clear),
    .collection-toolbar-controls > .collection-max-notice {
        grid-column: 2;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    .users-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
    .users-grid .user-card {
        aspect-ratio: 1 / 1 !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 5px !important;
        border-radius: 14px !important;
        text-align: center !important;
    }
    .users-grid .user-card-header {
        width: 100% !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 0 !important;
    }
    .users-grid .user-avatar { width: 64px !important; height: 64px !important; }
    .users-grid .user-meta-info { width: 100% !important; min-width: 0; text-align: center !important; }
    .users-grid .user-display-name { margin: 0 0 2px !important; font-size: 13px !important; font-weight: 600 !important; text-align: center !important; }
    .users-grid .user-username { font-size: 10px !important; text-align: center !important; }
    .users-grid .user-status-text, .users-grid .user-card-details { display: none !important; }
}

@media (max-width: 700px) {
    .profile-external-actions { display: none !important; }
}

/* Use one row only when search, category and sort all have enough room. */
.filter-panel { container-type: inline-size; }
@container (max-width: 619px) {
    .filter-panel .filter-main-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .filter-panel .search-input-wrapper { grid-column: 1 / -1; }
}
@container (min-width: 620px) {
    .filter-panel .filter-main-row {
        grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(180px, 1fr) !important;
    }
    .filter-panel .search-input-wrapper { grid-column: auto; }
}

/* Compact five item navigation for phones, with Home as the central action. */
.mobile-bottom-nav { display: none; }
#gamesLoadMoreSentinel { grid-column: 1 / -1; min-height: 1px; }
@media (max-width: 650px) {
    html { background-color: var(--bg-dark, #070a12); }
    html:has(.site-background) { background: var(--bg-dark, #070a12) !important; }
    body:has(.site-background) { background-color: var(--bg-dark, #070a12) !important; }
    body { padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important; }
    header { min-height: 58px !important; padding: 8px 14px !important; }
    header .logo-container { display: flex !important; }
    header .logo-container .logo img { height: 36px !important; }
    header .nav-links { display: none !important; }
    header .user-profile-wrapper { margin-left: auto !important; }
    .mobile-bottom-nav {
        position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0;
        display: flex; align-items: stretch; justify-content: space-between; gap: 0;
        min-height: 62px; padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255,255,255,.08); background: var(--header-surface-background, rgba(255,255,255,.015));
        backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2);
        box-sizing: border-box;
    }
    .mobile-bottom-nav-link {
        display: flex; flex: 1 1 0; align-self: stretch; align-items: center; justify-content: center;
        height: 62px; min-height: 62px; min-width: 0; padding: 0; border: 0; border-radius: 12px;
        background: transparent; color: inherit; text-decoration: none; cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-bottom-nav-link img { display: block; flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
    .mobile-bottom-nav-link.is-active img { opacity: 1; }
    .mobile-bottom-nav-home { flex: 1 1 0; height: 62px; min-height: 62px; margin: 0; border: 0; border-radius: 12px; background: transparent; box-shadow: none; }
    .mobile-more-toggle { position: relative; }
    .mobile-more-toggle[aria-expanded="true"] { background: rgba(255,255,255,.08); }
    .nav-more-menu {
        position: fixed !important; top: auto !important; right: 10px !important;
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        z-index: 1200 !important;
        display: grid !important;
    }
    .nav-more-menu[hidden] { display: none !important; }
}

/* The profile is a full-width page inside the space left by the site header/sidebar. */
@media (max-width: 650px) {
    .profile-bio-stats-row { grid-template-columns: minmax(0, 1fr) !important; }
}
.profile-page-container {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}
.profile-page-container > .profile-container {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
}

/* Preserve the game artwork's intended size inside the flexible banner row. */
.game-banner-icon {
    flex: 0 0 110px !important;
    width: 110px !important;
    height: 110px !important;
    max-width: none !important;
    object-fit: cover !important;
}
.game-banner-content button img {
    flex: 0 0 21px;
    width: 21px !important;
    height: 21px !important;
    max-width: none !important;
    object-fit: contain !important;
}
@media (max-width: 640px) {
    .game-banner-icon {
        flex-basis: 75px !important;
        width: 75px !important;
        height: 75px !important;
    }
}

/* Keep scrollbar tracks clear and thumbs lightly translucent throughout the site. */
* {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(220, 230, 245, .3) transparent !important;
}
::-webkit-scrollbar { width: 7px !important; height: 7px !important; }
::-webkit-scrollbar-track { background: transparent !important; }
::-webkit-scrollbar-thumb {
    background: rgba(220, 230, 245, .28) !important;
    border: 1px solid transparent !important;
    background-clip: padding-box !important;
    border-radius: 999px !important;
}
::-webkit-scrollbar-thumb:hover { background: rgba(220, 230, 245, .46) !important; }

/* Hide only the viewport scrollbar; nested lists keep their translucent scrollbars. */
html {
    scrollbar-width: none !important;
}
html::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Center Favorites tiles and keep them compact on narrow game pages. */
.favorites-grid { justify-content: center !important; }
@media (max-width: 650px) {
    .container .games-grid.favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(92px, 104px)) !important;
        justify-content: center !important;
        gap: 9px !important;
    }
}

/* Home page horizontal scrollers stay usable without showing scrollbar tracks. */
.index-page .rdash-friends-viewport,
.index-page .recommended-grid,
.index-page .continue-games-grid {
    scrollbar-width: none !important;
    scrollbar-color: transparent transparent !important;
}
.index-page .rdash-friends-viewport::-webkit-scrollbar,
.index-page .recommended-grid::-webkit-scrollbar,
.index-page .continue-games-grid::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.index-page .rdash-friends-row { gap: 12px !important; }
.index-page .continue-games-grid > .game-card-custom,
.index-page .recommended-grid > .game-card-custom {
    flex-basis: clamp(145px, 16vw, 190px) !important;
    width: clamp(145px, 16vw, 190px) !important;
    min-width: clamp(145px, 16vw, 190px) !important;
    max-width: clamp(145px, 16vw, 190px) !important;
}
.index-page .recommended-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    padding-right: 12px !important;
    scroll-padding-right: 12px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.index-page #recommended-section,
.index-page .category-recommendation-games,
.index-page .continue-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
.index-page .recommended-grid > .game-card-custom,
.index-page .recommended-grid > .for-you-card {
    flex: 0 0 clamp(145px, 16vw, 190px) !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    scroll-snap-align: start;
}
@media (max-width: 600px) {
    .index-page .rdash-friends-row { gap: 10px !important; }
}
@media (max-width: 650px) {
    .index-page .continue-games-grid > .game-card-custom,
    .index-page .recommended-grid > .game-card-custom {
        flex-basis: 145px !important;
        width: 145px !important;
        min-width: 145px !important;
        max-width: 145px !important;
    }
}


/* ================================================================ phone navigation bar - floating, slightly rounded, a line slides above the active icon */
@media (max-width: 650px) {
    body { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
    .mobile-bottom-nav { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 62px; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(10, 14, 22, .86); box-shadow: 0 14px 34px -12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05); backdrop-filter: blur(22px) saturate(1.25); -webkit-backdrop-filter: blur(22px) saturate(1.25); }
    .mobile-bottom-nav-link { height: 62px; min-height: 62px; border-radius: 0; background: transparent !important; color: rgba(226, 232, 240, .62); transition: color .25s ease; }
    .mobile-bottom-nav-link.is-active { color: #4aa8ff; }
    .mbn-ic { display: block; width: 25px; height: 25px; background-color: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; transition: transform .25s cubic-bezier(.2,.9,.3,1); }
    .mobile-bottom-nav-link.is-active .mbn-ic { transform: translateY(1px); }
    .mbn-ind { position: absolute; left: 0; top: 0; z-index: 0; height: 3px; width: 0; pointer-events: none; opacity: 0; transition: transform .38s cubic-bezier(.3,.9,.3,1), width .38s cubic-bezier(.3,.9,.3,1), opacity .2s ease; }
    .mbn-ind::before { content: ''; position: absolute; left: 22%; right: 22%; top: 0; height: 3px; border-radius: 0 0 4px 4px; background: #4aa8ff; box-shadow: 0 0 14px 1px rgba(74,168,255,.8); }
    .mbn-ind::after { content: ''; position: absolute; left: 10%; right: 10%; top: 3px; height: 46px; background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(74,168,255,.34), transparent 100%); }
    .mobile-bottom-nav-link { position: relative; z-index: 1; }
    .nav-more-menu { bottom: calc(82px + env(safe-area-inset-bottom)) !important; }
}
@media (prefers-reduced-motion: reduce) { .mbn-ind, .mbn-ic { transition: none !important; } }
