* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full viewport height */
}


.wrap {
	 flex: 1; 
  position: relative;
    width: 60%;
	margin: auto;
  height: 100%;
  min-height: 500px;
  padding-bottom: 20px;
}

.game {
  transform-style: preserve-3d;
  perspective: 500px;
  min-height: 100%;
  height: 100%;
}

@-webkit-keyframes matchAnim {
  0% {
    background: #bcffcc;
  }
  100% {
    background: white;
  }
}

@keyframes matchAnim {
  0% {
    background: #bcffcc;
  }
  100% {
    background: white;
  }
}
.card {
  float: left;
  width: 16.66666%;
  height: 25%;
  padding: 1px;
  text-align: center;
  display: block;
  perspective: 500px;
  position: relative;
  cursor: pointer;
  z-index: 50;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
@media (max-width: 800px) {
  .card {
    width: 25%;
    height: 16.666%;
  }
}
.card .inside {
  width: 100%;
  height: 100%;
  display: block;
  transform-style: preserve-3d;
  transition: 0.4s ease-in-out;
  background: white;
}
.card .inside.picked, .card .inside.matched {
  transform: rotateY(180deg);
}
.card .inside.matched {
  -webkit-animation: 1s matchAnim ease-in-out;
          animation: 1s matchAnim ease-in-out;
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s;
}
.card .front, .card .back {
  border: 1px solid black;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 5px;
}
.card .front img,
.card .back img {
  max-width: 95%;   /* leave space on the sides */
  max-height: 95%;  /* leave space top/bottom */
  display: block;
  margin: auto;     /* center the image */
  object-fit: contain; /* maintain aspect ratio inside */
  padding: 1px;     /* optional extra spacing */
  box-sizing: border-box;
}
.card .front {
  transform: rotateY(-180deg);
}
@media (max-width: 800px) {
  .card .front {
    padding: 5px;
  }
}
.card .back {
  transform: rotateX(0);
}
@media (max-width: 800px) {
  .card .back {
    padding: 10px;
  }
}

.modal-overlay {
  display: none;
  background: rgba(0, 0, 0, 0.8);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal {
  display: none;
  position: relative;
  width: 400px;
  height: 200px;
  max-height: 90%;
  max-width: 90%;
  min-height: 380px;
  margin: 0 auto;
  background: white;
  top: 50%;
  transform: translateY(-50%);
  padding: 30px 10px;
  text-align: center;
}
.modal .winner {
  margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;

}
.winner {
  font-size: 40px;
  text-align: center;
  color: red;

}
@media (max-width: 480px) {
	
	.wrap {
  position: relative;
    width: 90%;
	margin: auto;
  height: 100%;
  min-height: 500px;
  padding-bottom: 20px;
}
	.modal {
  display: none;
  position: relative;
  width: 300px;
  height: 200px;
  max-height: 90%;
  max-width: 90%;
 
  margin: 0 auto;
  background: white;
  top: 50%;
  transform: translateY(-50%);
  padding: 30px 10px;
}
  .modal .winner {
    margin-top: 0;
  color: #333;
  font-family: Tahoma, Arial, sans-serif;
  }
}
.modal .restart {
  font-size: 1em;
  padding: 10px;
  color: #red;
  border: 2px solid #06D85F;
  border-radius: 20px/50px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-out;
}
.modal .restart:hover {
  background: linear-gradient(#222, black);
   color: #fff;
}
.modal .newg {
  font-size: 1em;
  padding: 10px;
  color: #red;
  border: 2px solid #06D85F;
  border-radius: 20px/50px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-out;
}
.modal .newg:hover {
  background: linear-gradient(#222, black);
     color: #fff;
}

.modal .message {
  text-align: center;
}
.modal .message a {
  text-decoration: none;
  color: #28afe6;
  font-weight: bold;
}
.modal .message a:hover {
  color: #56c0eb;
  border-bottom: 1px dotted #56c0eb;
}
.modal .share-text {
  text-align: center;
  margin: 10px auto;
}
.modal .social {
  margin: 20px auto;
  text-align: center;
}
.modal .social li {
  display: inline-block;
  height: 50px;
  width: 50px;
  margin-right: 10px;
}
.modal .social li:last-child {
  margin-right: 0;
}
.modal .social li a {
  display: block;
  line-height: 50px;
  font-size: 20px;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}


footer {
  flex-shrink: 0; /* prevent footer from shrinking */
}
@media (max-width: 767px) {
  footer .disclaimer {
    font-size: 8px;
  }
}