.flip-container.hover .flipper,
.flip-container.flip .flipper {
  transform: rotateY(180deg);
}

#statistics {
  margin: auto;
  margin-bottom: 30px;
  justify-content: center;
  font-family: "Bangers", cursive;
  font-size: 16pt;
}

#header {
  text-align: center;
  margin: auto;
  justify-content: center;
  font-family: "Nosifer", cursive;
  font-size: 20pt;
  margin-top: -20px;
  margin-bottom: -30px;
}

#timer-container {
  text-align: center;
  margin: auto;
  justify-content: center;
}
#timer {
  text-align: center;
  margin: auto;
  justify-content: center;
}

#failed-attempts {
  text-align: center;
  margin: auto;
  justify-content: center;
}

#scoreboard {
  text-align: center;
  margin: auto;
  justify-content: center;
}

#wrapper {
  margin: auto;
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(4, 120px);
  grid-gap: 5px;
  grid-template-rows: repeat(4, 120px);
}

p {
  display: inline;
}

#tileset-selector-div p {
  font-family: "Bangers";
  font-size: 18px;
}

#tileset-selector {
  transform: translateY(-3px);
}

.card {
  align-content: center;
}

.row1 {
  grid-column: 1 / 2;
}

.row2 {
  grid-column: 2 / 3;
}

.row3 {
  grid-column: 3 / 4;
}

.row4 {
  grid-column: 4 / 5;
}

.column1 {
  grid-row: 1 / 2;
}

.column2 {
  grid-row: 2 / 3;
}

.column3 {
  grid-row: 3 / 4;
}

.column4 {
  grid-row: 4 / 5;
}

/* entire container, keeps perspective */
.flip-container {
  perspective: 1000px;
}

.flip-container.hover .flipper,
.flip-container.flip .flipper {
  transform: rotateY(540deg);
}

/* flip speed goes here */
.flipper {
  transition: 0.4s;
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
  position: relative;
}

/* hide back of pane during swap */
.front,
.back {
  backface-visibility: hidden;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* front pane, placed above back */
.front {
  border-radius: 5px;
  background-color: rgb(255, 0, 0);
  z-index: 2;
  /* for firefox 31 */
  transform: rotateY(0deg);
}

/* back, initially hidden pane */
.back {
  border-radius: 5px;
  background-color: rgb(255, 243, 0);
  transform: rotateY(540deg);
}

img {
  max-width: 100%;
  max-height: 100%;
}

div#menu-modal.modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 5px;
  position: absolute;
  z-index: 1;
  position: absolute;
  width: 50%;
  height: 40%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: auto;
  background-color: rgb(116, 166, 240);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  transform: translate(-50%, -50%);
}

.modal-content > p {
  font-family: "Bangers", cursive;
  font-size: 16pt;
}

.matched .back {
  background-color: rgb(62, 171, 69);
  transition: background-color 3s ease;
}
