/**
 * MINDS ACADEMY - SISTEMA DE DISEÑO GAMIFICADO & GAME-FEEL TÁCTIL
 * Identidad Oficial: Índigo (#4f46e5), Violeta (#7c3aed), Cian (#0284c7) y Oro (#f59e0b)
 * Diseñado para Móvil y Escritorio con cero saltos de maquetación (Zero Layout Shift)
 */

/* ==========================================================================
   1. VARIABLES Y TOKENS DE IDENTIDAD
   ========================================================================== */
:root {
  /* Paleta Primaria MINDS: Morado y Blanco Unificado */
  --minds-primary: #7c3aed;
  --minds-primary-hover: #6d28d9;
  --minds-primary-gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  --minds-primary-shadow: #5b21b6;
  --minds-primary-light: #f5f3ff;
  --minds-primary-border: #ddd6fe;

  /* Acento Interactivo Violeta / Índigo */
  --minds-cyan: #6366f1;
  --minds-cyan-hover: #4f46e5;
  --minds-cyan-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --minds-cyan-shadow: #3730a3;
  --minds-cyan-light: #eef2ff;

  /* Oro y Recompensas Suaves */
  --minds-gold: #d97706;
  --minds-gold-hover: #b45309;
  --minds-gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --minds-gold-shadow: #92400e;
  --minds-gold-light: #fffbeb;

  /* Éxito y Aciertos (Esmeralda) */
  --minds-emerald: #059669;
  --minds-emerald-hover: #047857;
  --minds-emerald-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --minds-emerald-shadow: #065f46;
  --minds-emerald-light: #ecfdf5;

  /* Alerta y Salir (Rojo Suave) */
  --minds-ruby: #dc2626;
  --minds-ruby-hover: #b91c1c;
  --minds-ruby-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --minds-ruby-shadow: #991b1b;
  --minds-ruby-light: #fef2f2;

  /* Neutro / Soporte (Púrpura Neutro) */
  --minds-slate: #64748b;
  --minds-slate-hover: #475569;
  --minds-slate-gradient: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  --minds-slate-shadow: #4c1d95;
  --minds-slate-light: #faf5ff;

  /* Superficies Blancas Limpias y Fondos Claros Morados */
  --minds-bg-app: #faf5ff;
  --minds-surface: #ffffff;
  --minds-surface-subtle: #f5f3ff;
  --minds-surface-border: #ede9fe;
  --minds-surface-border-subtle: #ddd6fe;
  --minds-surface-shadow: 0 1px 3px rgba(124, 58, 237, 0.05), 0 4px 12px rgba(124, 58, 237, 0.04);
  --minds-surface-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* Texto */
  --minds-text-main: #1e1b4b;
  --minds-text-muted: #6b21a8;
  --minds-text-light: #94a3b8;

  /* Tipografía */
  --font-game-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-game-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* FÍSICA DE RESORTE (SPRING TIMING TOKENS) */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);

  /* Sombras Físicas 3D Discretas */
  --minds-btn-shadow: 0 3px 0 #1e3a8a;
  --minds-btn-shadow-hover: 0 4px 0 #1e3a8a;
  --minds-btn-shadow-emerald: 0 3px 0 #065f46;
  --minds-btn-shadow-gold: 0 3px 0 #92400e;
  --minds-btn-shadow-ruby: 0 3px 0 #991b1b;
  --minds-btn-shadow-cyan: 0 3px 0 #075985;
  --minds-btn-shadow-slate: 0 3px 0 #1e293b;

  /* Resplandores Sutiles */
  --minds-glow-indigo: 0 0 16px rgba(37, 99, 235, 0.2);
  --minds-glow-cyan: 0 0 16px rgba(2, 132, 199, 0.2);
  --minds-glow-gold: 0 0 16px rgba(217, 119, 6, 0.2);
  --minds-glow-emerald: 0 0 16px rgba(5, 150, 105, 0.2);

  /* Bento Grid Tokens */
  --bento-radius: 16px;
  --bento-gap: 1.25rem;
  --bento-border: 1px solid #e2e8f0;
  --bento-surface: #ffffff;
  --bento-hover-transform: translateY(-2px);
}

/* Modo Oscuro Armónico (Carbón y Pizarra - Cero Morado) */
[data-theme="dark"] {
  --minds-bg-app: #0b0f19;
  --minds-surface: #131b2e;
  --minds-surface-subtle: #1e293b;
  --minds-surface-border: #1e293b;
  --minds-surface-border-subtle: #334155;
  --minds-surface-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --minds-surface-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --minds-text-main: #f8fafc;
  --minds-text-muted: #94a3b8;
  --minds-text-light: #64748b;

  --minds-primary-light: rgba(37, 99, 235, 0.15);
  --minds-cyan-light: rgba(2, 132, 199, 0.15);
  --minds-gold-light: rgba(217, 119, 6, 0.15);
  --minds-emerald-light: rgba(5, 150, 105, 0.15);
  --minds-ruby-light: rgba(220, 38, 38, 0.15);
  --minds-slate-light: rgba(71, 85, 105, 0.15);

  --minds-btn-shadow: 0 3px 0 #0f172a;
  --minds-btn-shadow-hover: 0 4px 0 #0f172a;
  --minds-btn-shadow-emerald: 0 3px 0 #022c22;
  --minds-btn-shadow-gold: 0 3px 0 #451a03;
  --minds-btn-shadow-ruby: 0 3px 0 #450a0a;
  --minds-btn-shadow-cyan: 0 3px 0 #082f49;
  --minds-btn-shadow-slate: 0 3px 0 #020617;

  --bento-border: 1px solid #1e293b;
  --bento-surface: #131b2e;
  --minds-glow-indigo: 0 0 16px rgba(37, 99, 235, 0.15);
  --minds-glow-cyan: 0 0 16px rgba(2, 132, 199, 0.15);
}

/* ==========================================================================
   2. TIPOGRAFÍA Y JERARQUÍA
   ========================================================================== */
body {
  font-family: var(--font-game-body);
  color: var(--minds-text-main);
  background-color: var(--minds-bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.page-title,
.game-title,
.quest-title {
  font-family: var(--font-game-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--minds-text-main);
}

/* ==========================================================================
   3. FÍSICA DE BOTONES TÁCTILES 3D (CERO SALTO DE MAQUETACIÓN & GAME-FEEL)
   ========================================================================== */
.btn-minds-game,
.btn-3d-tactile,
.btn-game-master,
.minds-btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-game-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 12px 24px;
  min-height: 44px; /* Estándar ergonómico táctil Google/Apple */
  border-radius: 16px;
  border: none;
  cursor: pointer;
  user-select: none;
  text-decoration: none !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, box-shadow;
  transition: transform 0.12s var(--ease-spring), box-shadow 0.12s var(--ease-spring), filter 0.15s ease;
}

/* Modificadores de Proporción y Tamaño */
.minds-btn-sm {
  padding: 8px 16px !important;
  font-size: 0.82rem !important;
  min-height: 36px !important;
  border-radius: 12px !important;
}

.minds-btn-lg {
  padding: 16px 32px !important;
  font-size: 1.1rem !important;
  min-height: 52px !important;
  border-radius: 20px !important;
}

.minds-btn-block {
  width: 100% !important;
  display: flex !important;
}

.minds-btn-pill {
  border-radius: 999px !important;
}

/* Botón Táctil de Icono (1:1 Proporcional) */
.minds-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.minds-btn-icon.minds-btn-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 0.85rem;
}
.minds-btn-icon.minds-btn-lg {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  font-size: 1.25rem;
}

/* 3.1. Botón Maestro Índigo/Violeta (Acción Primaria MINDS) */
.btn-minds-game.btn-primary,
.btn-primary.btn-3d-tactile,
.btn-game-master,
.minds-btn-primary {
  background: var(--minds-primary-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-primary-shadow), 0 8px 16px rgba(79, 70, 229, 0.3);
}

/* 3.2. Botón Acento Cian (Acciones de Exploración, Fonética y Continuación) */
.btn-minds-game.btn-cyan,
.btn-info.btn-3d-tactile,
.minds-btn-cyan,
.minds-btn-info {
  background: var(--minds-cyan-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-cyan-shadow), 0 8px 16px rgba(2, 132, 199, 0.3);
}

/* 3.3. Botón Éxito Esmeralda (Comprobar, Ganar y Finalizar) */
.btn-minds-game.btn-success,
.btn-success.btn-3d-tactile,
.minds-btn-success {
  background: var(--minds-emerald-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-emerald-shadow), 0 8px 16px rgba(16, 185, 129, 0.3);
}

/* 3.4. Botón Oro / Draco / Recompensas */
.btn-minds-game.btn-gold,
.btn-warning.btn-3d-tactile,
.minds-btn-gold,
.minds-btn-warning {
  background: var(--minds-gold-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-gold-shadow), 0 8px 16px rgba(245, 158, 11, 0.3);
}

/* 3.5. Botón Púrpura Épico (Evaluaciones y Desafíos de Jefe) */
.btn-minds-game.btn-purple,
.minds-btn-purple {
  background: var(--minds-purple-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-purple-shadow), 0 8px 16px rgba(139, 92, 246, 0.3);
}

/* 3.6. Botón Rubí / Alerta / Descarte / Salir */
.btn-minds-game.btn-ruby,
.btn-danger.btn-3d-tactile,
.minds-btn-ruby,
.minds-btn-danger {
  background: var(--minds-ruby-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-ruby-shadow), 0 8px 16px rgba(239, 68, 68, 0.3);
}

/* 3.7. Botón Slate Secundario (Neutro y Apoyo) */
.btn-minds-game.btn-secondary,
.minds-btn-secondary {
  background: var(--minds-slate-gradient) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 0 var(--minds-slate-shadow), 0 8px 16px rgba(100, 116, 139, 0.25);
}

/* 3.8. Botón Outline Táctil Redondeado */
.btn-minds-outline,
.minds-btn-outline {
  font-family: var(--font-game-display);
  font-weight: 700;
  border: 2px solid var(--minds-surface-border) !important;
  background: var(--minds-surface);
  color: var(--minds-primary) !important;
  box-shadow: 0 3px 0 var(--minds-surface-border);
  border-radius: 14px;
  padding: 10px 20px;
  transition: all 0.15s var(--ease-spring);
}
.btn-minds-outline:active,
.minds-btn-outline:active {
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 transparent !important;
}

/* Interacción de Hover en Computador (Mouse Pointer Real - Evita 'Sticky Hover' en Móvil) */
@media (hover: hover) and (pointer: fine) {
  .btn-minds-game:hover,
  .btn-3d-tactile:hover,
  .btn-game-master:hover,
  .minds-btn-3d:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    color: #ffffff !important;
  }
  .btn-minds-game.btn-primary:hover,
  .btn-primary.btn-3d-tactile:hover,
  .btn-game-master:hover,
  .minds-btn-primary:hover {
    box-shadow: 0 6px 0 var(--minds-primary-shadow), 0 10px 20px rgba(79, 70, 229, 0.35);
  }
  .btn-minds-game.btn-cyan:hover,
  .btn-info.btn-3d-tactile:hover,
  .minds-btn-cyan:hover,
  .minds-btn-info:hover {
    box-shadow: 0 6px 0 var(--minds-cyan-shadow), 0 10px 20px rgba(2, 132, 199, 0.35);
  }
  .btn-minds-game.btn-success:hover,
  .btn-success.btn-3d-tactile:hover,
  .minds-btn-success:hover {
    box-shadow: 0 6px 0 var(--minds-emerald-shadow), 0 10px 20px rgba(16, 185, 129, 0.35);
  }
  .btn-minds-game.btn-gold:hover,
  .btn-warning.btn-3d-tactile:hover,
  .minds-btn-gold:hover,
  .minds-btn-warning:hover {
    box-shadow: 0 6px 0 var(--minds-gold-shadow), 0 10px 20px rgba(245, 158, 11, 0.35);
  }
  .btn-minds-game.btn-purple:hover,
  .minds-btn-purple:hover {
    box-shadow: 0 6px 0 var(--minds-purple-shadow), 0 10px 20px rgba(139, 92, 246, 0.35);
  }
  .btn-minds-game.btn-ruby:hover,
  .btn-danger.btn-3d-tactile:hover,
  .minds-btn-ruby:hover,
  .minds-btn-danger:hover {
    box-shadow: 0 6px 0 var(--minds-ruby-shadow), 0 10px 20px rgba(239, 68, 68, 0.35);
  }
  .btn-minds-game.btn-secondary:hover,
  .minds-btn-secondary:hover {
    box-shadow: 0 6px 0 var(--minds-slate-shadow), 0 10px 20px rgba(100, 116, 139, 0.3);
  }
  .btn-minds-outline:hover,
  .minds-btn-outline:hover {
    background: var(--minds-primary-light);
    border-color: var(--minds-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--minds-surface-border);
  }
}

/* Física del Clic / Pulsación Táctil en Móvil y Escritorio (:active) */
.btn-minds-game:active,
.btn-3d-tactile:active,
.btn-game-master:active,
.minds-btn-3d:active,
.btn-minds-game.is-pressed,
.minds-btn-3d.is-pressed {
  transform: translateY(4px) !important;
  box-shadow: 0 0 0 transparent, 0 1px 3px rgba(0, 0, 0, 0.12) !important;
}

/* Botón Inactivo / Deshabilitado (Preserva altura sin romper maquetación) */
.btn-minds-game:disabled,
.btn-3d-tactile:disabled,
.minds-btn-3d:disabled,
.btn-minds-game.is-disabled,
.minds-btn-3d.is-disabled {
  background: #cbd5e1 !important;
  color: #64748b !important;
  box-shadow: 0 4px 0 #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
  filter: none !important;
  pointer-events: none;
}
[data-theme="dark"] .btn-minds-game:disabled,
[data-theme="dark"] .btn-3d-tactile:disabled,
[data-theme="dark"] .minds-btn-3d:disabled {
  background: #334155 !important;
  color: #94a3b8 !important;
  box-shadow: 0 4px 0 #1e293b !important;
}

/* ==========================================================================
   4. TARJETAS TÁCTILES CLAYMORPHIC (VOLUMEN SUAVE Y OPT-IN)
   ========================================================================== */
.minds-game-card:not([style*="background"]):not([style*="gradient"]),
.card.minds-game-card {
  background: var(--minds-surface);
  border-radius: 16px;
  border: 1px solid var(--minds-surface-border);
  box-shadow: var(--minds-surface-shadow);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Hover suave en tarjetas interactivas */
.minds-game-card:hover {
  border-color: var(--minds-primary-border);
}

.minds-game-card.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  border-color: var(--minds-primary);
}

/* ==========================================================================
   5. COMPONENTES DE EJERCICIOS (TÁCTIL Y ERGONÓMICO)
   ========================================================================== */
/* Bloque de Opción Múltiple Táctil (No oculta inputs, agrega tactilidad) */
.minds-tactile-option,
.opcion-card,
.exercise-option-btn {
  display: block;
  width: 100%;
  position: relative;
  background: var(--minds-surface);
  border: 2px solid var(--minds-surface-border);
  border-radius: 18px;
  padding: 14px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--minds-surface-border), 0 6px 12px rgba(15, 23, 42, 0.03);
  transition: all 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
}

.minds-tactile-option:hover,
.opcion-card:hover {
  border-color: var(--minds-primary-border);
  background: var(--minds-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--minds-primary-border), 0 8px 16px rgba(79, 70, 229, 0.08);
}

.minds-tactile-option:active,
.opcion-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--minds-primary-border);
}

/* Estado Seleccionado */
.minds-tactile-option.is-selected,
.minds-tactile-option.selected,
.opcion-card.selected {
  border-color: var(--minds-primary) !important;
  background: var(--minds-primary-light) !important;
  box-shadow: 0 4px 0 var(--minds-primary-shadow), 0 0 0 2px var(--minds-primary) !important;
  transform: translateY(1px);
}

[data-theme="dark"] .minds-tactile-option.is-selected,
[data-theme="dark"] .opcion-card.selected {
  background: rgba(79, 70, 229, 0.25) !important;
  border-color: #818cf8 !important;
  box-shadow: 0 4px 0 #4f46e5 !important;
}

/* Letra o Indicador de Opción (Badge tipo cápsula) */
.option-pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--minds-primary);
  font-family: var(--font-game-display);
  font-weight: 800;
  font-size: 0.9rem;
  margin-right: 12px;
  transition: all 0.15s ease;
}

.minds-tactile-option.is-selected .option-pill-badge,
.opcion-card.selected .option-pill-badge {
  background: var(--minds-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

/* 5.1 Cuadrícula de Opciones Gamificadas */
.gamified-options-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
  margin-top: 10px !important;
  margin-bottom: 16px !important;
}

/* Tarjeta de Opción Gamificada (3D Claymorphic Pushable) */
.gamified-option-card {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 60px !important;
  padding: 14px 18px !important;
  background: #ffffff !important;
  border: 2px solid rgba(99, 102, 241, 0.16) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 0 rgba(99, 102, 241, 0.12), 0 6px 14px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
  cursor: pointer !important;
  text-align: left !important;
  user-select: none !important;
  position: relative !important;
  overflow: hidden !important;
}

[data-theme="dark"] .gamified-option-card {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

.gamified-option-card:hover:not(:disabled) {
  border-color: #6366f1 !important;
  background: #f8faff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 0 rgba(99, 102, 241, 0.22), 0 10px 20px rgba(99, 102, 241, 0.12) !important;
}

[data-theme="dark"] .gamified-option-card:hover:not(:disabled) {
  background: #253349 !important;
  border-color: #818cf8 !important;
}

.gamified-option-card:active:not(:disabled) {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 rgba(99, 102, 241, 0.2) !important;
}

/* Estado Seleccionado */
.gamified-option-card.selected,
.gamified-option-card.active {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  box-shadow: 0 3px 0 #0369a1, 0 0 0 2px #0284c7 !important;
  transform: translateY(1px) !important;
}

[data-theme="dark"] .gamified-option-card.selected,
[data-theme="dark"] .gamified-option-card.active {
  background: rgba(2, 132, 199, 0.22) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 3px 0 #0284c7, 0 0 0 2px #38bdf8 !important;
}

/* Chip de Letra (A, B, C, D) */
.option-letter-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 12px !important;
  background: rgba(99, 102, 241, 0.1) !important;
  color: #4f46e5 !important;
  font-family: var(--font-game-display, 'Plus Jakarta Sans', sans-serif) !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  margin-right: 14px !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

[data-theme="dark"] .option-letter-chip {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #a5b4fc !important;
}

.gamified-option-card.selected .option-letter-chip,
.gamified-option-card.active .option-letter-chip {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4) !important;
}

/* Texto de la opción */
.option-text {
  flex-grow: 1 !important;
  font-family: var(--font-game-body, 'Inter', sans-serif) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  line-height: 1.4 !important;
}

[data-theme="dark"] .option-text {
  color: #f8fafc !important;
}

/* Indicador de acierto / error */
.option-indicator-chip {
  margin-left: 12px !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.option-indicator-chip .check-icon {
  opacity: 0;
  transition: opacity 0.15s ease;
  color: #0284c7;
}

.gamified-option-card.selected .option-indicator-chip .check-icon {
  opacity: 1;
}

/* 5.2 Botón de Acción Principal del Ejercicio (#submitExercise) */
#submitExercise {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 14px 32px !important;
  border-radius: 20px !important;
  font-family: var(--font-game-display, 'Plus Jakarta Sans', sans-serif) !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  border: none !important;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 0 #3730a3, 0 10px 22px rgba(79, 70, 229, 0.35) !important;
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.1s ease !important;
  cursor: pointer !important;
}

#submitExercise:hover:not(:disabled) {
  filter: brightness(1.08) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 7px 0 #3730a3, 0 14px 28px rgba(79, 70, 229, 0.45) !important;
}

#submitExercise:active:not(:disabled) {
  transform: translateY(4px) !important;
  box-shadow: 0 1px 0 #3730a3, 0 4px 10px rgba(79, 70, 229, 0.25) !important;
}

@media (max-width: 768px) {
  #submitExercise {
    width: 100% !important;
    padding: 15px 20px !important;
    font-size: 1.1rem !important;
  }
}

/* ==========================================================================
   6. HUD DE JUGADOR & MEDIDORES GAMIFICADOS
   ========================================================================== */
.minds-hud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font-family: var(--font-game-display);
  font-weight: 800;
  font-size: 0.88rem;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Racha (Streak) */
.hud-badge-streak {
  background: var(--minds-gold-light);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}
.hud-badge-streak i {
  color: var(--minds-gold);
  animation: streakFlame 1.8s infinite alternate ease-in-out;
}

/* Monedas (Gold) */
.hud-badge-coins {
  background: var(--minds-gold-light);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Nivel / EXP */
.hud-badge-level {
  background: var(--minds-primary-light);
  color: var(--minds-primary);
  border-color: var(--minds-primary-border);
}

/* Barra de Progreso Gamificada */
.progress {
  background: rgba(226, 232, 240, 0.7) !important;
  border-radius: 99px !important;
  height: 10px !important;
  overflow: hidden !important;
  border: 1px solid rgba(15, 23, 42, 0.04) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.progress-bar {
  background: var(--minds-primary-gradient) !important;
  border-radius: 99px !important;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.4) !important;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.progress-bar-gold {
  background: var(--minds-gold-gradient) !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4) !important;
}

/* ==========================================================================
   7. BARRA DE NAVEGACIÓN INFERIOR MÓVIL (BOTTOM APP BAR)
   ========================================================================== */
/* ==========================================================================
   7. BARRA DE NAVEGACIÓN INFERIOR MÓVIL (BOTTOM APP BAR)
   ========================================================================== */
.minds-bottom-nav,
.bottom-nav,
#mainBottomNav {
  display: none;
}

@media (max-width: 991.98px) {
  .minds-bottom-nav,
  .bottom-nav,
  #mainBottomNav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 70px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1.5px solid rgba(99, 102, 241, 0.15) !important;
    box-shadow: 0 -6px 25px rgba(15, 23, 42, 0.08) !important;
    z-index: 990 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
  }

  [data-theme="dark"] .minds-bottom-nav,
  [data-theme="dark"] .bottom-nav,
  [data-theme="dark"] #mainBottomNav {
    background: rgba(15, 23, 42, 0.96) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.5) !important;
  }

  .bottom-nav-content {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 0 !important;
  }

  .minds-bottom-item,
  .bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: var(--minds-text-muted, #64748b) !important;
    font-size: 0.72rem !important;
    font-family: var(--font-game-display, 'Plus Jakarta Sans', sans-serif) !important;
    font-weight: 700 !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 6px 2px !important;
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    user-select: none !important;
    position: relative !important;
  }

  .minds-bottom-item i,
  .bottom-nav-item i,
  .bottom-nav-icon {
    font-size: 1.28rem !important;
    margin-bottom: 3px !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease !important;
  }

  .bottom-nav-label {
    font-size: 0.68rem !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .minds-bottom-item.active,
  .bottom-nav-item.active {
    color: var(--minds-primary, #4f46e5) !important;
  }

  .minds-bottom-item.active i,
  .bottom-nav-item.active i,
  .bottom-nav-item.active .bottom-nav-icon {
    transform: translateY(-2px) scale(1.15) !important;
    color: var(--minds-primary, #4f46e5) !important;
  }

  .minds-bottom-item:active,
  .bottom-nav-item:active {
    transform: scale(0.92) !important;
  }

  /* Safe Area Padding para evitar que el contenido quede oculto detrás de la barra */
  #studentPageContent,
  .page-content,
  .main-content,
  .student-content-wrapper {
    padding-bottom: 95px !important;
  }
}

/* ==========================================================================
   8. MICRO-ANIMACIONES
   ========================================================================== */
@keyframes streakFlame {
  0% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
  100% { transform: scale(1.15) rotate(4deg); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8)); }
}

@keyframes gamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.anim-game-pulse {
  animation: gamePulse 2.5s infinite ease-in-out;
}

/* ==========================================================================
   9. OPTIMIZACIÓN RESPONSIVE DEL DASHBOARD (MÓVIL COMPACTO & ESCRITORIO TABLERO)
   ========================================================================== */

/* 9.1. CELULAR (Hasta 991.98px): Compactación extrema, sin scroll infinito */
@media (max-width: 991.98px) {
  .dashboard-container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .dashboard-top-quote {
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    border-radius: 14px !important;
  }

  .dashboard-top-quote .quote-main {
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
  }

  .dashboard-top-quote .quote-author {
    font-size: 0.72rem !important;
    margin-top: 2px !important;
  }

  .hero-section {
    padding: 1.25rem 0.85rem !important;
    margin: 0 -0.5rem 1rem -0.5rem !important;
    border-radius: 0 0 1.5rem 1.5rem !important;
  }

  .hero-title {
    font-size: 1.35rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.2 !important;
  }

  .hero-subtitle {
    font-size: 0.82rem !important;
    margin-bottom: 0.65rem !important;
  }

  /* Tira métrica deslizable en una sola fila (Cero desperdicio vertical) */
  .dashboard-top-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding: 4px 2px 8px 2px !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
  }

  .dashboard-top-grid::-webkit-scrollbar {
    display: none !important;
  }

  .dashboard-top-btn {
    flex: 0 0 92px !important;
    width: 92px !important;
    min-height: 86px !important;
    padding: 8px 4px 6px 4px !important;
    border-radius: 16px !important;
    box-shadow: 0 3px 0 rgba(99, 102, 241, 0.15), 0 6px 14px rgba(15, 23, 42, 0.05) !important;
  }

  .dashboard-top-btn .icon-wrap {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
    border-radius: 10px !important;
    margin-bottom: 3px !important;
  }

  .dashboard-top-btn .btn-metric {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
  }

  .dashboard-top-btn .dashboard-btn-label {
    font-size: 0.64rem !important;
    margin-top: 2px !important;
  }

  /* Acciones rápidas compactas en 2 columnas */
  .actions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .interactive-card {
    padding: 0.85rem 0.65rem !important;
    border-radius: 16px !important;
    text-align: center !important;
  }

  .interactive-card .card-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.15rem !important;
    margin: 0 auto 0.4rem auto !important;
    border-radius: 12px !important;
  }

  .interactive-card .card-title {
    font-size: 0.84rem !important;
    margin-bottom: 0.2rem !important;
  }

  .interactive-card .card-description {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
  }

  /* Tarjetas de cursos optimizadas para móvil */
  .course-card {
    border-radius: 20px !important;
    padding: 1.25rem 1rem !important;
    margin-bottom: 1rem !important;
  }

  .course-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .course-actions .btn-primary-custom {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    border-radius: 16px !important;
    text-align: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 0 #3730a3, 0 8px 16px rgba(79, 70, 229, 0.3) !important;
  }

  .course-actions .btn-secondary-custom {
    width: 100% !important;
    padding: 8px 14px !important;
    font-size: 0.86rem !important;
    border-radius: 14px !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* 9.2. ESCRITORIO (Desde 992px): Tablero de Juego balanceado sin huecos */
@media (min-width: 992px) {
  .dashboard-container {
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 1.5rem 2rem !important;
  }

  .hero-section {
    padding: 2.25rem 2.5rem !important;
    margin: 0 0 1.75rem 0 !important;
    border-radius: 26px !important;
    border: 1.5px solid var(--minds-surface-border) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
  }

  .hero-title {
    font-size: 2.2rem !important;
    font-weight: 800 !important;
  }

  .dashboard-top-grid {
    display: flex !important;
    justify-content: center !important;
    gap: 16px !important;
    margin-top: 1.25rem !important;
  }

  .dashboard-top-btn {
    width: 122px !important;
    min-height: 110px !important;
    border-radius: 20px !important;
  }

  .actions-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 1.25rem !important;
  }

  .courses-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
    gap: 1.5rem !important;
  }

  .course-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 24px !important;
  }

  .course-content {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
  }

  .course-actions {
    margin-top: auto !important;
  }
}

/* ==========================================================================
   10. SISTEMA UNIVERSAL SKELETON SHIMMER (CARGA FLUIDA Y CERO SALTOS)
   ========================================================================== */
.minds-skeleton {
  position: relative;
  overflow: hidden;
  background: #e2e8f0 !important;
  border-radius: 14px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
[data-theme="dark"] .minds-skeleton {
  background: #1e293b !important;
}
.minds-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.65) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: mindsShimmerSweep 1.6s infinite ease-in-out;
}
[data-theme="dark"] .minds-skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
}
@keyframes mindsShimmerSweep {
  100% {
    transform: translateX(100%);
  }
}
.minds-skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  width: 100%;
}
.minds-skeleton-title {
  height: 2rem;
  width: 65%;
  margin-bottom: 1rem;
  border-radius: 10px;
}
.minds-skeleton-avatar {
  width: 50px;
  height: 50px;
  border-radius: 999px;
  flex-shrink: 0;
}
.minds-skeleton-btn {
  height: 46px;
  width: 140px;
  border-radius: 16px;
}
.minds-skeleton-card {
  height: 220px;
  border-radius: 22px;
  width: 100%;
}

/* ==========================================================================
   11. BENTO GRID ARCHITECTURE (ESTRUCTURA MODERNA MODULAR)
   ========================================================================== */
.minds-bento-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--bento-gap);
  width: 100%;
  margin-bottom: 2rem;
}
@media (min-width: 768px) {
  .minds-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .minds-bento-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.bento-card {
  position: relative;
  background: var(--bento-surface);
  border: var(--bento-border);
  border-radius: var(--bento-radius);
  padding: 1.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  transition: transform 0.22s var(--ease-spring), box-shadow 0.22s var(--ease-spring), border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.bento-card:hover {
  transform: var(--bento-hover-transform);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.09);
  border-color: rgba(99, 102, 241, 0.35);
}
.bento-col-2 {
  grid-column: span 1;
}
@media (min-width: 768px) {
  .bento-col-2 {
    grid-column: span 2;
  }
}
.bento-col-3 {
  grid-column: span 1;
}
@media (min-width: 1024px) {
  .bento-col-3 {
    grid-column: span 3;
  }
}
.bento-col-4 {
  grid-column: 1 / -1;
}
.bento-row-2 {
  grid-row: span 1;
}
@media (min-width: 768px) {
  .bento-row-2 {
    grid-row: span 2;
  }
}

.bento-card.bento-featured {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, rgba(124, 58, 237, 0.1) 100%), var(--bento-surface);
  border-color: rgba(99, 102, 241, 0.3);
}
.bento-card.bento-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07) 0%, rgba(5, 150, 105, 0.1) 100%), var(--bento-surface);
  border-color: rgba(16, 185, 129, 0.3);
}
.bento-card.bento-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07) 0%, rgba(217, 119, 6, 0.1) 100%), var(--bento-surface);
  border-color: rgba(245, 158, 11, 0.3);
}

.bento-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-game-display);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 0.85rem;
}

/* ==========================================================================
   12. TROPHY UI GAMIFICATION SUITE (RACHAS, XP, DRACO & LOGROS)
   ========================================================================== */
.minds-streak-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #fdba74;
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: 0 4px 0 #ea580c;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s var(--ease-spring);
}
[data-theme="dark"] .minds-streak-card {
  background: linear-gradient(135deg, #431407 0%, #7c2d12 100%);
  border-color: #f97316;
  box-shadow: 0 4px 0 #9a3412;
}
.minds-streak-card:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 0 #ea580c;
}
.minds-streak-card:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #ea580c;
}
.minds-streak-flame {
  font-size: 1.3rem;
  animation: mindsFlameFlicker 1.8s infinite ease-in-out alternate;
  display: inline-block;
  transform-origin: 50% 90%;
}
@keyframes mindsFlameFlicker {
  0% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 2px #f97316); }
  50% { transform: scale(1.18) rotate(3deg); filter: drop-shadow(0 0 8px #ef4444); }
  100% { transform: scale(1.05) rotate(-2deg); filter: drop-shadow(0 0 4px #eab308); }
}
.minds-streak-count {
  font-family: var(--font-game-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: #c2410c;
}
[data-theme="dark"] .minds-streak-count {
  color: #ffedd5;
}

/* Barra de Experiencia XP (Candy Pill) */
.minds-xp-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.minds-xp-track {
  position: relative;
  flex-grow: 1;
  height: 18px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1.5px solid rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .minds-xp-track {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.08);
}
.minds-xp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  position: relative;
  transition: width 0.8s var(--ease-spring);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}
.minds-xp-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 24px 24px;
  animation: mindsStripeMove 1.2s linear infinite;
  border-radius: 999px;
}
@keyframes mindsStripeMove {
  0% { background-position: 0 0; }
  100% { background-position: 24px 0; }
}

/* Monedas de Dragón (Draco Coins Pill) */
.minds-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fefce8;
  border: 2px solid #fef08a;
  border-radius: 999px;
  padding: 5px 14px;
  box-shadow: 0 3px 0 #ca8a04;
  font-family: var(--font-game-display);
  font-weight: 800;
  color: #a16207;
  font-size: 0.95rem;
  user-select: none;
  transition: transform 0.15s var(--ease-spring);
}
[data-theme="dark"] .minds-coin-pill {
  background: #713f12;
  border-color: #eab308;
  color: #fef08a;
  box-shadow: 0 3px 0 #854d0e;
}
.minds-coin-pill:hover {
  transform: translateY(-2px) scale(1.04);
}
.minds-coin-icon {
  font-size: 1.15rem;
  animation: mindsCoinWobble 3s infinite ease-in-out;
}
@keyframes mindsCoinWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

/* Widget Flotante de Draco Mascot */
.minds-draco-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--minds-surface);
  border: 2px solid rgba(99, 102, 241, 0.16);
  border-radius: 24px;
  padding: 14px 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s var(--ease-spring);
}
.minds-draco-widget:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.35);
}
.draco-bubble-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  animation: mindsFloat 3s infinite ease-in-out alternate;
}
@keyframes mindsFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

/* ==========================================================================
   13. FICHAS INTERACTIVAS 3D FLIP (MEMORIA, VOCABULARIO & JUEGOS)
   ========================================================================== */
.minds-flip-container {
  perspective: 1200px;
  width: 100%;
  cursor: pointer;
  user-select: none;
}
.minds-flip-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  transition: transform 0.6s var(--ease-spring);
  transform-style: preserve-3d;
  border-radius: 22px;
}
.minds-flip-container:hover .minds-flip-inner,
.minds-flip-container.is-flipped .minds-flip-inner {
  transform: rotateY(180deg);
}
.minds-flip-front,
.minds-flip-back {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 2px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.minds-flip-front {
  background: var(--minds-surface);
  transform: rotateY(0deg);
}
.minds-flip-back {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  transform: rotateY(180deg);
  border-color: rgba(129, 140, 248, 0.3);
}
.phonetics-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  font-family: var(--font-game-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
[data-theme="dark"] .phonetics-pill {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}

/* ==========================================================================
   14. CONTROLES DE AUDIO INTERACTIVOS CON ONDAS SONORAS
   ========================================================================== */
.minds-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--minds-primary-light);
  color: var(--minds-primary);
  border: 2px solid var(--minds-primary-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-game-display);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), background 0.15s ease;
}
.minds-audio-btn:hover {
  transform: scale(1.05);
  background: rgba(99, 102, 241, 0.18);
}
.minds-audio-btn:active {
  transform: scale(0.95);
}
.minds-sound-bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}
.minds-sound-bar {
  width: 3px;
  height: 6px;
  background: currentColor;
  border-radius: 999px;
  transition: height 0.15s ease;
}
.minds-audio-btn.is-playing .minds-sound-bar:nth-child(1) {
  animation: mindsBarWave 0.6s infinite ease-in-out alternate;
}
.minds-audio-btn.is-playing .minds-sound-bar:nth-child(2) {
  animation: mindsBarWave 0.6s infinite ease-in-out alternate 0.2s;
}
.minds-audio-btn.is-playing .minds-sound-bar:nth-child(3) {
  animation: mindsBarWave 0.6s infinite ease-in-out alternate 0.4s;
}
@keyframes mindsBarWave {
  0% { height: 4px; }
  100% { height: 16px; }
}

/* ==========================================================================
   15. AUTO-ENHANCEMENT UNIVERSAL (CASCADA INTELIGENTE PARA TODAS LAS PÁGINAS)
   ========================================================================== */
/* Eleva automáticamente cualquier .btn estándar a botón táctil 3D con personalidad y física elástica */
/* ==========================================================================
   15. MICRO-DETALLES OPT-IN (CERO INVASIÓN DE BOTONES ESTÁNDAR)
   ========================================================================== */
/* Los botones estándar de Bootstrap mantienen sus estilos nativos del sistema.
   Para activar la física táctil 3D, se utiliza explícitamente .minds-btn-3d */

/* Modales con animación de escala elástica suave */
.modal.fade .modal-dialog {
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s var(--ease-spring) !important;
}
.modal.show .modal-dialog {
  transform: scale(1) translateY(0);
}
.modal-content {
  border-radius: 18px !important;
  border: 1px solid var(--minds-surface-border) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden !important;
}

/* ==========================================================================
   16. BENTO HERO & DRACO MASCOT COMPONENTS (DISEÑO LIMPIO Y SOBRIO)
   ========================================================================== */
.draco-bubble-avatar-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  animation: mindsMascotFloat 3.2s ease-in-out infinite;
  position: relative;
  flex-shrink: 0;
}
@keyframes mindsMascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px) scale(1.02); }
}

.draco-speech-bubble {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.35;
  display: inline-block;
  max-width: 640px;
}
[data-theme="dark"] .draco-speech-bubble {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}
.draco-speech-bubble .speech-quote-mark {
  color: #2563eb;
  font-weight: 800;
  font-size: 1rem;
}

.cognitive-pill-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 12px 4px 6px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
[data-theme="dark"] .cognitive-pill-trigger {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.cognitive-pill-trigger:hover {
  transform: translateY(-1px);
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.cognitive-pill-trigger:active {
  transform: translateY(1px);
}

.next-action-hero-banner {
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
  border: 1.5px solid rgba(124, 58, 237, 0.2);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
  border-radius: 16px;
  transition: transform 0.2s var(--ease-spring);
}
.next-action-hero-banner:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.35);
}
.action-pulse-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Modo oscuro textos de soporte */
[data-theme="dark"] .dark-text-light {
  color: #f8fafc !important;
}
[data-theme="dark"] .dark-text-muted {
  color: #94a3b8 !important;
}

/* ==========================================================================
   17. SISTEMA DE TOASTS FLOTANTES ELÁSTICOS (ESTILO SONNER 2026)
   ========================================================================== */
.minds-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
  width: calc(100vw - 32px);
}
@media (max-width: 600px) {
  .minds-toast-container {
    top: auto;
    bottom: 80px;
    right: 16px;
    left: 16px;
    width: auto;
    align-items: center;
  }
}

.minds-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--minds-surface-border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04);
  border-radius: 18px;
  padding: 12px 18px;
  color: var(--minds-text-main);
  font-family: var(--font-game-display);
  font-size: 0.9rem;
  font-weight: 600;
  transform: translateY(-10px) scale(0.94);
  opacity: 0;
  transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
  user-select: none;
}
[data-theme="dark"] .minds-toast {
  background: rgba(20, 27, 45, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  color: #f8fafc;
}
.minds-toast.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.minds-toast.is-leaving {
  transform: translateY(-10px) scale(0.9);
  opacity: 0;
}
.minds-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.minds-toast-success .minds-toast-icon {
  background: var(--minds-emerald-light);
  color: #059669;
}
.minds-toast-info .minds-toast-icon {
  background: var(--minds-cyan-light);
  color: #0284c7;
}
.minds-toast-warning .minds-toast-icon {
  background: var(--minds-gold-light);
  color: #d97706;
}
.minds-toast-error .minds-toast-icon {
  background: var(--minds-ruby-light);
  color: #dc2626;
}

/* ==========================================================================
   18. INPUTS, SEARCH & FORM CONTROLS ERGONÓMICOS
   ========================================================================== */
.minds-input,
.form-control.minds-input {
  font-family: var(--font-game-body);
  background: var(--minds-surface) !important;
  color: var(--minds-text-main) !important;
  border: 2px solid var(--minds-surface-border) !important;
  border-radius: 16px !important;
  padding: 12px 18px !important;
  font-size: 0.95rem !important;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease !important;
}
.minds-input:focus,
.form-control.minds-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18) !important;
  outline: none !important;
}
[data-theme="dark"] .minds-input,
[data-theme="dark"] .form-control.minds-input {
  background: #141b2d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}
[data-theme="dark"] .minds-input:focus,
[data-theme="dark"] .form-control.minds-input:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.25) !important;
}

/* Barra de Búsqueda Redondeada tipo Cápsula */
.minds-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.minds-search-box .minds-input {
  padding-left: 44px !important;
  border-radius: 999px !important;
}
.minds-search-icon {
  position: absolute;
  left: 16px;
  color: var(--minds-text-muted);
  font-size: 1rem;
  pointer-events: none;
}

/* Interruptor Táctil Gamificado (Toggle Switch) */
.minds-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  user-select: none;
}
.minds-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.minds-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s var(--ease-spring);
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.minds-switch-slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: 0.25s var(--ease-spring);
}
.minds-switch input:checked + .minds-switch-slider {
  background: var(--minds-primary-gradient);
}
.minds-switch input:checked + .minds-switch-slider::before {
  transform: translateX(22px);
}

/* ==========================================================================
   19. CAJÓN INFERIOR MÓVIL (MOBILE BOTTOM SHEET DRAWER)
   ========================================================================== */
.minds-bottom-sheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.minds-bottom-sheet-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.minds-bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: var(--minds-surface);
  border-radius: 28px 28px 0 0;
  border-top: 1.5px solid var(--minds-surface-border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  padding: 16px 20px 32px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-spring);
  overflow-y: auto;
}
.minds-bottom-sheet-overlay.is-open .minds-bottom-sheet {
  transform: translateY(0);
}
.minds-drawer-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 0 auto 16px auto;
  cursor: grab;
}
[data-theme="dark"] .minds-drawer-handle {
  background: #475569;
}


