/* =========================
   GAME: MEMORY
========================= */

.memory-game {
  font-family: "Fredoka", Arial, sans-serif;
}

.memory-top {
  background: #bff1ea;
  border: 7px solid #000;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: 8px 8px 0 rgba(0,0,0,0.25);
}

.memory-top h3 {
  margin: 0;
  font-size: 34px;
}

.memory-top p {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.memory-card {
  height: 170px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  perspective: 900px;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.35s;
  transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
  position: absolute;
  inset: 0;
  border: 6px solid #000;
  border-radius: 20px;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  box-shadow: 6px 8px 0 rgba(0,0,0,0.25);
}

.memory-card-front {
  background: linear-gradient(180deg, #ed9fff, #d277f0);
  font-size: 70px;
  font-weight: 900;
}

.memory-card-back {
  background: #fff;
  transform: rotateY(180deg);
  padding: 10px;
}

.memory-card-back strong {
  font-size: 26px;
}

.memory-card-back .vocab-img-box {
  width: 100%;
  height: 120px;
  margin: 0;
  border-width: 4px;
}

.memory-card.matched .memory-card-back {
  background: #d3ff00;
}

.memory-result {
  margin-top: 22px;
  background: #fff;
  border: 6px solid #000;
  border-radius: 20px;
  padding: 18px;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}