/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #ec4899;
  --green: #10b981;
  --yellow: #f59e0b;
  --orange: #f97316;
  --red: #ef4444;
  --bg: #fafafa;
  --bg-alt: #f3f4f6;
  --surface: #ffffff;
  --surface-alt: #f9fafb;
  --text: #111827;
  --text-secondary: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(99,102,241,0.08);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}
.section-tag-light {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.15);
}
h2 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}
.section-desc-light { color: rgba(255,255,255,0.6); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 0.9rem;
}
.brand-logo-sm { width: 28px; height: 28px; font-size: 0.8rem; border-radius: 8px; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: var(--transition);
}
.nav-icon-btn:hover { background: var(--bg-alt); color: var(--text); }

.nav-btn {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
  font-family: inherit;
}
.nav-btn-ghost { color: var(--text-secondary); }
.nav-btn-ghost:hover { background: var(--bg-alt); }
.nav-btn-solid {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(99,102,241,0.3);
}
.nav-btn-solid:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.nav-btn-dash { background: var(--green); box-shadow: 0 1px 2px rgba(16,185,129,0.3); }
.nav-btn-dash:hover { background: #059669; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 0.4rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
  text-decoration: none;
}
.btn-lg { padding: 0.85rem 2rem; font-size: 0.95rem; border-radius: 12px; }
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}
.btn-glass {
  background: rgba(255,255,255,0.15);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
}
.btn-glass:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }

.btn-sm {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: inherit;
}
.btn-sm:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 70%, #1e1b4b 100%);
  min-height: 92vh;
  display: flex;
  align-items: center;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}
.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -100px; left: -100px;
  animation: orbFloat 12s ease-in-out infinite;
}
.hero-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  bottom: -80px; right: -50px;
  animation: orbFloat 10s ease-in-out infinite reverse;
}
.hero-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat 14s ease-in-out infinite 3s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-pill {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 0.4rem 1.1rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: white;
  margin-bottom: 1.5rem;
}
.hero-gradient-text {
  background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6, #fb923c);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }

.hero-proof {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}
.hero-proof strong { color: rgba(255,255,255,0.9); }
.hero-proof-avatars { display: flex; }
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: white;
  border: 2px solid #1e1b4b;
  margin-right: -8px;
}

/* Hero visual */
.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}
.hero-card-stack {
  position: relative;
  width: 320px;
  height: 340px;
}
.hero-lang-card {
  position: absolute;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: cardFloat 4s ease-in-out infinite;
  transition: transform 0.3s;
}
.hero-lang-card:hover { transform: scale(1.05) !important; }
.hlc-flag {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 900; color: white;
  flex-shrink: 0;
}
.hlc-word { color: white; font-weight: 800; font-size: 1.1rem; }
.hlc-meaning { color: rgba(255,255,255,0.5); font-size: 0.8rem; font-weight: 600; margin-left: auto; }

.hlc-1 { top: 0; left: 0; animation-delay: 0s; }
.hlc-1 .hlc-flag { background: #3b82f6; }
.hlc-2 { top: 80px; left: 40px; animation-delay: 0.8s; }
.hlc-2 .hlc-flag { background: #ec4899; }
.hlc-3 { top: 160px; left: 10px; animation-delay: 1.6s; }
.hlc-3 .hlc-flag { background: #8b5cf6; }
.hlc-4 { top: 240px; left: 50px; animation-delay: 2.4s; }
.hlc-4 .hlc-flag { background: #14b8a6; }

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

.hero-stats-row {
  display: flex;
  gap: 0.75rem;
}
.hero-stat-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}
.hero-stat-chip strong { color: white; }

/* ===== BENTO GRID (features) ===== */
.features-section { background: var(--bg); }
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
}
.bento-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.bento-lg { grid-column: span 2; }
.bento-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(99,102,241,0.08);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.bento-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.bento-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===== LANGUAGES ===== */
.languages-section { background: var(--bg-alt); padding-top: 6rem; padding-bottom: 6rem; }
.languages-section .section { padding-top: 0; padding-bottom: 0; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.lang-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.lang-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.lang-card:hover::before { transform: scaleX(1); }
.lang-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.lang-flag-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent);
  opacity: 0.9;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.lang-flag-wrap span {
  font-size: 0.8rem; font-weight: 900; color: white; letter-spacing: 0.04em;
}
.lang-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.lang-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.lang-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0,0,0,0.04);
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  display: inline-block;
}

/* ===== DASHBOARD ===== */
.dashboard-section {
  background: var(--bg);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.dash-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: var(--shadow-md);
}
.xp-card { grid-column: span 2; }
.dash-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(99,102,241,0.08);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem;
}
.dash-icon-streak { background: rgba(249,115,22,0.08); color: var(--orange); }
.dash-icon-badge { background: rgba(245,158,11,0.08); color: var(--yellow); }
.dash-icon-quiz { background: rgba(236,72,153,0.08); color: var(--accent); }
.dash-icon-notes { background: rgba(16,185,129,0.08); color: var(--green); }

.dash-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.dash-card-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
  letter-spacing: -0.03em;
}
.dash-card-sub { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.dash-level-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary);
  color: white;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

.xp-bar-wrap { width: 100%; margin-top: 0.5rem; }
.xp-bar-track {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  transition: width 0.6s ease;
  width: 0%;
}
.xp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

/* ===== GRADES ===== */
.grades-section { background: var(--bg-alt); }
.grades-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.grade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
}
.grade-card:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(99,102,241,0.25);
}
.grade-num {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.04em;
  transition: color 0.3s;
}
.grade-card:hover .grade-num { color: white; }
.grade-label {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.35rem 0;
  transition: color 0.3s;
}
.grade-topics {
  font-size: 0.75rem;
  color: var(--muted);
  transition: color 0.3s;
}
.grade-card:hover .grade-topics { color: rgba(255,255,255,0.7); }

/* ===== RESOURCES ===== */
.resources-section { background: var(--bg); }
.resources-tabs {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 2rem;
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 0.3rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.tab {
  padding: 0.55rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: var(--transition);
  font-family: inherit;
}
.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab:not(.active):hover { color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.resource-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.rc-color {
  width: 100%;
  height: 3px;
  border-radius: 3px;
  margin-bottom: 1rem;
  opacity: 0.6;
}
.resource-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.resource-card p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Vocabulary */
.vocab-topics {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
}
.vocab-topic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.vocab-topic:hover { border-color: rgba(99,102,241,0.25); }
.vt-header {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.vt-header span { color: var(--muted); font-size: 1.1rem; font-weight: 500; }
.vt-body { display: none; padding: 0 1.25rem 1.25rem; }
.vt-body.open { display: block; animation: fadeIn 0.25s ease; }

.vocab-header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 0.4rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.vocab-table { padding-top: 0.25rem; }
.vrow {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 0.6rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  border-radius: 6px;
  transition: background 0.15s;
}
.vrow:last-child { border-bottom: none; }
.vrow:hover { background: var(--bg-alt); }
.vrow span:first-child { font-weight: 700; }
.vrow span:not(:first-child) { color: var(--muted); }

.speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  color: var(--primary);
  transition: var(--transition);
  vertical-align: middle;
  margin-left: 0.15rem;
}
.speak-btn:hover { background: rgba(99,102,241,0.08); }

/* ===== FLASHCARDS ===== */
.flashcards-section { background: var(--bg-alt); }
.flashcard-filters {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.fc-filter {
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: var(--transition);
  font-family: inherit;
}
.fc-filter.active {
  background: var(--primary);
  color: white;
}
.fc-filter:not(.active):hover { color: var(--text); background: var(--bg-alt); }

.flashcard-arena {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.flashcard-wrap { width: 100%; perspective: 1000px; }
.flashcard {
  width: 100%;
  height: 240px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: var(--radius-lg);
}
.flashcard.flipped { transform: rotateY(180deg); }

.fc-front, .fc-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.fc-front {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.fc-back {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  transform: rotateY(180deg);
  box-shadow: var(--shadow-lg);
}
.fc-lang-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(99,102,241,0.08);
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}
.fc-word {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}
.fc-hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.75rem; }
.fc-meaning {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}
.fc-pronunciation { font-size: 0.95rem; opacity: 0.8; font-weight: 600; }

.fc-counter { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.fc-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.fc-nav-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  transition: var(--transition);
}
.fc-nav-btn:hover { border-color: var(--primary); color: var(--primary); }

.fc-action-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: var(--transition);
}
.fc-action-btn.known { background: var(--green); color: white; }
.fc-action-btn.learning { background: var(--red); color: white; }
.fc-action-btn:hover { transform: translateY(-1px); opacity: 0.9; }

.fc-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.fc-stat-known { color: var(--green); }
.fc-stat-learning { color: var(--red); }

/* ===== QUIZ ===== */
.quiz-section {
  padding: 6rem 2rem;
  background: linear-gradient(135deg, #0f172a, #1e1b4b, #312e81);
  position: relative;
}
.quiz-section h2 { color: white; }

.quiz-progress-wrap { max-width: 560px; margin: 0 auto 1.5rem; }
.quiz-progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 50px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #34d399);
  border-radius: 50px;
  transition: width 0.4s ease;
  width: 10%;
}

.quiz-box {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}
.quiz-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.quiz-q {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.quiz-opts { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-opt {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
  text-align: left;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.quiz-opt::before {
  content: attr(data-letter);
  min-width: 26px;
  height: 26px;
  background: var(--bg-alt);
  color: var(--muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  transition: var(--transition);
}
.quiz-opt:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.04);
}
.quiz-opt:hover::before { background: var(--primary); color: white; }
.quiz-opt.correct { background: #ecfdf5; border-color: var(--green); }
.quiz-opt.correct::before { background: var(--green); color: white; }
.quiz-opt.wrong { background: #fef2f2; border-color: var(--red); }
.quiz-opt.wrong::before { background: var(--red); color: white; }

.quiz-feedback {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 1rem 0 0.5rem;
  min-height: 1.5rem;
}
.quiz-score {
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}
.quiz-score span { font-size: 1.4rem; color: var(--yellow); }

/* ===== CTA ===== */
.cta-section {
  padding: 6rem 2rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  text-align: center;
}
.cta-inner { max-width: 600px; margin: 0 auto; }
.cta-inner h2 {
  color: white;
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}
.cta-inner p {
  color: rgba(255,255,255,0.7);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

/* ===== FOOTER ===== */
.footer {
  background: #0f172a;
  color: white;
  padding: 4rem 2rem 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.footer-brand p {
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  line-height: 1.6;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  transition: var(--transition);
}
.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 0;
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 500px;
  width: 92%;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-alt);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: #fef2f2; color: var(--red); }

.modal-grade-banner {
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.modal-grade { font-size: 3rem; font-weight: 900; line-height: 1; }
.modal-grade-banner h3 { font-size: 1rem; opacity: 0.85; margin-top: 0.25rem; font-weight: 600; }
.modal-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.chip {
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
}
.modal-links-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.modal-links { display: flex; flex-direction: column; gap: 0.5rem; }
.modal-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.modal-link:hover { border-color: rgba(99,102,241,0.2); background: rgba(99,102,241,0.04); }
.modal-link .ml-arrow { margin-left: auto; color: var(--primary); }

/* Content Modal */
.content-modal-overlay { z-index: 300; }
.content-modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: min(800px, 95vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
  overflow: hidden;
}
.cm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cm-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.cm-title { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.cm-print-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-secondary);
  transition: var(--transition);
}
.cm-print-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.cm-body {
  overflow-y: auto;
  padding: 1.25rem 1.75rem 1.75rem;
  flex: 1;
  line-height: 1.7;
}

/* Notes styling inside modal */
.notes-section { margin-bottom: 1.5rem; }
.notes-section h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.notes-rule {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  border-left: 3px solid var(--primary);
}
.notes-rule b { color: var(--primary); }
.notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  overflow: hidden;
}
.notes-table th {
  background: var(--primary);
  color: white;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  text-align: left;
}
.notes-table td { padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--border); }
.notes-table tr:nth-child(even) td { background: var(--bg-alt); }
.notes-table tr:last-child td { border-bottom: none; }
.notes-tip {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
  margin-top: 0.6rem;
}

/* Video cards inside modal */
.video-list { display: flex; flex-direction: column; gap: 0.75rem; }
.video-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}
.video-card:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.vc-thumb {
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.vc-info { flex: 1; }
.vc-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 0.15rem; }
.vc-meta { font-size: 0.75rem; color: var(--muted); }
.vc-platform {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: rgba(99,102,241,0.08);
  color: var(--primary);
  white-space: nowrap;
}
.video-note {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 0.75rem;
}

/* Worksheet styling */
.ws-header {
  text-align: center;
  padding: 0.75rem 0 1.25rem;
  border-bottom: 2px solid var(--text);
  margin-bottom: 1.25rem;
}
.ws-header h3 { font-size: 1rem; font-weight: 800; }
.ws-header p { font-size: 0.78rem; color: var(--muted); }
.ws-section { margin-bottom: 1.5rem; }
.ws-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--text);
  color: white;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.85rem;
}
.ws-q { font-size: 0.88rem; margin-bottom: 0.75rem; }
.ws-q .q-num { font-weight: 800; color: var(--primary); }
.ws-blank { display: inline-block; border-bottom: 1.5px solid var(--text); min-width: 80px; }
.ws-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; padding-left: 1.2rem; }
.ws-opt { font-size: 0.85rem; }
.ws-answer-box { border: 1px solid var(--border); border-radius: 6px; height: 60px; width: 100%; margin-top: 0.3rem; padding: 0.5rem; font-family: inherit; }

/* Hiragana grid */
.hiragana-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.hira-cell {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 0.5rem 0.35rem;
  text-align: center;
  border: 1px solid var(--border);
}
.hira-char { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.hira-rom { font-size: 0.68rem; color: var(--muted); font-weight: 600; margin-top: 0.1rem; }

/* Badges Modal */
.badges-modal { max-width: 520px; }
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}
.badge-item {
  text-align: center;
  padding: 0.85rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.badge-item.unlocked {
  border-color: rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.04);
}
.badge-item.locked { opacity: 0.3; filter: grayscale(1); }
.badge-emoji { font-size: 1.8rem; margin-bottom: 0.3rem; display: block; }
.badge-name { font-size: 0.68rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.badge-item.unlocked .badge-name { color: var(--primary); }

@media print {
  .navbar, .cm-header { display: none !important; }
  .content-modal { box-shadow: none; max-height: none; border-radius: 0; width: 100%; }
  .cm-body { overflow: visible; }
}

/* ===== DAILY TIP ===== */
.daily-tip-banner {
  background: rgba(99,102,241,0.06);
  border-bottom: 1px solid rgba(99,102,241,0.1);
}
.daily-tip-banner.hidden { display: none; }
.tip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 2rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.tip-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}
.tip-text { flex: 1; color: var(--text-secondary); }
.tip-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.tip-close:hover { background: rgba(99,102,241,0.1); color: var(--primary); }

/* ===== SEARCH ===== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-overlay.open { display: flex; }
.search-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: min(620px, 94vw);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem;
  animation: modalIn 0.2s ease;
  max-height: 72vh;
  overflow-y: auto;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}
#searchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  color: var(--text);
}
.search-close-btn {
  background: transparent;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.search-close-btn:hover { background: #fef2f2; color: var(--red); }
.search-results { display: flex; flex-direction: column; gap: 0.4rem; }
.search-result-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface);
}
.search-result-card:hover { border-color: var(--primary); background: rgba(99,102,241,0.04); }
.src-icon { font-size: 1.3rem; flex-shrink: 0; }
.src-title { font-weight: 700; font-size: 0.88rem; }
.src-sub { font-size: 0.72rem; color: var(--muted); }
.search-empty { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.88rem; }

/* ===== FLOATING WIDGET ===== */
.floating-widget {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 110px;
}
.fw-row { display: flex; gap: 0.6rem; }
.fw-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: var(--transition);
}
.fw-item:hover { background: var(--bg-alt); }
.fw-streak { color: var(--orange); }
.fw-xp { color: var(--primary); }

.pomodoro-widget {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  text-align: center;
}
.pomo-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.pomo-time {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.pomo-time.break-mode { color: var(--green); }
.pomo-btns { display: flex; gap: 0.35rem; justify-content: center; }
.pomo-btn {
  background: var(--bg-alt);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pomo-btn:hover { background: rgba(99,102,241,0.1); color: var(--primary); }

/* ===== SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== DARK MODE ===== */
body.dark {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --surface-alt: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.5);
}
body.dark .navbar {
  background: rgba(15,23,42,0.9);
  border-bottom-color: var(--border);
}
body.dark .hero { background: linear-gradient(135deg, #020617, #0f172a, #1e1b4b); }
body.dark .daily-tip-banner { background: rgba(99,102,241,0.06); border-bottom-color: var(--border); }
body.dark .search-container { background: var(--surface); }
body.dark #searchInput { color: var(--text); }
body.dark .quiz-box { background: var(--surface); }
body.dark .quiz-q { color: var(--text); }
body.dark .quiz-opt { background: var(--bg); border-color: var(--border); color: var(--text); }
body.dark .quiz-opt::before { background: var(--bg-alt); }
body.dark .quiz-opt:hover { background: rgba(99,102,241,0.08); }
body.dark .modal, body.dark .content-modal, body.dark .badges-modal { background: var(--surface); }
body.dark .modal-close { background: var(--bg-alt); }
body.dark .fc-front { background: var(--surface); border-color: var(--border); }
body.dark .fc-word { color: var(--text); }
body.dark .fc-lang-tag { background: rgba(99,102,241,0.15); }
body.dark .ws-answer-box { background: var(--bg); color: var(--text); border-color: var(--border); }
body.dark .floating-widget { background: var(--surface); border-color: var(--border); }
body.dark .cta-section { background: linear-gradient(135deg, #312e81, #6366f1); }
body.dark .resources-tabs { background: var(--bg); }
body.dark .flashcard-filters { background: var(--bg); border-color: var(--border); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-lg { grid-column: span 1; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
  .xp-card { grid-column: span 1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 4rem 1.25rem; }
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 4rem 1.25rem;
    text-align: center;
    gap: 3rem;
  }
  .hero-content h1 { font-size: 2.4rem; }
  .hero-desc { margin: 0 auto 2rem; }
  .hero-cta { justify-content: center; }
  .hero-proof { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-card-stack { width: 260px; height: 280px; }
  .hero-stats-row { justify-content: center; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-inner { padding: 0 1.25rem; }
  .bento-grid { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); padding: 0 1.25rem; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .grades-row { flex-direction: column; align-items: stretch; }
  .grade-card { min-width: 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  h2 { font-size: 1.75rem; }
  .quiz-section { padding: 4rem 1.25rem; }
  .quiz-box { padding: 1.5rem; }
  .vrow, .vocab-header { grid-template-columns: 1fr 1fr; }
  .vrow span:nth-child(4), .vocab-header span:nth-child(4) { display: none; }
  .floating-widget { bottom: 1rem; right: 0.75rem; }
  .tip-inner { padding: 0.5rem 1.25rem; font-size: 0.78rem; }
  .cta-inner h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .hero-content h1 { font-size: 1.9rem; }
  .lang-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
