.mg-wrap,
.mg-wrap * {
  box-sizing: border-box;
}

.mg-wrap {
  position: relative;
}
.mg-wrap .mg-game {
  z-index: 10;
}
.mg-wrap .mg-modal-wrap {
  z-index: 20;
}

.mg-game {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 5px;
}

@media (orientation: landscape) {
  .mg-game {
    grid-template-columns: repeat(6, 1fr);
  }

  .mg-card {
    max-width: 18vh;
  }
}
@media (orientation: portrait) {
  .mg-game {
    grid-template-columns: repeat(4, 1fr);
  }

  .mg-card {
    max-width: 12vh;
  }
}
.mg-game.mg-img-picker,
.mg-game.mg-layout-6x4.mg-img-picker {
  grid-template-columns: repeat(6, 100px);
}

.mg-game.mg-layout-4x6.mg-img-picker {
  grid-template-columns: repeat(4, 100px);
}

.mg-game.mg-board-layout,
.mg-game.mg-layout-6x4.mg-board-layout {
  grid-template-columns: repeat(6, 15px);
}

.mg-game.mg-layout-4x6.mg-board-layout {
  grid-template-columns: repeat(4, 15px);
}

@keyframes matchAnim {
  0% {
    background: #bcffcc;
  }
  100% {
    background: white;
  }
}
.mg-inside {
  padding-top: 125%;
  height: 0;
}
.mg-inside.mg-picked, .mg-inside.mg-matched {
  transform: rotateY(180deg);
}
.mg-inside.mg-matched .mg-front {
  animation: 1s matchAnim ease-in-out;
  animation-delay: 0.4s;
}

.mg-front,
.mg-back {
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid black;
  background: white;
  padding: 5px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}
.mg-front img,
.mg-back img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  margin: 0 auto;
}
.mg-front img.mg-fit-cover,
.mg-back img.mg-fit-cover {
  object-fit: cover;
}

.mg-modal-wrap {
  display: none;
  background: rgba(0, 0, 0, 0.8);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.mg-modal-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
}

.mg-modal {
  width: 80%;
  margin: 0 auto;
  background: white;
  padding: 5%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex-flow: wrap;
  align-items: center;
  align-content: space-evenly;
  gap: 20px;
}
.mg-modal .mg-winner {
  font-size: 80px;
  text-align: center;
  color: #4d4d4d;
  text-shadow: 0px 3px 0 black;
}
@media screen and (max-width: 667px) {
  .mg-modal .mg-winner {
    font-size: 60px;
  }
}
.mg-modal .mg-modal-buttons {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  flex-flow: wrap;
  flex-flow: wrap;
  align-items: center;
  gap: 20px;
}
.mg-modal .mg-modal-buttons .mg-restart,
.mg-modal .mg-modal-buttons .mg-leave {
  margin: 5px;
  padding: 10px 20px;
  display: block;
  font-size: 25px;
  background: linear-gradient(#4d4d4d, #222);
  border: 1px solid #222;
  border-radius: 5px;
  color: white;
  text-shadow: 0px 1px 0 black;
  cursor: pointer;
}
.mg-modal .mg-modal-buttons .mg-restart:hover,
.mg-modal .mg-modal-buttons .mg-leave:hover {
  background: linear-gradient(#222, black);
}
@media screen and (max-width: 667px) {
  .mg-modal .mg-modal-buttons .mg-restart,
.mg-modal .mg-modal-buttons .mg-leave {
    font-size: 15px;
  }
}

.mg-card {
  perspective: 1000px;
  -moz-perspective: 1000px;
  -webkit-perspective: 1000px;
  -ms-perspective: 1000px;
  -moz-perspective: 1000px;
}

.mg-card.mg-picked .mg-inside,
.mg-card.mg-matched .mg-inside {
  transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  -ms-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
}

.mg-inside {
  transition: 0.6s;
  -moz-transition: 0.6s;
  -webkit-transition: 0.6s;
  -ms-transition: 0.6s;
  -moz-transition: 0.6s;
  transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  -ms-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  position: relative;
}

.mg-front,
.mg-back {
  backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -ms-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

.mg-back {
  z-index: 3;
  transform: rotateY(0deg);
  -moz-transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
  -ms-transform: rotateY(0deg);
  -moz-transform: rotateY(0deg);
}

.mg-front {
  z-index: 2;
  transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
  -ms-transform: rotateY(180deg);
  -moz-transform: rotateY(180deg);
}

/*# sourceMappingURL=mem-game.css.map */
