.wrapper {
  position: relative;
  padding: 0 0 30px;
  background: #f2f2f2;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* height: 100vh; */
  overflow: hidden;
  box-sizing: border-box;
}

@media only screen and (max-width: 767px) {
  .wrapper {
    padding: 10px 10px 30px;
    margin-top: 60px;
  }
}

h1 {
  margin-bottom: 20px
}

.font400 {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 400;
  font-style: normal
}

.font700 {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 700;
  font-style: normal
}

.font800 {
  font-family: "M PLUS Rounded 1c", sans-serif;
  font-weight: 800;
  font-style: normal
}

#status {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  font-size: 1.92rem;
  background-color: #ebd3ff;
  padding: 10px 30px;
  border-radius: 10px;
  color: #4d1a78;
  flex-shrink: 0;
  margin-top: 20px
}

#inGameRetryButton {
  background: #4d1a78;
  color: #fff;
  border: none;
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 1.44rem;
  cursor: pointer;
  transition: transform .1s, background-color .2s
}

#inGameRetryButton:hover {
  background: #6b26a5;
  transform: scale(1.05)
}

#inGameRetryButton:active {
  transform: scale(0.95)
}

#game {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
  height: min(100vw, 95vh - 50px)
}

@media only screen and (max-width: 767px) {
  #game {
    width: min(95vw, 100vh - 50px);
    min-height: 150vw;
    height: 100%;
  }
}

.card {
  width: 100%;
  height: 100%;
  aspect-ratio: 651/1000;
  perspective: 1000px;
  cursor: pointer
}

.card.open .card-inner {
  transform: rotateY(180deg)
}

.card {
  transform-style: preserve-3d
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform .5s;
  transform-style: preserve-3d
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .2);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d
}

.card-back {
  transform: rotateY(0deg)
}

.card-front {
  transform: rotateY(180deg)
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform .5s;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d
}

.card img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
  object-fit: contain
}

.card-front {
  background: #fff;
  transform: rotateY(180deg)
}

.card-front img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
  object-fit: contain
}

.card-back {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff
}

.card-back img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
  object-fit: contain;
  display: block
}

#clearMessage {
  display: none;
  margin-top: 20px;
  font-size: 3.2rem;
  font-weight: bold;
  color: #f60;
  text-align: center
}

#retryButton {
  margin-top: 16px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: #5b7cff;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  transition: .2s;
}

#retryButton:hover {
  transform: scale(1.05)
}

@media(max-width: 768px) {
  #game {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px
  }
}

@media(max-width: 768px) {
  /* body {
    padding: 10px
  } */

  h1 {
    font-size: 2.24rem;
    margin-bottom: 10px
  }

  #status {
    gap: 12px;
    font-size: 1.44rem;
    margin-bottom: 10px
  }

  #game {
    gap: 4px
  }
}

.elekids-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1
}

.overlay-content {
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
}

.overlay-content h2 {
  font-size: 3.84rem;
  margin-bottom: 10px
}

.overlay-content h2.title {
  color: #4d1a78
}

.overlay-content p {
  font-size: 1.92rem;
  margin-bottom: 10px
}

.overlay-content button {
  margin-top: 15px;
  padding: 10px 20px;
  font-size: 1.6rem;
  cursor: pointer;
  color: #000;
  background-color: #efefef;
  border: 1px solid #767676;
  border-radius: 3px;
}

.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: all
}

.countdown-box {
  background-color: rgba(0, 0, 0, .75);
  padding: 20px 50px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
  border: 2px solid hsla(0, 0%, 100%, .2);
  min-width: 160px;
  text-align: center
}

#countDownText {
  font-size: 6.4rem;
  font-weight: bold;
  color: #fff;
  display: block;
  animation: popIn .3s ease-out
}

@keyframes popIn {
  0% {
    transform: scale(0.6);
    opacity: 0
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}