/*
	Zombie appearance
*/

#ZombieAppearance,
#ZombieDefeated {

    background-image: radial-gradient(farthest-corner at 730px 320px, #009d82 0%, #002935 100%);

    .zombie {
        position: absolute;
        right: 75px;
        bottom: 100px;
        animation-duration: 0.5s;
        animation-iteration-count: once;
        animation-timing-function: ease-out;
        animation-name: zombie-in;
    }

    .description {
        position: absolute;
        left: 50px;
        top: 50px;
        width: 500px;
        bottom: 50px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        font-size: 28px;

        .you-unlocked {
            font-size: 24px;
            text-transform: uppercase;
            font-family: var(--button-font-family);
            font-weight: bold;
            text-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
            margin-bottom: 10px;
        }

        .zombie-type {
            font-family: var(--heading-font-family);
            text-shadow: 2px 2px 0 rgba(0, 0, 0, .3),
                2px 2px 10px rgba(0, 0, 0, .8);
            font-size: 88px;
            line-height: 1;
            font-weight: bold;
            text-align: center;
            transform: rotate(-5deg);
            margin: 10px auto;
            /*            text-transform: uppercase;*/
        }

        .zombie-description {
            display: flex;
            flex-flow:column;
            justify-content: center;
            align-items: center;
            width: 90%;
            margin: 25px auto;
                    text-shadow: 2px 2px 0 rgba(0, 0, 0, .3);
            
            p {
                margin:5px auto;
            }   
            ul {margin:5px auto;

                li {
                    list-style: square;
                    margin: 8px 0;
                    font-size: 28px;

                }
            }
        }

    }

    #exit-button {
        position: absolute;
        left: 0px;
        top: 0px;
        width: 80px;
        height: 81px;
        background-image: url('../images/buttons/button_exit.png');
        background-repeat: no-repeat;
        text-transform: uppercase;
        display: grid;
        align-items: center;
        justify-items: center;
        padding-left: 6px;
        padding-right: 0px;
        font-size: 12px;
        color: black;
        font-weight: bold;
        text-align: center;
        filter: brightness(0.8);
        transform-origin: left top;
        transition: all .2s ease-in-out;

        &.tab-highlighted {
            filter: none;
            outline: none;
            transform: scale(1.1);
            filter: brightness(1.1);
        }
    }
}

.starburst {
    position: absolute;
    left: 730px;
    top: 320px;
    width: 2048px;
    height: 2048px;
    border-radius: 512px;
    opacity: 0.2;
    background-image: repeating-conic-gradient(at center,
            #009d82 0% 5%,
            transparent 5% 10%);
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-name: rotate-forever;
}

@keyframes rotate-forever {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(72deg);
    }
}

@keyframes zombie-in {
    0% {
        transform: translate(300px, 0px);
    }

    100% {
        transform: translate(0px, 0px);
    }
}

/*
	Animated zombies
	These animated zombies use a flipbook animation to animate
	the head.
	They're based on a basic rectangle that is used for all the
	zombies.  The zombie's body is placed in a :before
	pseudoelement and the head is placed in an :after
	pseudoelement, with each being resized and animated based
	on which zombie type it is.
	The animations are played when a zombie appears alongside 
	a 1s-long zombie growl sound.
*/

.animated-zombie {

    position: relative;
    display: block;

    width: 446px;
    height: 695px;

    &:before {
        content: ' ';
        display: inline-block;
        overflow: hidden;
        background-repeat: no-repeat;
        background-position: 0px 0px;
        position: absolute;
        bottom: 0px;
        left: 50%;
        transform: translate(-50%, 0);
    }

    &:after {
        content: ' ';
        display: inline-block;
        overflow: hidden;
        background-repeat: no-repeat;
        position: absolute;
    }

    &.groaning:after {
        animation-duration: 0.6s;
        animation-iteration-count: once;
        animation-timing-function: step-end;
    }

}

.animated-zombie#home-0-zombie {
    &:before {
        width: 367px;
        height: 455px;
        background-position: 0px 0px;
        background-image: url('../images/zombies/home-0.png');
    }

    &:after {
        background-image: url('../images/zombies/home-0.png');
        background-position: 0px -455px;
        width: 163px;
        height: 184px;
        left: 120px;
        top: 140px;
    }

    &.groaning:after {
        animation-name: home-0-zombie-animation;
        animation-fill: forwards;
    }
}

@keyframes home-0-zombie-animation {
    0% {
        background-position: 0px -455px;
    }

    20% {
        background-position: -163px -455px;
    }

    40% {
        background-position: -326px -455px;
    }

    60% {
        background-position: 0px -639px;
    }

    80% {
        background-position: -163px -639px;
    }

    100% {
        background-position: 0px -455px;
    }
}

.animated-zombie#home-1-zombie {
    &:before {
        width: 365px;
        height: 463px;
        background-position: 0px 0px;
        background-image: url('../images/zombies/home-1.png');
    }

    &:after {
        background-image: url('../images/zombies/home-1.png');
        background-position: 0px -463px;
        width: 149px;
        height: 203px;
        left: 170px;
        top: 120px;
    }

    &.groaning:after {
        animation-name: home-1-zombie-animation;
    }
}

@keyframes home-1-zombie-animation {
    0% {
        background-position: 0px -463px;
    }

    20% {
        background-position: -149px -463px;
    }

    40% {
        background-position: -298px -463px;
    }

    60% {
        background-position: -0px -666px;
    }

    80% {
        background-position: -149px -666px;
    }

    100% {
        background-position: 0px -463px;
    }
}

.animated-zombie#home-2-zombie {
    &:before {
        width: 306px;
        height: 542px;
        background-position: -0px -310px;
        background-image: url('../images/zombies/home-2.png');
    }

    &:after {
        background-image: url('../images/zombies/home-2.png');
        background-position: -0px -0px;
        width: 135px;
        height: 155px;
        left: 180px;
        top: 50px;
    }

    &.groaning:after {
        animation-name: home-2-zombie-animation;
    }
}

@keyframes home-2-zombie-animation {
    0% {
        background-position: -0px -0px;
    }

    20% {
        background-position: -135px -0px;
    }

    40% {
        background-position: -270px -0px;
    }

    60% {
        background-position: -0px -155px;
    }

    80% {
        background-position: -135px -155px;
    }

    100% {
        background-position: -0px -0px;
    }
}

.animated-zombie#education-zombie {
    &:before {
        width: 309px;
        height: 500px;
        background-position: 0px 0px;
        background-image: url('../images/zombies/education.png');
    }

    &:after {
        background-image: url('../images/zombies/education.png');
        background-position: -309px -0px;
        width: 177px;
        height: 234px;
        left: 80px;
        top: 220px;
    }

    &.groaning:after {
        animation-name: education-zombie-animation;
    }
}

@keyframes education-zombie-animation {
    0% {
        background-position: -309px -0px;
    }

    20% {
        background-position: -0px -500px;
    }

    40% {
        background-position: -177px -500px;
    }

    60% {
        background-position: -0px -734px;
    }

    80% {
        background-position: -177px -734px;
    }

    100% {
        background-position: -309px -0px;
    }
}

.animated-zombie#insurance-zombie {
    &:before {
        width: 397px;
        height: 750px;
        background-position: 0px 0px;
        background-image: url('../images/zombies/insurance.png');
    }

    &:after {
        background-image: url('../images/zombies/insurance.png');
        background-position: -397px -0px;
        width: 135px;
        height: 181px;
        left: 220px;
        top: 70px;
    }

    &.groaning:after {
        animation-name: insurance-zombie-animation;
    }
}

@keyframes insurance-zombie-animation {
    0% {
        background-position: -397px -0px;
    }

    20% {
        background-position: -0px -750px;
    }

    40% {
        background-position: -135px -750px;
    }

    60% {
        background-position: -270px -750px;
    }

    80% {
        background-position: -405px -750px;
    }

    100% {
        background-position: -397px -0px;
    }
}

.animated-zombie#credit-card-zombie {
    &:before {
        width: 359px;
        height: 387px;
        background-position: 0px 0px;
        background-image: url('../images/zombies/credit-card.png');
    }

    &:after {
        background-image: url('../images/zombies/credit-card.png');
        background-position: -0px -387px;
        width: 169px;
        height: 189px;
        left: 90px;
        top: 190px;
    }

    &.groaning:after {
        animation-name: credit-card-zombie-animation;
    }
}

@keyframes credit-card-zombie-animation {
    0% {
        background-position: -0px -387px;
    }

    20% {
        background-position: -169px -387px;
    }

    40% {
        background-position: -338px -387px;
    }

    60% {
        background-position: -0px -576px;
    }

    80% {
        background-position: -169px -576px;
    }

    100% {
        background-position: -0px -387px;
    }
}

.animated-zombie#subprime-zombie {
    &:before {
        width: 369px;
        height: 539px;
        background-position: -0px -336px;
        background-image: url('../images/zombies/subprime.png');
    }

    &:after {
        background-image: url('../images/zombies/subprime.png');
        background-position: -0px -0px;
        width: 133px;
        height: 168px;
        left: 170px;
        top: 80px;
    }

    &.groaning:after {
        animation-name: subprime-zombie-animation;
    }
}

@keyframes subprime-zombie-animation {
    0% {
        background-position: -0px -0px;
    }

    20% {
        background-position: -133px -0px;
    }

    40% {
        background-position: -266px -0px;
    }

    60% {
        background-position: -0px -168px;
    }

    80% {
        background-position: -133px -168px;
    }

    100% {
        background-position: -0px -0px;
    }
}


.animated-zombie#car-zombie {
    &:before {
        width: 359px;
        height: 579px;
        background-position: 0px -396px;
        background-image: url('../images/zombies/car.png');
    }

    &:after {
        background-image: url('../images/zombies/car.png');
        background-position: -0px -0px;
        width: 129px;
        height: 198px;
        left: 160px;
        top: 40px;
    }

    &.groaning:after {
        animation-name: car-zombie-animation;
    }
}

@keyframes car-zombie-animation {
    0% {
        background-position: -0px -0px;
    }

    20% {
        background-position: -129px -0px;
    }

    40% {
        background-position: -258px -0px;
    }

    60% {
        background-position: -0px -198px;
    }

    80% {
        background-position: -129px -198px;
    }

    100% {
        background-position: -0px -0px;
    }
}
