@import url("https://fonts.googleapis.com");

* {
  font-family: "Fredoka", sans-serif;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Reutilizando seus botões Joystick */
.btn-back {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: #ff5757;
  color: white !important;
  padding: 12px 28px;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 700;
  border: 4px solid white;
  box-shadow: 0 8px 0px #b33939;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-back:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0px #b33939;
}

.btn-play-again {
  background: #10b981;
  color: white;
  padding: 16px 32px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 1.25rem;
  border: 4px solid white;
  box-shadow: 0 8px 0px #065f46;
  transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 100%;
  text-transform: uppercase;
}

.btn-play-again:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0px #064e3b;
}

/* Estrutura 3D do Card de Memória */
.memory-card {
  aspect-ratio: 1/1;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

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

/* Estilo Adesivo (Igual ao seu animal-card) */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  border: 4px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0px #cccccc;
}

/* Lado Escondido */
.card-front {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: white;
  font-size: 3rem;
  font-weight: bold;
}

/* Lado Revelado */
.card-back {
  background: white;
  transform: rotateY(180deg);
}

.card-back span {
  display: block;
  text-align: center;
}

/* Animação de acerto */
.memory-card.matched .card-inner {
  animation: success-pop 0.5s ease forwards;
}

@keyframes success-pop {
  50% {
    transform: rotateY(180deg) scale(1.1);
  }
  100% {
    transform: rotateY(180deg) scale(1);
    opacity: 0.8;
  }
}
