* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color:transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  height: 100vh;
  display: flex;
  background: url(img/background/s1200.webp);
  background-repeat: no-repeat;
  background-size: cover;
}

.game {
  width: 950px;
  height: 490px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;
  cursor: pointer;
}

.endgame {
  text-align: center;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 400px;
  height: 200px;
  line-height: 200px;
  font-size: 32px;
  border: 1px solid rgba(0, 0, 0, .3);
  box-shadow: 2px 2px 2px rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
  display: none;
  z-index: 999;
  background: #fff;
}

.endgame strong {
  color: darkolivegreen;
}

.restart_img {
  width: 46px;
  position: absolute;
  top: 130px;
  left: 176px;
  cursor: pointer;
}



.card {
  width: 108px;
  height: 108px;
  margin: 5px;
  position: relative;
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform .5s;

}

.card:active {
  transform: scale(0.97);
  transition: transform .2s;
}

.card.flip {
  transform: rotateY(180deg);
}

.invisible {
  visibility: hidden;
  transition: visibility 1.5s;


}

.front-face,
.back-face {
  width: 100%;
  height: 100%;

  position: absolute;
  border-radius: 5px;
  background: #1C7CCC;
  backface-visibility: hidden;
}

.front-face {
  transform: rotateY(180deg);
}


#button {
  display: block;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.08);
  color: #fff;
  width: 450px;
  text-align: center;
  font-family: 'segoe ui';
  font-size: 40px;
  padding: 15px 16px;
  margin: 20px auto;
  cursor: pointer;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
  background-color: rgb(43, 153, 91);
  border: 1px solid rgb(33, 126, 74);

}

#button:hover {
  background-color: rgb(75, 183, 141);
}


@media screen and (max-width: 750px) {
  body {
    background: #3ae6ca;

  }

  .game {
    padding: 0 0 0 58px;
    width: 950px;
    height: auto;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    perspective: 1000px;
    cursor: pointer;
  }


  .endgame {
    text-align: center;
    position: fixed;
    left: 50%;
    top: 50%;
    width: 280px;
    height: 200px;
    line-height: 200px;
    font-size: 32px;
    border: 1px solid rgba(0, 0, 0, .3);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, .3);
    transform: translate(-50%, -50%);
    display: none;
    z-index: 999;
    background: #fff;
  }

  #button {
    display: block;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.08);
    color: #fff;
    width: 115px;
    text-align: center;
    font-family: 'segoe ui';
    font-size: 40px;
    padding: 15px 16px;
    margin: 20px auto;
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.075);
    background-color: rgb(43, 153, 91);
    border: 1px solid rgb(33, 126, 74);

  }

  .restart_img {
    width: 46px;
    position: absolute;
    top: 130px;
    left: 115px;
    cursor: pointer;
  }
}