navbar-gamification {
    --icon-size: 50px;
    --icon-padding: 2.5px;
    --top-distance: 1em;
}

navbar-gamification .navbar-gamification-grid-container {
    display: grid;
    grid-template-columns: 1fr calc(var(--icon-size) / 2); /* 25px */
    grid-template-rows: 1fr;
}

navbar-gamification .progress-container {
    position: relative;
    padding: calc((var(--icon-size) - 20px) / 2) 0; /* 15px */
    z-index: 1;
}

/* fix random bootstrap progress margin */
navbar-gamification .progress-container .progress {
    margin-bottom: 0;
}

navbar-gamification .progress-container .points-animation-container {
    text-align: center;
    position: absolute;
    top: var(--top-distance);
    left: 0;
    right: 0;
    pointer-events: none;
}

navbar-gamification .gamification-progress {
    border-style: solid;
    border-width:1px;
    border-color:grey
}

@keyframes points-animation {
    0% {
        margin-top: var(--top-distance);
        font-size: 1.5em;
        opacity: 0;
        position: relative;
    }
    20% {
        opacity: 100%;
    }
    80% {
        opacity: 100%;
    }
    100% {
        opacity: 0;
        position: relative;
    }
}

navbar-gamification .points-animation-element:not(.ng-leave) {
    opacity: 0;
    animation-name: points-animation;
    animation-duration: 2s;
    position: absolute;
}

navbar-gamification .level-container {
    position: absolute;
    z-index: 2;
    top: 0;
    left: calc(-1 * var(--icon-size) / 2);
    padding: var(--icon-padding);
}

navbar-gamification .gamification-icon-wrapper {
    width: calc(var(--icon-size) - var(--icon-padding) * 2);
    height: calc(var(--icon-size) - var(--icon-padding) * 2);
}

navbar-gamification .gamification-level {
    width: 100%;
    height: 100%;
    float: right;
}

navbar-gamification .animated-level-up {
    animation-name: level-up;
    animation-duration: 2s;
}

@keyframes level-up {
    0% {
        width: 100%;
        height: 100%;
    }
    50% {
        width: 140%;
        height: 140%;
    }
    100% {
        transform: rotateY(calc(3 * 360deg));
        width: 100%;
        height: 100%;
    }
}

/**
    levelup particle effect
    based on: https://www.cssscript.com/bubble-confetti-effect-button/
 */
navbar-gamification .confetti-container {
    --confetti-color: Lime;
    position: absolute;
    height: 100%;
    width: 100%;
    left: -2%;
}

navbar-gamification .confetti-container:before, .confetti-container:after {
    position: absolute;
    content: '';
    width: 100%;
    height: 50%;
    z-index: -1000;
    transition: all ease-in-out 0.5s;
    background-repeat: no-repeat;
}

navbar-gamification .confetti-container:before {
    display: none;
    top:-15%;
    background-image: radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, transparent 20%, var(--confetti-color) 20%, transparent 30%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, transparent 10%, var(--confetti-color) 15%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%);
    background-size: 20% 20%, 40% 40%, 30% 30%, 40% 40%, 36% 36%, 20% 20%, 30% 30%, 20% 20%, 36% 36%;
}

navbar-gamification .confetti-container:after {
    display: none;
    bottom: 15%;
    background-image: radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, transparent 10%, var(--confetti-color) 15%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%), radial-gradient(circle, var(--confetti-color) 20%, transparent 20%);
    background-size: 30% 30%, 40% 40%, 36% 36%, 40% 40%, 30% 30%, 20% 20%, 40% 40%;
}

navbar-gamification .confetti-container.animate-confetti:before {
    display: block;
    animation: topBubbles ease-in-out 0.75s forwards;
}

navbar-gamification .confetti-container.animate-confetti:after {
    display: block;
    animation: bottomBubbles ease-in-out 0.75s forwards;
}
@keyframes
topBubbles {
    0% {
        background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%, 40% 90%, 55% 90%, 70% 90%;
    }
    50% {
        background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%, 50% 50%, 65% 20%, 90% 30%;
    }
    100% {
        background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%, 50% 40%, 65% 10%, 90% 20%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}
@keyframes
bottomBubbles {
    0% {
        background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%, 70% -10%, 70% 0%;
    }
    50% {
        background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%, 105% 0%;
    }
    100% {
        background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%, 110% 10%;
        background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

/**
    icon colours
 */

navbar-gamification .icon-red {
    fill: darkred;
    stroke: indianred;
}

navbar-gamification .icon-purple {
    fill: rebeccapurple;
    stroke: mediumpurple;
}

navbar-gamification .icon-blue {
    fill: blue;
    stroke: cornflowerblue;
}

navbar-gamification .icon-lightblue {
    fill: cornflowerblue;
    stroke: lightblue;
}

navbar-gamification .icon-green {
    fill: forestgreen;
    stroke: lightgreen;
}

navbar-gamification .icon-orange {
    fill: darkorange;
    stroke: orange
}

navbar-gamification .icon-text {
    fill: white;
    stroke: black;
    stroke-width: 0.5px;
    font-weight: bold;
}

navbar-gamification .progress-bar-red {
    background-image: linear-gradient(to bottom, red 0, darkred 100%);
}

navbar-gamification .progress-bar-purple {
    background-image: linear-gradient(to bottom, mediumpurple 0, rebeccapurple 100%);
}

navbar-gamification .progress-bar-blue {
    background-image: linear-gradient(to bottom, cornflowerblue 0, blue 100%);
}

navbar-gamification .progress-bar-lightblue {
    background-image: linear-gradient(to bottom, lightblue 0, cornflowerblue 100%);
}

navbar-gamification .progress-bar-green {
    background-image: linear-gradient(to bottom, lightgreen 0, forestgreen 100%);
}

navbar-gamification .progress-bar-orange {
    background-image: linear-gradient(to bottom, orange 0, darkorange 100%);
}


