* {
  box-sizing: border-box;
  margin: 0;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "roboto", sans-serif;
  background-image: url("../assets/background.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

h1 {
  text-align: center;
  margin: 60px auto 10px;
  font-family: "Homemade Apple", cursive;
  font-size: 42px;
  letter-spacing: 3px;
  color: #193a2a;
}

.main {
  background-color: #fcf1ecd3;
  height: calc(100vh - 60px);
  border-radius: 8px;
  width: 70%;
  max-width: 700px;
}

/* navigation section ---------------------------------------- */

.navigation-container {
  display: flex;
  justify-content: space-evenly;
  width: 80%;
  margin: 0 auto;
  margin-bottom: 50px;
  border-radius: 6px;
  padding: 15px;
}

.difficulty-level {
  display: flex;
  align-items: center;
}

select {
  cursor: pointer;
}

.mute {
  border: none;
  background-color: #fcf1ec00;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  scale: 1.8;
  display: flex;
  align-items: flex-start;
}

.mute:hover {
  scale: 2;
}

.open-popup {
  cursor: pointer;
  transition: 0.2s ease-in-out;
}

.open-popup:hover {
  color: #193a2a;
}

/* Pop up styling: instructions, game won and game lost --------- */

.popup-container,
.win-container,
.lose-container {
  position: absolute;
  display: flex;
  height: 100%;
  width: 100%;
  background-color: #2e5a3b9a;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lose,
.win {
  height: 50%;
  width: 30%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  text-align: center;
  font-family: "Homemade Apple", cursive;
}

.win-container #butterfly {
  width: 200px;
  margin: 10px auto;
  justify-self: center;
}

.win-container p {
  font-family: "roboto", sans-serif;
  margin-top: 10px;
}

.win-container h2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.win-container h2 #gold {
  width: 60px;
  margin-left: 20px;
  animation: shake 0.7s infinite;
}

@keyframes shake {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(25deg);
  }

  51% {
    transform: rotate(-1deg);
  }

  75% {
    transform: rotate(-25deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

#caterpillar {
  display: flex;
  justify-content: center;
  margin: 20px auto;
  width: 250px;
}

.restart,
.restart-win {
  cursor: pointer;
  font-family: "Homemade Apple", cursive;
  padding: 10px 20px;
  width: 150px;
  margin: 20px auto;
}

.popup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 750px;
  width: 50%;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
}

.popup h2 {
  margin-bottom: 20px;
  font-family: "Homemade Apple", cursive;
  text-align: center;
}

.popup p {
  margin-bottom: 10px;
  text-align: center;
}

.popup p#disclaimer {
  font-family: "Homemade Apple", cursive;
  font-size: 12px;
  margin-top: 10px;
}

.popup .close-btn {
  align-self: flex-end;
  cursor: pointer;
  margin-right: 10px;
}

/* grid styling ------------------------------------------- */

.grid-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.grid {
  align-items: center;
  box-shadow: 0 0 20px 0 rgba(107, 160, 116, 0.712);
  display: flex;
  flex-wrap: wrap;
  height: 100%;
  justify-content: center;
  height: 600px;
  width: 600px;
  margin-top: 0;
}

.grid div {
  border: 1px solid #193a2a;
  background-color: #96c07f;
  flex-grow: 1;
  height: 12.5%;
  width: 12.5%;
}

.grid div.flag {
  background-image: url("../assets/flag.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}

.grid div.mine {
  border: 1px solid #193a2a;
}

.mine.uncovered {
  background-image: url("../assets/mine.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
  background-color: rgb(91, 148, 91);
}

.grid div.finished {
  background-image: url("https://media2.giphy.com/media/Q9ajBrYQoSzkWPJ8Os/200w.webp");
  background-position: center;
  background-size: 70%;
  background-repeat: no-repeat;
}

.grid div.zero {
  background-color: rgb(87, 123, 91);
}

.grid div.one {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/one.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.two {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/two.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.three {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/three.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.four {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/four.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.five {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/five.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.six {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/six.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.seven {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/seven.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

.grid div.eight {
  background-color: rgb(103, 145, 108);
  background-image: url("../assets/eight.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
}

/* reduce grid size on smaller screens --------------------------------- */

@media screen and (max-width: 1500px) {
  .grid {
    max-height: 400px;
    max-width: 400px;
  }

  .navigation-container {
    margin-bottom: 10px;
  }

  h1 {
    margin-bottom: 0;
    margin-top: 20px;
  }

  .win,
  .lose {
    min-height: 70%;
  }
}
