#hourglass {
    position: relative;
    width: 1rem;
    height: 2rem;
    background: linear-gradient(to left, #666 0%, #444 50%, #666 100%);
    clip-path: polygon(0 0, 0 0.15rem, 40% 50%, 0 calc(100% - 0.15rem), 0 100%, 100% 100%, 100% calc(100% - 0.15rem), 60% 50%, 100% 0.15rem, 100% 0);
    border-bottom: 0.15rem solid gray;
    border-top: 0.15rem solid gray;
    overflow: hidden;
}
#hourglass.new-day {
    transform: rotate(180deg);
    transition: transform 1s ease-in-out;
}

.top-sand, .bottom-sand {
    position: absolute;
    left: 0;
    width: 100%;
    background: #c6b78b;
}

.top-sand {
    top: 10%;
    height: 40%;
}


.bottom-sand {
    bottom: 0;
    height: 0;
}

#hourglass .bottom-sand::after {
    content: '';
    display: block;
    width: 1rem;
    height: min(150%, 0.5rem);
    background-color: #c6b78b;
    position: absolute;
    left: 0;
    top: 0;
    clip-path: polygon(0 50%, 50% 0%,100% 50%);
    transform: translateY(-20%);
}

#hourglass:not(.new-day):not(.almost-empty)::after {
    content: '';
    display: block;
    background-color:#c6b78b;
    width:1px;
    height:1px;
    position: absolute;
    left: calc(0.5rem - 0.5px);
    top: 1rem;
    animation:falling-sand 0.2s infinite ease-out;
}

@keyframes falling-sand {
    0% {
        top:calc(1rem - 0.15rem);
    }
    100% {
        top:calc(2rem - 0.15rem);
    }
}