body,
html {
    width: 100%;
    height: 100%;

    background-color: #111;

    font-family: 'Press Start 2P',
        cursive;
}

* {
    margin: 0;
    padding: 0;
}

/* All Animations  */
@keyframes superPointBlink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

@keyframes playerOnSuperBlink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

@keyframes ghostFadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes ghostFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes boardFlash {
    0% {
        background-color: #111;
    }

    50% {
        background-color: #0935e37e;
    }

    100% {
        background-color: #111;
    }
}

@keyframes gotEatenFlash {
    0% {
        background-color: #111;
    }

    50% {
        background-color: #9f001391;
    }

    100% {
        background-color: #111;
    }
}

@keyframes titleBlink {
    0% {
        color: yellow;
    }

    50% {
        color: #FFF;
    }

    100% {
        color: yellow
    }
}

/* Animation classes to toggle */
.gotEatenFlash {
    animation: gotEatenFlash 1000ms;
    animation-iteration-count: 2;
}

.boardFlash {
    animation: boardFlash 1000ms;
    animation-iteration-count: 3;
}

.player-animation {
    animation: playerOnSuperBlink 500ms infinite;
}

.ghost-fadeOut {
    animation: ghostFadeOut 1500ms forwards;
}

.ghost-fadeIn {
    animation: ghostFadeIn 1500ms forwards;
}

/* Game over pop out container  */
.gameover-wrapper {
    width: 100%;
    height: 100%;

    display: none;

    background-color: transparent;

    position: absolute;
    top: 0;
    left: 0;

    z-index: 500;
}

.gameover-container {
    width: 100%;
    height: 100%;

    background-color: rgba(114, 114, 114, 0.337);

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 36px;
}

.gameover-container h1 {
    font-weight: bold;
    font-size: 128px;
    color: #FFF;
}

.gameover-container button {
    min-width: 200px;
    min-height: 100px;
    font-size: 64px;
    color: red;
    font-family: inherit;
    padding: 24px;

    transition: scale 200ms;
}

.gameover-container button:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Main Container  */
.container {
    width: 100%;
    height: 100%;

    background-color: transparent;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 12px;
}

.title {
    font-size: 72px;
    font-weight: bold;
    color: yellow;
    margin: 12px;

    text-shadow: 0px 0px 55px rgba(255, 255, 0, 0.5);
}

.title span {
    animation: titleBlink 2000ms infinite;
    transition: all 0ms;
}

.controlls {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: bold;
    color: #FFF;

}

.topbar {
    width: 860px;
    height: 100px;

    color: #FFF;

    border: 4px dashed #0935E3;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px;

    gap: 12px;
}

.playerScore-container,
.topScore-container {
    width: 300px;
    height: 100%;
    text-align: center;

    display: flex;
    align-items: center;
}

/* Grid where we add all the blocks */
.grid {
    width: 860px;
    height: 860px;

    background-color: #111;

    position: relative;

    transition: backgroundColor 1000ms;

    box-shadow: 0px 0px 128px 88px rgba(11, 84, 255, 0.2);
    z-index: 1;
}

#playerScore {
    font-size: 22px;
    color: #FFF;
}

#highestScore {
    font-size: 22px;
    color: #FFF;
}


/* Player lives container  */
.player-lives-container {
    min-width: 150px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.player-lives-container>div {
    width: 50px;
    height: 50px;

    background: url('images/heart.png');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;
}

/* ### Gird blocks types ### */
.block {
    width: 40px;
    height: 40px;

    background-color: #0935E3;

    box-sizing: border-box;

    position: absolute;
}

.path-block {
    width: 40px;
    height: 40px;

    background-color: transparent;

    box-sizing: border-box;

    position: absolute;
}

/* Point blocks  */
.path-point {
    width: 7.5px;
    height: 7.5px;

    background-color: #FFF;

    border-radius: 50px;
    position: relative;

    top: 16.25px;
    left: 16.25px;
}

.path-superPoint {
    width: 15px;
    height: 15px;

    background-color: #FFF;

    border-radius: 50px;
    position: relative;

    top: 12.5px;
    left: 12.5px;

    animation: superPointBlink 1200ms infinite;
}


/* Player */
.player-block {
    width: 35px;
    height: 35px;

    background: url('images/pac-man.gif');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;

    box-sizing: border-box;
    border-radius: 50px;

    position: absolute;
    margin-top: 2.5px;
    margin-left: 2.5px;

    transition: top 200ms, left 200ms;
    transition-timing-function: linear;

    z-index: 300;
}



/* Ghots */
.ghost {
    width: 50px;
    height: 45px;

    box-sizing: border-box;
    border-radius: 50px;

    position: absolute;

    transition: top 200ms, left 200ms;
    transition-timing-function: linear;

    z-index: 100;
}

.ghost-red {
    background: url('images/ghostRed.png');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;
}

.ghost-blue {
    background: url('images/ghostBlue.png');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;
}

.ghost-yellow {
    background: url('images/ghostYellow.png');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;
}

.ghost-purple {
    background: url('images/ghostPurple.png');
    background-size: contain;
    background-color: transparent;
    background-repeat: no-repeat;
}