.bee {
    position: absolute;
    width: 100px;
    height: 50px;
    user-select: none;
    transition: top 0.1s linear, left 0.1s linear;
}

.bee.facing-right {
    transform: scaleX(-1);
}

.bee .hpbar {
    position: absolute;
    top: -10px;
    left: 50px;
    width: 40px;
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    z-index: 150;
}
    .bee .hpbar.fill0 {
        display: none;
    }

.bee .hpbar::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0px;
    height: 5px;
    background: #f00;
    border-radius: 3px;
    transition: width 0.5s linear, background 0.5s linear;
}
    .bee .hpbar.fill10::before {
        width: 40px;
        background: #009c00;
    }
    .bee .hpbar.fill9::before {
        width: 36px;
        background: #009c00;
    }
    .bee .hpbar.fill8::before {
        width: 32px;
        background: #009c00;
    }
    .bee .hpbar.fill7::before {
        width: 28px;
        background: #90ce00;
    }
    .bee .hpbar.fill6::before {
        width: 24px;
        background: #ffee00;
    }
    .bee .hpbar.fill5::before {
        width: 20px;
        background: #ffa600;
    }
    .bee .hpbar.fill4::before {
        width: 16px;
        background: #ff5100;
    }
    .bee .hpbar.fill3::before {
        width: 12px;
        background: #f00;
        animation: alternate-wabble 0.5s infinite;
    }
    .bee .hpbar.fill2::before {
        width: 8px;
        background: #f00;
        animation: alternate-wabble 0.5s infinite;
    }
    .bee .hpbar.fill1::before {
        width: 4px;
        background: #f00;
        animation: alternate-wabble 0.5s infinite;
    }
/* this animation not just changes size of the bar but also lets a red shadow blinkg and moves it "randomly" to make it look wiggely*/
@keyframes alternate-wabble {
    0% {
        box-shadow: 0 0 4px 2px #ff0000;
        transform: translate(0, 0) scaleX(1) rotate(0deg);
    }
    12% {
        box-shadow: 0 0 6px 3px #ff0000;
        transform: translate(1px, -1px) scaleX(1.06) rotate(1deg);
    }
    25% {
        box-shadow: 0 0 8px 4px #ff0000;
        transform: translate(-1px, 1px) scaleX(1.04) rotate(-1deg);
    }
    37% {
        box-shadow: 0 0 9px 4px #ff0000;
        transform: translate(1px, 0px) scaleX(1.07) rotate(0.5deg);
    }
    50% {
        box-shadow: 0 0 10px 5px #ff0000;
        transform: translate(-1px, -1px) scaleX(1.1) rotate(-1deg);
    }
    62% {
        box-shadow: 0 0 9px 4px #ff0000;
        transform: translate(0px, 1px) scaleX(1.05) rotate(0.5deg);
    }
    75% {
        box-shadow: 0 0 8px 4px #ff0000;
        transform: translate(1px, -1px) scaleX(1.08) rotate(-0.5deg);
    }
    87% {
        box-shadow: 0 0 6px 3px #ff0000;
        transform: translate(-1px, 0px) scaleX(1.03) rotate(0deg);
    }
    100% {
        box-shadow: 0 0 4px 2px #ff0000;
        transform: translate(0, 0) scaleX(1) rotate(0deg);
    }
}

.bee .bum,
.bee .waist,
.bee .body,
.bee .neck,
.bee .head {
    position: absolute;
    background-color: #c7a200;
    border: 3px solid #5a470a;
    border-radius: 20px;

    transition: background-color 5s linear, border 0.5s linear;
}

.night .bee .bum,
.night .bee .waist,
.night .bee .body,
.night .bee .neck,
.night .bee .head {
    background-color: #7a6b00;
    border: 3px solid #2a2305;
}

.night .bee .bum:nth-child(odd) {
    background-color: #daff53;
    border: 3px solid #d0ff00;
    box-shadow: 0 0 15px 2px #d0ff00;
}

.bee .bum {
    top: 5px;
    width: 40px;
    height: 40px;
    z-index: 10;
}
    .bee .bum:nth-child(1) { left: 46px; z-index: 60; scale: .95; }
    .bee .bum:nth-child(2) { left: 52px; z-index: 50; scale: 1; }
    .bee .bum:nth-child(3) { left: 58px; z-index: 40; scale: .95; }
    .bee .bum:nth-child(4) { left: 64px; z-index: 30; scale: .90; }
    .bee .bum:nth-child(5) { left: 70px; z-index: 20; scale: .85; }
    .bee .bum:nth-child(6) { left: 76px; z-index: 10; scale: .80; }

    .bee .bum:nth-child(odd) {
        background: #3a2e07;
    }

    .bee.firing-laser .bum:nth-child(odd) {
        border: 3px solid #ff0000;
        box-shadow: 0 0 2px 2px rgb(255, 0, 0);
    }

.bee.ghost .bum,
.bee.ghost .waist,
.bee.ghost .body,
.bee.ghost .neck,
.bee.ghost .head {
    background-color: #a1f9ff50 !important;
    border: 3px solid #00bfff50 !important;
    box-shadow: 0 0 10px 5px #00bfff50 !important;
}

.bee .stinger {
    position: absolute;
    top: 20px;
    left: 110px;
    width: 40px;
    height: 10px;
    background: transparent;
    border: 1px solid transparent;
    border-left: 30px solid #000;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.bee.ghost .stinger {
    border-left: 30px solid #00bfff80;
}

.bee .waist {
    top: 10px;
    left: 35px;
    width: 40px;
    height: 30px;
    z-index: 70;
}

.bee .body {
    top: 5px;
    left: 20px;
    width: 40px;
    height: 40px;
    z-index: 80;
}   

.bee .neck {
    top: 5px;
    left: 15px;
    width: 35px;
    height: 35px;
    z-index: 90;
    background: #3d2302;
    border: 0px none;
}

.bee .head {
    top: 0px;
    left: 10px;
    width: 30px;
    height: 30px;
    z-index: 100;
}

.bee .head .eye {
    position: absolute;
    top: 2px;
    left: -3px;
    font-size: 10px;
    background: #fff;
    width: 12px;
    height: 12px;
    border: 1px solid #000;
    border-radius: 50%;
    overflow: hidden;
    transform-origin: 50% 50%;
    z-index: 110;
}

.bee.ghost .head .eye {
    top: 5px;
    left: 0px;
    background: #002b3acb;
    border: 0 none;
    width: 7px;
    height: 7px;
}

.bee .head .eye::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 1px;
    width: 5px;
    height: 5px;
    background: #000;
    border-radius: 50%;
}

.bee.ghost .head .eye::before {
    top: 3px;
    left: 2px;
    background: #7fdfff;
    width: 2px;
    height: 2px;
}

.bee.firing-laser .head .eye::before {
    background: red;
}

.bee .head .eye.n0 {
    left: 9px;
}

.bee.ghost .head .eye.n0 {
    left: 11px;
}

.bee.firing-laser .head .eye {
    rotate: 45deg;
}

.bee.firing-laser .head .eye.n0 {
    rotate: 135deg;
}

.bee .head .mouth {
    position: absolute;
    top: 10px;
    left: 5px;
    transform-origin: 50% 50%;
    width: 10px;
    height: 10px;
    background: transparent;
    border: 1px solid #000;
    border-top: 1px solid transparent;
    border-right: 1px solid transparent;
    border-radius: 50%;
    rotate: -45deg;
    z-index: 120;
}

.bee.firing-laser .head .mouth {
    top: 12px;
    left: -3px;
    border: 3px solid red;
    background: black;
    width: 25px;
    height: 13px;
    border-radius: 5px 5px 8px 8px;
    rotate: 0deg;
}

.bee.ghost .head .mouth {
    top: 15px;
    left: 5px;
    background: #00445ab6;
    border: 0 none;
    width: 8px;
    height: 4px;
    border-radius: 15px 15px 0 0;
    rotate: 0deg;
    scale: 1 2;
}

.bee .head .antenna {
    position: absolute;
    top: -12px;
    left: -5px;
    font-size: 14px;
    border: 3px solid #000;
    border-bottom: 0 none;
    border-left: 0 none;
    width: 12px;
    height: 12px;
    border-radius: 0 6px 0 0;
    rotate: -15deg;
}

.bee.ghost .head .antenna {
    border-color: #00bfff80;
}

.bee .head .antenna::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -2px;
    width: 7px;
    height: 7px;
    background: #000;
    border-radius: 4px;
}

.night .bee .head .antenna::before {
    background: #fffb7d;
    box-shadow: 0 0 10px 3px #fffb7d;
}

.bee.ghost .head .antenna::before {
    background: #00bfff;
    box-shadow: 0 0 10px 3px #00bfff;
}

.bee .head .antenna.n0 {
    top: -12px;
    left: 10px;
    rotate: 15deg;
}

.bee .leg {
    position: absolute;
    top: 25px;
    left: 25px;
    font-size: 22px;
    z-index: 110;
    rotate: 20deg;
    border: 3px solid #361f01;
    border-top: 5px solid #361f01;
    border-bottom: 0 none;
    border-left: 0 none;
    width: 15px;
    height: 24px;
    border-radius: 0 6px 4px 0;
    transform-origin: 0% 0%;
}

    /* Right Side */
    .bee .leg.n1 {
        left: 42px;
        rotate: 30deg;
    }
    .bee .leg.n3 {
        left: 50px;
    }
    .bee .leg.n5 {
        left: 57px;
        rotate: 0deg;
    }

    /* Left Side */
    .bee .leg.u0 {
        scale: -1 1;
        rotate: -20deg;
        z-index: 0;
        border: 3px solid #000;
        border-top: 5px solid #000;
        border-bottom: 0 none;
        border-left: 0 none;
    }
        .bee .leg.n0 {
            left: 30px;
            rotate: -30deg;
        }
        .bee .leg.n2 {
            left: 42px;
        }
        .bee .leg.n4 {
            left: 57px;
            rotate: 0deg;
        }

.bee.ghost .leg {
    border-color: #00bfff80;
    border-top-color: #00bfff80;
}

.bee .wing {
    position: absolute;
    top: -15px;
    left: 65px;
    width: 30px;
    height: 30px;
    background: #c8c8ffb0;
    border-radius: 20px 20px 20px 0px;
    transform: scale(1.5, 0.5) rotate(45deg);
    rotate: -20deg;
    z-index: 120;
}

.bee.ghost .wing {
    background: #00bfff50;
    box-shadow: 0 0 10px 5px #00bfff50;
}

.wing-tick .bee .wing.n0 {
    rotate: 0deg;
    top: -5px;
    left: 66px;
}

.bee .wing.n1 {
    left: 0px;
    rotate: -160deg;
    z-index: 0;
}

.wing-tick .bee .wing.n1 {
    left: 0px;
    top: -5px;
    rotate: -180deg;
}

.bee .laser {
    position: absolute;
    top: 20px;
    left: -1978px;
    width: 2000px;
    height: 3px;
    background: #ffafaf;
    border: 1px solid #ff5757;
    border-radius: 2px;
    box-shadow: 0 0 10px 5px red;
    filter: blur(1px);
    z-index: 200;
    transform-origin: 100% 50%;

    /* animating height from 3 to 5 and back to create a sort of beam flicker */
    animation: laser-flicker 0.1s infinite;
}

@keyframes laser-flicker {
    0% { height: 3px; }
    50% { height: 5px; }
    100% { height: 3px; }
}
