@import url("https://fonts.cdnfonts.com/css/pokemon-solid");
@import url(https://fonts.googleapis.com/css?family=Nunito:200,300,regular,500,600,700,800,900,200italic,300italic,italic,500italic,600italic,700italic,800italic,900italic);
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  text-align: center;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(
    to right top,
    #57e8f0,
    #66dfff,
    #92d2ff,
    #bdc4ff,
    #dcb7ea,
    #f0b3d9,
    #fbb1c6,
    #ffb3b3,
    #ffbca4,
    #ffca94,
    #ffdc87,
    #f9f184
  );
  font-family: "Nunito", sans-serif;
}

.game__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.game__header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.game__header h1 {
  font-size: 3rem;
  font-family: "Pokemon Solid", sans-serif;
  color: #fecb04;
  text-shadow: 2px 0 0 #3a5da8, 0 1px 0 #3a5da8, -1px 0 0 #3a5da8,
    0 -1px 0 #3a5da8;
  -webkit-text-stroke: 2px #3a5da8;
}

.game__header--timer-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.2rem;
}

.game__header--timer-container input {
  outline: none;
  padding: 1rem;
  border-radius: 16px;
  text-align: center;
  font-size: 1.2rem;
  color: #000;
}

.game__header--timer-container p {
  font-weight: 600;
}

#gameBoard {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  grid-template-rows: repeat(4, 120px);
  grid-gap: 1rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 16px;
  text-align: center;
}

.game__board--card {
  box-shadow: 0 3px 10px rgba(200, 200, 200, 0.9);
  border-radius: 10px;
  position: relative;
  transform-style: preserve-3d;
  overflow: hidden;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px,
    rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px,
    rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
  transition: all 0.2s ease-in-out;
}

.game__board--card:hover {
  transform: scale(1.2);
}

.game__board--card > .game__board--card-front,
.game__board--card > .game__board--card-back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  height: 100%;
  width: 100%;
  backface-visibility: hidden;
  transition: transform 0.5s;
}

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

.game__board--card-back h2 {
  text-align: center;
  font-size: 1rem;
}

.game__board--card-front {
  background-image: url("../assets/pokemonBall.png");
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}

#startGameButton {
  padding: 0.3rem;
  background-color: #fecb04;
  border: 5px #3a5da8 solid;
  width: 10rem;
  font-size: 1.5rem;
  font-family: inherit;
}

/* loader */
.lds-ring {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 64px;
  height: 64px;
  margin: 8px;
  border: 8px solid #000;
  border-radius: 50%;
  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: #000 transparent transparent transparent;
}
.lds-ring div:nth-child(1) {
  animation-delay: -0.45s;
}
.lds-ring div:nth-child(2) {
  animation-delay: -0.3s;
}
.lds-ring div:nth-child(3) {
  animation-delay: -0.15s;
}
@keyframes lds-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.highscore__container {
  padding: 1rem;
}

.highscore__list li {
  margin: 0.2rem;
  text-align: left;
}

.hidden {
  display: none;
}

@media screen and (max-width: 600px) {
  .game__header h1 {
    -webkit-text-stroke: 1px #3a5da8;
  }

  #gameBoard {
    grid-template-columns: repeat(4, 70px);
    grid-template-rows: repeat(4, 70px);
  }

  .game__header h1 {
    font-size: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .game__board--card-back img {
    height: 55px;
    width: 55px;
  }

  .game__board--card-back h2 {
    text-align: center;
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 420px) {
  .game__header h1 {
    -webkit-text-stroke: 1px #3a5da8;
  }

  #gameBoard {
    grid-template-columns: repeat(4, 70px);
    grid-template-rows: repeat(4, 70px);
  }

  .game__header h1 {
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .game__board--card-back img {
    height: 40px;
    width: 40px;
  }

  .game__board--card-back h2 {
    text-align: center;
    font-size: 0.7rem;
  }
}
