/* ═══════════════════════════════════════════════════════
   MyWordBook — style.css  (v2 — Animations & Fun Edition)
   ═══════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg: #f0f2f8;
  --bg-2: #e8eaf2;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e2e5f0;
  --text: #1a1d2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --primary: #4f46e5;
  --primary-light: #ede9fe;
  --primary-dark: #3730a3;
  --green: #059669;
  --green-light: #d1fae5;
  --orange: #d97706;
  --orange-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --yellow: #ca8a04;
  --yellow-light: #fef9c3;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --header-h: 60px;
  --transition: 0.2s ease;
  --font-main: 'Inter';
  --font-heading: 'Space Grotesk';
  --font-accent: 'Playfair Display';
}

.theme-dark {
  --bg: #0d0f1a;
  --bg-2: #141627;
  --surface: #1a1d2e;
  --surface-2: #20243a;
  --border: #2d3148;
  --text: #e8eaf5;
  --text-muted: #9ca3af;
  --text-light: #6b7280;
  --primary-light: #2d2660;
  --green-light: #064e3b;
  --orange-light: #451a03;
  --red-light: #450a0a;
  --purple-light: #3b0764;
  --blue-light: #1e3a8a;
  --yellow-light: #422006;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow: 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-main), -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Utilities ── */
.hidden { display: none !important; }

/* ════════════════════════════════════════
   KEYFRAME ANIMATIONS
════════════════════════════════════════ */
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  10%       { transform: translateX(-10px) rotate(-2deg); }
  20%       { transform: translateX(10px) rotate(2deg); }
  30%       { transform: translateX(-10px) rotate(-1deg); }
  40%       { transform: translateX(10px) rotate(1deg); }
  50%       { transform: translateX(-8px); }
  60%       { transform: translateX(8px); }
  70%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
  90%       { transform: translateX(-2px); }
}

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  60%  { transform: scale(0.95); }
  80%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes letterPop {
  0%, 100% { transform: scale(1) translateY(0); }
  30%       { transform: scale(1.25) translateY(-4px); }
  70%       { transform: scale(1.05) translateY(-1px); }
}

@keyframes letterShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%       { transform: translateX(-6px) rotate(-4deg); }
  40%       { transform: translateX(6px) rotate(4deg); }
  60%       { transform: translateX(-4px) rotate(-2deg); }
  80%       { transform: translateX(4px) rotate(2deg); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4); }
  50%       { box-shadow: 0 0 0 10px rgba(79,70,229,0); }
}

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

@keyframes glow-green {
  0%, 100% { box-shadow: 0 0 5px rgba(5,150,105,.4); }
  50%       { box-shadow: 0 0 20px rgba(5,150,105,.8), 0 0 40px rgba(5,150,105,.3); }
}

@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 5px rgba(220,38,38,.4); }
  50%       { box-shadow: 0 0 20px rgba(220,38,38,.8), 0 0 40px rgba(220,38,38,.3); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes starBurst {
  0%   { transform: scale(0) rotate(0); opacity: 1; }
  100% { transform: scale(1.5) rotate(180deg); opacity: 0; }
}

@keyframes countUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

@keyframes bounce-in {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25%       { transform: rotate(-10deg); }
  75%       { transform: rotate(10deg); }
}

@keyframes pin-particle {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-80px) scale(0); opacity: 0; }
}
@keyframes fireBurn {
  0%, 100% { transform: scale(1) translateY(0) rotate(-3deg); filter: drop-shadow(0 0 3px #f97316); }
  25% { transform: scale(1.13, .92) translateY(-2px) rotate(4deg); filter: drop-shadow(0 0 10px #fbbf24); }
  50% { transform: scale(.92, 1.12) translateY(-5px) rotate(-4deg); filter: drop-shadow(0 0 15px #ef4444); }
  75% { transform: scale(1.08, .96) translateY(-2px) rotate(3deg); filter: drop-shadow(0 0 8px #f97316); }
}

/* Helper classes */
.shake        { animation: shake .55s cubic-bezier(.36,.07,.19,.97) both; }
.pop          { animation: pop .4s cubic-bezier(.34,1.56,.64,1); }
.float        { animation: float 3s ease-in-out infinite; }
.pulse-anim   { animation: pulse 2s infinite; }
.wiggle       { animation: wiggle 0.4s ease-in-out; }
.bounce-in    { animation: bounce-in 0.5s cubic-bezier(.34,1.56,.64,1); }
.count-up     { animation: countUp 0.4s ease; }

/* ════════════════════════════════════════
   PIN SCREEN
════════════════════════════════════════ */
.pin-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed, #2563eb);
  background-size: 300% 300%;
  animation: gradientShift 6s ease infinite;
  min-height: 100vh;
  overflow: hidden;
}

.pin-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}

.pin-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  width: 100%; max-width: 360px;
  box-shadow: 0 25px 60px rgba(0,0,0,.35);
  position: relative; z-index: 1;
}
.pin-logo {
  width: 96px; height: 96px; margin: 0 auto 12px; color: var(--primary);
  animation: float 3s ease-in-out infinite;
  display: block; filter: drop-shadow(0 10px 12px rgba(79,70,229,.25));
}
.pin-logo img { width: 100%; height: 100%; display: block; }
.pin-title { font-size: 26px; font-weight: 800; margin-bottom: 4px; font-family: 'Space Grotesk', sans-serif; }
.pin-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; }
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--border); background: transparent;
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
}
.pin-dot.filled { background: var(--primary); border-color: var(--primary); transform: scale(1.2); box-shadow: 0 0 12px rgba(79,70,229,.5); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-key {
  height: 58px; border-radius: 12px;
  font-size: 20px; font-weight: 700;
  background: var(--surface-2); color: var(--text);
  border: 2px solid var(--border); transition: all 0.15s ease;
  position: relative; overflow: hidden;
}
.pin-key::after {
  content: ''; position: absolute; inset: 0; border-radius: 12px;
  background: radial-gradient(circle at center, rgba(79,70,229,.3), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.pin-key:hover { background: var(--primary-light); border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79,70,229,.2); }
.pin-key:hover::after { opacity: 1; }
.pin-key:active { transform: scale(0.93); }
.pin-enter { background: var(--primary); color: #fff; border-color: var(--primary); }
.pin-enter:hover { background: var(--primary-dark); }
.pin-clear { color: var(--text-muted); font-size: 18px; }
.pin-error { color: var(--red); font-size: 14px; margin-top: 16px; min-height: 20px; font-weight: 600; }

/* ════════════════════════════════════════
   LAYOUT
════════════════════════════════════════ */
.app { display: flex; min-height: 100vh; }

/* ── Mobile Header ── */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between;
  padding: 0 16px; box-shadow: var(--shadow-sm);
}
.mobile-menu-btn {
  display: flex; flex-direction: column; gap: 5px;
  width: 32px; height: 32px; justify-content: center; align-items: center; padding: 4px;
}
.mobile-menu-btn span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.mobile-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 16px; font-family: 'Space Grotesk', sans-serif; }
.mobile-title img { width: 25px; height: 25px; }
.brand-refresh { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.brand-refresh:hover { color: var(--primary); transform: scale(1.04); }
.mobile-icon-btn { font-size: 18px; padding: 4px 8px; color: var(--text-muted); transition: color var(--transition); }
.mobile-icon-btn:hover { color: var(--primary); }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
  transition: transform var(--transition); overflow-y: auto;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
}
.sidebar-logo { width: 34px; height: 34px; flex-shrink: 0; color: var(--primary); }
.sidebar-logo.brand-refresh { line-height: 1; }
.sidebar-logo img { width: 100%; height: 100%; display: block; }
.sidebar-title-group { flex: 1; }
.sidebar-title { font-size: 16px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; }
.sidebar-subtitle { font-size: 11px; color: var(--text-muted); }
.sidebar-close { display: none; font-size: 18px; color: var(--text-muted); padding: 4px; }
.sidebar-overlay { display: none; }

.nav-list { list-style: none; padding: 12px 8px; flex: 1; }
.nav-list li { margin-bottom: 2px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-light); padding: 8px 10px 4px;
}
.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: all 0.15s ease; position: relative; overflow: hidden;
}
.nav-link::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
  transform: scaleY(0); transition: transform 0.2s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.nav-link.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.nav-link.active::before { transform: scaleY(1); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.sidebar-stats { font-size: 12px; color: var(--text-muted); line-height: 2; margin-bottom: 10px; }
.sidebar-stats i { width: 16px; margin-right: 4px; }

.sound-toggle-btn {
  width: 100%; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition); text-align: center;
}
.sound-toggle-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.sound-toggle-btn i { margin-right: 6px; }

/* ── Content ── */
.content { flex: 1; margin-left: var(--sidebar-w); padding: 32px; min-height: 100vh; }
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }

/* ════════════════════════════════════════
   PAGE HEADER
════════════════════════════════════════ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-size: 28px; font-weight: 800; line-height: 1.2;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-title i { -webkit-text-fill-color: initial; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted); margin: 24px 0 12px;
}

/* ── Greeting ── */
.dash-greeting {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; padding: 8px 18px; border-radius: 100px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.dash-avatar-button {
  width: 58px; height: 58px; padding: 0; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--primary-light);
  box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.dash-avatar-button:hover { transform: translateY(-4px) rotate(5deg) scale(1.08); border-color: var(--primary); }

/* Custom cartoon learner avatar */
.avatar {
  width: 48px; height: 48px; position: relative; margin: 0 auto;
  border-radius: 50% 50% 45% 45%; background: #ffd0a8;
  overflow: visible; animation: avatar-bob 3s ease-in-out infinite;
}
@keyframes avatar-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
.avatar-api {
  display: block; width: 48px; height: 48px; object-fit: cover;
  border-radius: 50%; background: var(--primary-light);
  border: 2px solid rgba(255,255,255,.7); overflow: hidden;
}
.avatar-api::after { display: none; }
.avatar-large { width: 128px; height: 128px; margin: 12px auto; transform: scale(1.15); }
.avatar-large.avatar-api { border-width: 4px; box-shadow: 0 10px 24px rgba(79,70,229,.25); }
.avatar-skin-sunny { background: #ffd0a8; }
.avatar-skin-warm { background: #e7a878; }
.avatar-skin-cool { background: #b97855; }
.avatar-skin-deep { background: #75432f; }
.avatar::after {
  content: ''; position: absolute; left: 8%; right: 8%; bottom: -18%; height: 48%;
  border-radius: 48% 48% 20% 20%; background: #4f46e5; z-index: -1;
}
.avatar-outfit-indigo::after { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.avatar-outfit-mint::after { background: linear-gradient(135deg,#059669,#34d399); }
.avatar-outfit-sunset::after { background: linear-gradient(135deg,#f97316,#fbbf24); }
.avatar-outfit-berry::after { background: linear-gradient(135deg,#db2777,#9333ea); }
.avatar-hair-shape { position: absolute; left: -4%; right: -4%; top: -10%; height: 38%; background: #3b241b; z-index: 2; }
.avatar-hair-cloud .avatar-hair-shape { border-radius: 55% 55% 35% 35%; }
.avatar-hair-spiky .avatar-hair-shape { clip-path: polygon(0 100%,8% 30%,20% 65%,33% 5%,47% 60%,63% 0,75% 55%,90% 20%,100% 100%); }
.avatar-hair-curly .avatar-hair-shape { border-radius: 50%; box-shadow: -7px 3px 0 #3b241b, 7px 3px 0 #3b241b; }
.avatar-hair-cap .avatar-hair-shape { background: #111827; border-radius: 60% 60% 15% 15%; height: 28%; }
.avatar-hair-cap .avatar-hair-shape::after { content:''; position:absolute; width:60%; height:16%; right:-30%; bottom:0; border-radius:99px; background:#111827; }
.avatar-ear { position: absolute; top: 42%; width: 12%; height: 18%; border-radius: 50%; background: inherit; z-index: -1; }
.avatar-ear.left { left: -7%; }.avatar-ear.right { right: -7%; }
.avatar-eye { position: absolute; top: 47%; width: 9%; height: 9%; border-radius: 50%; background: #1f2937; z-index: 3; }
.avatar-eye.left { left: 29%; }.avatar-eye.right { right: 29%; }
.avatar-mood-focused .avatar-eye { height: 3%; border-radius: 0; transform: rotate(-8deg); }
.avatar-mood-cool .avatar-eye { width: 20%; height: 9%; border-radius: 3px; background: #111827; }
.avatar-mood-cool .avatar-eye.left { left: 18%; transform: rotate(8deg); }.avatar-mood-cool .avatar-eye.right { right: 18%; transform: rotate(-8deg); }
.avatar-mood-sleepy .avatar-eye { height: 3%; border-radius: 0; }
.avatar-mouth { position: absolute; left: 41%; top: 64%; width: 18%; height: 9%; border-bottom: 2px solid #7f1d1d; border-radius: 0 0 50% 50%; z-index: 3; }
.avatar-mood-focused .avatar-mouth { width: 14%; border-bottom: 0; border-top: 2px solid #7f1d1d; }
.avatar-mood-cool .avatar-mouth { width: 13%; border-bottom: 2px solid #111827; }
.avatar-mood-sleepy .avatar-mouth { width: 12%; height: 12%; border: 2px solid #7f1d1d; border-radius: 50%; }
.avatar-accessory { position: absolute; z-index: 5; font-weight: 900; pointer-events: none; }
.accessory-sparkles { right: -20%; top: -24%; color: #fbbf24; font-size: 22px; animation: wiggle 1.8s ease-in-out infinite; }
.accessory-crown { left: 24%; top: -38%; color: #fbbf24; font-size: 24px; transform: rotate(-8deg); }
.accessory-glasses { left: 11%; right: 11%; top: 42%; height: 17%; border: 2px solid #111827; border-radius: 7px; }
.accessory-glasses::after { content:''; position:absolute; left:43%; top:40%; width:14%; border-top:2px solid #111827; }
.avatar-large .avatar-eye { transform: scale(1.3); }
.avatar-large .avatar-accessory { transform: scale(1.45); transform-origin: center; }

/* ════════════════════════════════════════
   CARDS & STATS
════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 15px; font-weight: 700; }
.card-title i { margin-right: 6px; color: var(--primary); }
.card-subtitle { font-size: 13px; color: var(--text-muted); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 18px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all 0.2s cubic-bezier(.34,1.56,.64,1); text-align: center;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  transition: opacity var(--transition);
}
.stat-card.blue::before  { background: linear-gradient(135deg, rgba(37,99,235,.05), transparent); }
.stat-card.green::before { background: linear-gradient(135deg, rgba(5,150,105,.05), transparent); }
.stat-card.orange::before { background: linear-gradient(135deg, rgba(217,119,6,.05), transparent); }
.stat-card.purple::before { background: linear-gradient(135deg, rgba(124,58,237,.05), transparent); }
.stat-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: 1; }
.stat-card.blue   { border-top: 4px solid var(--blue); }
.stat-card.green  { border-top: 4px solid var(--green); }
.stat-card.orange { border-top: 4px solid var(--orange); }
.stat-card.purple { border-top: 4px solid var(--purple); }
.stat-icon { font-size: 24px; margin-bottom: 2px; }
.stat-card.blue   .stat-icon { color: var(--blue); }
.stat-card.green  .stat-icon { color: var(--green); }
.stat-card.orange .stat-icon { color: var(--orange); }
.stat-card.purple .stat-icon { color: var(--purple); }
.stat-card.streak-hot .stat-icon { color: #f97316; animation: fireBurn 1s ease-in-out infinite; transform-origin: 50% 85%; }
.stat-card.streak-hot::after {
  content: ''; position: absolute; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(249,115,22,.12); animation: pulse 1.5s infinite; pointer-events: none;
}
.stat-number {
  font-size: 30px; font-weight: 800; line-height: 1;
  font-family: 'Space Grotesk', sans-serif;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Progress Bar */
.progress-bar-track { height: 14px; background: var(--bg-2); border-radius: 100px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--purple), #06b6d4);
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
  transition: width 0.8s cubic-bezier(.34,1.56,.64,1);
  width: 0%;
}

/* Alert Cards */
.alert-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid transparent; margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}
.alert-card.orange { background: var(--orange-light); border-color: rgba(217,119,6,.3); }
.alert-card.green  { background: var(--green-light); border-color: rgba(5,150,105,.3); }
.alert-icon { font-size: 22px; flex-shrink: 0; }
.alert-card.orange .alert-icon { color: var(--orange); }
.alert-card.green  .alert-icon { color: var(--green); }
.alert-body { flex: 1; }
.alert-body strong { font-size: 14px; font-weight: 700; display: block; }
.alert-body p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Action Grid */
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.action-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.action-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary-light), transparent);
  opacity: 0; transition: opacity var(--transition);
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px) scale(1.03); box-shadow: var(--shadow-lg); }
.action-btn:hover::after { opacity: 1; }
.action-btn:active { transform: scale(0.97); }
.action-icon { font-size: 28px; color: var(--primary); position: relative; z-index: 1; transition: transform 0.3s cubic-bezier(.34,1.56,.64,1); }
.action-btn:hover .action-icon { transform: scale(1.2) rotate(-5deg); }
.action-btn span { position: relative; z-index: 1; }

/* Word of the Day */
.wotd-card {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: var(--radius-lg); padding: 24px;
  color: #fff; margin-top: 20px;
  box-shadow: 0 8px 24px rgba(79,70,229,.3);
  animation: fadeIn 0.4s ease;
}
.wotd-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; opacity: 0.8; margin-bottom: 10px;
}
.wotd-label i { margin-right: 6px; }
.wotd-word { font-size: 28px; font-weight: 800; font-family: 'Playfair Display', serif; margin-bottom: 8px; }
.wotd-def { font-size: 14px; opacity: 0.9; line-height: 1.6; margin-bottom: 10px; }
.wotd-syns { font-size: 12px; opacity: 0.75; }

/* Clear daily dashboard path */
.daily-plan-card {
  padding: 20px; margin-bottom: 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface), var(--primary-light));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.daily-plan-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.plan-kicker { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.daily-plan-header h2 { font-size: 19px; font-family: 'Space Grotesk', sans-serif; margin: 3px 0; }
.daily-plan-header p { color: var(--text-muted); font-size: 13px; }
.plan-count { min-width: 54px; height: 54px; display: grid; place-items: center; align-content: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--primary), var(--purple)); font-size: 20px; font-weight: 900; font-family: 'Space Grotesk', sans-serif; box-shadow: 0 5px 14px rgba(79,70,229,.3); }
.plan-count small { font-size: 11px; }.plan-count span { font-size: 8px; font-weight: 700; opacity: .75; text-transform: uppercase; }
.plan-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-step { display: flex; align-items: center; gap: 9px; padding: 11px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); text-align: left; transition: all .2s cubic-bezier(.34,1.56,.64,1); }
.plan-step:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.plan-step.done { background: var(--green-light); border-color: rgba(5,150,105,.3); }
.plan-step-number { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; color: #fff; background: var(--primary); font-size: 11px; font-weight: 900; }
.plan-step.done .plan-step-number { background: var(--green); }.plan-step-icon { color: var(--primary); font-size: 15px; }.plan-step.done .plan-step-icon { color: var(--green); }
.plan-step-copy { flex: 1; min-width: 0; }.plan-step-copy strong, .plan-step-copy small { display: block; }.plan-step-copy strong { font-size: 12px; }.plan-step-copy small { color: var(--text-muted); font-size: 10px; margin-top: 2px; }
.plan-arrow { color: var(--text-light); font-size: 11px; }

.word-finder-card {
  padding: 20px; margin-bottom: 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.word-finder-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.word-finder-heading h2 { font-size: 19px; font-family: var(--font-heading), sans-serif; margin: 3px 0; }
.word-finder-heading p { color: var(--text-muted); font-size: 13px; }
.word-finder-heading > i { color: var(--primary); font-size: 24px; padding: 8px; border-radius: 12px; background: var(--primary-light); animation: pulse 2s infinite; }
.word-finder-input-wrap { position: relative; }
.word-finder-input-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--primary); }
.word-finder-input {
  width: 100%; padding: 13px 14px 13px 42px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); color: var(--text); background: var(--surface-2);
  font-size: 14px; transition: all var(--transition);
}
.word-finder-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.word-finder-results { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.word-finder-result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); transition: all .18s ease; }
.word-finder-result:hover { transform: translateX(4px); background: var(--primary-light); }
.word-finder-word { min-width: 105px; color: var(--primary); font-weight: 800; font-family: var(--font-accent), serif; }
.word-finder-definition { flex: 1; overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.word-finder-result > i { color: var(--primary); font-size: 11px; }
.word-finder-empty { padding: 10px 2px 0; color: var(--text-muted); font-size: 12px; }
.word-finder-empty i { margin-right: 5px; color: var(--primary); }
.dashboard-capture-card {
  display: grid; grid-template-columns: auto 1fr minmax(280px, 1.2fr); align-items: center; gap: 16px;
  margin: 16px 0; padding: 18px 20px; border: 1px solid rgba(124,58,237,.2);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 100% 0, rgba(124,58,237,.18), transparent 35%), var(--surface);
  box-shadow: var(--shadow-sm); animation: fadeIn .3s ease;
}
.dashboard-capture-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px;
  color: #fff; font-size: 22px; background: linear-gradient(135deg, var(--purple), var(--primary));
  animation: float 3s ease-in-out infinite;
}
.dashboard-capture-copy h2 { font-size: 18px; margin: 3px 0 4px; font-family: var(--font-heading), sans-serif; }
.dashboard-capture-copy p { color: var(--text-muted); font-size: 12px; }
.dashboard-capture-form { display: flex; gap: 8px; align-items: center; }
.dashboard-capture-form .form-input { min-width: 0; }
.dashboard-capture-form .btn-primary, .dashboard-capture-form .btn-secondary { white-space: nowrap; }

/* Momentum + daily missions */
.momentum-card {
  margin-bottom: 16px; padding: 18px; border-radius: var(--radius-lg);
  color: #fff; background: linear-gradient(135deg, #111827, #312e81 55%, #7c3aed);
  box-shadow: 0 10px 24px rgba(49,46,129,.25); animation: fadeIn .35s ease;
}
.momentum-level { display: flex; align-items: center; gap: 14px; }
.level-orb {
  width: 62px; height: 62px; flex-shrink: 0; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 0 0 5px rgba(251,191,36,.16);
  animation: float 3s ease-in-out infinite;
}
.level-orb i { font-size: 16px; position: absolute; margin-top: -30px; margin-left: 28px; }
.level-orb strong { font-size: 26px; font-family: 'Space Grotesk', sans-serif; }
.momentum-copy { flex: 1; min-width: 0; }
.momentum-kicker { font-size: 10px; font-weight: 900; letter-spacing: .13em; opacity: .65; }
.momentum-copy h3 { font-size: 18px; margin: 2px 0; font-family: 'Space Grotesk', sans-serif; }
.momentum-copy p { font-size: 12px; opacity: .72; margin-bottom: 8px; }
.momentum-copy small { font-size: 10px; opacity: .65; }
.xp-track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; margin-bottom: 4px; }
.xp-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #fbbf24, #f472b6); transition: width .6s cubic-bezier(.34,1.56,.64,1); }
.coin-purse { min-width: 64px; text-align: center; }
.coin-purse i { display: block; color: #fbbf24; font-size: 20px; margin-bottom: 3px; }
.coin-purse strong { display: block; font-size: 20px; font-family: 'Space Grotesk', sans-serif; }
.coin-purse span { font-size: 10px; opacity: .7; }
.mission-row {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 16px; padding: 11px 12px;
  border-radius: var(--radius-sm); color: #fff; text-align: left; background: rgba(255,255,255,.12);
  transition: all .2s ease;
}
.mission-row:hover { transform: translateY(-2px); background: rgba(255,255,255,.2); }
.mission-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.16); color: #fbbf24; }
.mission-copy { flex: 1; }
.mission-copy strong, .mission-copy small { display: block; }
.mission-copy strong { font-size: 12px; }
.mission-copy small { font-size: 11px; opacity: .7; margin-top: 2px; }
.mission-progress { font-size: 12px; font-weight: 800; color: #fde68a; white-space: nowrap; }
.mission-progress i { margin-left: 5px; }

.focus-card {
  display: flex; align-items: center; gap: 16px; padding: 20px; margin-bottom: 18px;
  border: 1px solid rgba(79,70,229,.3); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-light), var(--surface));
}
.focus-card-icon {
  width: 52px; height: 52px; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; border-radius: 16px; font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  animation: pulse 2s infinite;
}
.focus-card-copy { flex: 1; }
.focus-card-copy h2 { font-size: 19px; font-family: 'Space Grotesk', sans-serif; margin: 3px 0 5px; }
.focus-card-copy p:last-child { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.focus-controls { min-width: 205px; text-align: center; }
.focus-time { font-size: 30px; font-weight: 900; color: var(--primary); font-family: 'Space Grotesk', sans-serif; margin-bottom: 7px; }
.focus-buttons { display: flex; justify-content: center; gap: 5px; }
.focus-buttons .btn-secondary, .focus-buttons .btn-primary { padding: 6px 9px; }
.focus-stop { color: var(--red); font-size: 11px; font-weight: 800; margin-top: 7px; }
.coin-purse small { display: block; color: rgba(255,255,255,.6); font-size: 9px; margin-top: 5px; }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; border: none;
  transition: all var(--transition); cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,70,229,.3); position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,.15));
  opacity: 0; transition: opacity var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(79,70,229,.4); }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary i { margin-right: 6px; }

.btn-secondary {
  background: var(--surface); color: var(--text);
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; border: 1px solid var(--border);
  transition: all var(--transition); cursor: pointer;
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--red); color: #fff; padding: 10px 20px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 700;
  border: none; transition: all var(--transition); cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }
.btn-danger i { margin-right: 6px; }

.btn-danger-outline {
  background: transparent; color: var(--red); padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--red); transition: all var(--transition); cursor: pointer; margin-top: 8px;
}
.btn-danger-outline:hover { background: var(--red-light); }

.btn-sm { padding: 6px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; white-space: nowrap; }
.btn-sm i { margin-right: 4px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row i { margin-right: 6px; }

/* ════════════════════════════════════════
   WORD MANAGER
════════════════════════════════════════ */
.search-bar { position: relative; margin-bottom: 14px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--text-muted); pointer-events: none; }
.search-input {
  width: 100%; padding: 11px 40px 11px 42px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  transition: all var(--transition);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; padding: 4px; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: 100px; border: 2px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1); cursor: pointer;
}
.filter-tab i { margin-right: 5px; }
.filter-tab:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.filter-tab.active { background: linear-gradient(135deg, var(--primary), var(--purple)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(79,70,229,.3); }

.words-list { display: flex; flex-direction: column; gap: 12px; }

/* Quick Capture */
.capture-hero {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 20px;
  border: 1px solid rgba(79,70,229,.18); border-radius: var(--radius-lg);
  background: radial-gradient(circle at 90% 20%, rgba(124,58,237,.18), transparent 34%), linear-gradient(135deg, var(--primary-light), var(--surface));
}
.capture-hero-icon {
  width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 18px; color: #fff; font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 8px 20px rgba(79,70,229,.25); animation: float 3s ease-in-out infinite;
}
.capture-hero h2 { font-size: 20px; color: var(--text); margin: 3px 0 5px; font-family: var(--font-heading), sans-serif; }
.capture-hero p { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.capture-form { margin-bottom: 24px; }
.capture-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.capture-form .form-group { margin-bottom: 14px; }
.capture-list-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 12px; }
.capture-list-header h2 { font-size: 18px; font-family: var(--font-heading), sans-serif; }
.capture-list-header h2 i { color: var(--primary); margin-right: 6px; }
.capture-list { display: flex; flex-direction: column; gap: 10px; }
.capture-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border: 1px solid var(--border); border-left: 4px solid var(--purple);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  animation: fadeIn .25s ease; transition: all .2s ease;
}
.capture-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.capture-card-main { min-width: 0; }
.capture-word { color: var(--primary); font-size: 20px; font-weight: 800; font-family: var(--font-accent), serif; }
.capture-meta { color: var(--text-light); font-size: 11px; margin-top: 5px; }
.capture-meta i { margin-right: 3px; }
.capture-meta span { margin: 0 5px; }
.capture-note { color: var(--text-muted); font-size: 12px; margin-top: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.capture-note i { color: var(--purple); margin-right: 5px; }
.capture-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.capture-empty { padding: 42px 20px; }

.word-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); transition: all 0.2s ease;
  animation: fadeIn 0.2s ease;
}
.word-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.word-card.known { border-left: 4px solid var(--green); background: linear-gradient(to right, rgba(5,150,105,.03), var(--surface)); }
.word-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 12px; }
.word-name { font-size: 19px; font-weight: 800; font-family: 'Playfair Display', serif; color: var(--primary); }
.word-definition { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.word-actions { display: flex; gap: 5px; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 1px solid var(--border);
  background: var(--surface-2); transition: all 0.15s ease; cursor: pointer;
}
.icon-btn:hover { transform: scale(1.1) rotate(5deg); }
.icon-btn:hover.btn-edit { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.icon-btn:hover.btn-delete { background: var(--red-light); border-color: var(--red); color: var(--red); }
.icon-btn:hover.btn-known { background: var(--green-light); border-color: var(--green); color: var(--green); }

.synonyms { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.synonyms-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.synonym-tag {
  background: var(--primary-light); color: var(--primary);
  border-radius: 100px; padding: 3px 10px; font-size: 12px; font-weight: 600;
  transition: all var(--transition);
}
.synonym-tag:hover { background: var(--primary); color: #fff; transform: scale(1.05); }
.retry-badge {
  background: var(--orange-light); color: var(--orange);
  border-radius: var(--radius-sm); padding: 4px 10px;
  font-size: 12px; font-weight: 600; margin-bottom: 6px; display: inline-block;
}
.word-meta { font-size: 11px; color: var(--text-light); margin-top: 8px; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 60px; margin-bottom: 16px; display: block; color: var(--text-light); animation: float 3s ease-in-out infinite; }
.empty-state h2 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 8px; font-family: 'Space Grotesk', sans-serif; }
.empty-state p { font-size: 15px; line-height: 1.7; margin-bottom: 8px; }
.empty-state.success .empty-icon { animation: bounce-in 0.6s cubic-bezier(.34,1.56,.64,1); }

/* ════════════════════════════════════════
   DAILY STUDY — FLIP CARDS
════════════════════════════════════════ */
.study-cards-container { display: flex; flex-direction: column; gap: 20px; }
.study-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: all var(--transition);
  animation: fadeIn 0.3s ease;
}
.study-card:hover { box-shadow: var(--shadow-lg); }
.study-card.studied { opacity: 0.75; }

.study-card-inner {
  position: relative; height: 210px;
  transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(.4,0,.2,1);
  cursor: pointer;
}
.study-card-inner.flipped { transform: rotateY(180deg); }
.study-card-front, .study-card-back {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px; gap: 8px;
}
.study-card-front {
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 60%, #2563eb 100%);
  background-size: 200% 200%; animation: gradientShift 6s ease infinite; color: #fff;
}
.study-card-back { background: var(--surface); transform: rotateY(180deg); }
.card-num { font-size: 11px; font-weight: 700; opacity: 0.7; text-transform: uppercase; letter-spacing: .1em; }
.study-card-front .card-num { color: rgba(255,255,255,.75); }
.card-word { font-size: 30px; font-weight: 800; font-family: 'Playfair Display', serif; text-align: center; }
.study-card-front .card-word { color: #fff; }
.card-hint { font-size: 13px; opacity: 0.7; display: flex; align-items: center; gap: 6px; }
.study-card-front .card-hint { color: rgba(255,255,255,.75); }
.card-definition { font-size: 15px; color: var(--text-muted); text-align: center; line-height: 1.6; }
.card-synonyms { font-size: 13px; color: var(--text-muted); text-align: center; }

.study-card-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); }
.btn-study-fail {
  padding: 16px; font-size: 14px; font-weight: 700; color: var(--red);
  background: var(--red-light); border-right: 1px solid var(--border);
  transition: all var(--transition); cursor: pointer;
}
.btn-study-fail:hover { background: #fca5a5; transform: scale(1.02); }
.btn-study-pass {
  padding: 16px; font-size: 14px; font-weight: 700; color: var(--green);
  background: var(--green-light); transition: all var(--transition); cursor: pointer;
}
.btn-study-pass:hover { background: #6ee7b7; transform: scale(1.02); }
.study-status { padding: 14px 20px; text-align: center; font-size: 14px; font-weight: 700; }
.study-status.known { background: var(--green-light); color: var(--green); }
.study-status.unknown { background: var(--orange-light); color: var(--orange); }

/* ════════════════════════════════════════
   SPELLING TEST — LETTER BOXES
════════════════════════════════════════ */
.spelling-container { max-width: 620px; margin: 0 auto; }
.spelling-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.spelling-progress-label { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.spelling-dots { display: flex; gap: 6px; align-items: center; }
.sdot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border); transition: all 0.3s ease;
}
.sdot.done    { background: var(--green); transform: scale(1); }
.sdot.active  { background: var(--primary); transform: scale(1.3); animation: pulse 2s infinite; }

.spelling-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow);
  text-align: center; transition: border-color 0.3s ease;
}
.spelling-card.correct-border { border-color: var(--green); animation: glow-green 0.6s ease; }
.spelling-card.error-border   { border-color: var(--red); animation: glow-red 0.6s ease; }
.spelling-card h3 { font-size: 15px; font-weight: 700; color: var(--text-muted); margin-bottom: 16px; }
.spelling-card h3 i { margin-right: 6px; color: var(--primary); }
.scrambled-word {
  display: inline-block; padding: 12px 22px; margin: 4px 0 10px;
  border-radius: 14px; color: var(--primary); background: var(--primary-light);
  font-size: 36px; font-weight: 900; letter-spacing: .18em;
  font-family: 'Space Grotesk', sans-serif; text-transform: uppercase;
  animation: bounce-in .45s cubic-bezier(.34,1.56,.64,1);
}
.spelling-challenge-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.spelling-challenge-hint i { color: var(--yellow); margin-right: 5px; }

.spelling-definition {
  font-size: 17px; font-style: italic; line-height: 1.75; color: var(--text);
  padding: 16px 20px; background: var(--surface-2); border-radius: var(--radius-sm);
  margin-bottom: 12px; border-left: 4px solid var(--primary);
}
.spelling-synonyms { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.spelling-synonyms i { margin-right: 5px; color: var(--purple); }

/* Letter Boxes */
.letter-boxes {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin: 24px 0; min-height: 60px;
}
.letter-box {
  width: 46px; height: 56px; border: 3px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; text-transform: uppercase;
  background: var(--surface); color: var(--text);
  transition: all 0.15s ease; font-family: 'Space Grotesk', sans-serif;
}
.letter-box.empty {
  border-style: dashed; border-color: var(--border);
}
.letter-box.current {
  border-color: var(--primary); border-style: solid;
  animation: pulse 1.5s infinite; background: var(--primary-light);
}
.letter-box.correct {
  border-color: var(--green); background: var(--green-light); color: var(--green);
  animation: letterPop 0.3s cubic-bezier(.34,1.56,.64,1);
}
.letter-box.incorrect {
  border-color: var(--red); background: var(--red-light); color: var(--red);
  animation: letterShake 0.35s ease;
}
.letter-box.correct-final { border-color: var(--green); background: var(--green-light); color: var(--green); }
.letter-box.all-correct {
  animation: letterPop 0.4s cubic-bezier(.34,1.56,.64,1);
}

.spelling-hidden-input {
  position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px;
}
.spelling-tap-area {
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border); font-size: 15px; color: var(--text-muted);
  text-align: center; cursor: text; transition: border-color var(--transition);
  margin-bottom: 16px; user-select: none;
}
.spelling-tap-area:hover { border-color: var(--primary); color: var(--primary); }
.spelling-type-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.spelling-type-hint i { margin-right: 6px; }

.spelling-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.spelling-buttons .btn-primary { flex: 1; max-width: 200px; padding: 13px; font-size: 15px; }
.btn-skip {
  flex: 1; max-width: 200px; padding: 13px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; color: var(--orange);
  background: var(--orange-light); border: 2px solid rgba(217,119,6,.3);
  transition: all var(--transition); cursor: pointer;
}
.btn-skip:hover { background: #fcd34d; transform: translateY(-2px); }
.btn-skip i { margin-right: 6px; }

.spelling-feedback {
  margin-top: 20px; padding: 16px 20px; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; text-align: center;
  animation: bounce-in 0.4s cubic-bezier(.34,1.56,.64,1);
}
.spelling-feedback.correct { background: var(--green-light); color: var(--green); border: 2px solid rgba(5,150,105,.3); }
.spelling-feedback.incorrect { background: var(--red-light); color: var(--red); border: 2px solid rgba(220,38,38,.3); }

.wrong-letter-hint {
  font-size: 13px; color: var(--red); margin-top: 10px; font-weight: 600;
  animation: fadeIn 0.3s ease;
}

/* Spelling Results */
.results-list { text-align: left; max-width: 420px; margin: 20px auto 0; }
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px;
  font-size: 14px; font-weight: 600; animation: fadeIn 0.2s ease;
}
.result-item.pass { background: var(--green-light); color: var(--green); }
.result-item.fail { background: var(--red-light); color: var(--red); }
.retry-note { font-size: 12px; margin-left: auto; opacity: 0.8; }
.skip-note { font-size: 12px; color: var(--orange); margin-left: auto; }

/* ════════════════════════════════════════
   QUIZ
════════════════════════════════════════ */
.quiz-container { max-width: 660px; margin: 0 auto; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-progress { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.quiz-score-display {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; padding: 5px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 800; font-family: 'Space Grotesk', sans-serif;
}
.quiz-progress-bar { height: 8px; background: var(--bg-2); border-radius: 100px; overflow: hidden; margin-bottom: 24px; }
.quiz-timer-big {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: -4px 0 18px;
  min-height: 78px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(135deg, #312e81, #7c3aed); box-shadow: 0 8px 22px rgba(79,70,229,.25);
  animation: pulse 2s infinite;
}
.quiz-timer-big i { color: #fde68a; font-size: 25px; animation: fireBurn 1.4s ease-in-out infinite; }
.quiz-timer-big .quiz-timer-value { font-size: 38px; line-height: 1; font-weight: 900; font-family: 'Space Grotesk', sans-serif; letter-spacing: .04em; }
.quiz-timer-big small { align-self: flex-end; margin-bottom: 18px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.quiz-timer-big.timer-danger { background: linear-gradient(135deg, #991b1b, #dc2626); animation: glow-red .7s infinite; }
.quiz-progress-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transition: width 0.5s cubic-bezier(.34,1.56,.64,1);
}
.quiz-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
}
.quiz-card h3 { font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 12px; }
.quiz-card h3 i { margin-right: 6px; color: var(--primary); }
.quiz-definition {
  font-size: 18px; font-style: italic; line-height: 1.7; color: var(--text);
  padding: 16px 20px; background: var(--surface-2); border-radius: var(--radius-sm);
  margin-bottom: 24px; border-left: 4px solid var(--primary);
}
.quiz-choices { display: flex; flex-direction: column; gap: 10px; }
.quiz-choice {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface);
  font-size: 15px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: all 0.2s cubic-bezier(.34,1.56,.64,1); text-align: left;
}
.quiz-choice:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); transform: translateX(6px); }
.quiz-choice:disabled { cursor: default; }
.quiz-choice.correct { border-color: var(--green); background: var(--green-light); color: var(--green); animation: pop 0.4s cubic-bezier(.34,1.56,.64,1); }
.quiz-choice.incorrect { border-color: var(--red); background: var(--red-light); color: var(--red); animation: shake 0.4s ease; }
.choice-letter {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-2); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0; font-family: 'Space Grotesk', sans-serif;
  transition: all var(--transition);
}
.quiz-choice.correct .choice-letter  { background: var(--green); color: #fff; }
.quiz-choice.incorrect .choice-letter { background: var(--red); color: #fff; }
.quiz-choice:hover:not(:disabled) .choice-letter { background: var(--primary); color: #fff; }
.choice-word { font-family: 'Playfair Display', serif; font-size: 16px; }
.quiz-feedback {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; animation: bounce-in 0.4s cubic-bezier(.34,1.56,.64,1);
}
.quiz-feedback.correct { background: var(--green-light); color: var(--green); border: 2px solid rgba(5,150,105,.3); }
.quiz-feedback.incorrect { background: var(--red-light); color: var(--red); border: 2px solid rgba(220,38,38,.3); }
.quiz-feedback i { margin-right: 6px; }
.quiz-score-big {
  font-size: 56px; font-weight: 900; color: var(--primary);
  margin: 12px 0 6px; line-height: 1;
  font-family: 'Space Grotesk', sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.score-message { font-size: 16px; color: var(--text-muted); margin-top: 6px; }

/* Grade badge */
.grade-badge {
  width: 90px; height: 90px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 900; margin: 0 auto 12px;
  font-family: 'Space Grotesk', sans-serif;
  animation: bounce-in 0.6s cubic-bezier(.34,1.56,.64,1);
}
.grade-A-plus { background: linear-gradient(135deg, #ffd700, #ff8c00); color: #fff; box-shadow: 0 0 30px rgba(255,215,0,.5); }
.grade-A      { background: linear-gradient(135deg, var(--green), #10b981); color: #fff; }
.grade-B      { background: linear-gradient(135deg, var(--blue), #38bdf8); color: #fff; }
.grade-C      { background: linear-gradient(135deg, var(--orange), #f59e0b); color: #fff; }
.grade-D      { background: linear-gradient(135deg, var(--red), #f87171); color: #fff; }

/* ════════════════════════════════════════
   PROGRESS / ANALYTICS
════════════════════════════════════════ */
.progress-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.progress-tab {
  padding: 8px 18px; border-radius: 100px; border: 2px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
}
.progress-tab i { margin-right: 6px; }
.progress-tab:hover { border-color: var(--primary); color: var(--primary); }
.progress-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-color: transparent; color: #fff; box-shadow: 0 3px 12px rgba(79,70,229,.3);
}
.progress-tab-content { display: none; }
.progress-tab-content.active { display: block; animation: fadeIn 0.25s ease; }

.analytics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.analytics-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.analytics-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.analytics-card.wide { grid-column: 1 / -1; }
.analytics-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 16px; font-family: 'Space Grotesk', sans-serif; }
.analytics-card h3 i { margin-right: 8px; color: var(--primary); }

/* Grade overview */
.grade-overview { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.grade-side { text-align: center; }
.grade-desc { flex: 1; }
.grade-desc h4 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.grade-desc p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* Stats row */
.stat-list { display: flex; flex-direction: column; gap: 2px; }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--text-muted); }
.stat-row span i { margin-right: 6px; width: 16px; }
.stat-row strong { font-weight: 800; font-family: 'Space Grotesk', sans-serif; }

/* Bar chart (last 7 days) */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-fill {
  width: 100%; border-radius: 6px 6px 0 0; min-height: 4px;
  background: linear-gradient(to top, var(--primary), var(--purple));
  transition: height 0.6s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.bar-fill.empty { background: var(--bg-2); }
.bar-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.bar-count { font-size: 11px; font-weight: 800; color: var(--primary); }

/* Missed days indicator */
.missed-streak-row { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.streak-badge {
  flex: 1; padding: 14px; border-radius: var(--radius-sm); text-align: center;
  min-width: 100px;
}
.streak-badge.fire { background: linear-gradient(135deg, #ff6b35, #ff8e53); color: #fff; }
.streak-badge.ice  { background: linear-gradient(135deg, #06b6d4, #38bdf8); color: #fff; }
.streak-badge.miss { background: var(--red-light); color: var(--red); }
.streak-badge-num { font-size: 28px; font-weight: 900; font-family: 'Space Grotesk', sans-serif; line-height: 1; }
.streak-badge-label { font-size: 11px; font-weight: 700; opacity: 0.85; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* Insights */
.insights-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 14px; line-height: 1.5;
}
.insight-item.good { background: var(--green-light); color: var(--green); }
.insight-item.warn { background: var(--orange-light); color: var(--orange); }
.insight-item.info { background: var(--blue-light); color: var(--blue); }
.insight-item.tip  { background: var(--purple-light); color: var(--purple); }
.insight-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* Weak words */
.weak-words-list { display: flex; flex-direction: column; gap: 8px; }
.weak-word-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--surface-2); border-radius: var(--radius-sm);
}
.weak-word-name { font-weight: 700; font-family: 'Playfair Display', serif; flex: 1; }
.weak-word-retries {
  background: var(--red-light); color: var(--red);
  padding: 2px 10px; border-radius: 100px; font-size: 12px; font-weight: 800;
}

/* Heatmap */
.heatmap-grid { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 10px; }
.heatmap-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-2); transition: transform var(--transition); cursor: default; }
.heatmap-cell:hover { transform: scale(1.4); }
.heatmap-cell.level-1 { background: #bbf7d0; }
.heatmap-cell.level-2 { background: #4ade80; }
.heatmap-cell.level-3 { background: #16a34a; }
.theme-dark .heatmap-cell.level-1 { background: #064e3b; }
.theme-dark .heatmap-cell.level-2 { background: #065f46; }
.theme-dark .heatmap-cell.level-3 { background: #059669; }
.heatmap-legend { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text-muted); }

/* Study history */
.study-history { display: flex; flex-direction: column; gap: 5px; }
.history-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.history-date { color: var(--text-muted); }
.history-known { color: var(--green); font-weight: 700; }

/* Retry Queue */
.retry-list { display: flex; flex-direction: column; gap: 8px; }
.retry-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
}
.retry-date { font-size: 12px; color: var(--orange); font-weight: 700; }

/* Achievements */
.achievements-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.achievement-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface-2);
  transition: all var(--transition); flex: 1; min-width: 180px;
}
.achievement-badge.earned {
  border-color: rgba(255,215,0,.5); background: linear-gradient(135deg, rgba(255,215,0,.1), var(--surface-2));
  box-shadow: 0 2px 8px rgba(255,215,0,.2);
}
.achievement-badge.earned:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,215,0,.3); }
.ach-badge-icon { font-size: 28px; flex-shrink: 0; }
.ach-badge-info { flex: 1; }
.ach-badge-name { font-size: 13px; font-weight: 800; }
.ach-badge-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ach-badge-locked { opacity: 0.4; filter: grayscale(1); }

/* ════════════════════════════════════════
   SETTINGS
════════════════════════════════════════ */
.settings-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.settings-card:hover { box-shadow: var(--shadow); }
.avatar-settings-card { background: radial-gradient(circle at 95% 5%, var(--primary-light), transparent 28%), var(--surface); }
.avatar-editor { display: flex; align-items: center; gap: 28px; }
.avatar-preview { width: 155px; flex-shrink: 0; padding: 12px 0 24px; }
.avatar-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; flex: 1; }
.avatar-field { display: flex; flex-direction: column; gap: 5px; color: var(--text-muted); font-size: 11px; font-weight: 800; }
.avatar-field .form-input { width: 100%; padding: 8px 10px; font-size: 12px; }
.avatar-actions { margin-top: 10px; }
.avatar-credit { color: var(--text-light); font-size: 10px; margin-top: 10px; }
.avatar-credit a { color: var(--primary); text-decoration: underline; }
.sync-card { border-color: rgba(37,99,235,.3); background: linear-gradient(135deg, var(--surface), var(--blue-light)); }
.sync-code-row { display: flex; gap: 10px; align-items: center; }
.sync-code-row .form-input { min-width: 0; }
.sync-actions { margin-top: 12px; }
.sync-actions .btn-secondary { flex: 1; }
.sync-status { color: var(--text-muted); font-size: 11px; margin-top: 10px; min-height: 15px; }
.updates-card { border-color: rgba(124,58,237,.25); background: linear-gradient(135deg, var(--surface), rgba(124,58,237,.05)); }
.updates-version { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.updates-version strong { color: var(--primary); font-size: 13px; }
.updates-list { display: flex; flex-direction: column; gap: 9px; }
.updates-list > div { display: flex; align-items: flex-start; gap: 9px; color: var(--green); font-size: 12px; }
.updates-list > div > i { margin-top: 2px; }
.updates-list span { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.updates-list small { color: var(--text-muted); font-size: 11px; line-height: 1.35; }

/* User-selected typography */
body, button, input, textarea, select {
  font-family: var(--font-main), -apple-system, BlinkMacSystemFont, sans-serif;
}
.pin-title, .mobile-title, .sidebar-title, .page-title, .card-title,
.stat-number, .empty-state h2, .modal-header h3, .settings-card-header h3,
.daily-plan-header h2, .momentum-copy h3, .challenge-hero h2, .exam-card h2,
.focus-card-copy h2, .quiz-score-big, .grade-badge, .level-orb strong {
  font-family: var(--font-heading), sans-serif;
}
.card-word, .word-name, .choice-word {
  font-family: var(--font-accent), serif;
}
.font-picker-row { display: flex; align-items: center; gap: 14px; }
.font-picker-row .form-input { max-width: 260px; }
.font-live-preview {
  flex: 1; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: 16px;
}
.settings-card.danger { border-color: rgba(220,38,38,.3); }
.settings-card-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.settings-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.settings-icon i { font-size: 20px; }
.settings-card-header h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; font-family: 'Space Grotesk', sans-serif; }
.settings-card-header p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-input {
  flex: 1; min-width: 0; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  transition: all var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }
.form-input.small { max-width: 100px; flex: none; }
.pin-status { font-size: 13px; color: var(--green); margin-top: 8px; font-weight: 700; }
.lock-app-btn { margin-top: 12px; }
.theme-options { display: flex; gap: 10px; }
.theme-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 700; color: var(--text-muted);
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1); cursor: pointer;
}
.theme-btn i { margin-right: 6px; }
.theme-btn.active {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
  box-shadow: 0 3px 10px rgba(79,70,229,.2);
}
.theme-btn:hover { transform: translateY(-2px); }

/* ════════════════════════════════════════
   FORM / MODAL
════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-label i { margin-right: 6px; color: var(--primary); }
.required { color: var(--red); }
.form-hint { color: var(--text-muted); font-weight: 400; }
.form-textarea {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  resize: vertical; line-height: 1.6; transition: all var(--transition);
}
.form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.1); }

/* Dictionary Lookup */
.word-input-row { display: flex; gap: 8px; align-items: stretch; }
.word-input-row .form-input { flex: 1; }
.btn-lookup {
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; font-size: 13px; font-weight: 700; border: none; cursor: pointer;
  white-space: nowrap; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-lookup:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(79,70,229,.4); }
.btn-lookup:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.btn-lookup i { font-size: 14px; }
.lookup-hint { font-size: 11px; color: var(--text-light); margin-top: 5px; }
.lookup-hint i { margin-right: 4px; }

.lookup-result {
  background: var(--surface-2); border: 2px solid var(--primary);
  border-radius: var(--radius-sm); margin-bottom: 16px; overflow: hidden;
  animation: bounce-in 0.3s cubic-bezier(.34,1.56,.64,1);
}
.lookup-result-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: var(--primary-light);
}
.lookup-badge { font-size: 12px; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.lookup-badge i { margin-right: 6px; }
.lookup-result-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lookup-tab {
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.lookup-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.lookup-preview { padding: 14px; max-height: 200px; overflow-y: auto; }
.lookup-entry { margin-bottom: 12px; }
.lookup-pos {
  display: inline-block; font-size: 10px; font-weight: 800;
  color: var(--purple); background: var(--purple-light);
  padding: 2px 8px; border-radius: 100px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em;
}
.lookup-def { font-size: 14px; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.lookup-example { font-size: 13px; color: var(--text-muted); font-style: italic; }
.lookup-syns { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.lookup-phonetic { font-size: 14px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.lookup-audio-btn {
  font-size: 12px; padding: 3px 10px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-muted); cursor: pointer; transition: all var(--transition); margin-left: 8px;
}
.lookup-audio-btn:hover { background: var(--primary-light); color: var(--primary); }
.lookup-actions { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.btn-use-def {
  flex: 1; padding: 9px; border-radius: var(--radius-sm);
  background: var(--green); color: #fff; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; transition: all var(--transition);
}
.btn-use-def:hover { background: #047857; transform: translateY(-1px); }
.btn-use-def i { margin-right: 6px; }
.btn-dismiss {
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer; transition: all var(--transition);
}
.btn-dismiss:hover { background: var(--red-light); color: var(--red); }
.btn-dismiss i { margin-right: 6px; }
.lookup-error { padding: 12px 14px; font-size: 13px; color: var(--red); font-weight: 600; display: flex; align-items: flex-start; gap: 10px; }
.lookup-loading { padding: 16px 14px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(5px); }
.modal-card {
  position: relative; background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; box-shadow: var(--shadow-lg);
  animation: bounce-in 0.3s cubic-bezier(.34,1.56,.64,1);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; margin-bottom: 16px; }
.modal-header h3 { font-size: 18px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; }
.modal-close {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2);
  color: var(--text-muted); font-size: 16px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); border: 1px solid var(--border);
}
.modal-close:hover { background: var(--red-light); color: var(--red); transform: rotate(90deg); }
.modal-body { padding: 0 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); margin-top: 16px; }

/* ════════════════════════════════════════
   ACHIEVEMENT TOAST
════════════════════════════════════════ */
.achievement-toast {
  position: fixed; bottom: 90px; right: 24px; z-index: 9998;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #1a1d2e, #20243a);
  color: #fff; padding: 16px 20px; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  border: 1px solid rgba(255,215,0,.3);
  max-width: 320px; animation: slideInRight 0.4s cubic-bezier(.34,1.56,.64,1);
}
.achievement-toast.hiding { animation: slideOutRight 0.3s ease forwards; }
.ach-icon { font-size: 36px; flex-shrink: 0; animation: wiggle 0.5s ease; }
.ach-body { flex: 1; }
.ach-title { font-size: 13px; font-weight: 800; color: #ffd700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.ach-desc { font-size: 13px; opacity: 0.9; }
.theme-dark .achievement-toast { background: linear-gradient(135deg, #0d0f1a, #141627); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 100px;
  font-size: 14px; font-weight: 700; z-index: 9999;
  box-shadow: var(--shadow-lg); white-space: nowrap;
  animation: bounce-in 0.3s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { background: #1a1d2e; color: #fff; }
.toast.error   { background: var(--red); color: #fff; }
.theme-dark .toast.success { background: var(--surface-2); }

/* ════════════════════════════════════════
   WELCOME + CHALLENGE LAB
════════════════════════════════════════ */
.welcome-card {
  max-width: 460px;
  text-align: center;
  padding: 30px;
  background: radial-gradient(circle at top right, var(--primary-light), transparent 45%), var(--surface);
}
.welcome-card > .modal-close { position: absolute; right: 16px; top: 16px; }
.welcome-orbit {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; font-size: 32px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 0 0 10px rgba(79,70,229,.1), 0 12px 25px rgba(79,70,229,.3);
  animation: float 3s ease-in-out infinite;
}
.welcome-kicker, .challenge-kicker {
  color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .13em;
  text-transform: uppercase;
}
.welcome-card h2 { font-size: 26px; font-family: 'Space Grotesk', sans-serif; margin: 4px 0 8px; }
.welcome-card p:not(.welcome-kicker) { color: var(--text-muted); line-height: 1.6; }
.welcome-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0;
}
.welcome-stats div { padding: 12px 6px; border-radius: var(--radius-sm); background: var(--surface-2); }
.welcome-stats strong { display: block; font-size: 22px; color: var(--primary); font-family: 'Space Grotesk', sans-serif; }
.welcome-stats span { display: block; color: var(--text-muted); font-size: 11px; margin-top: 3px; }
.welcome-actions { justify-content: center; }
.challenge-hero {
  display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 18px;
  color: #fff; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #db2777);
  box-shadow: 0 10px 30px rgba(79,70,229,.25); overflow: hidden; position: relative;
}
.challenge-hero::after { content: '✦  ✧  ✦'; position: absolute; right: 24px; top: 14px; opacity: .35; font-size: 28px; }
.challenge-hero-icon {
  width: 62px; height: 62px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 18px; background: rgba(255,255,255,.18); font-size: 28px;
  animation: wiggle 2.5s ease-in-out infinite;
}
.quiz-mascot {
  width: 58px; height: 58px; float: right; margin: -8px 0 4px 14px;
  animation: mascot-bob 2.2s ease-in-out infinite;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.challenge-hero h2 { font-size: 24px; font-family: 'Space Grotesk', sans-serif; margin: 3px 0 5px; }
.challenge-hero p:last-child { opacity: .85; font-size: 13px; line-height: 1.5; }
.difficulty-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.difficulty-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px; text-align: left;
  padding: 18px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
}
.difficulty-card:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.difficulty-card > i { font-size: 25px; color: var(--primary); }
.difficulty-card strong { font-size: 16px; font-family: 'Space Grotesk', sans-serif; }
.difficulty-card span, .difficulty-card small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.difficulty-easy > i { color: var(--green); }
.difficulty-hard > i { color: var(--orange); }
.difficulty-challenging > i { color: var(--red); }
.exam-card {
  display: flex; align-items: center; gap: 16px; padding: 20px; margin-bottom: 18px;
  border: 2px solid rgba(217,119,6,.35); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--orange-light), var(--surface));
}
.exam-card-icon { font-size: 30px; color: var(--orange); flex-shrink: 0; }
.exam-card-body { flex: 1; }
.exam-card h2 { font-size: 20px; font-family: 'Space Grotesk', sans-serif; margin: 3px 0 5px; }
.exam-card p:not(.challenge-kicker) { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.exam-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; color: var(--orange); font-size: 11px; font-weight: 800; }
.exam-meta i { margin-right: 3px; }
.exam-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.quiz-score-display b { margin-left: 8px; color: #fde68a; }
.quiz-score-display b.timer-danger { color: #fecaca; animation: pulse .7s infinite; }
.exam-result-note { color: var(--orange) !important; font-size: 13px; font-weight: 700; }
.compact { padding: 28px 20px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Big progress bar (track only) */
.progress-bar-track.large { height: 20px; border-radius: 100px; overflow: hidden; }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET
════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: 1fr; }
  .plan-steps { grid-template-columns: 1fr; }
  .daily-plan-header { align-items: flex-start; }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .difficulty-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE
════════════════════════════════════════ */
@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); z-index: 200; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.visible { opacity: 1; pointer-events: all; }
  .content { margin-left: 0; padding: 80px 16px 24px; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 26px; }
  .action-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .action-btn { padding: 14px 10px; }
  .action-icon { font-size: 24px; }
  .letter-box { width: 38px; height: 46px; font-size: 18px; }
  .spelling-buttons .btn-primary, .btn-skip { max-width: 100%; }
  .quiz-container, .spelling-container { max-width: 100%; }
  .settings-wrap { gap: 12px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-input.small { max-width: 100%; }
  .modal { padding: 12px; }
  .modal-card { max-width: 100%; }
  .btn-row { flex-direction: column; }
  .analytics-grid { grid-template-columns: 1fr; }
  .bar-chart { height: 90px; }
  .achievement-toast { right: 12px; left: 12px; max-width: none; }
  .missed-streak-row { gap: 8px; }
  .achievements-grid { gap: 8px; }
  .achievement-badge { min-width: 140px; }
  .challenge-hero, .exam-card { align-items: flex-start; }
  .difficulty-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-card { flex-wrap: wrap; }
  .exam-actions { width: 100%; }
  .exam-actions > * { flex: 1; }
  .focus-card { align-items: flex-start; flex-wrap: wrap; }
  .focus-card-copy { min-width: calc(100% - 70px); }
  .focus-controls { width: 100%; }
  .avatar-editor { align-items: flex-start; flex-direction: column; gap: 6px; }
  .avatar-preview { width: 100%; }
  .avatar-fields { width: 100%; }
  .font-picker-row { align-items: stretch; flex-direction: column; }
  .font-picker-row .form-input { max-width: none; }
  .sync-code-row { align-items: stretch; flex-direction: column; }
  .sync-code-row .btn-secondary { width: 100%; }
  .capture-form-grid { grid-template-columns: 1fr; gap: 0; }
  .capture-hero { align-items: flex-start; }
  .capture-list-header { align-items: flex-start; flex-direction: column; }
  .capture-card { align-items: flex-start; flex-direction: column; }
  .capture-actions { width: 100%; }
  .capture-actions .btn-primary { flex: 1; }
  .dashboard-capture-card { grid-template-columns: auto 1fr; }
  .dashboard-capture-form { grid-column: 1 / -1; flex-wrap: wrap; }
  .dashboard-capture-form .form-input { flex: 1 1 100%; }
  .dashboard-capture-form .btn-primary, .dashboard-capture-form .btn-secondary { flex: 1; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-tabs { gap: 5px; }
  .filter-tab { padding: 5px 10px; font-size: 11px; }
  .letter-box { width: 32px; height: 40px; font-size: 15px; gap: 5px; }
  .letter-boxes { gap: 5px; }
  .difficulty-grid { grid-template-columns: 1fr; }
  .challenge-hero { padding: 18px; }
  .challenge-hero-icon { width: 50px; height: 50px; }
  .welcome-stats { gap: 5px; }
  .momentum-level { align-items: flex-start; flex-wrap: wrap; }
  .momentum-copy { min-width: calc(100% - 80px); }
  .coin-purse { margin-left: 76px; margin-top: -28px; }
}
