/* ═══════════════════════════════════════════════════════════════
   JULIA'S LEARNING UNIVERSE - Design System
   Un sistema de diseño único para una mente brillante
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ─── Paleta Cósmica (No genérica) ─── */
  --cosmos-deep: #0f0c29;
  --cosmos-mid: #302b63;
  --cosmos-light: #24243e;
  
  --nebula-pink: #ff6b9d;
  --nebula-purple: #c44cff;
  --nebula-blue: #4cc9ff;
  --nebula-mint: #4cffd7;
  --nebula-gold: #ffd54c;
  --nebula-coral: #ff6b6b;
  
  /* ─── Gradientes Mágicos ─── */
  --gradient-cosmic: linear-gradient(135deg, var(--cosmos-deep) 0%, var(--cosmos-mid) 50%, var(--cosmos-light) 100%);
  --gradient-aurora: linear-gradient(135deg, var(--nebula-pink) 0%, var(--nebula-purple) 50%, var(--nebula-blue) 100%);
  --gradient-sunrise: linear-gradient(135deg, var(--nebula-coral) 0%, var(--nebula-gold) 100%);
  --gradient-ocean: linear-gradient(135deg, var(--nebula-blue) 0%, var(--nebula-mint) 100%);
  --gradient-candy: linear-gradient(135deg, var(--nebula-pink) 0%, var(--nebula-purple) 100%);
  
  /* ─── Sombras Glassmorphism ─── */
  --shadow-glow-pink: 0 0 40px rgba(255, 107, 157, 0.4);
  --shadow-glow-purple: 0 0 40px rgba(196, 76, 255, 0.4);
  --shadow-glow-blue: 0 0 40px rgba(76, 201, 255, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, 0.4);
  
  /* ─── Tipografía Distintiva ─── */
  --font-display: 'Baloo 2', cursive;
  --font-body: 'Nunito', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  /* ─── Espaciado ─── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* ─── Bordes ─── */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --radius-full: 9999px;
  
  /* ─── Transiciones ─── */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--gradient-cosmic);
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   FONDO ANIMADO - Estrellas y Partículas
   ═══════════════════════════════════════════════════════════════ */

.cosmic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, white, transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 230px 80px, white, transparent),
    radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent);
  background-size: 350px 350px;
  animation: twinkle 8s ease-in-out infinite;
}

.stars:nth-child(2) {
  background-position: 50px 50px;
  animation-delay: -2s;
}

.stars:nth-child(3) {
  background-position: 100px 100px;
  animation-delay: -4s;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Planeta decorativo */
.floating-planet {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  animation: float-planet 20s ease-in-out infinite;
}

.planet-1 {
  width: 120px;
  height: 120px;
  background: var(--gradient-candy);
  top: 10%;
  right: 5%;
  opacity: 0.6;
}

.planet-2 {
  width: 80px;
  height: 80px;
  background: var(--gradient-ocean);
  bottom: 15%;
  left: 8%;
  opacity: 0.5;
  animation-delay: -5s;
}

@keyframes float-planet {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
}

/* ═══════════════════════════════════════════════════════════════
   GLASSMORPHISM CARDS
   ═══════════════════════════════════════════════════════════════ */

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-smooth);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-8px);
  box-shadow: var(--shadow-float);
}

.glass-card--pink:hover {
  border-color: var(--nebula-pink);
  box-shadow: var(--shadow-glow-pink);
}

.glass-card--purple:hover {
  border-color: var(--nebula-purple);
  box-shadow: var(--shadow-glow-purple);
}

.glass-card--blue:hover {
  border-color: var(--nebula-blue);
  box-shadow: var(--shadow-glow-blue);
}

/* ═══════════════════════════════════════════════════════════════
   BOTONES MÁGICOS
   ═══════════════════════════════════════════════════════════════ */

.btn-magic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.btn-magic::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.btn-magic:hover::before {
  left: 100%;
}

.btn-magic:hover {
  transform: scale(1.08);
}

.btn-magic:active {
  transform: scale(0.95);
}

.btn-magic--primary {
  background: var(--gradient-aurora);
}

.btn-magic--secondary {
  background: var(--gradient-ocean);
}

.btn-magic--success {
  background: linear-gradient(135deg, #00c853, #00e676);
}

/* ═══════════════════════════════════════════════════════════════
   TIPOGRAFÍA
   ═══════════════════════════════════════════════════════════════ */

.title-cosmic {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 800;
  background: var(--gradient-aurora);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(255, 107, 157, 0.5);
  animation: glow-text 3s ease-in-out infinite alternate;
}

@keyframes glow-text {
  from { filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.5)); }
  to { filter: drop-shadow(0 0 40px rgba(196, 76, 255, 0.8)); }
}

.subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   MÓDULOS / TARJETAS DE JUEGO
   ═══════════════════════════════════════════════════════════════ */

.module-card {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card-gradient);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: -1;
}

.module-card:hover::before {
  opacity: 0.15;
}

.module-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: var(--card-accent);
  box-shadow: 0 0 50px var(--card-glow);
}

.module-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  display: block;
  animation: bounce-soft 2s ease-in-out infinite;
}

@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.module-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
  color: white;
}

.module-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin-bottom: var(--space-lg);
}

/* ═══════════════════════════════════════════════════════════════
   SISTEMA DE ESTRELLAS / XP
   ═══════════════════════════════════════════════════════════════ */

.xp-bar {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.xp-fill {
  height: 20px;
  background: var(--gradient-sunrise);
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
  position: relative;
  overflow: hidden;
}

.xp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.star-counter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 215, 76, 0.2);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  border: 1px solid var(--nebula-gold);
}

.star-icon {
  font-size: 1.5rem;
  animation: star-pulse 1.5s ease-in-out infinite;
}

@keyframes star-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ═══════════════════════════════════════════════════════════════
   MASCOTA FLOTANTE
   ═══════════════════════════════════════════════════════════════ */

.mascot {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 100px;
  height: 100px;
  z-index: 1000;
  cursor: pointer;
  animation: mascot-float 3s ease-in-out infinite;
  transition: transform var(--transition-bounce);
}

.mascot:hover {
  transform: scale(1.1);
}

.mascot-bubble {
  position: absolute;
  bottom: 110%;
  right: 0;
  background: white;
  color: var(--cosmos-deep);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 200px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-smooth);
  pointer-events: none;
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 30px;
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: white transparent transparent;
}

.mascot:hover .mascot-bubble {
  opacity: 1;
  transform: translateY(0);
}

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

/* ═══════════════════════════════════════════════════════════════
   EFECTOS DE CELEBRACIÓN
   ═══════════════════════════════════════════════════════════════ */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Tablets y móviles grandes */
@media (max-width: 768px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
  }
  
  .module-card {
    padding: var(--space-lg);
  }
  
  .module-icon {
    font-size: 3rem;
  }
  
  .module-title {
    font-size: 1.4rem;
  }
  
  .mascot {
    width: 70px;
    height: 70px;
    bottom: 10px;
    right: 10px;
  }
  
  .btn-magic {
    padding: var(--space-sm) var(--space-lg);
    font-size: 1rem;
  }
  
  .glass-card {
    padding: var(--space-lg);
  }
}

/* Móviles medianos */
@media (max-width: 480px) {
  :root {
    --space-lg: 1rem;
    --space-xl: 1.25rem;
    --space-2xl: 1.5rem;
    --space-3xl: 2rem;
  }
  
  html {
    font-size: 14px;
  }
  
  .module-card {
    padding: var(--space-md);
  }
  
  .module-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
  }
  
  .module-title {
    font-size: 1.2rem;
  }
  
  .module-desc {
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
  }
  
  .mascot {
    width: 60px;
    height: 60px;
    bottom: 8px;
    right: 8px;
  }
  
  .mascot-bubble {
    max-width: 160px;
    font-size: 0.8rem;
    padding: var(--space-sm) var(--space-md);
  }
  
  .btn-magic {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.95rem;
    gap: var(--space-xs);
  }
  
  .title-cosmic {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }
  
  .subtitle {
    font-size: clamp(0.9rem, 3vw, 1.2rem);
  }
  
  .xp-bar {
    padding: 3px;
  }
  
  .xp-fill {
    height: 16px;
  }
  
  .star-counter {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.9rem;
  }
  
  .star-icon {
    font-size: 1.2rem;
  }
}

/* Móviles pequeños (iPhone SE, etc) */
@media (max-width: 375px) {
  :root {
    --space-md: 0.75rem;
    --space-lg: 0.875rem;
    --space-xl: 1rem;
  }
  
  html {
    font-size: 13px;
  }
  
  .module-icon {
    font-size: 2rem;
  }
  
  .module-title {
    font-size: 1.1rem;
  }
  
  .mascot {
    width: 50px;
    height: 50px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   UTILIDADES
   ═══════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-glow { text-shadow: 0 0 20px currentColor; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

