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

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Press Start 2P", sans-serif;
    list-style: none;
    text-decoration: none;
}

body{
    width: 100vw;
    height: 100svh;
    background-color: #1f1f1f;
    color: greenyellow;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
main{
    width: 100vmin;
    height: 100vmin;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* border: 1px solid white; */
}
header{
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    width: 100%;
}
header h1{
    font-size: 22px;
}

.score-board{
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    gap: 20px;
    margin-top: 20px;
}

.game-board{
    background-color: #333;
    aspect-ratio: 1;
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
}
.snake{
    background-color: greenyellow;
    border: .2vmin solid black;
    color: black;
    font-family: sans-serif;
    font-size: 10px;
}
.food{
    background-color: crimson;
    border: .2vmin solid black;
}
.head{
    border-top-right-radius: 100px;
    border-bottom-right-radius: 100px;
    position: relative;
}
.head::before,
.head::after{
    content: '';
    position: absolute;
    border-radius: 50%;
    border: .3vmin solid white;
    background-color: black;
    width: 30%;
    aspect-ratio: 1;
    top: 0;
    right: 0;
}
.head::before{
    top: auto;
    bottom: 0;
}
.head.down{
    transform: rotate(90deg);
}
.head.up{
    transform: rotate(-90deg);
}
.head.left{
    transform: rotate(-180deg);
}
.head.right{
    transform: rotate(0deg);
}

.controlls{
    width: 100px;
    height: 100px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 5px;
    overflow: hidden;
    border-radius: 50%;
    transform: rotate(45deg);
    position: relative;
    z-index: 100;
}
button{
    cursor: pointer;
    background-color: greenyellow;
    border: none;
    outline: none;
    border-radius: 10px;
}

button#up img{
    transform: rotate(-45deg);
}
button#left img{
    transform: rotate(-135deg);
}
button#right img{
    transform: rotate(45deg);
}
button#down img{
    transform: rotate(135deg);
}

