.menu {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(94vw, 410px);
    height: 76px;
    padding: 0 12px;
    box-sizing: border-box;
    border-radius: 40px;
    z-index: 2000;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    gap: 4px;

    background:
        radial-gradient(120% 140% at 50% 0%, rgba(248, 211, 127, 0.08), transparent 42%),
        linear-gradient(180deg, #151315 0%, #0d0c0f 100%);
    border: 1px solid rgba(215, 166, 91, 0.65);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 223, 153, 0.35),
        inset 0 -1px 0 rgba(128, 90, 40, 0.55);
}

.menu::after {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 32px;
    border: 1px solid rgba(197, 147, 74, 0.45);
    pointer-events: none;
}

.menu button {
    border: 0;
    background: transparent;
    color: #e7c07d;
    height: 56px;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.menu button img {
    width: 27px;
    height: 27px;
    opacity: 0.88;
    filter: brightness(0) saturate(100%) invert(79%) sepia(35%) saturate(430%) hue-rotate(357deg) brightness(94%) contrast(93%);
    transition: opacity 140ms ease, transform 140ms ease, filter 140ms ease;
}

.menu button:hover img {
    opacity: 1;
    transform: scale(1.07);
}

.menu button[data-screen="feed"] {
    width: 78px;
    height: 78px;
    margin-top: -18px;
    justify-self: center;
    border-radius: 50%;
    position: relative;
    background: transparent;
    border: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
}

.menu button[data-screen="feed"] .menu-core-icon {
    width: 70px;
    height: 70px;
    opacity: 1;
    filter: none;
    transform: none;
}

.menu-core-label {
    position: relative;
    display: inline-block;
    font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -6px;
    color: #f3f2ee;
    font-style: italic;
    transform: skewX(-4deg) translateY(1px);
    text-shadow: 0 1px 0 rgba(24, 20, 15, 0.95), 0 0 8px rgba(255, 255, 255, 0.1);
}

.menu-core-label::after {
    content: "";
    position: absolute;
    left: -8px;
    right: -6px;
    top: 58%;
    height: 22px;
    border-top: 3px solid #c88a30;
    border-radius: 100% 100% 0 0 / 100% 100% 0 0;
    transform: rotate(-16deg);
    box-shadow: 0 0 8px rgba(210, 151, 70, 0.35);
    pointer-events: none;
}

.menu-core-label::before {
    content: "";
    position: absolute;
    right: -4px;
    top: 52%;
    width: 0;
    height: 0;
    border-left: 10px solid #c88a30;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    transform: rotate(-24deg);
    filter: drop-shadow(0 0 4px rgba(210, 151, 70, 0.45));
    pointer-events: none;
}

body[data-screen="home"] .menu button[data-screen="home"],
body[data-screen="chat"] .menu button[data-screen="chat"],
body[data-screen="community"] .menu button[data-screen="community"],
body[data-screen="map"] .menu button[data-screen="map"],
body[data-screen="profile"] .menu button[data-screen="profile"] {
    background: rgba(239, 197, 121, 0.12);
    box-shadow: inset 0 0 0 1px rgba(227, 180, 99, 0.28);
}

body[data-screen="home"] .menu button[data-screen="home"] img,
body[data-screen="chat"] .menu button[data-screen="chat"] img,
body[data-screen="community"] .menu button[data-screen="community"] img,
body[data-screen="map"] .menu button[data-screen="map"] img,
body[data-screen="profile"] .menu button[data-screen="profile"] img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(88%) sepia(31%) saturate(415%) hue-rotate(344deg) brightness(98%) contrast(95%);
}

body[data-screen="feed"] .menu button[data-screen="feed"] {
    transform: scale(1.03);
}

@media (max-width: 420px) {
    .menu {
        width: calc(100vw - 12px);
        height: 74px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .menu button[data-screen="feed"] {
        width: 74px;
        height: 74px;
        margin-top: -14px;
    }

    .menu button[data-screen="feed"] .menu-core-icon {
        width: 64px;
        height: 64px;
    }

    .menu-core-label {
        font-size: 58px;
        letter-spacing: -5px;
    }
}
