*{
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

/* *** START SCREEN *** */

/* Start Button */
.introBtn{
    position:absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color:white;
    cursor:pointer;
    width: 160px;
    height: 160px;
    border-radius: 100%;
    transition: opacity 0.5s ease;

    display: flex;
    justify-content: center;
    align-items: center;
}
.introBtn p{
    color:deepskyblue;
    font-weight: bold;
    font-size: 24px;
    font-family: 'Sigmar One', cursive;
}
.introBtn.start{
    opacity: 0;
}
.introBtn.loading{
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Start Overlay */
.overlay{
    position:absolute;
    width: 100vw;
    height: 100vh;
    background-color: white;
    clip-path: circle(80px at center);
    transition: all 1s ease;
}
.overlay.start{
    clip-path: circle(100% at center);
}
.overlay.loading{
    clip-path: circle(0% at center);
}
.background{
    position:absolute;
    width: 100vw;
    height: 100vh;
    background-color: deepskyblue;
}

/* *** MAIN GAME *** */
.main{
    position: relative;
    opacity: 1;
    transition: opacity 1s ease;
    overflow: hidden;
    cursor: default;
}
.main.in-active{
    opacity: 0;
}

/* Background */
.grid{
    position: absolute;
    width: 100vw;
    height: 100vh;
    background-color: #fff;
    background-image:
    linear-gradient(#eee .1em, transparent .1em);
    background-size: 100% 1.2em;
    opacity: 0.3;
}
#gameBg{
    position: absolute;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20vh;
    font-family: 'Sigmar One', cursive;
    text-align: center;
    color: deepskyblue;
    user-select: none;
    opacity: 0.1;
}
#time{
    position: absolute;
    right: 20px;
    text-align: right;
    font-family: 'Sigmar One', cursive;
}

/* Target */
.target{
    position: absolute;
    cursor: pointer;
    width: 5vw;
    height: 5vw;
    border-radius: 50%;
    border: 1px solid black;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    display: flex;
    justify-content: center;
    align-items: center;
}
.target.move{
    animation: targetPosition 1s infinite;
}
.innerTarget2{
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 1px solid black;
    background-color: white;

    display: flex;
    justify-content: center;
    align-items: center;
}
.innerTarget3{
    width: 40%;
    height: 40%;
    border-radius: 50%;
    border: 1px solid black;
}
.colored{
    background-color: crimson;
}

/* Screen overlay */
.block{
    background-color: lawngreen;
    width: 100vw;
    transform: translateX(-100%);
    transition: width 1s ease;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.block.start{
    animation: boxes 3s;
}
.block.gameOver{
    animation: gameOver 8s forwards;
}
.block p{
    color: rgb(255, 255, 255);
    font-size: 46px;
    font-family: 'Sigmar One', cursive;
    opacity: 0;
    animation: levelAnim 2s 0.8s;
}
.block h3{
    color: rgb(255, 255, 255);
    font-size: 60px;
    font-family: 'Sigmar One', cursive;
}
.block .pressR{
    opacity: 1;
    font-size: 30px;
}

@media screen and (max-width: 450px) {

    #gameBg{
        font-size: 10vh;
    }

    .block h3{
        font-size: 40px;
    }
    .block .pressR{
        font-size: 20px;
    }

}


/* *** ANIMATIONS *** */
@keyframes boxes{

    0% {
        background-color: lawngreen;
        transform: translateX(-100%);
    }
    10% {
        transform: translateX(0%);
    }
    90% {
        transform: translateX(0%);
    }
    100% {
        background-color: rgb(80, 160, 0);
        transform: translateX(100%);
    }

}

@keyframes targetPosition {
    0% {
        top: calc(var(--oldposy) * 1vh);
        left: calc(var(--oldposx) * 1vw);
    }
    90% {
        top: calc(var(--randomposy) * 1vh);
        left: calc(var(--randomposx) * 1vw);
    }
    100% {
        top: calc(var(--randomposy) * 1vh);
        left: calc(var(--randomposx) * 1vw);
    }
}

@keyframes levelAnim {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    10% {
        opacity: 0;
    }
}

@keyframes gameOver{

    0% {
        background-color: rgb(255, 0, 51);
        transform: translateX(-100%);
    }
    10% {
        transform: translateX(0%);
    }
    90% {
        transform: translateX(0%);
    }
    100% {
        background-color: rgb(121, 0, 0);
        transform: translateX(0%);
    }

}