/* Phone bottom tab bar (components/bottom_nav.html), the twin of the app's tab
   bar: Games, PMill, My Bets, Social, More on every page at <=768px. */
.bnav { display: none; }

@media (max-width: 768px) {
    :root { --bnav-h: calc(58px + env(safe-area-inset-bottom, 0px)); }

    .bnav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 250; /* over sticky bars, under sheets, modals and the menu */
        display: flex;
        height: var(--bnav-h);
        padding: 4px 0 env(safe-area-inset-bottom, 0px);
        background: var(--bg-secondary, #fff);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 12px rgba(16, 16, 20, 0.06);
    }

    .bnav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 0;
        border: 0;
        background: none;
        color: var(--text-muted);
        font: inherit;
        font-size: 11px;
        font-weight: 500;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .bnav-item.is-on { color: var(--accent-primary); }

    .bnav-icon {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 30px;
        border-radius: 12px;
    }
    .bnav-item.is-on .bnav-icon { background: rgba(42, 60, 255, 0.12); }
    .bnav-icon svg {
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .bnav-item.is-on .bnav-icon svg { stroke-width: 2.2; }

    .bnav-badge {
        position: absolute;
        top: -2px;
        right: 0;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: var(--accent-red-light, #d92d20);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        align-items: center;
        justify-content: center;
    }

    /* Room for the bar: the page ends above it, and everything that floats at
       the bottom (slip button, share, toasts, cookie note) sits on top of it. */
    body.has-bnav { padding-bottom: var(--bnav-h); }
    body.has-bnav .bet-slip-toggle,
    body.has-bnav .pm-share-fab,
    body.has-bnav .pm-share-sheet,
    body.has-bnav .pm-share-toast,
    body.has-bnav .tier-preview-fab,
    body.has-bnav .toast-container,
    body.has-bnav .cookie-banner { translate: 0 calc(-1 * var(--bnav-h)); }

    /* Chat rooms, direct messages, a group's open chat and Ask PMill keep the
       bottom for their message box */
    body:has(.ck-composer:not(#tabChat *), #tabChat:not([style*="none"]) .ck-composer, .asst-composer) {
        --bnav-h: 0px;
    }
    body:has(.ck-composer:not(#tabChat *), #tabChat:not([style*="none"]) .ck-composer, .asst-composer) .bnav { display: none; }
}
