/* ═══════════════════════════════════════════════════════
   NenitoClub — Estilos do motor de jogos
   Fontes: Baloo 2 (títulos) + Nunito (corpo) via PHP enqueue
   ═══════════════════════════════════════════════════════ */

/* ── Reset dentro do escopo NCL ─────────────────────────── */
#ncl-root *,
#ncl-root *::before,
#ncl-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Container raiz ─────────────────────────────────────── */
#ncl-root {
  --module-color: #4CAF50;
  --ncl-correct: #43A047;
  --ncl-wrong: #FB8C00;
  --ncl-complete: #7C4DFF;
  --ncl-radius: 20px;
  --ncl-shadow: 0 4px 20px rgba(0,0,0,.12);
  --ncl-font-title: 'Baloo 2', 'Nunito', sans-serif;
  --ncl-font-body: 'Nunito', 'Baloo 2', sans-serif;

  position: relative;
  min-height: 480px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--ncl-font-body);
  background: #FAFAFA;
  border-radius: var(--ncl-radius);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── Estados genéricos ──────────────────────────────────── */
.ncl-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 200px;
  font-size: 1rem;
  color: #888;
  font-family: var(--ncl-font-body);
}

.ncl-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #ddd;
  border-top-color: var(--module-color);
  border-radius: 50%;
  animation: ncl-spin 0.8s linear infinite;
}

@keyframes ncl-spin { to { transform: rotate(360deg); } }

/* ── Home do módulo ─────────────────────────────────────── */
.ncl-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 40px;
  gap: 16px;
}

.ncl-home-header {
  text-align: center;
}

.ncl-module-title {
  font-family: var(--ncl-font-title);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 800;
  color: var(--module-color);
  letter-spacing: -0.5px;
}

.ncl-home-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
}

/* ── Botões base ────────────────────────────────────────── */
.ncl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 64px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--ncl-radius);
  font-family: var(--ncl-font-title);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, opacity .2s;
  box-shadow: var(--ncl-shadow);
}

.ncl-btn:active { transform: scale(0.96); }
.ncl-btn:disabled { opacity: 0.5; cursor: default; }

.ncl-btn-flashcard {
  background: var(--module-color);
  color: #fff;
}

.ncl-btn-game {
  background: #fff;
  color: var(--module-color);
  border: 3px solid var(--module-color);
}

.ncl-btn-locked {
  background: #f5f5f5;
  color: #aaa;
  border: 3px solid #ddd;
}

.ncl-btn-primary {
  background: var(--module-color);
  color: #fff;
}

.ncl-btn-back {
  min-height: 44px;
  width: auto;
  padding: 10px 18px;
  background: transparent;
  color: #666;
  font-size: 0.9rem;
  box-shadow: none;
  border: 2px solid #ddd;
  border-radius: 12px;
}

.ncl-btn-nav {
  width: 48%;
  min-height: 60px;
  background: #fff;
  color: #444;
  border: 2px solid #ddd;
  border-radius: 16px;
  font-size: 1rem;
  box-shadow: none;
}

.ncl-btn-nav:disabled { opacity: 0.35; }

/* ── Layout dos jogos ───────────────────────────────────── */
.ncl-game {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 480px;
  padding: 16px 16px 24px;
  gap: 16px;
}

.ncl-game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ncl-counter {
  font-size: 0.9rem;
  color: #888;
  font-weight: 600;
}

/* ── Flashcard ──────────────────────────────────────────── */
.ncl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 16px;
  padding: 12px;
  background: #fff;
  border-radius: var(--ncl-radius);
  box-shadow: var(--ncl-shadow);
  cursor: pointer;
}

.ncl-card-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
}

.ncl-card-name {
  font-family: var(--ncl-font-title);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  color: #333;
  text-align: center;
}

.ncl-nav-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Prompt (FindItem) ──────────────────────────────────── */
.ncl-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--ncl-shadow);
  font-family: var(--ncl-font-title);
  font-size: 1.3rem;
  color: #333;
  cursor: pointer;
}

/* ── Grade de opções ────────────────────────────────────── */
.ncl-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
}

.ncl-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 3px solid #eee;
  border-radius: var(--ncl-radius);
  box-shadow: var(--ncl-shadow);
  cursor: pointer;
  transition: transform .1s, border-color .15s;
  min-height: 120px;
}

.ncl-option:active { transform: scale(0.93); border-color: var(--module-color); }

.ncl-option img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
}

/* ── GroupByColor — swatch de cor ───────────────────────── */
.ncl-color-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  border: none;
  border-radius: var(--ncl-radius);
  cursor: pointer;
  box-shadow: var(--ncl-shadow);
  transition: transform .1s;
}

.ncl-color-prompt:active { transform: scale(0.97); }

.ncl-color-name {
  font-family: var(--ncl-font-title);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ── Overlay de feedback ────────────────────────────────── */
.ncl-overlay {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--ncl-radius);
  animation: ncl-pop .25s ease-out;
}

@keyframes ncl-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.ncl-overlay-correct  { background: var(--ncl-correct); }
.ncl-overlay-wrong    { background: var(--ncl-wrong); }
.ncl-overlay-complete { background: var(--ncl-complete); }

.ncl-overlay-icon {
  font-size: 4rem;
  line-height: 1;
  animation: ncl-bounce .4s ease infinite alternate;
}

.ncl-overlay-icon-big { font-size: 5rem; }

@keyframes ncl-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

.ncl-overlay-text {
  font-family: var(--ncl-font-title);
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ── Tela de Parabéns ───────────────────────────────────── */
.ncl-overlay-done-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.ncl-overlay-done-title {
  font-family: var(--ncl-font-title);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
}

.ncl-overlay-done-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

.ncl-overlay-score {
  font-size: 1rem;
  color: rgba(255,255,255,.75);
  font-weight: 600;
}

.ncl-btn-again {
  margin-top: 8px;
  background: #fff;
  color: var(--ncl-complete);
  min-height: 60px;
  max-width: 280px;
  font-size: 1.1rem;
}

/* ── Confetti animado ───────────────────────────────────── */
.ncl-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ncl-confetti-item {
  position: absolute;
  font-size: 1.8rem;
  animation: ncl-float 2.5s ease-in-out infinite;
  opacity: 0.8;
}

.ncl-confetti-0 { left: 10%; top: 5%;  animation-delay: 0s;    animation-duration: 2.2s; }
.ncl-confetti-1 { left: 80%; top: 10%; animation-delay: 0.3s;  animation-duration: 2.7s; }
.ncl-confetti-2 { left: 45%; top: 3%;  animation-delay: 0.6s;  animation-duration: 2.0s; }
.ncl-confetti-3 { left: 20%; top: 75%; animation-delay: 0.9s;  animation-duration: 2.5s; }
.ncl-confetti-4 { left: 70%; top: 70%; animation-delay: 1.2s;  animation-duration: 2.3s; }
.ncl-confetti-5 { left: 55%; top: 80%; animation-delay: 0.15s; animation-duration: 2.8s; }

@keyframes ncl-float {
  0%   { transform: translateY(0) rotate(0); }
  50%  { transform: translateY(-20px) rotate(15deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* ── Bloco de cor (módulo Cores) ────────────────────────── */
.ncl-color-block {
  width: 100%;
  max-width: 280px;
  height: 220px;
  border-radius: 20px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.15);
}

/* ── Letra grande (módulo Alfabeto) ─────────────────────── */
.ncl-letter-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  border-radius: 20px;
  background: var(--module-color);
  color: #fff;
  font-family: var(--ncl-font-title);
  font-size: 7rem;
  font-weight: 800;
}

/* ── Responsivo ─────────────────────────────────────────── */
@media (max-width: 400px) {
  .ncl-card-name     { font-size: 1.4rem; }
  .ncl-color-name    { font-size: 1.6rem; }
  .ncl-overlay-done-title { font-size: 1.8rem; }
  .ncl-option        { min-height: 100px; }
}

@media (min-width: 641px) {
  #ncl-root          { border-radius: 24px; box-shadow: 0 8px 40px rgba(0,0,0,.1); }
}

