/* ===================================================================
   IrisKids — Kids Memory
   Aligné sur le design system (iriskids-ui.css déjà importé)
   Pattern Quiz/Comptines : hero animé + screen + cards
   =================================================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--ik-font, 'Baloo 2', system-ui, sans-serif);
  color: var(--ik-text, #1a1033);
  background:
    radial-gradient(circle at 15% -10%, #d1fae5 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, #ecfccb 0%, transparent 50%),
    #fffafc;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* === Layout commun === */
.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--ik-header-h, 52px) + 20px) 18px 40px;
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 12px 0 8px;
}
.hero-emoji {
  font-size: 64px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 6px 12px rgba(34, 197, 94, .35));
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0)    rotate(-3deg); }
  50%      { transform: translateY(-6px) rotate(3deg); }
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 8px 0 4px;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 60%, #84cc16 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.01em;
}
.hero-sub {
  color: #4b3a72;
  font-size: 1rem;
  margin: 4px 0 24px;
}

/* === CONTROLS === */
.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.control-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.control-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b3a72;
  min-width: 140px;
  flex: 1;
  max-width: 200px;
}

.control-label > span {
  margin-left: 4px;
}

.move-counter {
  background: #fff;
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ik-accent, #22c55e);
  box-shadow: 0 2px 8px rgba(34, 197, 94, .15);
}

/* === GAME BOARD === */
#game-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.card {
  background: #fff;
  border-radius: 20px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(34, 197, 94, .08);
  border: 2px solid transparent;
}

.card:hover {
  transform: scale(1.05);
  border-color: rgba(34, 197, 94, .3);
}

.card.flipped {
  background: #fef3c7;
  transform: rotateY(180deg);
}

@keyframes victory-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .screen {
    padding-left: 12px;
    padding-right: 12px;
  }
  .hero-title { font-size: 1.8rem; }
  .hero-emoji { font-size: 56px; }
  #game-board {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
  }
  .card { font-size: 2.5rem; border-radius: 15px; }
  .control-label { min-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-emoji { animation: none; }
  .card { transition: none; }
}
