/* ================================================================
   ItalIA — ULTRA PREMIUM Design System v3
   ================================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Core palette */
  --bg-base:      #060614;
  --bg-surface:   #0d0d24;
  --bg-card:      #111130;
  --bg-elevated:  #181840;
  --bg-hover:     #1e1e4a;

  /* Accents */
  --green:        #22c55e;
  --green-light:  #4ade80;
  --green-glow:   rgba(34,197,94,0.18);
  --green-dim:    #16a34a;

  --purple:       #a855f7;
  --purple-light: #c084fc;
  --purple-glow:  rgba(168,85,247,0.18);

  --amber:        #f59e0b;
  --amber-light:  #fcd34d;
  --amber-glow:   rgba(245,158,11,0.2);

  --red:          #ef4444;
  --red-glow:     rgba(239,68,68,0.18);

  --blue:         #3b82f6;
  --blue-light:   #60a5fa;
  --blue-glow:    rgba(59,130,246,0.18);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #e2e8f8;
  --text-muted:     #b8c4e0;

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-md:    rgba(255,255,255,0.12);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:  0 6px 24px rgba(0,0,0,0.6);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.7);

  /* Radius */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;
}

/* ---------- Light mode overrides ---------- */
body.light-mode {
  --bg-base:      #f3f4f8;
  --bg-surface:   #ffffff;
  --bg-card:      #ffffff;
  --bg-elevated:  #eef0f8;
  --bg-hover:     #e6e8f4;

  --text-primary:   #1a1a3e;
  --text-secondary: #374270;
  --text-muted:     #6b7399;

  --border:       rgba(0,0,0,0.07);
  --border-md:    rgba(0,0,0,0.12);
  --border-accent: rgba(34,197,94,0.25);

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 6px 24px rgba(0,0,0,0.1);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.12);
}
body.light-mode #topnav {
  background: rgba(243,244,248,0.92);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
body.light-mode #sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0,0,0,0.08);
}
body.light-mode .nav-link {
  color: #4a5280;
}
body.light-mode .nav-link:hover,
body.light-mode .nav-link.active {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
}
body.light-mode .card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* ---------- Keyframes ---------- */
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes gradient-x {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pop-in {
  0%  { transform: scale(0.75); opacity: 0; }
  70% { transform: scale(1.06); }
  100%{ transform: scale(1); opacity: 1; }
}
@keyframes glow-pulse {
  0%,100% { opacity: 0.6; }
  50%      { opacity: 1; }
}
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes token-drop {
  from { opacity: 0; transform: scale(0.8) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes correct-flash {
  0%  { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  70% { box-shadow: 0 0 0 16px rgba(74,222,128,0); }
  100%{ box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@keyframes wrong-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-12px); }
  40% { transform: translateX(12px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}
@keyframes typing-bounce {
  0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
  40%          { transform: scale(1); opacity: 1; }
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(140px) rotate(480deg); opacity: 0; }
}
@keyframes trophy-bounce {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-14px) scale(1.06); }
}
@keyframes xp-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ---------- PREMIUM CARD ---------------------------------------- */
/* A card with glowing top accent line */
.premium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
  transition: border-color .2s, transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s;
}
.premium-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}
.premium-card:hover {
  border-color: var(--border-md);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---------- GLASS CARD ------------------------------------------ */
.glass-card {
  background: rgba(13,13,36,0.7);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

/* ---------- STAT CARD ------------------------------------------- */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px 20px 16px;
  position: relative;
  overflow: hidden;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
}
/* Top accent gradient line (colored per card via inline style) */
.stat-card .accent-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card:hover {
  border-color: var(--border-md);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.stat-icon {
  width: 42px; height: 42px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; margin-bottom: 8px; flex-shrink: 0;
}
.stat-value {
  font-size: 2.2rem; font-weight: 900; line-height: 1;
  letter-spacing: -0.04em;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.stat-action {
  font-size: 0.72rem; font-weight: 700; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--green); transition: gap .15s;
}
.stat-action:hover { gap: 8px; }

/* ---------- MODULE CARD ----------------------------------------- */
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  transition: all .22s cubic-bezier(.4,0,.2,1);
  display: block; color: inherit;
  position: relative; overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.module-card:hover {
  border-color: rgba(34,197,94,0.35);
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(34,197,94,0.1), var(--shadow-md);
}

/* ---------- QUICK ACCESS CARD ----------------------------------- */
.quick-card {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 20px 12px;
  border-radius: var(--r-xl); border: 1px solid var(--border);
  background: var(--bg-card); transition: all .22s cubic-bezier(.4,0,.2,1);
  cursor: pointer; text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.quick-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(34,197,94,0.1), transparent 70%);
  opacity: 0; transition: opacity .22s;
}
.quick-card:hover {
  border-color: rgba(34,197,94,0.4);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.25), 0 16px 40px rgba(0,0,0,0.6), 0 0 40px rgba(34,197,94,0.12);
}
.quick-card:hover::after { opacity: 1; }
.quick-card:active { transform: scale(0.97); }

/* ---------- BUTTONS --------------------------------------------- */
.btn-primary {
  background: linear-gradient(135deg, #15803d 0%, #22c55e 100%);
  color: #000; padding: 10px 22px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 800; border: none; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; letter-spacing: -0.01em;
  position: relative; overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left .5s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  box-shadow: 0 0 30px rgba(34,197,94,0.5), 0 4px 16px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:active { transform: scale(0.96) translateY(0); }

.btn-secondary {
  background: var(--bg-elevated); color: var(--text-primary);
  padding: 10px 20px; border-radius: var(--r-md);
  font-size: 0.875rem; font-weight: 600;
  border: 1px solid var(--border-md); cursor: pointer;
  transition: all .18s; display: inline-flex; align-items: center;
  justify-content: center; gap: 7px;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.18); }
.btn-secondary:active { transform: scale(0.97); }

.btn-icon {
  width: 36px; height: 36px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--bg-card);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); transition: all .15s;
}
.btn-icon:hover { border-color: var(--border-md); color: var(--text-primary); background: var(--bg-elevated); }

/* ---------- INPUTS ---------------------------------------------- */
.input-field {
  width: 100%; padding: 12px 16px; border-radius: var(--r-md);
  border: 1.5px solid var(--border-md); background: var(--bg-elevated);
  font-size: 0.9rem; color: var(--text-primary); outline: none;
  font-family: inherit; transition: all .18s; line-height: 1.5;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15), 0 0 20px rgba(34,197,94,0.08);
  background: var(--bg-card);
}

/* ---------- WORD OF DAY ----------------------------------------- */
.word-of-day {
  background: linear-gradient(135deg,
    rgba(34,197,94,0.08) 0%,
    rgba(16,185,129,0.04) 50%,
    rgba(99,102,241,0.04) 100%);
  border: 1px solid rgba(34,197,94,0.22);
  border-radius: var(--r-2xl); padding: 24px 28px;
  position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.word-of-day::before {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(34,197,94,0.12), transparent 70%);
  border-radius: 50%; animation: float 7s ease-in-out infinite;
}
.word-of-day::after {
  content: '';
  position: absolute; bottom: -30px; left: 10%;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(99,102,241,0.08), transparent 70%);
  border-radius: 50%; animation: float 10s ease-in-out infinite reverse;
}
.word-of-day:hover {
  border-color: rgba(34,197,94,0.4);
  box-shadow: 0 0 60px rgba(34,197,94,0.08);
}

/* ---------- LESSON CARD ----------------------------------------- */
.lesson-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--bg-card); transition: all .2s cubic-bezier(.4,0,.2,1);
  color: inherit; position: relative; overflow: hidden;
}
.lesson-card::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--green), var(--green-light));
  border-radius: 0 2px 2px 0; transform: scaleY(0); transition: transform .2s;
}
.lesson-card:hover {
  border-color: rgba(34,197,94,0.35);
  background: var(--bg-elevated);
  transform: translateX(4px);
  box-shadow: 0 0 30px rgba(34,197,94,0.1);
}
.lesson-card:hover::after { transform: scaleY(1); }

/* ---------- XP BAR ---------------------------------------------- */
.xp-bar {
  height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.xp-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  background-size: 200% auto;
  animation: gradient-x 3s ease infinite;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ---------- SESSION PROGRESS ------------------------------------ */
.session-progress {
  height: 6px; border-radius: 99px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
.session-progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #4ade80);
  background-size: 200% auto;
  animation: gradient-x 3s ease infinite;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(34,197,94,0.5);
}

/* ---------- FLASHCARD 3D --------------------------------------- */
.flashcard-container { perspective: 1200px; cursor: pointer; user-select: none; }
.flashcard {
  position: relative; width: 100%; min-height: 340px;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; width: 100%; min-height: 340px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-2xl);
}
.flashcard-front {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
}
.flashcard-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(34,197,94,0.04));
  border: 1px solid rgba(34,197,94,0.35);
  box-shadow: 0 0 60px rgba(34,197,94,0.2);
}

/* ---------- QUALITY BUTTONS ------------------------------------ */
.quality-btn {
  padding: 10px 18px; border-radius: var(--r-md); border: none;
  cursor: pointer; font-size: 0.82rem; font-weight: 700;
  transition: all .18s; font-family: inherit;
}
.quality-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.quality-btn:active { transform: scale(0.95); }

/* ---------- BADGE FILTER --------------------------------------- */
.badge-filter {
  padding: 5px 14px; border-radius: 99px; font-size: 0.75rem;
  font-weight: 600; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text-muted); transition: all .15s; cursor: pointer;
}
.badge-filter:hover { border-color: var(--green); color: var(--green-light); }
.badge-filter.active {
  background: rgba(34,197,94,0.12); color: var(--green-light);
  border-color: rgba(34,197,94,0.35);
  box-shadow: 0 0 14px rgba(34,197,94,0.15);
}

/* ---------- CHAT ----------------------------------------------- */
.chat-bubble {
  padding: 12px 16px; border-radius: var(--r-lg);
  font-size: 0.9rem; line-height: 1.65; word-break: break-word;
  animation: fade-up .3s ease forwards;
}
.chat-bubble-user {
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: #000; font-weight: 600;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 20px rgba(34,197,94,0.3);
}
.chat-bubble-assistant {
  background: var(--bg-elevated); border: 1px solid var(--border-md);
  color: var(--text-primary); border-bottom-left-radius: 4px;
}

/* ---------- TYPING DOTS --------------------------------------- */
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); display: inline-block;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

/* ---------- TOAST --------------------------------------------- */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  padding: 12px 20px; border-radius: var(--r-lg);
  font-size: 0.875rem; font-weight: 700; z-index: 9999;
  animation: pop-in .35s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 8px; max-width: 360px;
}
.toast-success { background: linear-gradient(135deg,#15803d,#22c55e); color:#000; border:1px solid rgba(34,197,94,0.4); }
.toast-error   { background: linear-gradient(135deg,#dc2626,#ef4444); color:#fff; border:1px solid rgba(239,68,68,0.4); }
.toast-info    { background: linear-gradient(135deg,#4338ca,#6366f1); color:#fff; border:1px solid rgba(99,102,241,0.4); }

/* ---------- GRADIENT TEXT ------------------------------------- */
.gradient-text {
  background: linear-gradient(135deg, #22c55e, #4ade80, #86efac);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: gradient-x 4s ease infinite;
}
.gradient-text-amber {
  background: linear-gradient(135deg, #f59e0b, #fcd34d);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.gradient-text-purple {
  background: linear-gradient(135deg, #a855f7, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ---------- SCORE RING ---------------------------------------- */
.score-ring-track { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 8; }
.score-ring-fill {
  fill: none; stroke-width: 8; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s cubic-bezier(.4,0,.2,1);
}

/* ---------- EXERCISE OPTION BUTTONS --------------------------- */
.option-btn {
  width: 100%; padding: 14px 18px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border-md); background: var(--bg-elevated);
  color: var(--text-primary); font-size: 0.95rem; text-align: left;
  cursor: pointer; transition: all .18s cubic-bezier(.4,0,.2,1);
  font-family: inherit; font-weight: 500; position: relative; overflow: hidden;
}
.option-btn::after {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--green); transform: scaleY(0); transition: transform .18s;
  border-radius: 0 2px 2px 0;
}
.option-btn:hover:not(:disabled) {
  border-color: rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.06);
  transform: translateX(4px);
}
.option-btn:hover:not(:disabled)::after { transform: scaleY(1); }
.option-btn:disabled { cursor: default; transform: none !important; }
.option-btn.correct {
  border-color: #4ade80 !important; background: rgba(74,222,128,0.1) !important;
  color: #4ade80 !important; animation: correct-flash .6s ease;
}
.option-btn.wrong {
  border-color: #f87171 !important; background: rgba(239,68,68,0.1) !important;
  color: #f87171 !important; animation: wrong-shake .4s ease;
}

/* ---------- FILL INPUT --------------------------------------- */
.fill-input {
  width: 100%; padding: 14px 18px; border-radius: var(--r-lg);
  border: 1.5px solid var(--border-md); background: var(--bg-elevated);
  color: var(--text-primary); font-size: 1.05rem; outline: none;
  font-family: inherit; transition: all .18s; line-height: 1.5;
}
.fill-input::placeholder { color: var(--text-muted); }
.fill-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
  background: var(--bg-card);
}
.fill-input.correct { border-color: #4ade80 !important; background: rgba(74,222,128,0.06) !important; }
.fill-input.wrong   { border-color: #f87171 !important; background: rgba(239,68,68,0.06) !important; animation: wrong-shake .4s ease; }

/* ---------- TOKEN CHIPS --------------------------------------- */
.token-chip {
  display: inline-flex; align-items: center; padding: 9px 16px;
  border-radius: var(--r-md); border: 1.5px solid var(--border-md);
  background: var(--bg-elevated); color: var(--text-primary);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all .15s; animation: token-drop .2s ease forwards;
  user-select: none;
}
.token-chip:hover { border-color: var(--green); background: rgba(34,197,94,0.08); color: var(--green-light); transform: translateY(-2px); }
.token-chip.used   { opacity: 0.22; pointer-events: none; filter: grayscale(1); }

.answer-chip {
  display: inline-flex; align-items: center; padding: 9px 14px;
  border-radius: var(--r-md); border: 1.5px solid rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.08); color: var(--green-light);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all .15s;
}
.answer-chip:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.4); color: #f87171; }

/* ---------- SECTION HEADING ---------------------------------- */
.section-heading {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
  display: flex; align-items: center; gap: 10px;
}
.section-heading::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- VOCAB ROW --------------------------------------- */
.vocab-row { transition: background .12s; cursor: default; }
.vocab-row:hover { background: var(--bg-elevated); }

/* ---------- PRONUNCIATION RING ------------------------------ */
.score-ring-track { fill: none; stroke: var(--border); stroke-width: 8; }
.score-ring-fill  { fill: none; stroke-width: 8; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset .8s ease; }

/* ---------- WAVEFORM ---------------------------------------- */
#waveform-canvas { display: block; }

/* ---------- ANIMATE HELPERS --------------------------------- */
.animate-fade-up  { animation: fade-up .45s ease forwards; }
.animate-scale-in { animation: scale-in .4s ease forwards; }
.animate-fade-in  { animation: fade-in .35s ease forwards; }

/* ---------- RESPONSIVE ---------------------------------------- */
@media (max-width: 640px) {
  .flashcard, .flashcard-face { min-height: 260px; }
  .stat-value { font-size: 1.8rem; }
  .word-of-day { padding: 18px 20px; }
}
