/* ============================================================
   Design tokens
============================================================ */
:root {
  --bg: #f5f4ff;
  --bg-tint: #eeebff;
  --surface: #ffffff;
  --surface-2: #fbfbff;
  --text: #1f1d3a;
  --text-soft: #4a4770;
  --muted: #8a8aa8;
  --primary: #6c5ce7;
  --primary-dark: #5546c9;
  --primary-soft: #efecff;
  --accent: #ffd93d;
  --success: #10b981;
  --success-soft: #e6f9f2;
  --danger: #ef4761;
  --danger-soft: #fdecef;
  --border: #ebeaf5;
  --border-strong: #d9d7ea;
  --shadow-sm: 0 1px 2px rgba(31, 29, 58, 0.04), 0 1px 3px rgba(31, 29, 58, 0.06);
  --shadow-md: 0 4px 12px rgba(31, 29, 58, 0.07), 0 2px 4px rgba(31, 29, 58, 0.05);
  --shadow-lg: 0 16px 32px rgba(31, 29, 58, 0.1), 0 4px 8px rgba(31, 29, 58, 0.06);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
  --font-greek: "GFS Didot", "Gentium Plus", "Old Standard TT",
    "Cardo", "Palatino Linotype", "Book Antiqua", Palatino, serif;

  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(108, 92, 231, 0.08), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(255, 217, 61, 0.08), transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.5;
  padding: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ============================================================
   Accessibility utilities
============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--primary);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
  font-size: 14px;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: calc(8px + env(safe-area-inset-top));
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

button:focus-visible,
.chapter-pill:focus-visible,
.list-tab:focus-visible,
.subject-btn:focus-visible {
  outline-offset: 3px;
}

/* ============================================================
   Greek text
============================================================ */
.greek {
  font-family: var(--font-greek);
  font-feature-settings: "kern" 1, "liga" 1;
  letter-spacing: 0;
}

/* Boost reading size for Greek polytonic */
.face-text.greek {
  font-size: clamp(28px, 6.5vw, 44px);
  line-height: 1.3;
}

.word-table .col-term.greek {
  font-size: 17px;
  line-height: 1.4;
}

.learn-prompt.greek {
  font-size: clamp(24px, 5.5vw, 34px);
}

.choice-btn.greek {
  font-family: var(--font-greek);
  font-size: 17px;
}

/* ============================================================
   Top bar
============================================================ */
.topbar {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(10px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
    0 max(14px, env(safe-area-inset-left));
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-row--top {
  margin-bottom: 8px;
}

.brand {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 22px;
  filter: drop-shadow(0 1px 2px rgba(108, 92, 231, 0.3));
}

.subject-switch {
  display: inline-flex;
  background: var(--bg-tint);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}

.subject-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  min-height: 32px;
}

.subject-btn:hover {
  color: var(--text);
}

.subject-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.subject-icon {
  font-size: 14px;
}

.modes {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
  margin: 0 -4px;
}

.modes::-webkit-scrollbar {
  display: none;
}

.mode-btn {
  background: transparent;
  border: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
  scroll-snap-align: start;
  transition: all 0.2s var(--ease);
}

.mode-btn:hover {
  color: var(--text);
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}

/* ============================================================
   Layout
============================================================ */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right))
    calc(96px + env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

@media (min-width: 700px) {
  main {
    padding: 28px 24px 64px;
  }
  .topbar {
    padding: calc(18px + env(safe-area-inset-top)) 24px 0;
  }
  .brand {
    font-size: 20px;
  }
  .modes {
    margin-bottom: 14px;
  }
}

/* ============================================================
   Cards / panels
============================================================ */
.practice-panel,
.setup,
.learn-card,
.list-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

@media (min-width: 700px) {
  .practice-panel,
  .setup,
  .learn-card,
  .list-container {
    padding: 28px;
  }
}

.panel-title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* ============================================================
   Setup blocks
============================================================ */
.setup-block {
  margin-bottom: 20px;
}

.setup-block:last-child {
  margin-bottom: 0;
}

.setup-block-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
}

.setup-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ============================================================
   Chapter pills
============================================================ */
.chapter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chapter-pill {
  background: var(--bg-tint);
  border: 2px solid transparent;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s var(--ease);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.chapter-pill:hover {
  border-color: var(--primary);
  color: var(--text);
}

.chapter-pill:active {
  transform: scale(0.97);
}

.chapter-pill.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.chapter-pill .count {
  opacity: 0.7;
  font-weight: 500;
  margin-left: 6px;
  font-size: 12px;
}

/* ============================================================
   Toggles
============================================================ */
.direction-toggle {
  display: inline-flex;
  background: var(--bg-tint);
  padding: 4px;
  border-radius: 12px;
  gap: 2px;
  flex-wrap: wrap;
}

.dir-btn {
  background: transparent;
  border: none;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 9px;
  transition: all 0.15s var(--ease);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dir-btn:hover {
  color: var(--text);
}

.dir-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.dir-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dir-btn:disabled:hover {
  color: var(--muted);
}

/* ============================================================
   Buttons
============================================================ */
.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

.primary-btn:disabled {
  background: var(--border-strong);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.primary-btn.big {
  font-size: 16px;
  padding: 16px 28px;
  width: 100%;
  min-height: 56px;
}

.btn-count {
  font-weight: 500;
  opacity: 0.85;
}

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all 0.15s var(--ease);
  min-height: 40px;
}

.ghost-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ghost-btn.big {
  width: 100%;
  font-size: 15px;
  padding: 14px 22px;
  min-height: 52px;
}

/* ============================================================
   Setup row
============================================================ */
.setup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.setup-row:last-of-type {
  margin-bottom: 0;
}

.setup-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-width: 90px;
}

.shuffle-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.shuffle-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.status {
  margin-top: 14px;
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ============================================================
   Views
============================================================ */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: viewIn 0.3s var(--ease);
}

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

/* ============================================================
   Practice — active
============================================================ */
.practice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.practice-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.practice-progress strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.practice-progress .dot {
  color: var(--border-strong);
}

.ok { color: var(--success) !important; }
.bad { color: var(--danger) !important; }

.progress-bar {
  height: 6px;
  background: var(--bg-tint);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

/* ============================================================
   Flashcard
============================================================ */
.card-stage {
  perspective: 1500px;
  margin-bottom: 18px;
}

.flashcard {
  width: 100%;
  aspect-ratio: 3 / 2;
  min-height: 240px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

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

.flashcard.flipped .flashcard-inner {
  transform: rotateX(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
}

.flashcard-back {
  transform: rotateX(180deg);
  background: linear-gradient(135deg, #ffffff, var(--primary-soft));
}

.face-label {
  position: absolute;
  top: 14px;
  left: 18px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.face-text {
  font-size: clamp(26px, 6vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
  word-break: break-word;
}

.face-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   Grade controls
============================================================ */
.grade-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  animation: gradeIn 0.25s var(--ease);
}

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

.grade-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 10px;
  border-radius: var(--radius);
  border: 2px solid;
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s var(--ease);
  min-height: 84px;
}

.grade-btn:hover {
  transform: translateY(-2px);
}

.grade-btn:active {
  transform: translateY(0) scale(0.97);
}

.grade-icon {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
}

.grade-hint {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}

.grade-wrong {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.grade-correct {
  color: var(--success);
  border-color: var(--success);
  background: var(--success-soft);
}

/* ============================================================
   Practice — type method
============================================================ */
.type-area {
  margin-top: 16px;
  animation: gradeIn 0.25s var(--ease);
}

.type-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.type-input-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-strong);
  font-size: 16px;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  min-height: 50px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.type-input-row input:focus {
  border-color: var(--primary);
}

.type-input-row input.correct {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.type-input-row input.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.type-input-row .primary-btn {
  margin: 0;
  padding: 13px 22px;
}

.type-feedback {
  margin-top: 14px;
  min-height: 22px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.type-feedback.correct { color: var(--success); }
.type-feedback.wrong { color: var(--danger); }

.type-feedback .correct-answer {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.type-feedback .label {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  margin-right: 4px;
}

/* ============================================================
   Practice — done
============================================================ */
.done-panel {
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--primary-soft), var(--surface) 50%);
}

.done-emoji {
  font-size: 56px;
  animation: bounce 1s var(--ease) infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0) rotate(-6deg); }
  to { transform: translateY(-10px) rotate(6deg); }
}

.done-title {
  margin: 8px 0 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.done-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
}

.done-gif-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 20px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-tint);
  max-width: 360px;
  aspect-ratio: 4 / 3;
  align-items: center;
  position: relative;
}

.done-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
}

.gif-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-tint) 0%, #e3dffa 50%, var(--bg-tint) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  z-index: 1;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.done-gif-wrap.loaded .gif-skeleton {
  display: none;
}

.done-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.done-stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.done-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.done-stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.done-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 500px) {
  .done-title { font-size: 32px; }
  .done-stat-value { font-size: 28px; }
}

/* Confetti */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: translateY(110vh) rotate(720deg);
  }
}

.done-panel > *:not(.confetti) {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Card controls (flashcards mode)
============================================================ */
.card-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--text-soft);
  transition: all 0.15s var(--ease);
}

.nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.card-position {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  min-width: 64px;
  text-align: center;
}

.keyboard-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
  margin-bottom: 0;
}

kbd {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 11px;
  box-shadow: 0 1px 0 var(--border-strong);
}

@media (max-width: 480px) {
  .keyboard-hint {
    display: none;
  }
}

/* ============================================================
   Learn / Type (eenvoudige modi)
============================================================ */
.learn-prompt {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  text-align: center;
  padding: 22px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.learn-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 480px) {
  .learn-choices {
    grid-template-columns: 1fr;
  }
}

.choice-btn {
  background: var(--bg-tint);
  border: 2px solid transparent;
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  transition: all 0.1s var(--ease);
  min-height: 56px;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn.correct {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.choice-btn.wrong {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.learn-feedback {
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: 24px;
}

.learn-feedback.correct { color: var(--success); }
.learn-feedback.wrong { color: var(--danger); }

.type-form {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.type-form input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border-strong);
  font-size: 16px;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  min-height: 50px;
}

.type-form input:focus {
  border-color: var(--primary);
}

.type-form .primary-btn {
  margin: 0;
}

.learn-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

.learn-stats strong {
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   List mode
============================================================ */
.list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.list-tab {
  background: var(--surface);
  border: 1.5px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s var(--ease);
  min-height: 40px;
}

.list-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.list-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.35);
}

.list-tab .count {
  opacity: 0.7;
  font-weight: 500;
  margin-left: 6px;
  font-size: 12px;
}

.list-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.list-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.list-count {
  font-size: 13px;
  color: var(--muted);
}

.word-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.word-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.word-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.word-table tr:last-child td {
  border-bottom: none;
}

.word-table tr:hover td {
  background: var(--bg-tint);
}

.word-table .col-num {
  width: 36px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.word-table .col-term {
  font-weight: 700;
  width: 42%;
  color: var(--text);
}

.word-table .col-translation {
  color: var(--text-soft);
}

@media (max-width: 480px) {
  .word-table {
    font-size: 14px;
  }
  .word-table th,
  .word-table td {
    padding: 9px 8px;
  }
  .word-table .col-num {
    display: none;
  }
}

/* ============================================================
   Empty state
============================================================ */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
  font-size: 14px;
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.6;
}

/* ============================================================
   Reduced motion
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .confetti { display: none; }
  .gif-skeleton { animation: none; }
  .done-emoji { animation: none; }
}
