/* ========================================
   TEJUINO MEMORY MATCH — Card Styles
   ======================================== */

/* ── Section ── */
.fp-memory-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px;
  text-align: center;
}

.fp-memory-content h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: #111;
  margin-bottom: 6px;
}

.fp-memory-content .memory-subtitle {
  font-family: var(--font-sans);
  color: rgba(0,0,0,0.45);
  font-size: 0.95rem;
  margin-bottom: 20px;
  font-style: italic;
}

/* ── Stats ── */
.tm-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-size: 1rem;
}

.tm-stats span {
  color: rgba(0,0,0,0.5);
}

.tm-stats strong {
  color: #111;
}

/* ── Board ── */
.tm-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 400px;
  width: 100%;
  margin-bottom: 20px;
}

/* ── Cards ── */
.tm-card {
  aspect-ratio: 1;
  background: rgba(0,0,0,0.03);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(0,0,0,0.08);
}

.tm-card:hover:not(.flipped):not(.matched) {
  border-color: rgba(0,0,0,0.2);
}

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

.tm-card.matched {
  transform: rotateY(180deg);
  border-color: rgba(0,0,0,0.25);
  box-shadow: 0 0 16px rgba(0,0,0,0.06);
}

.tm-card-front,
.tm-card-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tm-card-front {
  background: rgba(0,0,0,0.04);
}

.tm-card-front::after {
  content: '✦';
  font-size: 1.4rem;
  color: rgba(0,0,0,0.15);
}

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

.tm-icon-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ── Message ── */
.tm-message {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: rgba(0,0,0,0.5);
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.tm-message.visible {
  opacity: 1;
}

/* ── Win overlay ── */
.tm-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  z-index: 10;
}

.tm-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.tm-overlay h3 {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: #111;
  margin-bottom: 12px;
}

.tm-overlay p {
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(0,0,0,0.55);
  font-size: 1.1rem;
  margin-bottom: 24px;
  max-width: 320px;
  text-align: center;
}

.tm-overlay .btn-continue {
  background: transparent;
  color: #111;
  border: 2px solid #111;
  padding: 12px 36px;
  border-radius: 50px;
  font-family: var(--font-serif);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  letter-spacing: 1px;
}

.tm-overlay .btn-continue:hover {
  background: #111;
  color: #fff;
  transform: translateY(-2px);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tm-board {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 300px;
  }

  .fp-memory-content h2 {
    font-size: 1.5rem;
  }

  .tm-stats {
    gap: 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .tm-board {
    grid-template-columns: repeat(4, 1fr);
    max-width: 260px;
    gap: 6px;
  }
}
