html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.2rem;
    width: 900px;
    height: 100%;
    margin: auto;

    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    flex-direction: column;
    gap: 0;
}

header h1 {
    margin-bottom: 0;
}

header p {
    font-size: 60%;
    opacity: .8;
}

header div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

header button {
    padding: .4rem 2rem;
    text-transform: uppercase;
    font-weight: 400;
    border: 1px solid rgba(200, 200, 200, 1);
    border-radius: 0;
    transition: 200ms;
}

header button.active {
    background: rgba(50, 205, 50, .4);
    border: rgba(50, 205, 50, 1) 1px solid;
}

header a {
    display: flex;
    font-size: 60%;
    align-items: center;
    align-self: center;
}

header a::before {
  display: inline-block;
  width: 1rem;
  aspect-ratio: 1/1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z'/%3E%3Cpath d='M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1rem;
  content: "";
  opacity: .7;
}

#up {
    grid-area: up;
}

#left {
    grid-area: left;

}

#right {
    grid-area: right;

}

#down {
    grid-area: down;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    height: max-content;
    flex: 1;
    flex-direction: column;
    gap: .5rem;
}

main #start_text {
    position: absolute;
    display: block;
    background: white;
    height: 2rem;
    width: calc(9 *2.5rem);
    text-align: center;
}

main #controls {
    display: grid;
    grid-template-columns: repeat(9, 2rem);
    grid-template-rows: repeat(3, 2rem);
    grid-template-areas:
        ". . . . up . . . ."
        ". . . left . right . . ."
        ". . . . down . . . .";
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

main #board {
    display:grid;
    grid-template-columns: repeat(9, 2rem);
    grid-template-rows: repeat(9, 2rem);
    gap: .5rem;
    /* background: blue; */
}

main #board div {
    width: 2rem;
    aspect-ratio: 1/1;
    background: rgba(200, 200, 200, 1);
}

main #board div.head {
    background-color: rgba(50, 100, 50, 1);
}

main #board div.body {
    background-color: rgba(50, 100, 50, .8);
}

main #board div.food {
    background-color: rgba(200, 50, 50, .8);
}

main button {
    width: fit-content;
    border: 1px solid rgba(200, 200, 200, 1);
    border-radius: 0;
    transition: 200ms;
    width: 2rem;
    aspect-ratio: 1/1;
}

main button[id]:before {
    content: '^';
}

main button[id]:nth-child(2) {
    transform: rotate(-90deg);
}

main button[id]:nth-child(3) {
    transform: rotate(90deg);
}

main button[id]:nth-child(4) {
    transform: rotate(180deg);
}

footer {
/* 
    position: relative;
    top: 3rem; */
    background: rgba(200, 200, 200, .4);
    border-top: rgba(200, 200, 200, 1) 1px solid;
    padding: 1rem;
    font-size: 60%;

    display: flex;
    justify-content: space-between;
}

@media only screen and (max-width: 900px) {
    body {
        width: 100%;
    }
}