/* ============================================================
   Swedish Learning App — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Swedish flag colors */
  --sv-blue:        #006AA7;
  --sv-blue-light:  #0080CC;
  --sv-blue-dark:   #004F7C;
  --sv-yellow:      #FECC02;
  --sv-yellow-dark: #D4AA00;

  /* Dark theme palette */
  --bg-primary:     #0A0E1A;
  --bg-secondary:   #0F1526;
  --bg-card:        #141B2E;
  --bg-elevated:    #1A2340;
  --bg-glass:       rgba(20, 27, 46, 0.7);

  /* Text */
  --text-primary:   #E8EEF8;
  --text-secondary: #8A9BC0;
  --text-muted:     #4A5A7A;
  --text-accent:    #FECC02;

  /* Status */
  --correct:        #22C55E;
  --correct-glow:   rgba(34, 197, 94, 0.25);
  --wrong:          #EF4444;
  --wrong-glow:     rgba(239, 68, 68, 0.25);
  --pending:        #4A5A7A;
  --cursor-color:   #FECC02;

  /* UI */
  --border:         rgba(255, 255, 255, 0.07);
  --border-hover:   rgba(254, 204, 2, 0.3);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;

  /* Shadows */
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:      0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow:    0 0 30px rgba(0, 106, 167, 0.3);

  /* Typography */
  --font-ui:        'Inter', 'Noto Sans SC', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Transitions */
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:       150ms;
  --dur-med:        280ms;
  --dur-slow:       500ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background gradient mesh ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(0, 106, 167, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 90%, rgba(254, 204, 2, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0, 80, 120, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--sv-blue-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sv-blue); }

/* ── Glass card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-med) var(--ease-smooth);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform var(--dur-med) var(--ease-smooth);
}

.btn:hover::before { transform: translateX(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--sv-blue), var(--sv-blue-light));
  color: white;
  box-shadow: 0 4px 20px rgba(0, 106, 167, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 106, 167, 0.5);
}

.btn-accent {
  background: linear-gradient(135deg, var(--sv-yellow-dark), var(--sv-yellow));
  color: #000;
  box-shadow: 0 4px 20px rgba(254, 204, 2, 0.25);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(254, 204, 2, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.nav-logo img {
  display: block;
  flex-shrink: 0;
}

.nav-logo span {
  color: var(--sv-yellow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-smooth);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.nav-link.active {
  color: var(--sv-yellow);
}

/* ── Page wrapper ───────────────────────────────────────────── */
.page {
  padding-top: 64px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Section titles ─────────────────────────────────────────── */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary), var(--sv-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 8px;
}

/* ── Character display (typing area) ────────────────────────── */
.char {
  display: inline;
  position: relative;
  transition: color var(--dur-fast), text-shadow var(--dur-fast);
  font-family: var(--font-mono);
}

.char.correct {
  color: var(--correct);
  text-shadow: 0 0 12px var(--correct-glow);
}

.char.wrong {
  color: var(--wrong);
  text-shadow: 0 0 12px var(--wrong-glow);
  animation: shake-char 0.3s var(--ease-bounce);
}

.char.pending {
  color: var(--pending);
}

.char.cursor-after {
  border-right: 2px solid var(--cursor-color);
  animation: blink-cursor 1s step-end infinite;
}

@keyframes shake-char {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@keyframes blink-cursor {
  0%, 100% { border-right-color: var(--cursor-color); }
  50% { border-right-color: transparent; }
}

@keyframes pop-correct {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Virtual Keyboard ─────────────────────────────────────────── */
.virtual-keys {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vkey {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--sv-yellow);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-smooth);
  user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.vkey:hover {
  background: var(--sv-blue-dark);
  border-color: var(--sv-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 106, 167, 0.3);
}

.vkey:active {
  transform: translateY(0) scale(0.95);
}

.vkey-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  white-space: nowrap;
}

/* ── Alt combo hints bar ─────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-card);
  border: 1px solid var(--text-muted);
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.hero-flag {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: float-y 3s ease-in-out infinite;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-support-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.modes-section {
  max-width: 1100px;
  margin: 80px auto;
  padding: 0 20px;
}

.modes-grid {
  display: grid;
  gap: 24px;
}

.mode-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: left;
  transition: all var(--dur-med) var(--ease-smooth);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.mode-card-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 4px 12px;
  background: var(--sv-blue);
  color: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}
.mode-card-badge.yellow {
  background: var(--sv-yellow);
  color: #000;
}
.mode-card-badge.green {
  background: var(--correct);
}

.mode-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow-lg), inset 0 2px 20px rgba(255,255,255,0.02);
}

.mode-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(0, 106, 167, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 24px;
  transition: transform var(--dur-med);
}

.mode-card:hover .mode-icon {
  transform: scale(1.1) rotate(-5deg);
}

.mode-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.mode-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.shortcut-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg-elevated);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sv-blue), var(--sv-yellow));
  border-radius: 100px;
  transition: width 0.6s var(--ease-smooth);
  box-shadow: 0 0 10px rgba(0, 106, 167, 0.4);
}

/* ── Stats badge ─────────────────────────────────────────────── */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-badge .stat-icon { font-size: 1rem; }
.stat-badge .stat-val { color: var(--text-primary); }
.stat-badge.streak { border-color: rgba(254, 204, 2, 0.3); }
.stat-badge.streak .stat-val { color: var(--sv-yellow); }

/* ── Achievement toast ─────────────────────────────────────── */
.achievement-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: var(--bg-card);
  border: 1px solid rgba(254, 204, 2, 0.4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(254, 204, 2, 0.15);
  transform: translateX(120%);
  transition: transform var(--dur-slow) var(--ease-bounce);
  max-width: 320px;
}

.achievement-toast.show { transform: translateX(0); }
.achievement-toast .ach-icon { font-size: 2.2rem; }
.achievement-toast .ach-name { font-weight: 700; color: var(--sv-yellow); font-size: 0.95rem; }
.achievement-toast .ach-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Bilingual prompt ─────────────────────────────────────────── */
.bilingual-prompt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prompt-zh {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Noto Sans SC', 'Inter', sans-serif;
  line-height: 1.5;
}

.prompt-en {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
}

.prompt-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(0, 106, 167, 0.2);
  border: 1px solid rgba(0, 106, 167, 0.4);
  border-radius: 100px;
  font-size: 0.78rem;
  color: var(--sv-blue-light);
  font-weight: 600;
}

.prompt-difficulty {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}
.prompt-difficulty.easy { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.prompt-difficulty.medium { background: rgba(254,204,2,0.12); color: var(--sv-yellow); border: 1px solid rgba(254,204,2,0.3); }
.prompt-difficulty.hard { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* ── Level badge ─────────────────────────────────────────────── */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--sv-blue-dark), var(--sv-blue));
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
}

/* ── Typing input field ─────────────────────────────────────── */
.typing-input-wrap {
  position: relative;
}

.typing-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: transparent;
  caret-color: var(--cursor-color);
  outline: none;
  transition: border-color var(--dur-med) var(--ease-smooth),
              box-shadow var(--dur-med) var(--ease-smooth);
  resize: none;
  z-index: 2;
  position: relative;
}

.typing-input:focus {
  border-color: rgba(0, 106, 167, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 106, 167, 0.15);
}

.typing-input.has-error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: shake-field 0.3s var(--ease-bounce);
}

@keyframes shake-field {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ── Score / complete modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--dur-slow) var(--ease-bounce);
  text-align: center;
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

/* ── Particle burst ──────────────────────────────────────────── */
@keyframes particle-burst {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.particle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-burst 0.8s var(--ease-smooth) forwards;
  z-index: 9999;
}

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast);
  z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Toggle switch ───────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: background var(--dur-med);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform var(--dur-med) var(--ease-bounce), background var(--dur-med);
}

.toggle input:checked + .toggle-slider { background: var(--sv-blue); border-color: var(--sv-blue); }
.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

/* ── Laptop Mockup ───────────────────────────────────────────── */
.laptop-mockup-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 60px auto 10px auto;
  max-width: 800px;
  cursor: pointer;
  transition: transform var(--dur-med);
}
.laptop-mockup-wrap:hover {
  transform: translateY(-5px);
}
.laptop-screen {
  background: #111;
  border: 16px solid #222;
  border-radius: 16px 16px 0 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.laptop-keyboard {
  background: #ccc;
  height: 20px;
  width: 110%;
  border-radius: 0 0 16px 16px;
  position: relative;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.5);
  display: flex;
  justify-content: center;
}
.laptop-trackpad {
  width: 100px;
  height: 6px;
  background: #aaa;
  border-radius: 0 0 6px 6px;
  margin-top: 4px;
}
/* App UI inside laptop */
.mockup-app {
  width: 100%;
  height: 100%;
  background: #1A1A1A; /* Mimicking the dark theme of the actual app */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font-family: var(--font-mono);
}
.mockup-prompt {
  font-size: 2rem;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-weight: 500;
}
.mockup-typing {
  display: flex;
  gap: 12px;
  font-size: 2.2rem;
}
.mockup-word {
  color: var(--text-primary);
  border-bottom: 3px solid #555;
  padding-bottom: 4px;
}
.mockup-word.error {
  border-color: #EF4444;
}
.mockup-word.done {
  border-color: transparent;
}

/* ── Vocabulary Engine ───────────────────────────────────────── */
.vocab-section {
  max-width: 1100px;
  margin: 100px auto;
  padding: 0 20px;
}
.vocab-header {
  text-align: center;
  margin-bottom: 60px;
}
.vocab-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
}
.vocab-title span {
  color: #ff6b4a; /* orange-red gradient vibe */
  background: linear-gradient(135deg, #ff6b4a, #ff9b7a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.vocab-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 600px;
  margin: 16px auto 0;
  line-height: 1.6;
}
.vocab-sub strong {
  color: var(--sv-yellow);
  border-bottom: 2px solid var(--sv-yellow);
}

.vocab-split {
  display: flex;
  gap: 60px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
}
.vocab-card-ui {
  flex: 1;
  background: #1e1e1e;
  border-radius: 16px;
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  overflow: hidden;
}
.vocab-card-ui::before {
  content: '';
  position: absolute;
  top: -50px; left: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%);
  z-index: 0;
}
.vocab-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}
.vocab-dots { display: flex; gap: 6px; }
.v-dot { width: 10px; height: 10px; border-radius: 50%; }
.v-dot.r { background: #ff5f56; }
.v-dot.y { background: #ffbd2e; }
.v-dot.g { background: #27c93f; }
.vocab-label { font-size: 0.7rem; font-weight: 700; color: #666; letter-spacing: 1px; }

.vocab-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.v-stat-box {
  background: #252525;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px;
}
.v-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.v-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  margin-bottom: 4px;
}
.v-desc {
  font-size: 0.75rem;
  color: #aaa;
}

.vocab-features {
  flex: 1;
}
.vocab-f-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
}
.vocab-f-title span { color: var(--sv-blue); }
.vocab-f-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 40px;
}
.v-feat-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.v-feat-icon {
  width: 40px; height: 40px;
  background: #2a2a2a;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.v-feat-text h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: white;
}
.v-feat-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── CTA Banner ──────────────────────────────────────────────── */
.cta-banner {
  background: var(--sv-yellow);
  padding: 80px 20px;
  text-align: center;
  color: #000;
}
.cta-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}
.cta-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}
.cta-sub {
  font-size: 1.1rem;
  font-weight: 500;
  max-width: 600px;
  margin: 0 auto 32px;
}
.btn-cta {
  background: #0f172a;
  color: white;
  padding: 16px 40px;
  font-size: 1.1rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s;
}
.btn-cta:hover { transform: translateY(-3px); }
.cta-footer-text {
  margin-top: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

/* ── Site Footer ─────────────────────────────────────────────── */
.site-footer {
  background: white;
  color: #333;
  padding: 60px 20px;
}
.footer-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.footer-col h4 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: #0f172a;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-links a {
  color: #475569;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.footer-links a:hover { color: var(--sv-blue); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .nav-links { gap: 4px; }
  .nav-link { padding: 6px 10px; font-size: 0.82rem; }
  .section-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .vkey { width: 38px; height: 38px; font-size: 1rem; }
  .modal-box { padding: 28px 20px; }
}

/* ── AI Loading Overlay ─────────────────────────────────────────────── */
.ai-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}
.ai-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--sv-blue-light);
  border-radius: 50%;
  animation: ai-spin 1s linear infinite;
  margin-bottom: 24px;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}
.ai-loading-text {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  animation: ai-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
