/* memory.css — Memotest */

/* Fondo azul */
body.game-page {
  background: linear-gradient(150deg, #005fa3 0%, #4DABF7 100%);
}

/* Área de juego */
#game-area {
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.5rem 1rem;
  gap: 0.75rem;
  overflow-y: auto;
}

/* Etiqueta de tema */
.mc-theme-lbl {
  font-size: 1rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

/* Grilla adaptativa */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(var(--mc-cols, 4), 1fr);
  gap: 0.4rem;
  width: 100%;
  max-width: 560px;
}

/* Carta — flip 3D */
.mc-card {
  aspect-ratio: 1;
  perspective: 600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

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

/* Cara trasera (?) */
.mc-back,
.mc-front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mc-back {
  background: rgba(0, 70, 130, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.35);
  font-size: 1.4em;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.6);
}

.mc-front {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.9);
  font-size: calc(min(560px, 100vw) / var(--mc-cols, 4) * 0.52);
  transform: rotateY(180deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Par encontrado: verde */
.mc-card.mc-matched .mc-front {
  background: #d4f8dd;
  border-color: #6BCB77;
  box-shadow: 0 0 0 2px #6BCB77;
}

/* Hover sutil en cartas no volteadas */
.mc-card:not(.mc-flipped):not(.mc-matched):hover .mc-back {
  background: rgba(0, 90, 160, 0.75);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Intentos badge en footer */
.intentos-badge {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Footer */
.game-footer {
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
}
.btn-accion {
  background: rgba(255, 255, 255, 0.9);
  color: #00315a;
}
.btn-siguiente {
  background: #FFD93D;
  color: #1a0a00;
}
