@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

html {
    font-size: 62.5%;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: url("../images/space.svg");
    background-size: cover;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
    color: white;
    min-height: 100vh;
}

/* Change Language */
.change-language {
    position: fixed;
    z-index: 8;
    top: 0;
    right: 0;
    margin: 2rem;
    margin-right: calc((100vw / 2) - 240px);
}

.change-language a {
    text-decoration: none;
    color: inherit;
}

.change-language img {
    position: relative;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 0.2rem solid #fff;
}

.change-language .activate {
    z-index: 1;
}

.change-language .margin-edit {
    margin-right: -3rem;
}

/* Main Help */
.main-help {
    position: fixed;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: rgba(71, 5, 5, 0.6);
    width: 100%;
    height: 100%;
}

.help-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem;
    max-width: 55rem;
    min-height: 40rem;
    background: #000;
    border: 0.2rem solid #fff;
    padding: 2rem;
}

.help-container>* {
    margin: 1rem;
    padding: 1rem;
    width: 100%;
}

.help-container h1 {
    text-align: center;
}

.close-help {
    width: 100%;
    text-align: right;
}

.close-help span {
    margin: 0;
    padding: 1rem;
    background: crimson;
    border-radius: 0.5rem;
    cursor: pointer;
}

/*** Title ***/


.title {
    background: black;
    display: inline-block;
    padding-top: 2rem;
}

/* Incompatible device */
.display-invalid {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 1rem;
    max-width: 55rem;
    min-height: 40rem;
    background: rgba(71, 5, 5, 0.6);
    border: 0.2rem solid #fff;
    padding: 2rem;
}

.display-invalid div {
    padding: 2rem 0;
}

.display-invalid span {
    font-size: 9rem;
}

/*** Container ***/

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
}


/*** Game ***/


#board {
    position: relative;
    width: 50rem;
    height: 50rem;
    margin: 2rem auto;
    border: 0.2rem solid white;
    background: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

#jet {
    position: absolute;
    width: 4rem;
    height: 4rem;
    background: url("../images/ship.png");
    background-size: cover;
    background-repeat: no-repeat;
    left: 50%;
    bottom: 0;
}

.bullets {
    position: absolute;
    bottom: 2.5rem;
    left: 51%;
    width: 3rem;
    height: 4rem;
    background: url("../images/bullets.png");
    background-size: cover;
    background-repeat: no-repeat;
}

.rocks {
    position: absolute;
    top: 0;
    width: 5rem;
    height: 5rem;
    background: url("../images/alien.png");
    background-size: cover;
    background-repeat: no-repeat;
}


/*** Game Over ***/

#gameOver {
    display: none;
}

#gameOver,
.startGame {
    background: black;
    z-index: 3;
    height: 100%;
    text-align: center;
    position: absolute;
}

#gameOver span,
.startGame span {
    font-size: 1.8rem;
}

#restart,
#start {
    border: solid white;
    padding: 1rem;
    cursor: pointer;
}

#restart:hover,
#start:hover {
    background: #fff;
    color: #000;
}

p {
    margin: 5rem;
}


/*** Points and Help ***/


.points {
    display: flex;
    justify-content: space-between;
}

.points-box,
.help,
.level {
    color: rgb(255, 255, 255);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.589);
    border-radius: 0 0 0.5rem 0.5rem;
    font-size: 4rem;
    z-index: 2;
}

.level {
    margin-top: 2rem;
    color: yellow;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.help a {
    color: inherit;
    text-decoration: none;
}

.help a:hover {
    color: yellow;
}


/*** Controls Menu ***/

.menu {
    display: block;
    position: relative;
    margin-top: -7rem;
    z-index: 2;
    width: 100%;
}


.controls-painel {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 2rem;
}

.controls-painel>* {
    margin: 0;
}

.directon {
    display: flex;
}

.arrow-right {
    margin-left: 2rem;
}


.space-bar,
.arrow-left,
.arrow-right {
    display: flex;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #000;
    width: 4rem;
    padding-bottom: 0.4rem;
    border: 0.2rem solid white;
    opacity: 50%;
}

.space-bar:hover,
.arrow-left:hover,
.arrow-right:hover {
    background: yellow;
    border-color: yellow;
}


/*** Media Query ***/

@media (max-width: 800px) {

    #board {
        margin: 2rem auto;
    }
}

@media (max-width:500px) {

    body {
        justify-content: start;
    }

    .title {
        text-align: left;
        width: 95vw;
    }

    .change-language {
        margin-right: 2rem;
    }

    .change-language img {
        width: 2.5rem;
        height: 2.5rem;
    }

    .change-language .margin-edit {
        margin-right: -2.5rem;
    }

    #board {
        width: 98vw;
        height: 40rem;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 394px) {
    .title {
        font-size: 0.85rem;
    }
}

@media (max-width:349px) {
    .container {
        display: none;
    }

    .display-invalid {
        display: flex;
        min-width: 10rem;
    }
}