/* ==========================================================================
   CHILD PATHSHALA - CARD FLIP MEMORY MATRIX STUDIO ENGINE
   Theme: 3D Holographic Flip Cards, Neural Sync Combos, Memory Quotient
   ========================================================================== */

:root {
  --mm-bg: #090d16;
  --mm-card: #131d2e;
  --mm-border: #23354f;
  --mm-cyan: #06b6d4;
  --mm-gold: #f59e0b;
  --mm-green: #10b981;
  --mm-purple: #a855f7;
}

.mm-wrapper {
  background: radial-gradient(circle at 50% 15%, #191b3b 0%, #090d16 75%);
  border-radius: 26px;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  padding: 1.5rem;
  max-width: 820px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, sans-serif;
  position: relative;
  overflow: hidden;
}

/* Dashboard HUD */
.mm-hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mm-hud-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(19, 29, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.mm-hud-card.moves { color: var(--mm-cyan); }
.mm-hud-card.time { color: var(--mm-gold); }
.mm-hud-card.pairs { color: var(--mm-green); }

/* Combo Banner */
.mm-combo-banner {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #ea580c, #f59e0b);
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  animation: mmPulse 0.5s ease infinite alternate;
}

@keyframes mmPulse {
  0% { transform: scale(0.96); }
  100% { transform: scale(1.05); }
}

/* 3D Card Grid */
.mm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 12px;
  max-width: 680px;
  margin: 0 auto 1.5rem;
  perspective: 1000px;
}

@media (max-width: 600px) {
  .mm-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* 3D Flip Card Container */
.mm-flip-card {
  aspect-ratio: 3 / 4;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  border-radius: 14px;
}

.mm-flip-card:hover:not(.flipped):not(.matched) {
  transform: translateY(-4px) scale(1.03);
}

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

/* Card Faces */
.mm-card-face {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  user-select: none;
}

/* Card Back (Hidden State) */
.mm-card-back {
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #0f172a 100%);
  border: 2px solid #334155;
  color: var(--mm-cyan);
}

.mm-card-back::before {
  content: '✨';
  font-size: 1.75rem;
  opacity: 0.7;
}

/* Card Front (Revealed State) */
.mm-card-front {
  background: radial-gradient(circle at 50% 30%, #1e293b 0%, #020617 100%);
  border: 2px solid #38bdf8;
  transform: rotateY(180deg);
  padding: 8px;
  text-align: center;
}

.mm-card-emoji {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1;
}

.mm-card-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 4px;
  text-transform: capitalize;
}

/* Matched Card Celebration Glow */
.mm-flip-card.matched .mm-card-front {
  background: radial-gradient(circle at 50% 30%, #064e3b 0%, #022c22 100%);
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  animation: mmPop 0.35s ease;
}

@keyframes mmPop {
  0% { transform: rotateY(180deg) scale(0.9); }
  50% { transform: rotateY(180deg) scale(1.15); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* Action Tools */
.mm-action-tray {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.mm-btn-tool {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.mm-btn-tool:hover:not(:disabled) {
  border-color: var(--mm-cyan);
  color: var(--mm-cyan);
}

.mm-btn-tool:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Victory Screen */
.mm-victory-wrap {
  text-align: center;
  padding: 2rem 1rem;
}

.mm-victory-icon {
  font-size: 4rem;
  display: inline-block;
  margin-bottom: 0.5rem;
  animation: mmPulse 0.8s ease infinite alternate;
}
