/* ═══ Mobile bottom tab bar — flush, integrated with page ═══ */
.mobile-tabbar {
    display: none;
}

@media (max-width: 768px) {
    body.has-mobile-tabbar {
        padding-bottom: calc(3.65rem + env(safe-area-inset-bottom, 0px));
    }

    .mobile-tabbar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        margin: 0;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--bg-primary);
        border-top: 1px solid var(--border);
        box-shadow: 0 -1px 0 rgba(10, 77, 38, 0.06);
        pointer-events: auto;
    }

    .mobile-tabbar-inner {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
        margin: 0;
        padding: 0.4rem 0 0.35rem;
        background: var(--bg-primary);
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        position: relative;
        overflow: hidden;
    }

    .mobile-tabbar-inner::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--green-500), var(--green-300), var(--green-500));
        opacity: 0.85;
    }

    .mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.18rem;
        padding: 0.3rem 0.1rem 0.35rem;
        text-decoration: none;
        color: var(--text-3);
        border-radius: 0;
        position: relative;
        min-width: 0;
        transition: color 0.2s ease, background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tab:active {
        background: var(--green-soft);
    }

    .mobile-tab-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 1.85rem;
        height: 1.85rem;
        border-radius: 8px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-tab-icon svg {
        width: 1.15rem;
        height: 1.15rem;
    }

    .mobile-tab-label {
        font-size: 0.6rem;
        font-weight: 700;
        line-height: 1.15;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        letter-spacing: -0.2px;
    }

    .mobile-tab-indicator {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 1.75rem;
        height: 2px;
        border-radius: 0 0 2px 2px;
        background: var(--green-400);
        opacity: 0;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .mobile-tab.is-active {
        color: var(--green-400);
        background: var(--green-soft);
    }

    .mobile-tab.is-active .mobile-tab-icon {
        background: transparent;
        color: var(--green-400);
        box-shadow: none;
    }

    .mobile-tab.is-active .mobile-tab-label {
        color: var(--green-400);
        font-weight: 800;
    }

    .mobile-tab.is-active .mobile-tab-indicator {
        opacity: 1;
        transform: translateX(-50%) scaleX(1);
    }

    .mobile-tab[data-tab="live"] .mobile-tab-icon svg circle {
        animation: tabLivePulse 2s ease-in-out infinite;
    }

    .mobile-tab[data-tab="live"].is-active {
        background: rgba(10, 77, 38, 0.08);
    }

    .mobile-tab[data-tab="live"].is-active .mobile-tab-icon {
        color: var(--green-400);
    }

    .mobile-tab[data-tab="live"].is-active .mobile-tab-icon svg circle {
        fill: var(--green-400);
    }

    .mobile-tab-lottery.is-active {
        background: rgba(201, 162, 39, 0.12);
        color: #b8860b;
    }

    .mobile-tab-lottery.is-active .mobile-tab-icon,
    .mobile-tab-lottery.is-active .mobile-tab-label {
        color: #b8860b;
    }
}

@media (max-width: 380px) {
    .mobile-tab-label {
        font-size: 0.54rem;
    }

    .mobile-tab-icon {
        width: 1.7rem;
        height: 1.7rem;
    }

    .mobile-tab-icon svg {
        width: 1.05rem;
        height: 1.05rem;
    }
}

@keyframes tabLivePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-tab[data-tab="live"] .mobile-tab-icon svg circle {
        animation: none;
    }
}
