#menu, #bars {
    display: none;
}

#menu {
    margin-top: 10px;
}
#menu.showMenu {
    display: flex;
}

#package, #inventory, #badges {
    height: 200px;
}

#package {
    width: 300px;
}

#package, #badges {
    flex: none;
}

#badges {
    width: 150px;
    justify-content: right;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    position: relative;
}
#badges > div {
    height: 69px;
    width: 100%;
    position: relative;
    margin: 10px;
}
#badges img {
    position: absolute;
    top: 0;
    right: 0;
    height: 69px;
    transition: 1s all;
}
#badges img.empty {
    opacity: .7;
}
#badges img.full {
    opacity: 0;
    transform: scale(1.3);
    pointer-events: none;
}

#badges .taken img.empty {
    opacity: 0;
}
#badges .taken img.full {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

#inventory {
    flex-grow: 1;
    display: flex;
    background: url("../images/pergamena_center.png");
    background-size: 100% 100%;
    padding: 20px;
    margin: 0 50px;
    position: relative;
}
#inventory:before {
    content: "";
    position: absolute;
    width: 50px;
    top: 0;
    bottom: 0;
    left: -50px;

    background: url("../images/pergamena_sx.png");
    background-size: 100% 100%;

}
#inventory:after {
    content: "";
    position: absolute;
    width: 50px;
    top: 0;
    bottom: 0;
    right: -50px;

    background: url("../images/pergamena_dx.png");
    background-size: 100% 100%;
}
#inventory .smallItems > [data-inventory] {
    margin: -1px 0 !important;
}
#package.unknownPackage {
    opacity: .7;
}

.bigItems {
    width: 25%;
    display: flex;
    flex-direction: column;
    position: relative;
}
.smallItems {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: space-around;
    position: relative;
    align-content: flex-start;
}

#inventory .smallItems {
    /*width: 75%;*/
    width: 100%;
}

.bigItems .icon, .smallItems .icon {
    background-image: url("../images/badge_quadrato_icone.png");
    background-size: 100%;
    background-repeat: no-repeat;
    position: relative;
    /*animation: heartbeatBig 2s 1;*/
}
.heartbeatBig {
    animation-name: heartbeatBig;
    animation-duration: 2s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

.bigItems > [data-inventory], .smallItems > [data-inventory] {
    position: relative;
    transition: 1s all;

    transform-origin: 20px;
    display: flex;
}

.bigItems > [data-inventory] {
    height: 64px;
    margin: 2px;
}
.bigItems .icon {
    width: 64px;
    height: 64px;
}
.smallItems > [data-inventory] {
    height: 42px;
    margin: 4px 0;
    flex-basis: 25%;
}
.smallItems .icon {
    width: 42px;
    height: 42px;
}

.bigItems .quantity, .smallItems .quantity {
    position: absolute;
    bottom: -2px;
    left: 50px;
    background-image: url("../images/inventory_quantity.png");
    background-size: 100%;
    background-repeat: no-repeat;
    width: 30px;
    height: 32px;
    line-height: 28px;
    text-align: center;
    color: #E5D0B2;
    font-size: 14px;
    font-weight: bold;
    opacity: 1;
    transition: 1s opacity;
}
.smallItems .quantity {
    left: 31px;
    width: 24px;
    height: 24px;
    bottom: 0px;
    line-height: 21px;
    font-size: 12px;
    background: #77604e;
    border-radius: 50%;
    border: 1px solid #4b311b;
}

.bigItems .name, .smallItems .name {
    display: flex;
    align-items: center;
    transition: 1s color;
    margin-left: 25px;

    font-size: 14px;
}
.smallItems .name {
    margin-left: 15px;
}
#inventory .hiddenInventory {
    /*filter: saturate(0.2);
    opacity: .7;*/
    opacity: 0;
    pointer-events: none;
    display: none;
}

#inventory .hiddenInventory .icon {
    animation: none;
}

#inventory .hiddenInventory .name {
    color: transparent;
}
#inventory .hiddenInventory .name::before {
    content: "???";
    color: black;
}
#inventory .hiddenInventory .quantity {
    opacity: 0;
}


#popupPackages {
    flex-direction: column;
}

#packagesContainer {
    display: flex;
    max-width: 1366px;
    margin: 0 auto;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

#packagesContainer .package {
    width: 250px;
    height: 493px;
    background-image: url("../images/box_base.png");
    background-size: 100%;
    background-repeat: no-repeat;
    padding: 30px;
    color: black;
    position: relative;
    margin: 8px;
    filter: saturate(0.2);
    transform: scale(0.9);
    transition: 0.5s all;
}
#packagesContainer .package:hover {
    filter: saturate(1);
    transform: scale(1);
}
.popupTitle {
    font-size: 22px;
}

#packagesContainer .package > img {
    padding: 10px 10px 0 10px;
}

#packagesContainer .choosePackage {
    position: absolute;
    bottom: -17px;
    left: 0;
    right: 0;
    margin: 0 auto;
}





#bars {
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    justify-content: center;
    align-items: center;
    transform: scale(0.8);
}
#bars[style*='display: block'] {
    display: flex !important;
}

@media (min-height: 800px) {
    #bars {
        top: 65px;
        transform: scale(1);
    }
}


#barSeparator {
    height: 50px;
    width: 63px;
    margin: 20px;
    background-repeat: no-repeat;
    background-size: 100%;
    background-image: url("../images/bars/cornice_dettaglio.png");
}
#waterBar, #foodBar {
    position: relative;
    width: 450px;
    height: 130px;
}
#bars .icon {
    position: absolute;
    height: 130px;
    width: 103px;
    background-repeat: no-repeat;
    background-size: 100%;
}

#waterBar .icon {
    background-image: url("../images/bars/label-ico_water.png");
    right: 0;
}
.consIndicator {
    font-family: 'Philosoper', sans-serif;
    position: absolute;
    bottom: 30px;
    left: 21px;
    background-size: 100%;
    text-align: center;
    width: 60px;
}
#foodBar .icon {
    background-image: url("../images/bars/label-ico_food.png");
    left: 0;
}

#bars .background {
    position: absolute;
    height: 130px;
    width: 355px;
    background-repeat: no-repeat;
    background-size: 100%;
    overflow: hidden;
}
#waterBar .background {
    background-image: url("../images/bars/bar_empty_water.png");
    right: 97px;
}
#foodBar .background {
    background-image: url("../images/bars/bar_empty_food.png");
    left: 97px;
}


#bars .fill {
    position: absolute;
    height: 130px;
    width: 331px;
    background-repeat: no-repeat;
    background-size: 100%;
    transition: 0.5s all;
}

#waterBar.dying , #foodBar.dying {
    animation: heartbeat 2s infinite;
}

.animation-duration4 {
    animation-duration: 2s !important;
}
.animation-duration3 {
    animation-duration: 1.5s !important;
}
.animation-duration2 {
    animation-duration: 1s !important;
}
.animation-duration1 {
    animation-duration: 0.5s !important;
}


#waterBar .fill {
    background-image: url("../images/bars/bar_full_water.png");
    right: 0;
    margin-right: 6px;
}
#foodBar .fill {
    background-image: url("../images/bars/bar_full_food.png");
    left: 0;
    margin-left: 6px;
}



@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartbeatBig {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}


.changedQuantity.minusQuantity {
    background: darkred;
}
.changedQuantity.plusQuantity {
    background: forestgreen;
}
.changedQuantity {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -12px;
    text-align: center;
    color: #E5D0B2;
    border-radius: 50%;
    border: 1px solid #E5D0B2;
    width: 24px;
    height: 24px;
    line-height: 22px;

    animation: changeQuantity 1.5s ease-in-out 1;

    z-index: 14;
}

@keyframes changeQuantity {
    0% {
        top: -50px;
        opacity: 0;
        transform: scale(1.5);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        top: 0;
        opacity: 0.8;
        transform: scale(1);
    }
}
