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

body {
  background: linear-gradient(to bottom, #0d3a37, #739f56);
  background-color: #183a37;
  min-height: 100vh;
  font-family: "MuseoModerno", cursive;
  color: #cbc0d3;
  font-size: 1em;
  max-width: 100%;
}
h1 {
  font-size: 2.5em;
  text-align: center;
  font-weight: bolder;
}
h2 {
  font-size: 1em;
  text-align: center;
  font-weight: bolder;
  padding: 5px;
}
span {
  color: rgb(251, 194, 7);
  padding: 3px;
}
#game {
  display: flex;
  flex-direction: column;
}
#panel {
  background: #0d3a37;
  /* background: linear-gradient(to bottom, #0d3a37, #739f56); */
  color: #cbc0d3;
  border: solid 2px #cbc0d3;
  border-radius: 5px;
  padding: 5px;
  margin: 10px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: rgba(0, 0, 0, 0.5) 10px 25px 10px;
}
#end {
  color: rgb(251, 194, 7);
  font-weight: bolder;
}
#reset {
  background-color: #cbc0d3;
  color: #0d3a37;
  width: fit-content;
  font-weight: bolder;
  border-radius: 5px;
  padding: 3px 10px;
  border: 0;
  margin: 5px;
  cursor: pointer;
}
#reset:hover {
  background-color: rgb(251, 194, 7);
}
section {
  width: 95vw;
  margin: auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  height: 100vh;
}
.cards {
  margin-top: 1em;
  display: grid;
  grid-template-columns: repeat(4, 4rem);
  grid-template-rows: repeat(4, 4rem);
  grid-gap: 0.5rem;
  perspective: 1000px;
}
.back {
  background-color: #cbc0d3;
  backface-visibility: hidden;
}

.front,
.back {
  width: 100%;
  height: 100%;
  position: absolute;
  pointer-events: none;
  border-radius: 5px;
}
.card {
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: all 2s ease;
  transform: rotateY(0deg);
  box-shadow: rgba(0, 0, 0, 0.5) 10px 25px 10px;
}

.flip {
  transform: rotateY(180deg);
}
@media only screen and (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(4, 6rem);
    grid-template-rows: repeat(4, 6rem);
  }
  section {
    height: 100vh;
  }
  #game {
    display: flex;
    flex-direction: row-reverse;
  }

  #panel {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: space-around;
  }
}
