/* Navigation */
nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 524px;
    height: 50px;
    background: #222;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px 1px #000000;
    z-index: 5;
}

nav a {
    position: relative;
    display: inline-block;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    padding: 0px 25px;
    z-index: 1;
}


/* Box */
nav span {
    position: absolute;
    top: 0;
    left: 88px;
    width: 85px;
    height: 100%;
    background: linear-gradient(90deg, #9b7b13, #282828);
    border-radius: 8px;
    transition: 0.5s;
}

nav:active span {
    background: #9b7b13;
}

nav a:nth-child(1):hover~span {
    left: 0;
    width: 90px;
}

nav a:nth-child(2):hover~span {
    left: 88px;
    width: 90px;
}

nav a:nth-child(3):hover~span {
    left: 175px;
    width: 90px;
}

nav a:nth-child(4):hover~span {
    left: 270px;
    width: 155px;
}

nav a:nth-child(5):hover~span {
    left: 425px;
    width: 100px;
}


/* Add this @media rule for 550px screen size */
@media screen and (max-width: 550px) {
    nav {
        width: 100%;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 0;
    }

    nav a {
        padding: 0 10px;
    }

    nav span {
        display: none;
    }

    nav:active span {
        display: none;
    }
}