@import url("https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300&display=swap");

html {
  height: -webkit-fill-available;
  overscroll-behavior: none;
}
body {
  min-height: 100vh;
  min-height: -webkit-fill-available;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  background-color: rgb(83, 83, 83);
  font-family: "Titillium Web", sans-serif;
  /* Sveip skal styre slangen, ikke skrolle/bounce'e siden (viktig når spillet
     også ligger i et lite iframe-vindu på mobilversjonen av rogersteinbakk.no). */
  touch-action: none;
  overscroll-behavior: none;
}
#swipe-mobile {
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.644);
  box-shadow: 0 0 6px rgb(43, 51, 27);
  z-index: 4;
  position: fixed;
  width: 100vw;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#swipe-mobile p {
  text-align: center;
  margin: 30px;
  background-color: #7b9548;
  padding: 20px;
  border-radius: 10px;
}

#swipe-mobile img {
  filter: invert();
  width: 30px;
  opacity: 0.6;
  animation-name: rotate;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

@keyframes rotate {
  from {
    transform: rotate(-10deg) translateX(-30px);
  }
  to {
    transform: rotate(20deg) translateX(10px);
  }
}

#gameboard {
  position: relative;
  background-color: #aacc66;
  border: 1px solid white;
  width: 95vmin;
  height: 95vmin;
  display: grid;
  grid-template-rows: repeat(21, 1fr);
  grid-template-columns: repeat(21, 1fr);
}

#start {
  letter-spacing: 2px;
  font-size: 1.2rem;
  z-index: 8;
  position: fixed;
  width: 100vw;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgb(123, 149, 72);
  background: linear-gradient(
    0deg,
    rgba(123, 149, 72, 0.795) 0%,
    rgba(43, 51, 27, 0.829) 100%
  );
}

#start div {
  z-index: 10;
  margin-bottom: 20%;
  z-index: 10;
  width: 350px;
  height: 300px;
  background-color: rgb(123, 149, 72);
  box-shadow: 0 0 6px rgb(43, 51, 27);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

#start button, #swipe-mobile button, #game-over button {
  background-color: rgb(43, 51, 27);
  color: rgba(195, 255, 176, 0.877);
  letter-spacing: 2px;
  border-radius: 5px;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
}
#start h2 {
  margin: 0;
}

#start p {
  text-align: center;
  margin-bottom: 0;
}

#start p button {
  background-color: #516131;
  padding: 8px 12px;
}

a {
  color: black;
  text-decoration: none;
}

#start button:hover {
  background-color: rgb(52, 65, 30);
}
#start h1 {
  margin: 10px;
}
#rs {
  margin-top: 2rem;
  letter-spacing: 1px;
  font-size: 0.9rem;
  text-align: center;
  line-height: 13px;
  color: #232e0e;
}

.snake {
  background-color: #49572d;
  border: 0.15vmin solid black;
  border-radius: 50%;
}

.food {
  /* background-color: red; */
  background-image: url("apple.svg");
  background-size: cover; /* <-- background size */
  background-position: center; /* <-- background position */
  /* border-radius: 10px; */
  /* border: 0.25vmin solid black; */
  display: flex;
  justify-content: center;
}

#red {
  background-color: red;
}
#points {
  position: fixed;
  width: 100vw;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}
#points div {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 2rem;
  color: #49572d;
  text-shadow: 1px black;
  background-color: rgba(252, 252, 252, 0.514);
  border-radius: 5px;
  padding: 2px 15px;
}

@media only screen and (max-width: 600px) {
  #points div {
    top: 3rem;
    left: 50%;
    bottom: auto;
    width: fit-content;
    transform: translateX(-50%);
  }
}

#game-over {
  visibility: hidden;
  z-index: 12;
  position: fixed;
  width: 100vw;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background-color: #7b9548fa;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: #fff;
  letter-spacing: 2px;
}

#game-over p {
  margin-bottom: 5px;
}
#game-over h2 {
  margin-top: 0;
  font-size: 3rem;
}

#game-over button {
  font-size: 1rem;
  box-shadow: 0 0 3px rgb(4, 97, 24);
  transition: ease-in-out 0.1s all;
}
#game-over button:hover {
  background-color: #313f15;
  transition: ease-in-out 0.1s all;
}
