* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Reggae One", system-ui;
}

body {
  background-image: url(https://wallpaperset.com/w/full/5/1/8/438242.jpg);
}

.wrapper {
  box-sizing: content-box;
  width: 26.87em;
  padding: 2.5em 3em;
  background-color: #ffffff96;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  border-radius: 0.6em;
  box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
}

.game-container {
  position: relative;
  width: 100%;
  display: grid;
  gap: 0.6em;
}
.stats-container {
  text-align: right;
  margin-bottom: 1.2em;
}
.stats-container span {
  font-weight: 600;
}
.card-container {
  position: relative;
  width: 6.25em;
  height: 6.25em;
  cursor: pointer;
  overflow: hidden;
  perspective: 1000px;
}

.card-before,
.card-after {
  position: absolute;
  border-radius: 5px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid black;
  transition: transform 0.7s ease-out;
  backface-visibility: hidden;
}

.card-before {
  background-color: #96d9d8;
  font-size: 2.8em;
  font-weight: 600;
}

.card-after {
  background-color: #ffffff;
  transform: rotateY(180deg);
}
.card-container.flipped .card-before {
  transform: rotateY(180deg);
}

.card-container.flipped .card-after {
  transform: rotateY(0deg);
}

.control-container {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-image: url(https://images.squarespace-cdn.com/content/v1/5fe4caeadae61a2f19719512/96b352c5-f120-4442-b65b-ef98cd0cffbd/Pokemon+%7C+Where+Are+You%3F);
  background-size: cover;
  background-repeat: no-repeat;
  top: 0;
}

.card-before img,
.card-after img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

button {
  border: none;
  border-radius: 0.3em;
  padding: 1em 1.5em;
  cursor: pointer;
}
#stop {
  font-size: 1.1em;
  display: block;
  margin: 1.1em auto 0 auto;
  background-color: #e02e21;
  color: #ffffff;
  box-shadow: 2px 2px 5px 2px rgba(0, 0, 0, 0.5);
}
.control-container button {
  font-size: 1.3em;
  box-shadow: 0 0.6em 2em rgba(86, 66, 0, 0.2);
}
.hide {
  display: none;
}
#result {
  text-align: center;
}
#result h2 {
  font-size: 2.5em;
}
#result h4 {
  font-size: 1.8em;
  margin: 0.6em 0 1em 0;
}

.game-instructions {
  text-align: center;
  margin-top: 1em;
  font-size: 1.2em;
  color: white;
}
