/* ============================================================
   MINO — Estilos Unificados v3
   Paleta: Azul pastel + Verde pastel   |   Offline-safe
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --azul:        #74C0E8;
  --azul-m:      #4DAAD4;
  --azul-soft:   #B8DFF5;
  --azul-bg:     #E8F6FD;
  --verde:       #6ECFA0;
  --verde-m:     #48B882;
  --verde-soft:  #B2EDD2;
  --verde-bg:    #E6FAF2;
  --amarillo:    #FDE97A;
  --amarillo-m:  #F5CC00;
  --rosa:        #FFB3C6;
  --morado:      #C9B1E8;
  --naranja:     #FFB347;
  --blanco:      #FFFFFF;
  --gris-bg:     #F4FAFF;
  --gris-texto:  #6B7280;
  --texto:       #2D4A5E;
  --sombra:      0 6px 24px rgba(116,192,232,.20);
  --sombra-hover:0 12px 36px rgba(116,192,232,.35);
  --radio:       16px;
  --radio-sm:    10px;
  --radio-lg:    28px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', Arial, sans-serif;
  background: linear-gradient(145deg, var(--azul-bg) 0%, var(--verde-bg) 100%);
  min-height: 100vh;
  color: var(--texto);
}
body.m2-body { background: linear-gradient(145deg, var(--azul-bg) 0%, var(--verde-bg) 100%); }

h1, h2, h3 { font-family: 'Fredoka One', cursive; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 16px rgba(116,192,232,.18);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-family: 'Fredoka One', cursive;
  font-size: 1.9rem;
  color: var(--azul);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -.5px;
}
.navbar-brand span { color: var(--verde); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--gris-texto);
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 50px;
  transition: background .2s, color .2s;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav-links a:hover { background: var(--azul-bg); color: var(--azul); }
.nav-links .btn-logout {
  background: #FFE4EC;
  color: #C0394C;
  font-weight: 800;
}
.nav-links .btn-logout:hover { background: #FFB3C6; }

/* ── Tarjetas ───────────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.94);
  border-radius: var(--radio);
  padding: 24px;
  box-shadow: var(--sombra);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--sombra-hover); }

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  font-size: .9rem;
  cursor: pointer;
  transition: transform .15s, filter .15s;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover  { transform: translateY(-2px); filter: brightness(1.07); }
.btn:active { transform: scale(.96); }
.btn-azul   { background: var(--azul);   color: #fff; box-shadow: 0 4px 14px rgba(116,192,232,.45); }
.btn-verde  { background: var(--verde);  color: #fff; box-shadow: 0 4px 14px rgba(110,207,160,.45); }
.btn-rojo   { background: #F88379;       color: #fff; }
.btn-amarillo{ background: var(--amarillo); color: var(--texto); }
.btn-morado { background: var(--morado); color: #fff; }
.btn-naranja{ background: var(--naranja);color: #fff; }
.btn-sm     { padding: 6px 14px; font-size: .8rem; }
.btn-lg     { padding: 14px 32px; font-size: 1.05rem; }
.btn-block  { width: 100%; justify-content: center; }

/* ── Formularios ─────────────────────────────────────────── */
.form-group  { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--gris-texto);
  font-size: .85rem;
}
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 2px solid var(--azul-soft);
  border-radius: var(--radio-sm);
  font-family: 'Nunito', Arial, sans-serif;
  font-size: .95rem;
  color: var(--texto);
  background: var(--blanco);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(116,192,232,.18); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Alertas ─────────────────────────────────────────────── */
.alert { padding: 11px 16px; border-radius: var(--radio-sm); font-weight: 700;
         margin-bottom: 14px; font-size: .88rem; display: flex; align-items: center; gap: 8px; }
.alert-error   { background: #FFE4EC; color: #C0394C; border-left: 4px solid #F88379; }
.alert-success { background: var(--verde-bg); color: #0A6640; border-left: 4px solid var(--verde); }
.alert-info    { background: var(--azul-bg);  color: #1A4D6E; border-left: 4px solid var(--azul); }
.alert-warn    { background: #FFFBE6; color: #7A5500; border-left: 4px solid var(--amarillo-m); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.badge-administrador { background: #EDE0FF; color: #6B21A8; }
.badge-maestro       { background: var(--azul-bg); color: var(--azul-m); }
.badge-alumno        { background: var(--verde-bg); color: #0A6640; }
.badge-activo        { background: var(--verde-bg); color: #0A6640; }
.badge-inactivo      { background: #FFE4EC; color: #C0394C; }

/* ── Tabla ───────────────────────────────────────────────── */
.tabla-mino { width: 100%; border-collapse: collapse; }
.tabla-mino thead tr { background: var(--azul-bg); }
.tabla-mino th {
  padding: 11px 14px; text-align: left;
  font-size: .82rem; color: var(--azul-m);
  font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.tabla-mino td { padding: 11px 14px; border-bottom: 1px solid var(--azul-bg); font-size: .88rem; }
.tabla-mino tr:last-child td { border-bottom: none; }
.tabla-mino tbody tr:hover td { background: var(--gris-bg); }

/* ── Dashboard layout ────────────────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(10px);
  padding: 20px 12px;
  border-right: 2px solid var(--azul-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-label {
  font-size: .68rem;
  font-weight: 800;
  color: var(--gris-texto);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 14px 4px;
  margin-top: 8px;
}
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--radio-sm);
  text-decoration: none;
  color: var(--gris-texto);
  font-weight: 700;
  font-size: .88rem;
  transition: background .18s, color .18s, transform .12s;
}
.sidebar-menu a:hover  { background: var(--azul-bg); color: var(--azul); transform: translateX(3px); }
.sidebar-menu a.activo { background: var(--azul-soft); color: var(--azul-m); font-weight: 900; }

/* ── Main content ────────────────────────────────────────── */
.main-content { padding: 28px; overflow-y: auto; }
.page-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  color: var(--texto);
  margin-bottom: 4px;
}
.page-sub { color: var(--gris-texto); font-size: .88rem; margin-bottom: 22px; }

/* ── Métricas ────────────────────────────────────────────── */
.metricas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metrica-card {
  background: white;
  border-radius: var(--radio);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--sombra);
  border-top: 4px solid var(--azul-soft);
  transition: transform .2s;
}
.metrica-card:hover { transform: translateY(-3px); }
.metrica-card .numero { font-family: 'Fredoka One', cursive; font-size: 2.4rem; color: var(--azul); line-height: 1; }
.metrica-card .etiqueta { font-size: .78rem; color: var(--gris-texto); font-weight: 700; margin-top: 4px; }

/* ── Progress bar ────────────────────────────────────────── */
.progress-bar-wrap { width: 100%; background: var(--azul-bg); border-radius: 50px; height: 12px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--azul), var(--verde)); border-radius: 50px; transition: width .5s ease; }

/* ── Grid de juegos ──────────────────────────────────────── */
.juegos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 4px 0;
}
.juego-card {
  background: white;
  border-radius: var(--radio-lg);
  padding: 26px 16px 20px;
  text-align: center;
  box-shadow: var(--sombra);
  cursor: pointer;
  border: 3px solid transparent;
  text-decoration: none;
  color: var(--texto);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.juego-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--sombra-hover);
  border-color: var(--azul);
}
.juego-card .icono { font-size: 3.2rem; display: block; }
.juego-card h3 { font-size: 1rem; color: var(--texto); font-family: 'Fredoka One', cursive; }
.juego-card p  { font-size: .78rem; color: var(--gris-texto); line-height: 1.4; }

/* ── Game UI ─────────────────────────────────────────────── */
.game-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: white;
  border-radius: var(--radio);
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: var(--sombra);
  flex-wrap: wrap;
}
.timer {
  background: var(--amarillo);
  border: 3px solid var(--amarillo-m);
  border-radius: 50px;
  padding: 6px 20px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: #6B5500;
  min-width: 86px;
  text-align: center;
}
.timer.urgente { background: var(--rosa); border-color: #FF5C85; color: #9C0030; animation: pulse .6s infinite alternate; }
.puntuacion { font-family: 'Fredoka One', cursive; font-size: 1.2rem; color: var(--verde); display: flex; align-items: center; gap: 5px; }
.game-board {
  background: white;
  border-radius: var(--radio-lg);
  padding: 28px 24px;
  box-shadow: var(--sombra);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ── Color & Shape buttons ───────────────────────────────── */
.colores-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.color-btn {
  width: 90px; height: 90px;
  border-radius: 20px;
  border: 4px solid rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  font-family: 'Fredoka One', cursive;
  font-size: .82rem;
  color: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  -webkit-tap-highlight-color: transparent;
}
.color-btn:hover { transform: scale(1.12) rotate(-3deg); }
.color-btn.correcto   { border-color: var(--verde) !important; transform: scale(1.15); box-shadow: 0 0 0 5px var(--verde-bg); }
.color-btn.incorrecto { animation: shake .3s; border-color: #F88379 !important; }

.shapes-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.shape-btn {
  width: 100px; height: 100px;
  cursor: pointer;
  transition: transform .15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  font-family: 'Fredoka One', cursive;
  font-size: .85rem;
  color: var(--gris-texto);
  -webkit-tap-highlight-color: transparent;
}
.shape-btn:hover { transform: scale(1.12); }

/* ── Cubes ───────────────────────────────────────────────── */
.cubes-area {
  display: flex; flex-direction: column-reverse; align-items: center; gap: 5px;
  min-height: 200px; padding: 10px;
  border: 3px dashed var(--azul-soft); border-radius: var(--radio); width: 110px;
}
.cube {
  width: 68px; height: 58px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive; font-size: .82rem;
  color: rgba(255,255,255,.9);
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
  animation: caer .35s ease-out;
}

/* ── Conteo ──────────────────────────────────────────────── */
.conteo-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; font-size: 2.4rem;
  min-height: 60px; align-items: center;
}
.conteo-obj {
  display: inline-block;
  animation: pop .3s cubic-bezier(.34,1.56,.64,1) both;
  user-select: none;
  transition: transform .15s;
  cursor: default;
}
.conteo-obj:hover { transform: scale(1.2) rotate(-5deg); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: var(--radio-lg);
  padding: 36px 28px; max-width: 420px; width: 92%;
  text-align: center;
  transform: scale(.88); transition: transform .25s;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal .emoji-big { font-size: 4.5rem; display: block; margin-bottom: 12px; }
.modal h2 { font-size: 1.8rem; color: var(--azul); margin-bottom: 8px; }
.modal p  { color: var(--gris-texto); margin-bottom: 20px; font-size: .92rem; }

/* ── LOGIN ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--azul-bg) 0%, var(--verde-bg) 50%, #EDE0FF 100%);
}
.login-card {
  background: rgba(255,255,255,.97);
  border-radius: var(--radio-lg);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(116,192,232,.30);
  border-top: 6px solid var(--azul);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-family: 'Fredoka One', cursive; font-size: 3.8rem; color: var(--azul); letter-spacing: -1px; }
.login-logo h1 span { color: var(--verde); }
.login-logo p { color: var(--gris-texto); font-size: .88rem; margin-top: 4px; }
.login-logo .logo-mascota { font-size: 2.8rem; display: block; margin-bottom: 4px; }

/* ── Num opciones (módulo 2 compat) ─────────────────────── */
.num-opciones {
  display: grid; grid-template-columns: repeat(5,1fr); gap: 10px;
  width: 100%; max-width: 400px;
}
.num-opcion {
  border-radius: 14px; border: 3px solid rgba(0,0,0,.1);
  font-family: 'Fredoka One', cursive; font-size: 1.8rem;
  padding: 12px 6px; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 10px rgba(0,0,0,.1); color: rgba(0,0,0,.55);
  -webkit-tap-highlight-color: transparent;
}
.num-opcion:hover  { transform: scale(1.1); }
.num-opcion.correcto   { outline: 5px solid var(--verde); transform: scale(1.15); }
.num-opcion.incorrecto { animation: shake .3s; outline: 5px solid var(--rosa); }

.letra-opciones {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px;
  width: 100%; max-width: 440px;
}
.letra-opcion {
  background: var(--azul-bg); border: 3px solid var(--azul-soft);
  border-radius: 14px; font-family: 'Fredoka One', cursive; font-size: 2rem;
  padding: 14px 8px; cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, transform .15s;
  color: var(--azul); -webkit-tap-highlight-color: transparent;
}
.letra-opcion:hover    { background: var(--azul-soft); transform: scale(1.07); }
.letra-opcion.correcto { background: var(--verde-soft); border-color: var(--verde); color: #0A6640; transform: scale(1.1); }
.letra-opcion.incorrecto { animation: shake .3s; background: #FFD6E0; border-color: var(--rosa); }

/* ── Vocab cards ─────────────────────────────────────────── */
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(110px,1fr)); gap: 10px; width: 100%; }
.vocab-card {
  background: var(--azul-bg); border: 3px solid var(--azul-soft);
  border-radius: 14px; padding: 12px 8px; text-align: center;
  cursor: pointer; transition: transform .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.vocab-card .vc-emoji  { font-size: 2.2rem; display: block; }
.vocab-card .vc-nombre { font-size: .75rem; font-weight: 800; color: var(--texto); margin-top: 4px; }
.vocab-card:hover      { transform: scale(1.06); border-color: var(--azul); }
.vocab-card.seleccionada{ border-color: var(--verde); background: var(--verde-soft); }
.vocab-card.correcta   { border-color: var(--verde); background: var(--verde-soft); animation: pop .3s; }
.vocab-card.incorrecta { border-color: var(--rosa);  background: #FFD6E0; animation: shake .3s; }

/* ── Puzzle ──────────────────────────────────────────────── */
.puzzle-board { display: grid; gap: 4px; margin: 0 auto; }
.puzzle-cell {
  border-radius: 10px; border: 3px dashed var(--azul-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; min-height: 68px; transition: background .2s;
}
.puzzle-cell.over    { background: var(--azul-soft); border-style: solid; }
.puzzle-cell.colocada{ border-style: solid; border-color: var(--verde); background: var(--verde-bg); }
.puzzle-piezas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.puzzle-pieza {
  border-radius: 10px; border: 3px solid var(--azul); background: white;
  padding: 8px 10px; font-size: 2rem; cursor: grab; user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.puzzle-pieza:hover { transform: scale(1.1) rotate(-3deg); }
.puzzle-pieza.usada { opacity: .2; pointer-events: none; }

/* ── Clasif ──────────────────────────────────────────────── */
.clasif-container { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.clasif-zona {
  border-radius: 14px; border: 3px dashed var(--azul-soft);
  min-height: 110px; padding: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start;
  transition: background .2s, border-color .2s;
}
.clasif-zona h4 { width: 100%; font-family: 'Fredoka One', cursive; font-size: .95rem; color: var(--azul); margin-bottom: 4px; }
.clasif-zona.over     { background: var(--azul-bg);  border-color: var(--azul); border-style: solid; }
.clasif-zona.correcta { background: var(--verde-bg); border-color: var(--verde); border-style: solid; }
.clasif-zona.incorrecta{ background: #FFD6E0; border-color: var(--rosa); animation: shake .3s; }
.clasif-item {
  background: white; border: 2px solid var(--azul-soft);
  border-radius: 10px; padding: 7px 10px; font-size: 1.5rem;
  cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .12s; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.clasif-item:hover { transform: scale(1.1); }

/* ── Canvas wrap ─────────────────────────────────────────── */
.canvas-wrap {
  position: relative; border-radius: var(--radio); overflow: hidden;
  box-shadow: var(--sombra); touch-action: none; background: white;
}
.canvas-wrap canvas { display: block; }

/* ── Secuencia ───────────────────────────────────────────── */
.secuencia-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.sec-num {
  width: 54px; height: 54px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fredoka One', cursive; font-size: 1.4rem;
  box-shadow: 0 3px 8px rgba(0,0,0,.1); transition: transform .15s;
}
.sec-num.relleno  { background: var(--azul-soft);  color: var(--azul-m); }
.sec-num.vacio    { background: white; border: 3px dashed var(--azul-soft); color: var(--gris-texto); cursor: pointer; }
.sec-num.vacio:hover { background: var(--azul-bg); transform: scale(1.07); }
.sec-num.correcto { background: var(--verde-soft); color: var(--verde-m); border: 3px solid var(--verde); }
.sec-num.error    { background: #FFD6E0; color: #C0004C; border: 3px solid var(--rosa); animation: shake .3s; }

/* ── Número / Letra grande ───────────────────────────────── */
.numero-grande {
  font-family: 'Fredoka One', cursive; font-size: 7rem; line-height: 1;
  color: var(--azul);
  text-shadow: 0 4px 0 var(--azul-soft), 0 8px 20px rgba(116,192,232,.3);
  transition: transform .2s;
}
.letra-grande {
  font-family: 'Fredoka One', cursive; font-size: 7rem; line-height: 1;
  color: var(--verde);
  text-shadow: 0 4px 0 var(--verde-soft), 0 8px 20px rgba(110,207,160,.3);
  display: flex; align-items: center; gap: 20px;
}

/* ── M2 Nav (módulo 2) ───────────────────────────────────── */
.m2-nav {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 2px 16px rgba(116,192,232,.18);
  position: sticky; top: 0; z-index: 100; flex-wrap: wrap;
}
.m2-nav-brand {
  font-family: 'Fredoka One', cursive; font-size: 1.5rem;
  color: var(--azul); text-decoration: none;
  display: flex; align-items: center; gap: 6px;
}
.m2-nav-brand span { color: var(--verde); }
.m2-badge-modulo {
  background: var(--azul); color: white;
  border-radius: 50px; padding: 4px 14px;
  font-size: .78rem; font-weight: 800;
}

/* ── M2 container / card / hub ───────────────────────────── */
.m2-container { max-width: 860px; margin: 0 auto; padding: 22px 16px 70px; }
.m2-card {
  background: rgba(255,255,255,.94); border-radius: var(--radio);
  padding: 22px; box-shadow: var(--sombra); margin-bottom: 18px;
}
.m2-game-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.m2-game-title { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: var(--azul); }
.m2-timer {
  background: var(--amarillo); border: 3px solid var(--amarillo-m);
  border-radius: 50px; padding: 5px 18px;
  font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: #6B5500;
  min-width: 82px; text-align: center;
}
.m2-timer.urgente { background: var(--rosa); border-color: #FF5C85; color: #9C0030; animation: pulse .6s infinite alternate; }
.m2-score { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: var(--verde); display: flex; align-items: center; gap: 5px; }
.m2-game-board {
  background: white; border-radius: var(--radio-lg); padding: 26px 20px;
  box-shadow: var(--sombra); display: flex; flex-direction: column;
  align-items: center; gap: 20px; min-height: 300px; justify-content: center;
}
.m2-hub-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(185px,1fr)); gap: 16px; padding: 4px 0; }
.m2-hub-card {
  background: white; border-radius: var(--radio-lg); padding: 26px 14px 20px;
  text-align: center; box-shadow: var(--sombra); cursor: pointer;
  border: 3px solid transparent; text-decoration: none; color: var(--texto);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.m2-hub-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--sombra-hover); border-color: var(--azul); }
.m2-hub-card .m2-icono { font-size: 3.2rem; }
.m2-hub-card h3 { font-family: 'Fredoka One', cursive; font-size: .97rem; }
.m2-hub-card p  { font-size: .76rem; color: var(--gris-texto); line-height: 1.4; }
.m2-hub-card .m2-tag { background: var(--azul-soft); color: var(--azul-m); border-radius: 50px; padding: 3px 10px; font-size: .7rem; font-weight: 800; }
.m2-progress-wrap { width: 100%; background: var(--azul-bg); border-radius: 50px; height: 12px; overflow: hidden; }
.m2-progress-fill { height: 100%; background: linear-gradient(90deg, var(--azul), var(--verde)); border-radius: 50px; transition: width .5s ease; }
.m2-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.m2-modal-overlay.show { opacity: 1; pointer-events: all; }
.m2-modal {
  background: white; border-radius: var(--radio-lg); padding: 36px 28px;
  max-width: 420px; width: 92%; text-align: center;
  transform: scale(.88); transition: transform .25s;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
}
.m2-modal-overlay.show .m2-modal { transform: scale(1); }
.m2-modal .big-emoji { font-size: 4.5rem; display: block; margin-bottom: 10px; }
.m2-modal h2 { font-family: 'Fredoka One', cursive; font-size: 1.8rem; color: var(--azul); }
.m2-modal p  { color: var(--gris-texto); margin: 10px 0 20px; font-size: .92rem; }
.m2-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px; border: none; border-radius: 50px;
  font-family: 'Nunito', Arial, sans-serif; font-weight: 800; font-size: .9rem;
  cursor: pointer; transition: transform .15s, filter .15s;
  text-decoration: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.m2-btn:hover  { transform: translateY(-2px); filter: brightness(1.07); }
.m2-btn:active { transform: scale(.96); }
.m2-btn-azul   { background: var(--azul);    color: white; box-shadow: 0 4px 14px rgba(116,192,232,.4); }
.m2-btn-verde  { background: var(--verde);   color: white; box-shadow: 0 4px 14px rgba(110,207,160,.4); }
.m2-btn-naranja{ background: var(--naranja); color: white; }
.m2-btn-morado { background: var(--morado);  color: white; }
.m2-btn-amarillo{ background: var(--amarillo); color: var(--texto); }
.m2-btn-sm     { padding: 6px 14px; font-size: .8rem; }
.m2-btn-lg     { padding: 14px 32px; font-size: 1.05rem; }
.m2-btn-block  { width: 100%; justify-content: center; }
.m2-alert { padding: 10px 14px; border-radius: 10px; font-weight: 700; margin-bottom: 10px; font-size: .88rem; }
.m2-alert-ok   { background: var(--verde-bg); color: #0A6640; border-left: 4px solid var(--verde); }
.m2-alert-err  { background: #FFD6E0; color: #9C0030; border-left: 4px solid var(--rosa); }
.m2-alert-info { background: var(--azul-bg);  color: #1A4D6E; border-left: 4px solid var(--azul); }

/* ── Elefante mascota ────────────────────────────────────── */
.elefante-wrap {
  position: fixed; bottom: 16px; right: 16px; z-index: 50;
  cursor: pointer; animation: elef-float 3s ease-in-out infinite; user-select: none;
}
.elefante-wrap svg { width: 68px; height: 68px; }
.elefante-burbuja {
  position: absolute; bottom: 76px; right: 0;
  background: white; border: 3px solid var(--azul);
  border-radius: 14px 14px 0 14px; padding: 9px 13px;
  font-size: .8rem; font-weight: 800; color: var(--texto);
  min-width: 140px; max-width: 190px; box-shadow: var(--sombra);
  display: none; line-height: 1.4;
}
.elefante-wrap:hover .elefante-burbuja { display: block; }

/* ── Animaciones ─────────────────────────────────────────── */
@keyframes pop   { 0%{transform:scale(0) rotate(-10deg)} 70%{transform:scale(1.15)} 100%{transform:scale(1)} }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
@keyframes pulse { from{transform:scale(1)} to{transform:scale(1.06)} }
@keyframes caer  { from{transform:translateY(-30px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes elef-float { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-8px) rotate(2deg)} }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 2px solid var(--azul-soft); flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .sidebar-menu { flex-direction: row; flex-wrap: wrap; }
  .sidebar-menu a { padding: 7px 10px; font-size: .8rem; }
  .juegos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .color-btn  { width: 70px; height: 70px; font-size: .75rem; }
  .m2-hub-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .login-card { padding: 30px 22px; }
  .clasif-container { grid-template-columns: 1fr; }
  .num-opciones { grid-template-columns: repeat(4, 1fr); }
  .letra-opciones { grid-template-columns: repeat(3, 1fr); }
  .numero-grande, .letra-grande { font-size: 5rem; }
}
@media (max-width: 480px) {
  .navbar-brand { font-size: 1.6rem; }
  .metricas-grid { grid-template-columns: repeat(2, 1fr); }
  .juegos-grid { grid-template-columns: repeat(2, 1fr); }
  .login-logo h1 { font-size: 3rem; }
  .game-board { padding: 18px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .navbar, .sidebar, .btn, .m2-btn, .modal-overlay, .elefante-wrap { display: none !important; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .card, .m2-card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}
