* {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    margin: 0; padding: 0;
}

button:focus {outline:0;}

body, .overlay {
    background-position: center top;
    font-family: 'Rubik', sans-serif;
    background-size: cover;
    overflow: hidden;
    max-width: 100vh;
}

body {
    background-image: url(bg2.png);
}

main {
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
}

@keyframes overlay {
    0%, 49% {
        background: rgb(117,209,63);
    }
    50%, 100% {
        background: #e50000;
    }
}

.overlay {
    animation: overlay .3s infinite;
    position: absolute;
    z-index: 900;
    width: 100%;
    opacity: .2;
    display: none;
    height: 1000px;
}

.final .overlay {
    display: block;
}

#h3 {
    position: absolute;
    text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
    margin-top: 20%;
    top: 0;
    text-align: center;
    z-index: 9999;
    color: red;
    font-size: 40px;
    width: 100%;
    transition: all 1s;
    transform: scale(0);
    transition-delay: 3s;
    color: white;
}

#h3 p {
    font-size: 25px;
    margin-top: 20px;
}

.final #h3 {
    transform: scale(1);
}

main {
    transition: all 1s;
}

body.final main {
    opacity: 0;
}

body.final {
    background-image: url(final2.png);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes cloud {
    0% { transform: translateX(100vh) }
    40% { transform: translateX(-30vh); }
    100% { transform: translateX(100vh) }
}

#cloud {
    width: 50%;
    position: absolute;
    left: 0;
    top: 30px;
    animation: cloud 20s infinite;
}

button {
    box-shadow: 2px 2px 5px #333;
    text-transform: uppercase;
    color: white;
    touch-action: manipulation;
    border: none;
}

#button, #start {
    background: #7AAA43;
    font-size: 25px;
    padding: 20px 20px;
    width: 70%;
    margin-left: 15%;
    display: block;
    border-radius: 30px;
    transition: all .5s;
    position: absolute;
    left: 0;
    font-weight: bold;
    z-index: 100;
}

#start {
    top: 40vh;
}

#button {
    bottom: 5vh;
    display: none;
}

#button.init,
#done-button,
#start {
    animation: pulse .5s infinite;
}

.go #button {
    transform: translateY(100vh) !important;
}

#done-button {
    background: #D41C04;
    color: white;
    font-size: 30px;
    border-radius: 100px;
    width: 100px;
    height: 100px;
    z-index: 110;
    position: absolute;
    top: 30px;
    right: 30px;
    opacity: 0;
    display: none;
    transition: all 1s;
}

.done #done-button {
    opacity: 1;
    display: block;
    transition-delay: 1s;
}

#slot {
    touch-action: manipulation;
    z-index: 50;
    position: absolute;
    width: 250px;
    left: 50%;
    margin-left: -125px;
    bottom: 10vh;
    transform: translateY(100vh);
    transition: all .15s;
}

#slot img {
    width: 100%;
}

.go #slot {
    transform: translateY(0);
}

#body {
    background-image: url(body.png);
    width: 204px;
    height: 233px;
    background-size: cover;
    position: absolute;
    bottom: 25vh;
    left: 50%;
    margin-left: -102px;
    transition: all 1s ease-in;
}

.beforestart #body {
    transform: translateY(-100vh);
}

.start #body {
    animation: bodygo 5s ease-in forwards;
}

.go #body {
    animation: rl 2s ease-in forwards;
}

.m100 #body {
    animation: bodyjump 1s ease-in;
}

.m500 #body { transform: rotate(360deg); }
.m1200 #body { transform: rotate(-90deg); }
.m1500 #body { transform: rotate(90deg); }
.m1700 #body { transform: rotate(0deg); }
.m2000 #body { animation: bodyjump 3s ease-in; }
.m2500 #body { animation: rl 3s ease-in; }
.m3200 #body { transform: rotate(-360deg); }
.m4000 #body { animation: rl 2s; }
.m4500 #body {
    animation: bodyjump .5s infinite;
}

@keyframes hat {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(4deg); }
    50% { transform: rotate(1deg); }
    75% { transform: rotate(6deg); }
    100% { transform: rotate(0deg); }
}

@keyframes rl {
    0% { transform: translateX(0vh); }
    50% { transform: translateX(5vh); }
    100% { transform: translateX(0vh); }
}

@keyframes bodyjump {
    0% { transform: translateY(0vh); }
    50% { transform: translateY(3vh); }
    100% { transform: translateY(0vh); }
}

@keyframes bodygo {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(0vh); }
}

@keyframes hat {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(4deg); }
    50% { transform: rotate(1deg); }
    75% { transform: rotate(6deg); }
    100% { transform: rotate(0deg); }
}

#head,
#hat,
#glasses {
    position: absolute;
}

#head {
    animation: hat 10s infinite;
    width: 100px;
    top: -95px;
    z-index: 10;
    left: 24px;
}

#hat {
    animation: hat 5s infinite;
    z-index: 20;
    width: 150px;
    left: -10px;
    top: -110px;
}

#glasses {
    transform: translateX(-100vh);
    z-index: 35;
    transition: all 1s;
    left: -15px;
    top: -40px;
    width: 137px !important;
}

.m2300 #glasses {
    transform: translateX(0vh);
}

.m4000 #glasses {
    transform: translateX(-100vh);
}

#panel {
    transition: all .5s;
    position: absolute;
    top: 0;
    text-align: center;
    width: 100%;
    font-size: 40px;
    text-shadow: -2px 0 black, 0 2px black, 2px 0 black, 0 -2px black;
}

#h2 {
    transition: all 5s;
    text-align: center;
    width: 100%;
    transition: all .2s;
    font-size: 33px;
    position: absolute;
    z-index: 50;
    top: 124px;
    left: -15px;
}
