@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Oswald", sans-serif;
  font-optical-sizing: auto;
}
html,
body {
  background-color: forestgreen;
  height: 100%;
  background-image: url(./image/jungle.jpg);
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
}
.loading{
  z-index: 99;
  position: absolute;
  height: 100vh;
  width: 100vw;
  background-color: forestgreen;
  transition: 0.45s;
}
.loading-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: whitesmoke;
  font-size: 7vw;
  text-shadow: 2px 2px 5px rgba(0,0,0, 0.3),
  5px 5px 70 px rgba(255,255,255, 0.5);

}
.number {
  width: 100%;
  text-align: center;
}
#bar{
width: 300px;
height: 12px;
border: 1px solid whitesmoke;
box-shadow: 2px 2px 5px rgba(0,0,0, 0.3),
  5px 5px 70 px rgba(255,255,255, 0.5);
}
#progress{
  background-color: whitesmoke;
  width: 0%;
  height: 100%;
}
.body {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes shake {
  0% {  transform: translate(2px, 1px) rotate(0deg); } 
  10% {  transform: translate(-1px, -2px) rotate(-1deg); }
  20% {  transform: translate(-3px, 0px) rotate(1deg); }
  30% {  transform: translate(0px, 2px) rotate(0deg); }
  40% {  transform: translate(1px, -1px) rotate(1deg); }
  50% {  transform: translate(-1px, 2px) rotate(-1deg); }
  60% {  transform: translate(-3px, 1px) rotate(0deg); }
  70% {  transform: translate(2px, 1px) rotate(-1deg); }
  80% {  transform: translate(-1px, -1px) rotate(1deg); }
  90% {  transform: translate(2px, 2px) rotate(0deg); }
  100% {  transform: translate(1px, -2px) rotate(-1deg); }
}
@keyframes serpent {
 0% {transform: translate(14%, -36%) scale(0.04);}
 100% { transform: translate(13%, -15%) scale(0.28);}
}
.shake{
   animation-name: shake;
   animation-duration: 0.5s;
   transform-origin:50% 50%;
   animation-iteration-count:infinite;
}
.active-snake{
   animation-name: serpent;
   animation-duration: 0.7s;
   transform-origin:50% 50%;
   animation-iteration-count:1;
}
/* #peach-img{
  filter: drop-shadow(2px 1px 2px black);
  inset: 370px 220px;
  position: fixed;
  width: 117px
} */
#snake-img {
  
  filter: drop-shadow(2px 1px 2px black);
  position: fixed;
  transform: translate(13%, -15%) scale(0.28);
}
/* 2 */
.play-mode {
  z-index: 1;
  padding: 7px;
  color: darkgreen;
  font-weight: 500;
  border-top: 3px ridge darkgreen;
  box-shadow: inset 1px 1px 3px black;
  background-color: greenyellow;
  text-align: justify;
  position: absolute;
  margin: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  width: 66vmin;
  height: 62vmin;
  top: 115px;
  visibility: Hidden;
}
/* 1 */
.play-menu {
  z-index: 1;
  padding: 7px;
  color: darkgreen;
  font-weight: 500;
  border-top: 3px ridge darkgreen;
  box-shadow: inset 1px 1px 3px black;
  background-color: greenyellow;
  text-align: justify;
  position: absolute;
  margin: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  width: 66vmin;
  height: 62vmin;
  top: 115px;
  visibility: visible;
}
.play-menu .titre-menu {
  margin-bottom: 7px;
  color: darkgreen;
  text-shadow: 0px 0px 1px black;
}
.play-menu p {
  margin: 30px;
}
div.play-menu ul.wrap-liste {
  display: flex;
  margin: 20px;
  list-style: none;
}
div.play-mode ul.wrap-liste {
  display: flex;
  margin: 20px;
  list-style: none;
}
ul.wrap-liste li {
  font-size: 1.4em;
  user-select: none;
  padding: 2px 5px;
  cursor: pointer;
  box-shadow: 1px 1px 2px black;
  border-radius: 7px;
  margin: 5px;
  display: flex;
  justify-content: space-around;
  background-color: darkgreen;
  color: lightgreen;
  width: 100%;
  height: auto;
  letter-spacing: 1px;
}
ul.wrap-liste li:hover {
  color: greenyellow;
}
ul.wrap-liste li:active {
  box-shadow: inset 1px 1px 2px black;
}
.mode {
  margin-top: 10px;
  border-top: 1px solid darkgreen;
}
/* 3 */
.game-over {
  z-index: 1;
  padding: 7px;
  color: darkgreen;
  font-weight: 500;
  border-top: 3px ridge darkgreen;
  box-shadow: inset 1px 1px 3px black;
  background-color: greenyellow;
  text-align: justify;
  position: absolute;
  margin: 7px;
  display: flex;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  width: 66vmin;
  height: 62vmin;
  top: 115px;
  background-image: url(./image/ipeach.svg);
  background-size: 1778px;
  background-position-x: -741px;
  background-position-y: -16px;
  visibility: hidden;
}
.game-over .titre-over {
  font-size: calc(3 * (0.5vmin + 1.5vmax));
  margin-bottom: 7px;
  color: darkgreen;
  text-shadow: 0px 0px 1px black;
}
div.game-over ul {
  display: flex;
  margin: 5px;
  list-style: none;
  flex-wrap: wrap;
justify-content: space-around;
  align-items: center;
}
div.game-over ul li {
  z-index: 1;
  margin-top: 20px;
  margin-bottom: 0px;
  width: auto;
}
div.game-over ul li:first-child {
  color: darkgreen;
  background-color: lightgreen;
  font-weight: 700;
}
div.game-over ul li:first-child:hover {
  color: green;
}
div.game-over ul li:nth-child(2) {
  color: darkgreen;
  background-color: lightgreen;
  font-weight: 700;
}
div.game-over ul li:last-child {
  margin: 45px;
}
div.game-over ul li:nth-child(2):hover {
  color: green;
}


.wrapper {
  margin: 7px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 78vmin;
  height: 90vmin;
  background-color: greenyellow;
  border: 3px solid rgb(0, 0, 0);
  border-radius: 5px;
}
.wrapper h1 {
  text-shadow: 1px 1px 0px lightgreen, /*bas droit */ 2px 2px 2px black,
    /*bas droit */ 1px -1px 2px black, /* haut droit*/ -1px -1px 2px black,
    /*haut gauche*/ -1px 1px 2px black; /*bas gauche*/
  letter-spacing: 9px;
  font-size: calc(3 * (0.5vmin + 1vmax));
  text-align: center;
  padding: 0;
  border-bottom: 5px double darkgreen;
  margin: 0;
  color: forestgreen;
}
.game-details {
  color: darkgreen;
  font-size: 15px;
  font-weight: 500;
  padding: 0px 15px 5px;
  display: flex;
  justify-content: space-between;
}
.wrap_board{
  display: grid;
  place-items: center; 
  margin: 20px; 
  background-color: #adff2f; 
}
.play-board {
  border: 2px solid #74ba74;
  max-width: 600px; 
  max-height: 600px; 
  width: 100%; 
  height: auto; 
  aspect-ratio: 1; 
  background-color: lightgreen;
  display: grid;
  grid-template: repeat(30, 1fr) / repeat(30, 1fr);
}
.play-board .food {  
  background-color: #fa1;
  display: block;
}
.play-board .head {
  background-color: forestgreen;
}
.guide{
  z-index: 0;
  transform: translate(50%, 50%);
  top: 50%;
  right: 50%;
  position: absolute;
}
.guide-mobile{
  display: none;
  z-index: 0;
  transform: translate(50%, 50%);
  top: 50%;
  right: 50%;
  position: absolute;
}
.wrap-quit{
  display:none;
  justify-content: space-around;  
}
.quit-game{
  font-size: 1.4em;
  user-select: none;
  padding: 2px 5px;
  cursor: pointer;
  box-shadow: 1px 1px 2px black;
  border-radius: 7px;
  margin: 5px;
  display: flex;
  justify-content: space-around;
  background-color: #90ee90;
    color: #006400;
  letter-spacing: 1px;
  font-weight: bolder;
}
.quit-game:active .texte {
  font-size: 0.98em 
}
.texte {
  transition: font-size 0.2s; 
}
/* footer */
.dje-wrap {
  min-height: 100%;
  margin-bottom: -20px;
}
.dje-wrap:after {
  content: "";
  display: block;
}
.dje-footer,
.dje-wrap:after {
  height: 20px;
}
.dje-footer {
  padding: 0 5px;
  display: flex;
  justify-content: space-between;
  background-color: forestgreen;
  color: #fcfcfc;
  font-size: 12px;
  text-align: center;
}


@media screen and (max-width: 800px){
  html, body {
    background-color: forestgreen;
    height: 100%;
    background-image: none 
  }
  .wrapper {
    width: 90%;
    height: 90vh;
}
  .play-menu,
  .play-mode,
  .game-over {
    width: 90%;
    height: 80vh
}
  .controls{
    display: grid;
    margin: -5px 0 -48px 0;
  }
  .game-details span{
    border-right: 2px double forestgreen;
    padding-right: 3px;
    font-size: 20px;
  }
  .mode {
    font-size: 25px;
  }
  .guide{
    display:none;
  } 
  .guide-mobile{
    text-align: center;
    margin-top: -115px;
    display:block;
  } 
  
  ul.wrap-liste li {
    font-size: calc(3 * (0.5vmin + 0.7vmax));
  }
#snake-img {
  transform: translate(3%, -5%) scale(0.4);
}
@keyframes serpent {
  0% { transform: translate(6%, -33%) scale(0.04);}
  100% { transform: translate(3%, -5%) scale(0.4);}
 }
}

@media screen and (min-width: 320px) and (max-width: 480px){
  .wrapper {
    width: 90%;
    height: 85vh;
}
  .play-menu,
  .play-mode,
  .game-over {
    width: 90%;
    height: 70vh
}
.game-details{
  flex-direction: column;  
}
.game-details span {
  font-size: 13.5px;
}
#snake-img {
  transform: translate(3%, -15%) scale(0.4);
}
@keyframes serpent {
  0% { transform: translate(6%, -33%) scale(0.04);}
  100% { transform: translate(3%, -15%) scale(0.4);}
 }

};
