/**
 * Trophy guide sticky rail.
 * The TOC and CTA are sibling rows in one sticky desktop rail. The rail keeps
 * its natural height until it reaches the viewport cap; only then does the TOC
 * shrink and scroll so it can never overlap the CTA below it.
 */

html body.dm-ps-trophy-guide-page {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

body.dm-ps-trophy-guide-page .dm-pt-toc__cta .dm-wiki-traffic-cta__icon {
    display: grid;
    place-items: center;
}

body.dm-ps-trophy-guide-page .dm-pt-toc__cta .dm-wiki-traffic-cta__icon svg {
    display: block;
}

body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a,
body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a:visited {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.22);
}

body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a:hover,
body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a:focus-visible {
    border-color: #ef202c;
    background: #ef202c;
    color: #fff !important;
}

body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a:active {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff !important;
}

body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a span,
body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta .dm-wiki-traffic-cta__actions a svg {
    color: inherit !important;
    fill: currentColor !important;
}

@media (min-width: 861px) {
    body.dm-ps-trophy-guide-page .dm-pt-aside {
        position: sticky !important;
        top: 164px !important;
        z-index: 4;
        display: flex !important;
        flex-direction: column;
        gap: 16px;
        align-self: start !important;
        height: auto !important;
        max-height: calc(100vh - 188px) !important;
        max-height: calc(100dvh - 188px) !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        overscroll-behavior: contain;
        box-sizing: border-box;
    }

    body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc {
        position: static !important;
        top: auto !important;
        flex: 1 1 auto;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta {
        position: relative !important;
        bottom: auto;
        z-index: 3;
        flex: 0 0 auto;
        margin-top: 0 !important;
    }

    body.admin-bar.dm-ps-trophy-guide-page .dm-pt-aside {
        top: 211px !important;
        max-height: calc(100vh - 235px) !important;
        max-height: calc(100dvh - 235px) !important;
    }
}

@media (max-width: 860px) {
    body.dm-ps-trophy-guide-page .dm-pt-aside {
        display: block !important;
        height: auto !important;
    }

    body.dm-ps-trophy-guide-page .dm-pt-aside,
    body.dm-ps-trophy-guide-page .dm-pt-toc {
        position: static !important;
        top: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.dm-ps-trophy-guide-page .dm-pt-aside > .dm-pt-toc__cta {
        position: relative !important;
        bottom: auto;
        margin-top: 14px !important;
    }
}
