/* ToolyLab — Hafıza (Memory) */
.mm-tool { max-width: 460px; margin: 0 auto; }
.mm-tool .calc-card { gap: var(--spacing-md); }

/* Mobilde kenar boşluklarını azalt → oyun alanı büyür */
@media (max-width: 640px) {
  .mm-tool .calc-card { padding: var(--spacing-md) var(--spacing-sm); }
}

.mm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}
.mm-stats { display: inline-flex; align-items: center; gap: var(--spacing-md); }
.mm-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-secondary);
}
.mm-stat svg { width: 17px; height: 17px; }
.mm-stat span { color: var(--text-primary); }

/* Tahta */
.mm-board { position: relative; }
.mm-grid {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: clamp(6px, 2.2vw, 12px);
}

/* Kart — 3B çevirme */
.mm-card {
  aspect-ratio: 3 / 4;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  perspective: 600px;
  -webkit-tap-highlight-color: transparent;
}
.mm-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.mm-card.flipped .mm-inner { transform: rotateY(180deg); }
.mm-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mm-front {
  background: var(--gradient-primary);
  color: rgba(255, 255, 255, 0.9);
}
.mm-front svg { width: 42%; height: 42%; }
.mm-back {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transform: rotateY(180deg);
  font-size: clamp(1.4rem, 13cqi, 2.6rem);
  line-height: 1;
}
.mm-card.matched .mm-inner { transition: transform 0.4s ease, opacity 0.3s ease; }
.mm-card.matched .mm-back { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.45); }
.mm-card.matched { opacity: 0.72; }

/* Kaplama */
.mm-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border: none;
  border-radius: var(--border-radius-sm);
  background: rgba(15, 15, 25, 0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
  padding: var(--spacing-md);
}
.mm-overlay[hidden] { display: none; }
.mm-ov-icon { font-size: 2.6rem; line-height: 1; }
.mm-ov-title { font-size: 1.4rem; font-weight: 800; color: #34d399; }
.mm-ov-sub { font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; }

.mm-controls { display: flex; }
.mm-ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: none;
  padding: var(--spacing-sm);
  font-size: 0.95rem;
}
.mm-ctl svg { width: 18px; height: 18px; }
.mm-new { background: var(--gradient-primary); color: #fff; border: none; }
.mm-new:hover { opacity: 0.92; color: #fff; }

.mm-hint { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin: 0; }
