/*
 * GROUPFINDER v2.5.5
 * Public pages use one predictable scroll container.
 * Desktop keeps the independent center-column scroll.
 * Mobile uses only the document/root scrollbar, matching the Hráči page.
 */

/* Signed-in public pages rendered inside the real /app shell. */
@media (min-width: 821px) {
    body.gf-app-public-content-page {
        overflow: hidden !important;
    }

    body.gf-app-public-content-page .gf-app-shell {
        height: 100vh !important;
        min-height: 0 !important;
        grid-template-rows: var(--gf-header-h) minmax(0, 1fr) !important;
    }

    body.gf-app-public-content-page .gf-app-main {
        min-height: 0 !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-width: thin;
        scrollbar-color: #2e3036 transparent;
        overscroll-behavior: contain;
    }

    body.gf-app-public-content-page .gf-app-main::-webkit-scrollbar {
        width: 8px;
    }

    body.gf-app-public-content-page .gf-app-main::-webkit-scrollbar-track {
        background: transparent;
    }

    body.gf-app-public-content-page .gf-app-main::-webkit-scrollbar-thumb {
        background: #2e3036;
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

    body.gf-app-public-content-page .gf-app-main::-webkit-scrollbar-thumb:hover {
        background: #454851;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

    /* Guest/public shell: fixed viewport + independently scrolling center. */
    body.gf-unified-public-page {
        height: 100vh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.gf-unified-public-page .gf-unified-takeover-stage {
        height: 100vh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.gf-unified-public-page .gf-unified-shell {
        height: 100vh !important;
        min-height: 0 !important;
        grid-template-rows: var(--gf-u-head) minmax(0, 1fr) !important;
    }

    body.gf-unified-public-page .gf-unified-main {
        min-height: 0 !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        scrollbar-width: thin;
        scrollbar-color: #2e3036 transparent;
        overscroll-behavior: contain;
    }

    body.gf-unified-public-page .gf-unified-main::-webkit-scrollbar {
        width: 8px;
    }

    body.gf-unified-public-page .gf-unified-main::-webkit-scrollbar-track {
        background: transparent;
    }

    body.gf-unified-public-page .gf-unified-main::-webkit-scrollbar-thumb {
        background: #2e3036;
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: padding-box;
    }

    body.gf-unified-public-page .gf-unified-main::-webkit-scrollbar-thumb:hover {
        background: #454851;
        border: 2px solid transparent;
        background-clip: padding-box;
    }
}

/*
 * Mobile:
 * Do not make body + center column two independent scroll containers.
 * The root document is the only vertical scroller. This removes the second
 * scrollbar and the "first wheel/touch scroll does nothing" behaviour.
 */
@media (max-width: 820px) {
    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.gf-unified-public-page,
    body.gf-app-public-content-page {
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        overflow: visible !important;
        overscroll-behavior-y: auto !important;
    }

    body.gf-app-public-content-page .gf-app-takeover-stage,
    body.gf-app-public-content-page .gf-app-shell,
    body.gf-unified-public-page .gf-unified-takeover-stage,
    body.gf-unified-public-page .gf-unified-shell {
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.gf-unified-public-page .gf-unified-main,
    body.gf-app-public-content-page .gf-app-main {
        height: auto !important;
        min-height: calc(100vh - 64px) !important;
        max-height: none !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
    }
}
