/* ── RESET + FONTS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* palette */
  --bg:         #080e0b;
  --surface:    #0d1610;
  --surface-2:  #131f16;
  --border:     rgba(255,255,255,0.07);
  --border-md:  rgba(255,255,255,0.13);

  /* accent */
  --accent:     #00f07a;
  --accent-dim: rgba(0,240,122,0.1);
  --accent-glow:0 0 28px rgba(0,240,122,0.25);

  /* text */
  --text:       #e8f0eb;
  --muted:      rgba(232,240,235,0.42);

  /* utility */
  --gold:       #f5c518;
  --rad:        14px;
  --rad-lg:     20px;
  --rad-sm:     10px;
  --shadow:     0 4px 28px rgba(0,0,0,.5);
  --shadow-h:   0 8px 44px rgba(0,0,0,.7);
  --nav-h:      68px;
  --hdr-h:      70px;

  /* category colors */
  --c-pos: #4ade80;
  --c-pit: #f87171;
  --c-day: #fb923c;
  --c-tac: #60a5fa;
  --c-tr:  #a78bfa;
  --c-soc: #f472b6;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: var(--nav-h);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   HEADER
───────────────────────────────────────── */
.hdr {
  background: rgba(13,22,16,0.92);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: var(--hdr-h);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.hdr-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hdr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hdr-ball {
  font-size: 1.9rem;
  filter: drop-shadow(0 0 10px rgba(0,240,122,0.45));
  background: none;
  border: none;
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  transition: filter .2s, transform .15s;
  line-height: 1;
  flex-shrink: 0;
}
.hdr-ball:hover {
  filter: drop-shadow(0 0 16px rgba(0,240,122,0.75));
  transform: scale(1.12);
}
.hdr-ball:active { transform: scale(0.93); }
.hdr-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.15rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.brand-u {
  color: var(--accent);
  font-weight: 300;
  text-shadow: 0 0 18px rgba(0,240,122,0.45);
}
.hdr-sub { display: none; }

/* language selectors */
.lang-selectors {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ls-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ls-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
/* custom language pill button */
.ls-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad-sm);
  color: var(--text);
  padding: 7px 11px;
  font-family: 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 138px;
  transition: border-color .18s, background .18s, box-shadow .18s;
  text-align: left;
}
.ls-btn:hover {
  border-color: var(--accent);
  background: rgba(0,240,122,0.05);
  box-shadow: 0 0 0 2px rgba(0,240,122,0.1);
}
.ls-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,240,122,0.2);
}
.ls-btn span:first-child { font-size: 1rem; flex-shrink: 0; }
.ls-btn span:nth-child(2) { flex: 1; }
.ls-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .2s;
}
.ls-btn:hover .ls-chevron { color: var(--accent); }

/* ── Language Picker Sheet ── */
.lp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInOverlay .18s ease;
}
.lp-sheet {
  background: #0d1a10;
  border: 1px solid rgba(255,255,255,0.09);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 480px;
  padding-bottom: 32px;
  animation: slideUp .28s cubic-bezier(.22,1,.36,1);
}
.lp-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  margin: 12px auto 0;
}
.lp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.lp-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.lp-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 30px; height: 30px;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.lp-close:hover { background: rgba(255,255,255,0.13); color: var(--text); }
.lp-list {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 0;
  gap: 2px;
}
.lp-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border-radius: var(--rad-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background .15s;
}
.lp-item:hover:not(.lp-locked) {
  background: rgba(255,255,255,0.05);
}
.lp-item.lp-active {
  background: rgba(0,240,122,0.07);
}
.lp-item.lp-locked { opacity: 0.55; cursor: pointer; }
.lp-flag { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.lp-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.lp-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}
.lp-item.lp-active .lp-name { color: var(--accent); }
.lp-native {
  font-size: 0.72rem;
  color: var(--muted);
}
.lp-right {
  display: flex; align-items: center; justify-content: flex-end;
  flex-shrink: 0;
  min-width: 24px;
}
.lp-check-icon { display: block; }
.lp-pro-tag {
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.3);
  color: #a78bfa;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 100px;
}

.swap-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad-sm);
  color: var(--muted);
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 18px;
  transition: color .18s, border-color .18s, transform .4s;
}
.swap-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: rotate(180deg);
}

/* ─────────────────────────────────────────
   CATEGORY BAR
───────────────────────────────────────── */
.cat-bar {
  background: rgba(13,22,16,0.92);
  border-bottom: 1px solid var(--border);
  padding: 9px 20px;
  position: sticky;
  top: var(--hdr-h);
  z-index: 30;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.cat-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  background: transparent;
  border: 1px solid var(--border-md);
  border-radius: 100px;
  color: var(--muted);
  padding: 5px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s;
}
.cat-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}
.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #080e0b;
  font-weight: 700;
}

/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */
#main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

/* ─────────────────────────────────────────
   BROWSE
───────────────────────────────────────── */
.browse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.browse-count {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.bcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-md);
  border-radius: var(--rad);
  padding: 17px 19px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .18s, box-shadow .18s;
}
.bcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.bcard[data-cat="positions"] { border-left-color: var(--c-pos); }
.bcard[data-cat="onpitch"]   { border-left-color: var(--c-pit); }
.bcard[data-cat="matchday"]  { border-left-color: var(--c-day); }
.bcard[data-cat="tactics"]   { border-left-color: var(--c-tac); }
.bcard[data-cat="transfer"]  { border-left-color: var(--c-tr);  }
.bcard[data-cat="social"]    { border-left-color: var(--c-soc); }

.bcard-mastered {
  margin-left: auto;
  background: rgba(0,240,122,0.15);
  color: var(--accent);
  border: 1px solid rgba(0,240,122,0.35);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.bcard-top { display: flex; align-items: center; gap: 10px; }
.bcard-emoji { font-size: 1.45rem; line-height: 1; }
.bcard-cat {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  padding: 3px 8px;
  border-radius: 6px;
}
.bcard-from {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.bcard-div { height: 1px; background: var(--border); }
.bcard-to {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
.bcard-lang {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: -6px;
}
.bcard-ctx {
  font-size: 0.74rem;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: -2px;
  line-height: 1.55;
}

/* ─────────────────────────────────────────
   FLASHCARDS
───────────────────────────────────────── */
.fc-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.fc-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: .83rem;
}
.fc-progress-bar {
  width: 180px; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}
.fc-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .3s;
  box-shadow: 0 0 8px rgba(0,240,122,0.5);
}

.fc-card-wrap {
  width: 100%; max-width: 500px; height: 300px;
  perspective: 1200px;
  cursor: pointer;
}
.fc-card-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.fc-card-inner.flipped { transform: rotateY(180deg); }

.fc-face {
  position: absolute; inset: 0;
  border-radius: var(--rad-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 28px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fc-front {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  box-shadow: var(--shadow);
}
.fc-back {
  background: linear-gradient(145deg, #031a0b 0%, #072d12 100%);
  border: 1.5px solid var(--accent);
  box-shadow: var(--accent-glow), var(--shadow);
  transform: rotateY(180deg);
}

.fc-face-emoji { font-size: 2.8rem; }
.fc-lang-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.fc-term {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}
.fc-front .fc-term { color: var(--text); }
.fc-back  .fc-term { color: var(--accent); }

.fc-pron {
  font-size: .8rem;
  font-style: italic;
  text-align: center;
  color: rgba(0,240,122,0.55);
}
.fc-ctx {
  font-size: .75rem;
  text-align: center;
  max-width: 340px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}
.fc-hint { font-size: .74rem; color: var(--muted); font-style: italic; }

.fc-nav { display: flex; align-items: center; gap: 14px; }
.fc-nav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .86rem;
  font-weight: 700;
  padding: 10px 22px;
  cursor: pointer;
  transition: all .18s;
}
.fc-nav-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #080e0b;
  box-shadow: var(--accent-glow);
}
.fc-nav-btn:disabled { opacity: .22; cursor: not-allowed; }
.fc-counter {
  font-size: .84rem;
  color: var(--muted);
  min-width: 52px;
  text-align: center;
}
.fc-tip { font-size: .74rem; color: var(--muted); text-align: center; }

/* ─────────────────────────────────────────
   QUIZ
───────────────────────────────────────── */
.quiz-wrap {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.quiz-scores { display: flex; gap: 12px; justify-content: center; }
.q-score-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 11px 20px;
  text-align: center;
  min-width: 74px;
}
.q-score-label {
  font-size: .62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
}
.q-score-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 2px;
}
.q-score-val.qcorrect { color: #4ade80; }
.q-score-val.qwrong   { color: #f87171; }
.q-score-val.qnum     { color: var(--accent); }

.quiz-qcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  padding: 28px 26px;
  text-align: center;
}
.quiz-qcat {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: 8px;
}
.quiz-emoji { font-size: 2.2rem; margin-bottom: 8px; }
.quiz-qterm {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
}
.quiz-qprompt {
  font-size: .79rem;
  color: var(--muted);
  margin-top: 6px;
}

.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-opt {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  line-height: 1.3;
}
.q-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.q-opt.q-correct {
  background: rgba(74,222,128,0.12);
  border-color: #4ade80;
  color: #4ade80;
}
.q-opt.q-wrong {
  background: rgba(248,113,113,0.12);
  border-color: #f87171;
  color: #f87171;
}
.q-opt:disabled { cursor: default; }

.quiz-feedback {
  text-align: center;
  padding: 11px 16px;
  border-radius: var(--rad-sm);
  font-weight: 700;
  font-size: .87rem;
  min-height: 24px;
}
.quiz-feedback.fb-correct {
  background: rgba(74,222,128,0.09);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.22);
}
.quiz-feedback.fb-wrong {
  background: rgba(248,113,113,0.09);
  color: #f87171;
  border: 1px solid rgba(248,113,113,0.22);
}

.quiz-next-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: .93rem;
  font-weight: 800;
  padding: 13px 28px;
  cursor: pointer;
  align-self: center;
  transition: all .18s;
}
.quiz-next-btn:hover {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}

.quiz-results {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 20px;
}
.qr-emoji { font-size: 4.5rem; }
.qr-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: var(--accent-glow);
}
.qr-pct   { font-size: .95rem; color: var(--muted); }
.qr-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text);
}
.qr-restart {
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: .98rem;
  font-weight: 800;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: all .18s;
}
.qr-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0,240,122,0.45);
}

/* ─────────────────────────────────────────
   IN CONTEXT
───────────────────────────────────────── */
.ctx-wrap {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ctx-streak {
  text-align: center;
  font-size: .84rem;
  font-weight: 700;
  color: var(--muted);
}
.ctx-streak span { color: var(--gold); font-size: 1.05rem; }

.ctx-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  padding: 26px 24px;
}
.ctx-scenario {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--accent);
  margin-bottom: 10px;
}
.ctx-sentence {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 16px;
}
.ctx-sentence b {
  color: #080e0b;
  background: var(--accent);
  padding: 0 5px;
  border-radius: 5px;
  font-weight: 800;
}
.ctx-prompt {
  font-size: .79rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.ctx-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 14px;
}
.ctx-opt {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--rad);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  padding: 13px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  line-height: 1.3;
}
.ctx-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.ctx-opt.ctx-correct {
  background: rgba(74,222,128,0.12);
  border-color: #4ade80;
  color: #4ade80;
}
.ctx-opt.ctx-wrong {
  background: rgba(248,113,113,0.12);
  border-color: #f87171;
  color: #f87171;
}
.ctx-opt:disabled { cursor: default; }

.ctx-feedback {
  font-size: .87rem;
  font-weight: 700;
  min-height: 20px;
  color: var(--text);
  margin-bottom: 8px;
}
.ctx-ctx-note {
  font-size: .77rem;
  color: var(--muted);
  font-style: italic;
  min-height: 20px;
}
.ctx-next-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: .91rem;
  font-weight: 800;
  padding: 13px 28px;
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
  transition: all .18s;
}
.ctx-next-btn:hover { box-shadow: var(--accent-glow); }

/* proceed button — auto width, used inside ctx preview */
.ctx-proceed-btn { width: auto; display: inline-block; padding: 13px 32px; }

.ctx-preview-hint {
  text-align: center;
  font-size: 0.79rem;
  color: var(--muted);
  font-style: italic;
}

/* ctx preview: center the flashcard */
.ctx-preview-card {
  max-width: 480px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────
   BOTTOM MODE NAV
───────────────────────────────────────── */
.mode-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(10,17,13,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.mode-nav-inner {
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: stretch;
}
.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  transition: color .18s;
  padding: 0;
  position: relative;
}
.mode-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
  transition: width .25s cubic-bezier(.4,0,.2,1);
}
.mode-btn.active { color: var(--accent); }
.mode-btn.active::before { width: 32px; }
.mode-btn:hover:not(.active) { color: rgba(232,240,235,0.7); }

.mode-icon  { font-size: 1.2rem; line-height: 1; }
.mode-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 20px;
  color: var(--muted);
}
.empty-state-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; }

/* ─────────────────────────────────────────
   SPEAK BUTTON
───────────────────────────────────────── */
.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.42;
  transition: opacity .15s, transform .15s;
  vertical-align: middle;
  flex-shrink: 0;
}
.speak-btn:hover { opacity: 1; transform: scale(1.12); }

@keyframes pulse-speak {
  0%   { box-shadow: 0 0 0 0   rgba(0,240,122,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0,240,122,0);    }
  100% { box-shadow: 0 0 0 0   rgba(0,240,122,0);    }
}
.speak-btn.speaking {
  opacity: 1;
  animation: pulse-speak 0.8s ease infinite;
}

.bcard    .speak-btn  { color: var(--accent);  border-color: var(--accent); }
.fc-speak             { color: rgba(232,240,235,0.6); border-color: rgba(232,240,235,0.3); }
.fc-speak-back        { color: var(--accent);  border-color: var(--accent); }
.quiz-speak           { color: var(--muted);   border-color: var(--muted); width: 26px; height: 26px; font-size: 0.74rem; }

/* ─────────────────────────────────────────
   STREAK BADGE (header)
───────────────────────────────────────── */
#streakBadge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 62px;
  flex-shrink: 0;
}
.streak-flame {
  font-size: 3.6rem;
  line-height: 1;
  display: block;
  filter:
    drop-shadow(0 0 10px rgba(251,146,60,0.85))
    drop-shadow(0 0 22px rgba(251,146,60,0.4));
}
.streak-num {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px;
  white-space: nowrap;
  pointer-events: none;
  /* dark pill backdrop so the number always pops */
  background: rgba(0,0,0,0.52);
  padding: 1px 6px 2px;
  border-radius: 6px;
  text-shadow:
    0 1px 3px rgba(0,0,0,0.9),
    0 0 8px rgba(0,0,0,0.7);
}

/* ─────────────────────────────────────────
   COURSE HOME
───────────────────────────────────────── */
.course-home {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.course-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cs-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.cs-big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.cs-label {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Pro Banner ─── */
.pro-banner {
  background: linear-gradient(135deg, rgba(0,240,122,0.08) 0%, rgba(0,240,122,0.03) 100%);
  border: 1px solid rgba(0,240,122,0.25);
  border-radius: var(--rad);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.pro-banner:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0,240,122,0.12);
}
.pro-banner strong {
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
}
.pro-banner p {
  font-size: 0.75rem;
  color: var(--muted);
}
.pro-banner-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad-sm);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: box-shadow .2s, transform .15s;
}
.pro-banner-btn:hover {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}

.pro-badge {
  background: rgba(0,240,122,0.08);
  border: 1px solid rgba(0,240,122,0.2);
  border-radius: var(--rad-sm);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 16px;
  text-align: center;
}

/* ─── Lessons List ─── */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lesson-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}
.lesson-card:hover:not(.lesson-locked) {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(0,240,122,0.1);
  transform: translateY(-1px);
}
.lesson-locked {
  opacity: 0.55;
  cursor: pointer;
}
.lesson-card-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lesson-card-right {
  flex-shrink: 0;
}
.lesson-num {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.lesson-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-meta {
  font-size: 0.72rem;
  color: var(--muted);
}
.lesson-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.lesson-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.lesson-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .4s;
  box-shadow: 0 0 6px rgba(0,240,122,0.4);
}
.lesson-pct {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}
.lesson-lock-icon { font-size: 1.2rem; }
.lesson-start-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad-sm);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 16px;
  cursor: pointer;
  transition: box-shadow .18s, transform .15s;
  white-space: nowrap;
}
.lesson-start-btn:hover {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   COURSE LESSON (intro + practice shell)
───────────────────────────────────────── */
.course-lesson {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.course-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.course-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  overflow: hidden;
}
.course-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px rgba(0,240,122,0.5);
}
.course-progress-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.course-back-btn {
  background: transparent;
  border: 1px solid var(--border-md);
  border-radius: 50%;
  color: var(--muted);
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.course-back-btn:hover { color: var(--text); border-color: var(--border-md); }

.course-phase-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  text-align: center;
}

/* "Got it" button inside intro phase */
.course-got-it-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 14px 36px;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}
.course-got-it-btn:hover {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────
   LISTEN PLAY CARD
───────────────────────────────────────── */
.listen-play-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.listen-play-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #080e0b;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .2s, transform .15s;
  box-shadow: 0 0 24px rgba(0,240,122,0.3);
}
.listen-play-btn:hover {
  box-shadow: 0 0 40px rgba(0,240,122,0.55);
  transform: scale(1.06);
}
.listen-play-hint {
  font-size: 0.84rem;
  color: var(--text);
  font-weight: 500;
}
.listen-play-sub {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   COURSE OPTIONS (used in listen + practice)
───────────────────────────────────────── */
.course-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.course-opt {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 15px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  line-height: 1.3;
}
.course-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.course-opt.course-correct {
  background: rgba(74,222,128,0.14);
  border-color: #4ade80;
  color: #4ade80;
}
.course-opt.course-wrong {
  background: rgba(248,113,113,0.14);
  border-color: #f87171;
  color: #f87171;
}
.course-opt:disabled { cursor: default; }

/* ─── Feedback strip ─── */
.course-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--rad-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}
.course-feedback.course-fb-correct {
  background: rgba(74,222,128,0.09);
  border: 1px solid rgba(74,222,128,0.22);
  color: #4ade80;
}
.course-feedback.course-fb-wrong {
  background: rgba(248,113,113,0.09);
  border: 1px solid rgba(248,113,113,0.22);
  color: #f87171;
}
.course-fb-icon { font-size: 1.1rem; flex-shrink: 0; }
.course-fb-note {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
}

/* Continue button (wrong answer / listen) */
.course-continue-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 28px;
  cursor: pointer;
  text-align: center;
  width: 100%;
  transition: border-color .18s, background .18s;
}
.course-continue-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── Quiz term card inside course ─── */
.course-quiz-term-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-lg);
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cq-emoji { font-size: 2.4rem; }
.cq-term {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.cq-prompt {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─────────────────────────────────────────
   COURSE COMPLETE
───────────────────────────────────────── */
.course-complete {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 20px 60px;
  text-align: center;
}
.cc-confetti { font-size: 3rem; }
.cc-emoji    { font-size: 4rem; }
.cc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
}
.cc-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: var(--accent-glow);
  line-height: 1;
}
.cc-score span { font-size: 1.6rem; color: var(--muted); }
.cc-pct   { font-size: 0.9rem; color: var(--muted); }
.cc-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.cc-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
}
.cc-next-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #080e0b;
  font-family: 'Inter', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  padding: 15px 28px;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  box-shadow: var(--accent-glow);
}
.cc-next-btn:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(0,240,122,0.5); }
.cc-pro-btn {
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  box-shadow: 0 0 20px rgba(167,139,250,0.35);
}
.cc-pro-btn:hover { box-shadow: 0 0 36px rgba(167,139,250,0.55); }
.cc-home-btn {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 28px;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.cc-home-btn:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.cc-retry-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
  transition: color .15s;
}
.cc-retry-btn:hover { color: var(--text); }

/* ─────────────────────────────────────────
   PRO MODAL
───────────────────────────────────────── */
.pro-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInOverlay .22s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pro-modal {
  background: #0f1a12;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-width: 520px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  animation: slideUp .32s cubic-bezier(.22,1,.36,1);
}
@keyframes slideUp {
  from { transform: translateY(80px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close button ── */
.pro-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 34px; height: 34px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.pro-modal-close:hover {
  background: rgba(255,255,255,0.14);
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
}

/* ── Header section ── */
.pro-modal-header {
  background: linear-gradient(160deg, #0d2218 0%, #0a1a10 100%);
  border-bottom: 1px solid rgba(0,240,122,0.1);
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.pro-modal-pill {
  background: var(--accent);
  color: #060e09;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 4px;
}
.pro-modal-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
}
.pro-modal-tagline {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  max-width: 260px;
  line-height: 1.5;
}

/* ── Pricing ── */
.pro-modal-pricing {
  padding: 22px 28px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pro-modal-price-row {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  line-height: 1;
}
.pro-price-dollar {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 6px;
}
.pro-price-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.pro-price-period {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  align-self: flex-end;
  margin-bottom: 6px;
  margin-left: 2px;
}
.pro-price-note {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

/* ── Feature list ── */
.pro-modal-features {
  list-style: none;
  padding: 20px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.pro-modal-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.pro-modal-features li::before {
  content: '';
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,240,122,0.15);
  border: 1.5px solid rgba(0,240,122,0.4);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='%2300f07a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Primary CTA ── */
.pro-modal-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 22px 28px 0;
  padding: 16px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--rad);
  color: #060e09;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  box-shadow: 0 0 32px rgba(0,240,122,0.28);
}
.pro-modal-cta:hover {
  box-shadow: 0 0 48px rgba(0,240,122,0.45);
  transform: translateY(-1px);
}
.pro-modal-cta svg { flex-shrink: 0; }

/* ── "Already have a key" divider ── */
.pro-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 28px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.pro-modal-divider::before,
.pro-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ── Key entry ── */
.pro-modal-key-row {
  display: flex;
  gap: 8px;
  padding: 12px 28px 0;
}
.pro-modal-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--rad-sm);
  color: var(--text);
  font-family: 'Space Grotesk', monospace;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .18s, background .18s;
}
.pro-modal-input:focus {
  border-color: rgba(0,240,122,0.4);
  background: rgba(0,240,122,0.04);
}
.pro-modal-input::placeholder {
  color: rgba(232,240,235,0.25);
  font-weight: 400;
  letter-spacing: 0;
}
.pro-modal-btn {
  background: rgba(0,240,122,0.12);
  border: 1px solid rgba(0,240,122,0.25);
  border-radius: var(--rad-sm);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.pro-modal-btn:hover {
  background: rgba(0,240,122,0.2);
  border-color: rgba(0,240,122,0.4);
  box-shadow: 0 0 16px rgba(0,240,122,0.2);
}

/* ── Footer note ── */
.pro-modal-note {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  padding: 10px 28px 32px;
  line-height: 1.6;
}
.pro-modal-note code {
  background: rgba(0,240,122,0.1);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(0,240,122,0.2);
}

/* ─────────────────────────────────────────
   STATS BUTTON (header)
───────────────────────────────────────── */
.hdr-inner { position: relative; }
.stats-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--rad-sm);
  color: var(--muted);
  font-size: 1.05rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
  margin-left: auto;
}
.stats-btn:hover {
  background: rgba(255,255,255,0.11);
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
}

/* ─────────────────────────────────────────
   STATS PANEL OVERLAY
───────────────────────────────────────── */
.stats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInOverlay .2s ease;
}
.stats-modal {
  background: #0a1410;
  border: 1px solid rgba(255,255,255,0.09);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp .32s cubic-bezier(.22,1,.36,1);
}
.stats-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.stats-modal-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 4px;
}
.stats-modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}
.stats-modal-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 34px; height: 34px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.stats-modal-close:hover { background: rgba(255,255,255,0.13); color: var(--text); }

.stats-scroll {
  overflow-y: auto;
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  -webkit-overflow-scrolling: touch;
}

/* ── KPI grid ── */
.sp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.sp-kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.sp-kpi-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.sp-kpi-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  line-height: 1.3;
  text-align: center;
}

/* ── Ring ── */
.sp-ring-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
  position: relative;
}
.sp-ring { display: block; flex-shrink: 0; }
.sp-ring-inner {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 120px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.sp-ring-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.sp-ring-sub {
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sp-ring-labels {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  overflow: hidden;
  width: 100%;
}
.sp-ring-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 3px;
}
.sp-ring-stat strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.sp-ring-stat span {
  font-size: 0.62rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.sp-ring-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Section wrapper ── */
.sp-section { display: flex; flex-direction: column; gap: 12px; }
.sp-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* ── Category bars ── */
.sp-cat-list { display: flex; flex-direction: column; gap: 12px; }
.sp-cat-row  { display: flex; flex-direction: column; gap: 5px; }
.sp-cat-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sp-cat-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}
.sp-cat-count {
  font-size: 0.7rem;
  color: var(--muted);
}
.sp-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sp-bar {
  flex: 1;
  height: 7px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: hidden;
}
.sp-bar-fill {
  height: 100%;
  border-radius: 8px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px currentColor;
}
.sp-bar-pct {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 30px;
  text-align: right;
}

/* ── Account card ── */
.sp-account-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sp-account-card.sp-account-pro {
  border-color: rgba(0,240,122,0.2);
  background: rgba(0,240,122,0.05);
}
.sp-account-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sp-account-icon { font-size: 1.4rem; }
.sp-account-plan {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.sp-account-detail {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.sp-upgrade-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--rad-sm);
  color: #060e09;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow .18s;
  flex-shrink: 0;
}
.sp-upgrade-btn:hover { box-shadow: var(--accent-glow); }

/* ── Analytics instructions card ── */
.sp-analytics-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.sp-analytics-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.sp-analytics-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.sp-analytics-body strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.sp-analytics-body p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
}
.sp-analytics-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 4px 0;
}
.sp-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.4;
}
.sp-step-n {
  background: rgba(0,240,122,0.12);
  border: 1px solid rgba(0,240,122,0.25);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sp-analytics-note {
  font-size: 0.72rem !important;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   TOAST NOTIFICATION
───────────────────────────────────────── */
.fl-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 100px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 24px;
  white-space: nowrap;
  z-index: 200;
  opacity: 0;
  box-shadow: 0 4px 24px rgba(0,0,0,.5), var(--accent-glow);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.fl-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────
   ONBOARDING
───────────────────────────────────────── */
.ob-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,14,11,0.96);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity .35s;
}
.ob-overlay--out { opacity: 0; pointer-events: none; }

.ob-card {
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--rad-lg);
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 28px;
  box-shadow: var(--shadow-h);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity .4s, transform .4s cubic-bezier(0.34,1.56,0.64,1);
}
.ob-card--in { opacity: 1; transform: translateY(0) scale(1); }

/* Slides */
.ob-slide { display: none; }
.ob-slide--active { display: block; animation: ob-fade .25s ease; }
@keyframes ob-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide 1 */
.ob-ball {
  font-size: 3.2rem;
  text-align: center;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 14px rgba(0,240,122,0.45));
}
.ob-title {
  font-family: 'Raleway', sans-serif;
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
  margin-bottom: 8px;
}
.ob-tagline {
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
}
.ob-body {
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Slide 2 */
.ob-slide-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 6px;
}
.ob-slide-sub {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}
.ob-modes { display: flex; flex-direction: column; gap: 11px; margin-bottom: 28px; }
.ob-mode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
}
.ob-mode-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Slide 3 */
.ob-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.ob-lang-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  border-radius: var(--rad-sm);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .13s;
  position: relative;
}
.ob-lang-btn:hover { border-color: var(--border-md); transform: scale(1.03); }
.ob-lang-btn.ob-lang-sel {
  border-color: var(--accent);
  background: rgba(0,240,122,0.08);
  box-shadow: 0 0 0 3px rgba(0,240,122,0.12);
}
.ob-lang-btn.ob-lang-locked {
  opacity: 0.55;
}
.ob-lang-flag { font-size: 1.8rem; }
.ob-lang-name { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.ob-lang-pro {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--gold);
  color: #080e0b;
  font-size: 0.52rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}
.ob-pro-hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
}

/* Shared buttons */
.ob-next-btn, .ob-finish-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #080e0b;
  border: none;
  border-radius: 100px;
  padding: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .18s, transform .15s;
  margin-bottom: 10px;
}
.ob-next-btn:hover, .ob-finish-btn:hover { opacity: 0.88; transform: scale(1.02); }
.ob-skip {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px;
  transition: color .18s;
  text-align: center;
}
.ob-skip:hover { color: var(--text); }

/* Dots */
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
}
.ob-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background .2s, width .2s;
}
.ob-dot--active { background: var(--accent); width: 20px; border-radius: 4px; }

/* ─────────────────────────────────────────
   MODE DONE / COMPLETION SCREENS
───────────────────────────────────────── */
.mode-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 28px 80px;
  max-width: 420px;
  margin: 0 auto;
  animation: ob-fade .3s ease;
}
.mode-done-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 18px rgba(0,240,122,0.4));
}
.mode-done-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.mode-done-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.mode-done-score span {
  font-size: 1.4rem;
  color: var(--muted);
  font-weight: 500;
}
.mode-done-sub {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 300px;
}
.mode-done-streak {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: 100px;
  padding: 6px 18px;
  margin-bottom: 28px;
}
.mode-done-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode-done-primary {
  background: var(--accent);
  color: #080e0b;
  border: none;
  border-radius: 100px;
  padding: 13px 28px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .18s, transform .15s;
}
.mode-done-primary:hover { opacity: 0.88; transform: scale(1.03); }
.mode-done-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border-md);
  border-radius: 100px;
  padding: 13px 22px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.mode-done-secondary:hover {
  border-color: var(--accent);
  background: rgba(0,240,122,0.06);
}

/* ─────────────────────────────────────────
   LANGUAGE PICKER — PRO WALL BANNER
───────────────────────────────────────── */
.lp-wall-banner {
  margin: 0 16px 4px;
  padding: 9px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--rad-sm);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.lp-wall-free {
  color: var(--accent);
  font-weight: 700;
}
.lp-wall-pro {
  color: var(--gold);
  font-weight: 700;
}
.lp-wall-sep { margin: 0 6px; opacity: 0.4; }

/* Locked language rows — more obviously locked */
.lp-item.lp-locked {
  opacity: 0.5;
}
.lp-item.lp-locked .lp-flag,
.lp-item.lp-locked .lp-name,
.lp-item.lp-locked .lp-native {
  filter: grayscale(1);
}

/* Flashcard "Finish" button variant */
.fc-nav-finish {
  background: var(--accent) !important;
  color: #080e0b !important;
  border-color: var(--accent) !important;
  font-weight: 700 !important;
}

/* ─────────────────────────────────────────
   SKELETON LOADING SCREEN
───────────────────────────────────────── */
.skeleton-screen {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
  margin: 0 auto;
}
.skel-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skel-line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 300% 100%;
  animation: skel-shimmer 1.6s ease-in-out infinite;
}
.skel-line--wide   { width: 80%; }
.skel-line--med    { width: 55%; }
.skel-line--narrow { width: 35%; }
@keyframes skel-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ─────────────────────────────────────────
   AVATAR BUTTON (header)
───────────────────────────────────────── */
.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}
.avatar-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,240,122,0.15);
}
.avatar-btn:active { transform: scale(0.93); }

/* ─────────────────────────────────────────
   PROFILE PANEL
───────────────────────────────────────── */
.prof-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.prof-sheet {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--rad-lg) var(--rad-lg) 0 0;
  border: 1px solid var(--border-md);
  border-bottom: none;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  padding-bottom: 32px;
}
.prof-sheet--open { transform: translateY(0); }
.prof-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  margin: 14px auto 0;
}

/* Hero */
.prof-hero {
  position: relative;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.prof-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0,240,122,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.prof-avatar-btn {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  cursor: pointer;
  transition: border-color .18s, transform .15s;
  flex-shrink: 0;
  z-index: 1;
}
.prof-avatar-btn:hover { border-color: var(--accent); transform: scale(1.05); }
.prof-avatar-edit-hint {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #080e0b;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.prof-name-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  width: 220px;
  padding: 4px 8px;
  outline: none;
  transition: border-color .18s;
  z-index: 1;
}
.prof-name-input::placeholder { color: var(--muted); font-weight: 400; }
.prof-name-input:focus { border-bottom-color: var(--accent); }
.prof-join-date {
  font-size: 0.72rem;
  color: var(--muted);
  z-index: 1;
}

/* Avatar picker */
.prof-avatar-picker {
  padding: 12px 20px 4px;
  animation: fade-in .18s ease;
}
.pap-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.pap-emoji {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  padding: 7px 4px;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pap-emoji:hover  { border-color: var(--border-md); transform: scale(1.1); }
.pap-emoji.pap-active {
  border-color: var(--accent);
  background: rgba(0,240,122,0.08);
  box-shadow: 0 0 0 2px rgba(0,240,122,0.15);
}

/* Stats row */
.prof-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.prof-stat {
  background: var(--surface);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.prof-stat-mid { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.prof-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  text-align: center;
}
.prof-stat-label {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Sections */
.prof-section {
  padding: 20px 20px 0;
}
.prof-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

/* Language rows */
.prof-lang-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.prof-lang-row:last-child { border-bottom: none; }
.prof-lang-flags {
  font-size: 1.1rem;
  flex-shrink: 0;
  letter-spacing: 2px;
}
.prof-lang-detail { flex: 1; min-width: 0; }
.prof-lang-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 5px;
}
.prof-lang-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.prof-lang-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.prof-lang-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  min-width: 3px;
  transition: width .4s ease;
}
.prof-lang-pct {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}
.prof-empty {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 8px 0;
}

/* Plan card */
.prof-plan-card {
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  border-radius: var(--rad-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prof-plan-card.prof-plan-pro {
  border-color: rgba(0,240,122,0.3);
  background: rgba(0,240,122,0.06);
}
.prof-plan-icon { font-size: 1.4rem; flex-shrink: 0; }
.prof-plan-info { flex: 1; min-width: 0; }
.prof-plan-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.prof-plan-detail {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}
.prof-plan-check {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.prof-upgrade-btn {
  background: var(--accent);
  color: #080e0b;
  border: none;
  border-radius: 100px;
  padding: 7px 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .18s, transform .15s;
}
.prof-upgrade-btn:hover { opacity: 0.88; transform: scale(1.03); }

/* Notification toggle */
.prof-notif-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.prof-notif-text { flex: 1; }
.prof-notif-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.prof-notif-sub {
  font-size: 0.72rem;
  color: var(--muted);
}
.notif-toggle {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid var(--border-md);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .22s, border-color .22s;
  padding: 0;
}
.notif-toggle.notif-on {
  background: var(--accent);
  border-color: var(--accent);
}
.notif-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform .22s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
}
.notif-toggle.notif-on .notif-knob { transform: translateX(20px); }

/* Close button */
.prof-close-btn {
  display: block;
  margin: 24px auto 0;
  background: var(--surface-2);
  border: 1px solid var(--border-md);
  color: var(--muted);
  border-radius: 100px;
  padding: 8px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.prof-close-btn:hover { color: var(--text); border-color: var(--border-md); }

/* ─────────────────────────────────────────
   SHARE BUTTONS
───────────────────────────────────────── */
.qr-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.qr-share {
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  color: var(--text);
  border-radius: 100px;
  padding: 12px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.qr-share:hover {
  border-color: var(--accent);
  background: rgba(0,240,122,0.07);
}
.cc-share-btn {
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  color: var(--text);
  border-radius: 100px;
  padding: 11px 22px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.cc-share-btn:hover {
  border-color: var(--accent);
  background: rgba(0,240,122,0.07);
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --hdr-h: 120px; }
  .pap-grid { grid-template-columns: repeat(6, 1fr); }
  .prof-sheet { border-radius: 24px 24px 0 0; }

  .hdr { height: var(--hdr-h); padding: 10px 16px; }
  .hdr-inner { flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; }
  .lang-selectors { width: 100%; }
  .ls-select { min-width: 0; flex: 1; }

  .browse-grid    { grid-template-columns: 1fr; }
  .quiz-options   { grid-template-columns: 1fr; }
  .ctx-options    { grid-template-columns: 1fr; }
  .course-options { grid-template-columns: 1fr; }

  .fc-term        { font-size: 1.4rem; }
  .quiz-qterm     { font-size: 1.3rem; }
  .hdr-title      { font-size: 1.2rem; }

  .course-stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cs-big           { font-size: 1.5rem; }
  .cs-label         { font-size: 0.6rem; }

  .lesson-card      { flex-direction: row; gap: 10px; }
  .lesson-name      { font-size: 0.9rem; }

  .pro-modal        { padding: 28px 20px 40px; }
  .pro-modal-title  { font-size: 1.25rem; }
  .pro-modal-price  { font-size: 1.8rem; }

  .cc-score         { font-size: 2.5rem; }
  .cc-title         { font-size: 1.3rem; }
}
