
* {
  box-sizing: border-box;
}

body {
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 20px;
  background: linear-gradient(
    90deg,
    rgba(42, 123, 155, 1) 0%,
    rgba(87, 199, 133, 1) 50%,
    rgba(237, 221, 83, 1) 100%
  );
  margin: 0;
}

/* Title */
.title {
  font-style: italic;
  font-size: 25px;
  font-weight: 700;
  margin: 10px 0;
  text-align: center;
	color: darkviolet;
}

/* Basic structure */
.game-wrapper {
  display: flex;
}

.sidebar {
  display: flex;
  justify-content: space-evenly;
  margin: 10px auto;
  max-width: 300px;
	color: #d10404;
}

.chooser {
	font-size: 16px;
	font-weight: 600;
  border-radius: 8px;
	border: 2px solid #cd04e7;
	color: #058316;
}

.statistic {
  margin: 10px 0;
  font-size: 18px;
  font-weight: 500;
	color: darkviolet;
}

.timer, .scores {
	color: #d10404;
}

/* Playing field */
.playground {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: auto;
  width: 700px;
}

.big-playground {
  width: 900px;
}

/* Cards */
.card {
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  background-image: url(../pics/logo1.svg);
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
  height: 150px;
  margin: 5px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease-in-out;
  width: 150px;
}

.card-for-6x6 {
  height: 100px;
  width: 100px;
  border-radius: 8px;
}

.turned {
  transform: rotateY(180deg);
}

.side {
  backface-visibility: hidden;
  height: 100%;
  position: absolute;
  width: 100%;
}

.front {
  transform: rotateY(180deg);
  border-radius: 8px;
}

/* Game over popup*/
.end-game-popup {
  background-color: #faf1fc;
  border: 1px solid #cd04e7;
  box-shadow: 0 0 10px rgba(227, 3, 3, 0.96) inset;
  border-radius: 8px;
  height: 280px;
  margin: auto;
  padding-top: 12px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 300px;
  text-align: center;
  color: blueviolet;
}

.game-popup {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px; 
}

.final-text-title {
  font-weight: 700;
  font-size: 42px;
  line-height: 1.3;
  margin-block: 0px;
	font-family: "Merienda", cursive;
	color: darkviolet;
}

.final-text {
  font-size: 25px;
  font-weight: 500;
  margin-block: 16px;
	color: darkviolet;
}

.result {
	color: #d10404;	
}

.new-game-btn {
	padding: 6px 24px;
	border-radius: 8px;
	border: 2px solid darkviolet;
  margin-top: 4px;
	font-size: 18px;
	font-weight: 600;
	color: #058316;
}

.new-game-btn:hover {
  box-shadow: 0 0 8px #d3d3d3;
}

.new-game-btn:active {
  box-shadow: none;
}

@media screen and (max-width: 768px) {
  .game-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    align-self: center;
    text-align: center;
  }

  .playground {
    width: 600px;
    justify-content: center;
  }

  .big-playground {
    width: 700px;
    margin: 0;
  }

  .card {
    width: 125px;
    height: 125px;
  }

  .card-for-6x6 {
    width: 80px;
    height: 80px;
  }

  .card-for-8x8 {
    border-right: none;
    margin: 2px;
    height: 80px;
    width: 80px;
  }

  .end-game-popup {
    top: 100px;
  }
}

@media screen and (max-width: 480px) {
  .playground {
    justify-content: center;
    margin: 0 auto;
  }

  .card {
    height: 120px;
    width: 120px;
    margin: 4px;
  }

  .card-for-6x6 {
    height: 90px;
    width: 90px;
  }

  .card-for-8x8 {
    border-right: none;
    margin: 2px;
    height: 90px;
    width: 90px;
  }
}

@media screen and (max-width: 414px) {
  .playground {
    width: 100vw;
  }

  .card {
    height: 80px;
    width: 80px;
    margin: 2px;
  }

  .card-for-6x6 {
    height: 76px;
    width: 76px;
  }

  .card-for-6x6 .back {
    padding: 25% 0;
  }

  .card-for-8x8 {
    border-right: none;
    margin: 2px;
    height: 76px;
    width: 76px;
  }

  .card-for-8x8:nth-child(8n) {
    border-right: 1px solid #ddd;
  }
}

@media screen and (max-width: 380px) {
  .card-for-8x8 {
    border: 1px solid #ddd;
  }
}

@media screen and (max-width: 360px) {
  .card {
    height: 80px;
    margin: 2px;
    width: 80px;
  }

  .card-for-6x6 {
    height: 80px;
    width: 80px;
    margin: 2px;
  }

  .card-for-8x8 {
    height: 65px;
    width: 65px;
    border: 1px solid #ddd;
  }
}
