:root {
    --menu-height: 90px;
    --menu-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px));
}

/* ===== MENU ===== */
.menu {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;

    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;

    padding: 4px 4px calc(6px + var(--menu-safe-bottom));
    min-height: var(--menu-height);

    background:
        linear-gradient(180deg, rgba(6, 16, 34, 0.92) 0%, rgba(4, 10, 24, 0.98) 100%);
    border-top: 1px solid rgba(255, 214, 120, 0.12);
    border-radius: 22px 22px 0 0;

    box-shadow:
        0 -10px 28px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);

    backdrop-filter: blur(12px);
}

/* ===== BUTTON ===== */
.menu-btn {
    position: relative;
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 20px;

    cursor: pointer;
    overflow: hidden;

    transition: transform 0.12s ease;
}

.menu-btn:active {
    transform: scale(0.95);
}

/* ===== IKONY (MAX SIZE) ===== */
.menu-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    transform: translateY(0px);

    transition:
        transform 0.18s ease,
        filter 0.18s ease;

    filter:
        drop-shadow(0 4px 8px rgba(0,0,0,0.4))
        drop-shadow(0 0 6px rgba(255,200,80,0.18));
}

/* ===== ACTIVE ===== */
.menu-btn.active-nav::before {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 20px;

    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(255,220,120,0.7) 0%, rgba(255,200,80,0.25) 45%, transparent 75%);
    filter: blur(5px);
}

/* ===== ACTIVE ICON ===== */
.menu-btn.active-nav .menu-icon {
    transform: scale(1.15);

    filter:
        drop-shadow(0 0 18px rgba(255,215,100,0.65))
        drop-shadow(0 4px 10px rgba(0,0,0,0.5));

    animation: glowPulse 2s infinite ease-in-out;
}

/* ===== ANIMACJA ===== */
@keyframes glowPulse {
    0% {
        filter:
            drop-shadow(0 0 10px rgba(255,210,90,0.3))
            drop-shadow(0 4px 10px rgba(0,0,0,0.45));
    }
    50% {
        filter:
            drop-shadow(0 0 22px rgba(255,220,120,0.7))
            drop-shadow(0 4px 12px rgba(0,0,0,0.55));
    }
    100% {
        filter:
            drop-shadow(0 0 10px rgba(255,210,90,0.3))
            drop-shadow(0 4px 10px rgba(0,0,0,0.45));
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 560px) {
    .menu-icon {
        width: 58px;
        height: 58px;
    }

    .menu-btn {
        height: 68px;
    }
}

@media (max-width: 400px) {
    .menu-icon {
        width: 54px;
        height: 54px;
    }

    .menu-btn {
        height: 64px;
    }
}

/* ===== CONTENT FIX ===== */
.screen,
.tab-content,
.zoo-screen,
.main-content,
.app-content {
    padding-bottom: calc(var(--menu-height) + var(--menu-safe-bottom)) !important;
}