/* ================================
   KooBits Clone — Global Styles
   ================================ */

:root {
  --font-main: 'Nunito', sans-serif;

  /* Paleta vibrante infantil */
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-primary: #4f46e5;
  --color-primary-light: #818cf8;
  --color-accent: #f59e0b;
  --color-accent-light: #fcd34d;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-text: #1f2937;
  --color-text-light: #6b7280;

  /* Sombras suaves */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);

  /* Radii */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;

  /* Transiciones */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 32px;
}
.logo {
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}
.tagline {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-top: 6px;
}

/* Section Title */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

/* Grade Grid */
.grades {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Grade Card */
.grade-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}
.grade-card:hover, .grade-card:active {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--shadow-md);
}
.grade-card.grade-1:hover, .grade-card.grade-1:active {
  box-shadow: 0 0 0 2px rgba(99,102,241,0.4), 0 0 24px rgba(99,102,241,0.45), 0 0 48px rgba(124,58,237,0.25);
}
.grade-card.grade-2:hover, .grade-card.grade-2:active {
  box-shadow: 0 0 0 2px rgba(5,150,105,0.4), 0 0 24px rgba(5,150,105,0.45), 0 0 48px rgba(8,145,178,0.25);
}
.grade-card.grade-3:hover, .grade-card.grade-3:active {
  box-shadow: 0 0 0 2px rgba(219,39,119,0.4), 0 0 24px rgba(219,39,119,0.45), 0 0 48px rgba(124,58,237,0.25);
}
.grade-card.grade-1 {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
}
.grade-card.grade-1 .grade-label,
.grade-card.grade-1 .grade-desc,
.grade-card.grade-1 .grade-progress {
  color: rgba(255,255,255,0.95);
}

.grade-card.grade-2 {
  background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
  color: #fff;
}
.grade-card.grade-2 .grade-label,
.grade-card.grade-2 .grade-desc,
.grade-card.grade-2 .grade-progress {
  color: rgba(255,255,255,0.95);
}

.grade-card.grade-3 {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
  color: #fff;
}
.grade-card.grade-3 .grade-label,
.grade-card.grade-3 .grade-desc,
.grade-card.grade-3 .grade-progress {
  color: rgba(255,255,255,0.95);
}

.grade-card.grade-4 {
  background: linear-gradient(135deg, #f97316 0%, #e11d48 100%);
  color: #fff;
}
.grade-card.grade-4 .grade-label,
.grade-card.grade-4 .grade-desc,
.grade-card.grade-4 .grade-progress {
  color: rgba(255,255,255,0.95);
}
.grade-card.grade-4:hover, .grade-card.grade-4:active {
  box-shadow: 0 0 0 2px rgba(249,115,22,0.4), 0 0 24px rgba(249,115,22,0.45), 0 0 48px rgba(225,29,72,0.25);
}

.grade-card.grade-locked {
  opacity: 0.55;
  cursor: not-allowed;
  background: #e5e7eb;
}
.grade-card.grade-locked:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.2);
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.grade-locked .grade-badge {
  background: rgba(0,0,0,0.06);
  color: var(--color-text-light);
}

.grade-label {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.grade-desc {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 8px;
}
.grade-progress {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.8;
}

.lock {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.4rem;
  opacity: 0.5;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 48px;
  color: var(--color-text-light);
  font-size: 0.85rem;
}

/* Utility buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79,70,229,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 2px solid #e5e7eb;
}
.btn-secondary:hover { border-color: var(--color-primary); background: #f5f3ff; }

/* Responsive */
@media (max-width: 640px) {
  .app { padding: 16px 12px 60px; }
  .logo { font-size: 1.6rem; }
  .grades { grid-template-columns: 1fr; }
}
