@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700');

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

@keyframes shake {
  0% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(5deg);
  }
  40% {
    transform: rotate(-5deg);
  }
  60% {
    transform: rotate(5deg);
  }
  80% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

body {
  position: relative;
  font-family: "Source Sans Pro", sans-serif;
}

.modal__wrapper {
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 11119;
  justify-content: center;
  align-items: center;
}

.modal {
  width: 420px;
  height: 300px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 4px #000;
}

.modal--top {
  display: flex;
  height: 50%;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2345;
  color: #4b4b4b(293, 96%, 28%);
  font-size: 28px;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background-color: #7d038d;
}

.overlay:before {
  position: absolute;
  content: " ";
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background-color: #82faff;
  opacity: 0.5;
}

.modal--bottom {
  display: flex;
  height: 50%;
  padding: 6%;
  color: #585a5b;
  flex-direction: column;
  justify-content: space-between;
}

.modal__btn {
  height: 45px;
  width: 110px;
  border: none;
  color: #005597;
  cursor: pointer;
  font-size: 16px;
  align-self: right;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: #aaf0ff;
}

.modal__btn:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.area__wrapper {
  height: 100vh;
  width: 100vw;
  background-color: #9a03ad;
  
  background-size: cover;
  background-position: 50% 0%;
  background-repeat: no-repeat;
  padding-top: 6%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.area {
  width: 400px;
  height: 400px;
  list-style: none;
  margin: 6% 0;
}

.area__head {
  color: #ffffff;
}

.tile {
  width: 20%;
  height: 20%;
  margin: 10px;
  position: relative;
  display: inline-block;
}

.tile--front,
.tile--back {
  padding: 20px 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: absolute;
  top: 0;
  font-size: 30px;
  width: 100%;
  min-height: 100%;
  text-align: left;
  backface-visibility: hidden;
  transform-style: preserve3d;
  transition: all 0.4s;
}

.tile--front {
  background: #ffffff;
  cursor: pointer;
}

.tile--back {
  transform: rotateY(-180deg);
}

.tile--selected .tile--back {
  transform: rotateY(0deg);
}

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

.tile--selected.tile--matched .tile--back,
.tile--selected.tile--matched .tile--front {
  animation-name: shake;
  animation-duration: 0.4s;
}

.area__footer {
  width: 80%;
  margin-top: 5%;
  display: flex;
  justify-content: space-between;
}

.area__footer > p {
  color: #ffffff;
  text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}