/* =============================================
   ENGLISH UP! — vocabulary.css
   Sistema de vocabulario: banco + práctica
============================================= */

/* ════════════════════════════════════════════
   PAGE LAYOUT
════════════════════════════════════════════ */

.vocab-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  max-width: 960px;
  margin: 0 auto;
  animation: fadeUp var(--duration-slow) var(--ease-spring);
}

/* ════════════════════════════════════════════
   VOCAB PAGE HEADER
════════════════════════════════════════════ */

.vocab-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.vocab-page-title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.vocab-page-title h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
  line-height: 1;
}

.vocab-page-title-icon {
  font-size: var(--text-2xl);
  line-height: 1;
}

.vocab-stats-bar {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.vocab-stat-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
}

.vocab-stat-total   { background: var(--brand-100);  color: var(--brand-700); }
.vocab-stat-learned { background: #dcfce7;            color: var(--green-600); }
.vocab-stat-review  { background: #ffe4e6;            color: #be123c; }

/* ════════════════════════════════════════════
   FILTER & SEARCH BAR
════════════════════════════════════════════ */

.vocab-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.vocab-search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.vocab-search {
  width: 100%;
  padding: var(--sp-2) var(--sp-4) var(--sp-2) var(--sp-9);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-fast);
}

.vocab-search:focus { border-color: var(--color-primary); }

.vocab-search-icon {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--text-sm);
  pointer-events: none;
  opacity: 0.5;
}

.vocab-filter-group {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.vocab-filter-btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
}

.vocab-filter-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.vocab-filter-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ════════════════════════════════════════════
   PRACTICE MODES LAUNCHER
════════════════════════════════════════════ */

.vocab-practice-banner {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--teal-500) 100%);
  border-radius: var(--radius-xl);
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.vocab-practice-banner::before {
  content: "📖";
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 80px;
  opacity: 0.10;
  pointer-events: none;
  line-height: 1;
}

.vocab-practice-banner-text h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--neutral-900);
  margin-bottom: 2px;
}

.vocab-practice-banner-text p {
  font-size: var(--text-sm);
  color: rgba(0,0,0,0.55);
}

.vocab-practice-modes {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.vocab-mode-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-spring);
  font-family: var(--font-body);
}

.vocab-mode-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.vocab-mode-btn:active { transform: scale(0.96); }

.vocab-mode-flashcard { background: var(--neutral-900); color: #fff; }
.vocab-mode-quiz      { background: #fff; color: var(--neutral-900); }
.vocab-mode-type      { background: var(--teal-700); color: #fff; }
.vocab-mode-match     { background: var(--brand-800); color: #fff; }

/* ════════════════════════════════════════════
   VOCABULARY GRID (word cards)
════════════════════════════════════════════ */

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.vocab-word-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-spring),
              box-shadow var(--duration-normal) var(--ease-default),
              border-color var(--duration-normal) var(--ease-default);
  animation: fadeUp var(--duration-normal) var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.vocab-word-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--brand-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.vocab-word-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

.vocab-word-card:hover::before {
  transform: scaleX(1);
}

/* Stagger animation */
.vocab-word-card:nth-child(1)  { animation-delay: 30ms; }
.vocab-word-card:nth-child(2)  { animation-delay: 60ms; }
.vocab-word-card:nth-child(3)  { animation-delay: 90ms; }
.vocab-word-card:nth-child(4)  { animation-delay: 120ms; }
.vocab-word-card:nth-child(5)  { animation-delay: 150ms; }
.vocab-word-card:nth-child(6)  { animation-delay: 180ms; }

/* Part of speech color variants */
.vocab-word-card[data-pos="verb"]        { --card-accent: #14b8a6; }
.vocab-word-card[data-pos="noun"]        { --card-accent: #f59e0b; }
.vocab-word-card[data-pos="adjective"]   { --card-accent: #8b5cf6; }
.vocab-word-card[data-pos="adverb"]      { --card-accent: #ec4899; }
.vocab-word-card[data-pos="phrase"]      { --card-accent: #3b82f6; }
.vocab-word-card[data-pos="expression"]  { --card-accent: #f97316; }
.vocab-word-card[data-pos="grammar"]     { --card-accent: #10b981; }

.vocab-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
}

.vocab-card-word {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1.2;
}

.vocab-card-pron {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
  margin-top: 2px;
}

.vocab-pos-badge {
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.pos-verb       { background: rgba(20,184,166,.15);  color: var(--teal-700); }
.pos-noun       { background: var(--brand-100);       color: var(--brand-700); }
.pos-adjective  { background: #ede9fe;                color: #6d28d9; }
.pos-adverb     { background: #fce7f3;                color: #9d174d; }
.pos-phrase     { background: #dbeafe;                color: #1e40af; }
.pos-expression { background: #ffedd5;                color: #9a3412; }
.pos-grammar    { background: #d1fae5;                color: #065f46; }
.pos-other      { background: var(--neutral-150);     color: var(--neutral-600); }

.vocab-card-definition {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vocab-card-translation {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  background: var(--color-surface-alt);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  width: fit-content;
}

.vocab-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}

.vocab-card-lesson-tag {
  font-size: 10px;
  font-weight: var(--weight-bold);
  color: var(--color-text-faint);
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score ring on card */
.vocab-score-ring {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.vocab-score-ring svg {
  transform: rotate(-90deg);
}

.vocab-score-ring circle {
  fill: none;
  stroke-width: 3;
}

.vocab-ring-bg   { stroke: var(--neutral-150); }
.vocab-ring-fill { stroke: var(--teal-400); transition: stroke-dashoffset 0.6s var(--ease-out); }
.vocab-ring-fill.low  { stroke: var(--rose-400); }
.vocab-ring-fill.mid  { stroke: var(--brand-400); }
.vocab-ring-fill.high { stroke: var(--green-400); }

.vocab-score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: var(--weight-black);
  color: var(--color-text-muted);
}

/* ════════════════════════════════════════════
   WORD DETAIL MODAL
════════════════════════════════════════════ */

.word-detail {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.word-detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  background: linear-gradient(135deg, var(--color-surface-alt), var(--color-surface));
  border-radius: var(--radius-lg);
}

.word-detail-word {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1.1;
  flex: 1;
}

.word-detail-pron {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--sp-1);
}

.word-detail-translation {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--teal-600);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.word-detail-definition {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.word-detail-examples {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.word-detail-example {
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand-50);
  border-left: 3px solid var(--brand-300);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text);
  line-height: var(--leading-snug);
}

.word-detail-progress {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  gap: var(--sp-5);
  align-items: center;
}

.word-progress-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.word-progress-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-text);
}

.word-progress-stat-label {
  font-size: 10px;
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

/* ════════════════════════════════════════════
   PRACTICE ENGINE
════════════════════════════════════════════ */

.practice-screen {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  animation: fadeUp var(--duration-slow) var(--ease-spring);
}

.practice-header {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-soft);
  border-radius: var(--radius-xl);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.practice-mode-icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
  line-height: 1;
}

.practice-meta { flex: 1; min-width: 0; }

.practice-mode-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--sp-1);
}

.practice-progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.practice-progress-track {
  flex: 1;
  height: 6px;
  background: var(--neutral-150);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.practice-progress-fill {
  height: 100%;
  background: var(--brand-500);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

.practice-progress-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ── FLASHCARD ── */

.flashcard-wrap {
  perspective: 1000px;
  min-height: 260px;
  cursor: pointer;
}

.flashcard {
  position: relative;
  width: 100%;
  height: 260px;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-spring);
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-8);
  text-align: center;
}

.flashcard-front {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--teal-500) 100%);
  box-shadow: var(--shadow-xl);
  color: var(--neutral-900);
}

.flashcard-back {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-soft);
  box-shadow: var(--shadow-xl);
  transform: rotateY(180deg);
}

.flashcard-word {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  line-height: 1.1;
}

.flashcard-front .flashcard-word { color: var(--neutral-900); }
.flashcard-back  .flashcard-word { color: var(--color-text); font-size: var(--text-2xl); }

.flashcard-front-hint {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: auto;
}

.flashcard-pron {
  font-size: var(--text-sm);
  color: rgba(0,0,0,0.45);
  font-style: italic;
}

.flashcard-back-def {
  font-size: var(--text-md);
  color: var(--color-text);
  line-height: var(--leading-snug);
  max-width: 400px;
}

.flashcard-back-translation {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--teal-600);
  background: var(--teal-50);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-full);
}

.flashcard-back-example {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  max-width: 380px;
}

.flashcard-result-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.flashcard-result-btn {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-xl);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.flashcard-result-btn:active { transform: scale(0.96); }

.btn-knew-it {
  background: #dcfce7;
  color: var(--green-600);
  border-color: var(--green-400);
}

.btn-knew-it:hover {
  background: #bbf7d0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-didnt-know {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
}

.btn-didnt-know:hover {
  background: #fecdd3;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.flashcard-result-btn small {
  font-size: 10px;
  opacity: 0.7;
  font-weight: var(--weight-bold);
}

/* ── TYPEWRITING ── */

.typewrite-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-soft);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.typewrite-prompt {
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.typewrite-definition {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: var(--leading-snug);
  max-width: 400px;
}

.typewrite-translation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
}

.typewrite-input-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.typewrite-input {
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  padding: var(--sp-4);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.typewrite-input:focus {
  border-color: var(--brand-400);
  box-shadow: var(--shadow-glow-brand);
}

.typewrite-input.correct {
  border-color: var(--green-500);
  background: #f0fdf4;
  color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}

.typewrite-input.wrong {
  border-color: var(--rose-500);
  background: #fff1f2;
  animation: shake 0.4s ease;
}

.typewrite-hint-row {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.typewrite-hint-btn {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.typewrite-hint-btn:hover { color: var(--color-text-muted); background: var(--color-surface-alt); }

.typewrite-hint-text {
  font-size: var(--text-sm);
  font-family: var(--font-display);
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  font-weight: var(--weight-bold);
}

.typewrite-feedback {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  min-height: 20px;
  animation: feedbackIn var(--duration-normal) var(--ease-spring);
}

.typewrite-feedback.correct { color: var(--green-600); }
.typewrite-feedback.wrong   { color: #be123c; }

/* ── MATCHING (practice) ── */

.match-practice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.match-practice-col-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}

.match-practice-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.match-practice-item {
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  text-align: center;
  user-select: none;
  background: var(--color-surface);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-practice-item:hover:not(.matched):not(.disabled) {
  background: var(--brand-50);
  border-color: var(--brand-300);
}

.match-practice-item.selected {
  background: var(--brand-100);
  border-color: var(--brand-500);
  transform: scale(1.03);
  box-shadow: var(--shadow-glow-brand);
}

.match-practice-item.correct {
  background: #dcfce7;
  border-color: var(--green-500);
  color: var(--green-600);
  cursor: default;
}

.match-practice-item.wrong {
  background: #ffe4e6;
  border-color: var(--rose-500);
  color: #be123c;
  animation: shake 0.4s ease;
  cursor: default;
}

.match-practice-item.disabled {
  opacity: 0.4;
  cursor: default;
}

/* ════════════════════════════════════════════
   PRACTICE RESULTS
════════════════════════════════════════════ */

.practice-results {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-soft);
  border-radius: var(--radius-2xl);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  box-shadow: var(--shadow-xl);
  animation: resultsIn var(--duration-slow) var(--ease-spring);
}

@keyframes resultsIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.practice-results-emoji {
  font-size: 64px;
  line-height: 1;
  animation: resultsBounce 0.6s var(--ease-spring) 0.2s both;
}

@keyframes resultsBounce {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.practice-results-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}

.practice-results-score {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.practice-score-big {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: var(--weight-black);
  line-height: 1;
  color: var(--color-primary);
}

.practice-score-suffix {
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  color: var(--color-text-muted);
  text-align: left;
}

.practice-results-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* ════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════ */

.vocab-empty {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  color: var(--color-text-muted);
}

.vocab-empty-icon { font-size: 56px; margin-bottom: var(--sp-4); }
.vocab-empty h3   { font-size: var(--text-xl); margin-bottom: var(--sp-2); color: var(--color-text); }
.vocab-empty p    { font-size: var(--text-sm); max-width: 280px; margin: 0 auto; }

/* ════════════════════════════════════════════
   TEACHER: VOCAB TAB
════════════════════════════════════════════ */

.vocab-teacher-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.vocab-teacher-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.vocab-teacher-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-fast);
  flex-wrap: wrap;
}

.vocab-teacher-row:hover { box-shadow: var(--shadow-sm); }

.vocab-teacher-word {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  min-width: 120px;
}

.vocab-teacher-def {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vocab-teacher-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* Extract modal */
.extract-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-8);
  color: var(--color-text-muted);
}

.extract-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

.extract-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 320px;
  overflow-y: auto;
}

.extract-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-alt);
  transition: background var(--duration-fast);
}

.extract-item.selected-item {
  background: var(--brand-50);
  border-color: var(--brand-300);
}

.extract-item-word {
  font-weight: var(--weight-extrabold);
  font-size: var(--text-sm);
  color: var(--color-text);
  min-width: 100px;
}

.extract-item-def {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
}

/* ════════════════════════════════════════════
   TTS (Text-to-Speech) BUTTON
   Consistent with lesson TTS style
════════════════════════════════════════════ */

.vocab-tts-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: opacity var(--duration-fast) var(--ease-default),
              background var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-spring);
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.vocab-tts-btn:hover {
  opacity: 1;
  background: rgba(245, 158, 11, 0.15);
  transform: scale(1.15);
}

.vocab-tts-btn.speaking {
  opacity: 1;
  background: rgba(20, 184, 166, 0.18);
  animation: vocabTtsSpeak 0.55s ease-in-out infinite alternate;
}

@keyframes vocabTtsSpeak {
  from { transform: scale(1); }
  to   { transform: scale(1.25); }
}

/* TTS button inside the flashcard (larger, centered below word) */
.flashcard-tts-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
}

.flashcard-tts-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: scale(1.1);
}

.flashcard-tts-btn.speaking {
  background: rgba(20, 184, 166, 0.3);
  animation: vocabTtsSpeak 0.55s ease-in-out infinite alternate;
}

/* TTS button in the back of the flashcard */
.flashcard-back .flashcard-tts-btn {
  border-color: var(--color-border);
  background: var(--color-surface-alt);
}

.flashcard-back .flashcard-tts-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
}

/* TTS in word detail modal (medium size) */
.word-detail-tts-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-alt);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-spring);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.word-detail-tts-btn:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  transform: scale(1.08);
}

.word-detail-tts-btn.speaking {
  background: var(--teal-50);
  border-color: var(--teal-400);
  animation: vocabTtsSpeak 0.55s ease-in-out infinite alternate;
}

/* TTS in typewriting mode (below the word prompt) */
.typewrite-tts-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* No print */
@media print {
  .vocab-tts-btn,
  .flashcard-tts-btn,
  .word-detail-tts-btn { display: none !important; }
}

/* ════════════════════════════════════════════
   DARK MODE
════════════════════════════════════════════ */

[data-theme="dark"] .vocab-word-card {
  background:   var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .vocab-word-card:hover { border-color: rgba(245,158,11,.35); }

[data-theme="dark"] .pos-verb       { background: rgba(20,184,166,.15);  color: #2dd4bf; }
[data-theme="dark"] .pos-noun       { background: rgba(245,158,11,.15);  color: var(--brand-400); }
[data-theme="dark"] .pos-adjective  { background: rgba(167,139,250,.15); color: #a78bfa; }
[data-theme="dark"] .pos-adverb     { background: rgba(236,72,153,.15);  color: #f472b6; }
[data-theme="dark"] .pos-phrase     { background: rgba(59,130,246,.15);  color: #60a5fa; }
[data-theme="dark"] .pos-expression { background: rgba(249,115,22,.15);  color: #fb923c; }
[data-theme="dark"] .pos-grammar    { background: rgba(16,185,129,.15);  color: #34d399; }

[data-theme="dark"] .flashcard-front { box-shadow: var(--shadow-xl); }
[data-theme="dark"] .flashcard-back  { background: var(--color-surface); border-color: var(--color-border); }

[data-theme="dark"] .typewrite-input {
  background:   var(--color-surface-alt);
  border-color: var(--color-border);
  color:        var(--color-text);
}

[data-theme="dark"] .match-practice-item {
  background:   var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .match-practice-item:hover:not(.matched):not(.disabled) {
  background:   rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.4);
}

[data-theme="dark"] .word-detail-example {
  background:  rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3);
}

[data-theme="dark"] .vocab-ring-bg { stroke: var(--color-border); }

/* Valentine skin */
[data-skin="valentine"] .vocab-practice-banner {
  background: linear-gradient(135deg, #e91e8c, #ff6b9d);
}
[data-skin="valentine"] .vocab-mode-flashcard { background: #c2177a; }
[data-skin="valentine"] .vocab-mode-type      { background: #fce4f3; color: #c2177a; }
[data-skin="valentine"] .vocab-mode-match     { background: #fff; color: #c2177a; }
[data-skin="valentine"] .flashcard-front {
  background: linear-gradient(135deg, #e91e8c, #ff6b9d);
}
[data-skin="valentine"] .match-practice-item.selected { box-shadow: var(--shadow-glow-brand); }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */

@media (max-width: 600px) {
  .vocab-grid           { grid-template-columns: 1fr; }
  .match-practice-grid  { grid-template-columns: 1fr; }
  .flashcard            { height: 220px; }
  .practice-results     { padding: var(--sp-8) var(--sp-5); }
  .vocab-practice-modes { gap: var(--sp-1); }
  .vocab-mode-btn       { padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs); }
  .flashcard-result-buttons { gap: var(--sp-2); }
}