/* The theme scrolls the viewport through body. Lock that same scroll
   container so the root keeps its normal gutter and page width. */
html.ts-prediction-open > body { overflow: hidden; }

@media (any-pointer: coarse) {
    a[data-ts-pick-posted],
    a[href*="/tipster/"][href*="#"][href*="-vs-"],
    tr[link*="#"][link*="-vs-"] {
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none;
        user-select: none;
    }
}

dialog.ts-prediction-popup {
    box-sizing: border-box;
    width: min(720px, calc(100% - 32px));
    max-width: 100%;
    height: 90vh;
    height: 90dvh;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: #252525;
    font: 12px Arial;
    text-align: left;
}

dialog.ts-prediction-popup:focus { outline: none; }

.ts-prediction-popup::backdrop { background: rgb(9 17 26 / 72%); }

.ts-prediction-popup > .ts-popup-panel {
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    isolation: isolate;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 60px rgb(0 0 0 / 40%);
}

.ts-prediction-popup > header {
    position: relative;
    z-index: 3;
    height: 0;
}

/* aria-labelledby still uses the hidden heading as the dialog name. */
.ts-prediction-popup #ts-prediction-popup-title {
    display: none;
}

.ts-prediction-popup .ts-popup-close {
    position: absolute;
    top: -12px;
    right: -12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
    background: #25394d;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.ts-prediction-popup .ts-popup-close:focus { outline: none; }
.ts-prediction-popup .ts-popup-close:focus-visible {
    box-shadow: inset 0 0 0 2px #ffc13d, 0 2px 6px rgb(0 0 0 / 30%);
}
@media (forced-colors: active) {
    .ts-prediction-popup .ts-popup-close:focus-visible {
        outline: 2px solid Highlight;
        outline-offset: -4px;
    }
}
.ts-prediction-popup .bc-pick-kicker { padding-right: 52px; }
.ts-prediction-popup .ts-popup-status { padding: 16px calc(52px + env(safe-area-inset-right, 0px)) 16px 16px; margin: 0; }
.ts-prediction-popup .ts-popup-status.is-loading { display: grid; place-items: center; height: 100%; padding: 0; }
.ts-prediction-popup .ts-popup-status[hidden], .ts-popup-body [data-ts-follow-action][hidden] { display: none; }
.ts-popup-body > .ts-popup-details, .ts-popup-body > .ts-popup-retry { display: inline-block; margin: 0 16px 12px; }

@media (max-width: 768px), (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
    dialog.ts-prediction-popup {
        position: fixed;
        inset: 0;
        width: 100vw;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
    }

    .ts-prediction-popup > .ts-popup-panel {
        box-sizing: border-box;
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    }

    .ts-prediction-popup .ts-popup-close {
        top: calc(4px + env(safe-area-inset-top, 0px));
        right: calc(4px + env(safe-area-inset-right, 0px));
    }
}

@media (max-width: 1119.98px) {
    .ts-prediction-popup > .ts-popup-panel {
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
    }

    .ts-prediction-popup:has(> .menu-container-fixed) > .ts-popup-panel {
        padding-bottom: 0;
    }

    .ts-prediction-popup .articles > .one-post,
    .ts-prediction-popup .articles .ts-popup-body {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    dialog.ts-prediction-popup {
        bottom: var(--ts-popup-bar-height, 0px);
        max-height: calc(100vh - var(--ts-popup-bar-height, 0px));
        max-height: calc(100dvh - var(--ts-popup-bar-height, 0px));
    }
}
