/* 18-vocab.css — Vocabulary trainer (/vocab/<subject>/<topic>) + the deck index (/vocab).
   Page-scoped: loaded via train.html / landing.html {% block extra_head %}, NOT in
   app.bundle.css. Endless practice + game feel: glass card, live score, celebratory FX.
   Theme matches the site (slate/cyan glass on the space background). */

/* ── Deck index cards (/vocab) ───────────────────────────────────────────────────
   Each card carries its subject's own --accent-rgb (inline, from subject_color()), and
   06-landing.css — pulled in by landing.html — supplies the shared .practice-card-icon-bg
   / .practice-card-icon rules that tint the icon tile from it. Everything here just
   spends that same variable, so the deck index matches the Learn / Know / Practice
   grids instead of inventing a second palette. */
.vl-card {
  border-color: rgba(var(--accent-rgb), 0.18);
}
.vl-card:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background-image: linear-gradient(to bottom, rgba(var(--accent-rgb), 0.10), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 22px -6px rgba(var(--accent-rgb), 0.4);
}
.vl-card:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.7);
  outline-offset: 2px;
}
/* Mastery fill in the deck's own colour (see landing.html). */
.vl-bar {
  background-image: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), rgb(var(--accent-rgb)));
}

/* --accent-rgb is the deck's subject colour, set inline by train.html from
   subject_color(). Declared here too so the sheet is self-sufficient: every rule below
   spends the variable, and without the inline value the trainer simply stays the cyan it
   always was. Semantic colour is NOT accented — the rating buttons stay red/amber/green
   and the score stays gold, because those mean the same thing on every deck. */
.vocab-trainer { max-width: 40rem; margin: 0 auto; position: relative; --accent-rgb: 34, 211, 238; }

/* [hidden] must win: the display rules below (e.g. .vt-btn{display:inline-flex})
   otherwise override the UA-stylesheet [hidden]{display:none}, leaking elements
   the JS toggles (the caught-up hint, the screens). */
.vocab-trainer [hidden] { display: none !important; }

/* ── Session top bar: sound toggle + sitting tallies + score ── */
.vt-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 1.5rem; }

/* Sound toggle (auto-pronounce + feedback blips). aria-pressed drives the glyph. */
.vt-sound {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; border-radius: 9999px; cursor: pointer;
  color: #7dd3fc; color: color-mix(in srgb, rgb(var(--accent-rgb)) 80%, white); border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.vt-sound svg { width: 1.15rem; height: 1.15rem; }
.vt-sound:hover { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.4); }
.vt-sound:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }
.vt-sound .vt-sound-off { display: none; }
.vt-sound[aria-pressed="false"] { color: #64748b; }
.vt-sound[aria-pressed="false"] .vt-sound-on { display: none; }
.vt-sound[aria-pressed="false"] .vt-sound-off { display: block; }

/* This-sitting tally: cards graded (✓ n). */
.vt-chip {
  display: inline-flex; align-items: center; gap: 0.32rem; line-height: 1;
  padding: 0.28rem 0.6rem; border-radius: 9999px; font-size: 0.85rem; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1; font-variant-numeric: tabular-nums;
}
.vt-chip svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.vt-done-chip svg { color: #6ee7b7; }

/* Undo (last grade) + tricky-words: chips that are also buttons. */
button.vt-chip { cursor: pointer; }
button.vt-chip:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.22); }
button.vt-chip:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }
.vt-undo svg { color: #93c5fd; }
.vt-leech-chip { color: #fcd34d; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.08); }
.vt-leech-chip svg { color: #fbbf24; }
.vt-leech-chip:hover { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.5); }

/* ── Box-distribution strip: one segment per Leitner box, width ∝ card count ──
   Coloured by MODE BAND, not by box, so the three groups the learner actually
   experiences (new → recognise → produce) read at a glance; exact counts are in the
   title. Widths come from flex-grow (JS), so segments always fill the track exactly. */
.vt-boxes {
  display: flex; gap: 2px; margin-top: 0.4rem; height: 4px;
  border-radius: 9999px; overflow: hidden;
}
.vt-box-seg { flex: 1 1 0; min-width: 2px; border-radius: 9999px; transition: flex-grow 0.4s ease; }
.vt-box-seg[data-vt-box="0"] { background: rgba(148, 163, 184, 0.35); }   /* new — flashcard */
.vt-box-seg[data-vt-box="1"] { background: rgba(251, 191, 36, 0.4); }     /* recognising — MC */
.vt-box-seg[data-vt-box="2"] { background: rgba(251, 191, 36, 0.6); }
.vt-box-seg[data-vt-box="3"] { background: rgba(251, 191, 36, 0.85); }
.vt-box-seg[data-vt-box="4"] { background: rgba(var(--accent-rgb), 0.75); }    /* producing — typing */
.vt-box-seg[data-vt-box="5"] { background: #34d399; }

/* Score chip (identity total; mirrors the global header badge). */
.vt-score {
  position: relative; margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.35rem; line-height: 1;
  padding: 0.28rem 0.75rem; border-radius: 9999px;
  border: 1px solid rgba(250, 204, 21, 0.32);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(245, 158, 11, 0.12));
  color: #fde68a; font-size: 0.95rem; font-weight: 800;
}
.vt-score-icon { width: 1rem; height: 1rem; color: #fbbf24; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5)); flex-shrink: 0; }
.vt-score-value { font-variant-numeric: tabular-nums; }
.vt-score.is-bumping { animation: score-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
/* "+N" floats up out of the chip on a gain; absolute so it never reflows the row. */
.vt-score-gain {
  position: absolute; right: 0.7rem; top: -0.1rem; opacity: 0; pointer-events: none;
  font-size: 0.85rem; font-weight: 800; color: #fde68a; white-space: nowrap;
  text-shadow: 0 1px 6px rgba(245, 158, 11, 0.5);
}
.vt-score-gain.is-floating { animation: vt-gain-float 0.9s ease-out; }

/* ── Deck mastery bar (full width, live) ── */
.vt-deckbar { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.vt-deckbar-track {
  position: relative; flex: 1; height: 8px; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08); overflow: hidden;
}
/* Two-tone: a lighter "learning" segment (box≥1) behind the green "mastered"
   segment, so the bar moves after the first session instead of sitting at 0. */
.vt-deckbar-fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  border-radius: 9999px; transition: width 0.4s ease;
}
.vt-deckbar-fill-learning { background: rgba(251, 191, 36, 0.5); }
.vt-deckbar-fill-mastered { background: linear-gradient(90deg, rgb(var(--accent-rgb)), #34d399); }
.vt-deckbar-label { font-size: 0.8rem; color: #94a3b8; white-space: nowrap; }

/* ── Today's remaining scored cards (due + new), counts down under the bar ── */
.vt-today { margin-top: 0.45rem; font-size: 0.8rem; color: #94a3b8; text-align: right; }

/* ── "All caught up — reviewing for fun" hint (cosmetic cycle) ── */
.vt-caughtup {
  margin-top: 0.85rem; padding: 0.6rem 0.85rem; border-radius: 0.7rem;
  font-size: 0.85rem; color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.08);
}

/* ── Buttons ── */
.vt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  cursor: pointer; border-radius: 0.7rem; padding: 0.6rem 1.1rem;
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0; transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.vt-btn:hover { background: rgba(255, 255, 255, 0.09); }
.vt-btn:active { transform: translateY(1px); }
.vt-btn-primary {
  border-color: transparent;
  background: linear-gradient(90deg, #06b6d4, #4f46e5); color: #fff;
}
.vt-btn-primary:hover { background: linear-gradient(90deg, #22d3ee, #6366f1); }
.vt-btn-ghost { background: transparent; }

/* ── Card stage ── */
.vt-stage { margin-top: 1.5rem; position: relative; outline: none; }
.vt-stage.vt-flash-correct { animation: vt-flash-correct 0.55s ease; }
.vt-stage.vt-flash-wrong { animation: vt-shake 0.4s ease; }

.vt-cardbox {
  position: relative; width: 100%; min-height: 13rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; text-align: center; cursor: pointer;
  /* Horizontal drag is ours (swipe-to-grade); vertical stays native page scrolling. */
  touch-action: pan-y;
  border-radius: 1.25rem; padding: 2.25rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 40px -24px rgba(0, 0, 0, 0.6),
    0 0 60px -30px rgba(var(--accent-rgb), 0.25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
.vt-cardbox:hover { border-color: rgba(var(--accent-rgb), 0.3); transform: translateY(-2px); }
.vt-cardbox:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }
.vt-cardbox.is-flipped {
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.1), rgba(99, 102, 241, 0.06));
  border-color: rgba(var(--accent-rgb), 0.25);
}

/* Grade cue: a small directional swipe on the outgoing card (know = right/green,
   don't-know = left/red, hard = amber pulse). Subtle, then it's re-rendered away.
   Reduced-motion swaps the slide for a static colour (see the media query below). */
.vt-cardbox.vt-grade-good  { animation: vt-swipe-right 0.2s ease forwards; }
.vt-cardbox.vt-grade-again { animation: vt-swipe-left 0.2s ease forwards; }
.vt-cardbox.vt-grade-hard  { animation: vt-pulse-hard 0.22s ease forwards; }

/* ── Swipe to grade ──
   While dragging, the card tracks the finger (inline transform from JS) and tints once
   past the commit threshold — so the rating is previewed BEFORE release; under the
   threshold it springs back to centre. The transition is dropped mid-drag so the card
   doesn't lag the finger, and restored on release to animate the spring-back.
   :hover's translateY would fight the drag transform, so it's disabled here too. */
.vt-cardbox.vt-dragging { transition: border-color 0.2s ease, box-shadow 0.25s ease; cursor: grabbing; }
.vt-cardbox.vt-dragging:hover { transform: none; }
.vt-cardbox.vt-drag-good {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45), 0 0 26px -4px rgba(52, 211, 153, 0.4);
}
.vt-cardbox.vt-drag-again {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.45), 0 0 26px -4px rgba(248, 113, 113, 0.4);
}

/* ── "You keep forgetting this one" badge ── */
.vt-leech-badge {
  position: absolute; top: 0.7rem; left: 50%; transform: translateX(-50%);
  padding: 0.15rem 0.6rem; border-radius: 9999px; white-space: nowrap;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.1);
}
.vt-prompt-wrap { position: relative; }
.vt-prompt-wrap .vt-leech-badge { position: static; transform: none; display: inline-block; margin-bottom: 0.6rem; }

/* ── Example sentence ("in context") ──
   Deliberately quiet: it appears with the answer, so it must read as supporting
   evidence, not compete with the word itself. */
.vt-context {
  margin-top: 0.9rem; padding: 0.7rem 0.85rem; text-align: left;
  border-radius: 0.7rem; border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03); border-left: 2px solid rgba(var(--accent-rgb), 0.4);
}
.vt-context-label {
  display: block; margin-bottom: 0.2rem;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: #64748b;
}
.vt-context-text { margin: 0; font-size: 0.9rem; line-height: 1.55; color: #cbd5e1; }
.vt-ctx-term { background: none; color: #67e8f9; color: color-mix(in srgb, rgb(var(--accent-rgb)) 55%, white); font-weight: 700; }

/* Cloze: the same block, but asking. The gap is sized to the missing word (capped, so a
   long term can't hint at its own length too precisely) and sits on the baseline so the
   sentence still reads as a sentence. */
.vt-cloze { border-left-color: rgba(251, 191, 36, 0.5); }
.vt-cloze-gap {
  display: inline-block; min-width: 3.5rem; margin: 0 0.15rem;
  border-bottom: 2px solid rgba(251, 191, 36, 0.7); white-space: pre;
}
/* The card centres its children, so the reveal panel would otherwise shrink-wrap the
   word and leave the sentence in a narrow ragged column. Stretch it: the word/pinyin
   stay centred (the card's text-align does that), while the prose gets the full width. */
.vt-cardbox .vt-reveal { align-self: stretch; }

.vt-prompt-wrap { position: relative; text-align: center; margin-bottom: 1.25rem; }
.vt-prompt {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 1.9rem; font-weight: 600; color: #f1f5f9; line-height: 1.2;
}

/* Inline pronunciation button, next to the English word wherever it is visible. */
.vt-speak {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; border-radius: 9999px; cursor: pointer;
  color: #7dd3fc; color: color-mix(in srgb, rgb(var(--accent-rgb)) 80%, white); border: 1px solid rgba(var(--accent-rgb), 0.28); background: rgba(var(--accent-rgb), 0.08);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.vt-speak svg { width: 1.05rem; height: 1.05rem; }
.vt-speak:hover { background: rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.5); transform: translateY(-1px); }
.vt-speak:active { transform: translateY(0); }
.vt-speak:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }
.vt-fb-line .vt-speak { width: 1.7rem; height: 1.7rem; align-self: center; }
.vt-fb-line .vt-speak svg { width: 0.85rem; height: 0.85rem; }
/* No English voice on this device ⇒ the buttons vanish (vocab-trainer.js sets the class). */
.vt-no-tts .vt-speak { display: none; }
.vt-prompt-zh { font-size: 2.2rem; }
.vt-reveal { display: flex; flex-direction: column; gap: 0.25rem; }
.vt-reveal[hidden] { display: none; }
.vt-zh { font-size: 2rem; font-weight: 600; color: #a5f3fc; color: color-mix(in srgb, rgb(var(--accent-rgb)) 55%, white); }
.vt-py { font-size: 1rem; color: #94a3b8; font-style: normal; }
.vt-fliphint { font-size: 0.8rem; color: #64748b; }

/* ── Card visual: a picture or concept icon shown together with the word ──────── */
/* Fixed-height box so a late-loading thumbnail never shifts the card. The word is
   always shown alongside, so the visual is supportive (dual-coding), not the answer. */
.vt-card-image {
  display: block; height: 8.25rem; max-width: 100%;
  margin: 0 auto 0.25rem; object-fit: contain;
  border-radius: 0.75rem; padding: 0.4rem;
  background: #f8fafc;  /* light panel keeps dark-stroke diagrams legible on the dark card */
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.7);
}
.vt-card-icon {
  display: flex; align-items: center; justify-content: center;
  height: 6rem; margin: 0 auto 0.25rem; color: #67e8f9; color: color-mix(in srgb, rgb(var(--accent-rgb)) 80%, white);  /* the deck's accent, matching the card */
}
.vt-card-icon svg { width: 5rem; height: 5rem; }
/* The MC/typing header is not a flex column, so add explicit spacing below the visual. */
.vt-prompt-wrap .vt-card-image, .vt-prompt-wrap .vt-card-icon { margin-bottom: 0.9rem; }
@media (max-width: 640px) {
  .vt-card-image { height: 6.5rem; }
  .vt-card-icon { height: 5rem; }
  .vt-card-icon svg { width: 4rem; height: 4rem; }
}
.vt-fliphint[hidden] { display: none; }

/* ── Rating row (flashcard): three symbol buttons. The outer two (✕ / ✓) mirror the
   card's left/right click-zones (don't-know / know); the middle ~ is "hard". ── */
.vt-rating { display: flex; align-items: center; justify-content: center; gap: 1.4rem; margin-top: 1.25rem; }
.vt-rating[hidden] { display: none; }
.vt-rate {
  position: relative; flex: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.3rem; height: 3.3rem; border-radius: 9999px; color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.vt-rate svg { width: 1.5rem; height: 1.5rem; }
.vt-rate:hover { transform: translateY(-2px); }
.vt-rate:active { transform: translateY(0); }
.vt-rate:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }
.vt-rate-again { color: #fca5a5; }
.vt-rate-again:hover { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.45); }
.vt-rate-hard { color: #fcd34d; width: 2.8rem; height: 2.8rem; }   /* middle: smaller, lower-emphasis */
.vt-rate-hard svg { width: 1.3rem; height: 1.3rem; }
.vt-rate-hard:hover { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.45); }
.vt-rate-good { color: #6ee7b7; }
.vt-rate-good:hover { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.45); }
/* Standing affordance: ← beside ✕, → beside ✓ — telegraphs the card-zone / arrow-key gesture. */
.vt-rate-again::before, .vt-rate-good::after {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 0.95rem; color: #64748b; pointer-events: none;
}
.vt-rate-again::before { content: "←"; right: 100%; margin-right: 0.5rem; }
.vt-rate-good::after { content: "→"; left: 100%; margin-left: 0.5rem; }

/* ── Multiple choice ── */
.vt-options { display: flex; flex-direction: column; gap: 0.6rem; }
.vt-option {
  width: 100%; min-height: 3rem; cursor: pointer; text-align: left;
  padding: 0.85rem 1.1rem; border-radius: 0.8rem; font-size: 1.05rem; color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.vt-option:hover:not([disabled]) { background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.35); transform: translateY(-1px); }
.vt-option[disabled] { cursor: default; }
.vt-option.is-correct { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.55); color: #bbf7d0; }
.vt-option.is-wrong { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

/* ── Dictation (box-5 typing: the word is heard, not shown) ── */
.vt-dictate {
  display: inline-flex; align-items: center; justify-content: center;
  width: 4rem; height: 4rem; border-radius: 9999px; cursor: pointer;
  margin-bottom: 0.5rem; color: #fff; border: 1px solid transparent;
  background: linear-gradient(135deg, #06b6d4, #4f46e5);
  box-shadow: 0 12px 28px -14px rgba(6, 182, 212, 0.7);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.vt-dictate svg { width: 1.8rem; height: 1.8rem; }
.vt-dictate:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(6, 182, 212, 0.85); }
.vt-dictate:active { transform: translateY(0); }
.vt-dictate:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 2px; }

/* ── Typing ── */
.vt-input {
  width: 100%; margin-top: 0.25rem; padding: 0.85rem 1rem; border-radius: 0.8rem;
  font-size: 1.15rem; color: #f1f5f9; background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.vt-input::placeholder { color: #64748b; }
.vt-input:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18); }
.vt-input.vt-shake { animation: vt-shake 0.4s ease; }
.vt-type-row { display: flex; gap: 0.6rem; margin-top: 0.8rem; }

/* ── Feedback ── */
.vt-feedback { margin-top: 1.1rem; font-size: 0.95rem; }
.vt-feedback:empty { display: none; }
.vt-feedback.is-correct { color: #a7f3d0; }
.vt-feedback.is-almost { color: #fde68a; }
.vt-feedback.is-wrong { color: #fecaca; }
.vt-feedback.is-hint { color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; }
.vt-fb-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem; }
.vt-fb-answer { font-weight: 700; color: #f1f5f9; }
.vt-fb-reason { color: #94a3b8; }
.vt-next { margin-top: 0.85rem; }

/* ── Celebrations: confetti burst + mastery toast (DOM kept inside .vocab-trainer) ── */
.vt-confetti { position: fixed; left: 50%; top: 38%; width: 0; height: 0; pointer-events: none; z-index: 60; }
.vt-confetti-bit {
  position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 2px;
  background: hsl(var(--h, 50), 90%, 60%);
  animation: vt-confetti-fly 1s ease-out forwards;
}
.vt-toast {
  position: fixed; left: 50%; bottom: 2rem; z-index: 60; opacity: 0;
  transform: translate(-50%, 1rem);
  padding: 0.65rem 1.05rem; border-radius: 0.85rem;
  font-size: 0.9rem; font-weight: 600; color: #f0fdf4;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.92));
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, 0.6), 0 0 28px -8px rgba(16, 185, 129, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.vt-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* ── Keyframes ── */
@keyframes score-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes vt-gain-float { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-1.5rem); } }
@keyframes vt-flash-correct {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
  30% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.5), 0 0 28px -2px rgba(52, 211, 153, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
@keyframes vt-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}
@keyframes vt-confetti-fly {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, -80px)) rotate(var(--rot, 180deg)); opacity: 0; }
}
@keyframes vt-swipe-right {
  to { transform: translateX(16px); opacity: 0.9; border-color: rgba(52, 211, 153, 0.55);
       box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.5), 0 0 26px -4px rgba(52, 211, 153, 0.45); }
}
@keyframes vt-swipe-left {
  to { transform: translateX(-16px); opacity: 0.9; border-color: rgba(248, 113, 113, 0.55);
       box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.5), 0 0 26px -4px rgba(248, 113, 113, 0.45); }
}
@keyframes vt-pulse-hard {
  50% { border-color: rgba(251, 191, 36, 0.55);
        box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 0 22px -4px rgba(251, 191, 36, 0.4); }
}

@media (max-width: 480px) {
  .vt-prompt { font-size: 1.55rem; }
  .vt-prompt-zh { font-size: 1.85rem; }
  .vt-zh { font-size: 1.7rem; }
}

/* Respect reduced-motion: kill BOTH transitions and the new keyframe animations
   (state is always conveyed without motion — flip via show/hide, score via the
   number itself, correct/wrong via colour). */
@media (prefers-reduced-motion: reduce) {
  .vt-deckbar-fill, .vt-cardbox, .vt-btn, .vt-rate, .vt-option, .vt-toast,
  .vt-sound, .vt-speak, .vt-dictate, .vt-box-seg { transition: none; }
  /* Swipe still works and still tints (colour, not motion) — the JS just doesn't
     translate the card, so there is nothing here to disable beyond the transition. */
  .vt-score.is-bumping, .vt-score-gain.is-floating,
  .vt-stage.vt-flash-correct, .vt-stage.vt-flash-wrong, .vt-input.vt-shake,
  .vt-confetti-bit,
  .vt-cardbox.vt-grade-good, .vt-cardbox.vt-grade-again, .vt-cardbox.vt-grade-hard { animation: none; }
  /* Motion-free grade cue: colour the border so the result still reads clearly. */
  .vt-cardbox.vt-grade-good  { border-color: rgba(52, 211, 153, 0.6); }
  .vt-cardbox.vt-grade-again { border-color: rgba(248, 113, 113, 0.6); }
  .vt-cardbox.vt-grade-hard  { border-color: rgba(251, 191, 36, 0.6); }
}

/* ── English→English "definition" decks (e.g. GRE) ──────────────────────────────
   The card BACK is a sentence-length English definition, not a short CJK word, so the
   2rem cyan `.vt-zh` / `.vt-prompt-zh` styling reads wrong. Reskin to plain, readable
   text. Higher specificity (0,2,0) than the base + the 480px overrides (0,1,0), so it
   wins everywhere — media queries add no specificity. The WORD prompt (`.vt-prompt`
   without `-zh`, used for the flashcard front + MC word prompt) keeps its big headword look. */
.vocab-trainer[data-deck-kind="definition"] .vt-zh,
.vocab-trainer[data-deck-kind="definition"] .vt-prompt-zh {
  font-size: 1.2rem; font-weight: 500; color: #e2e8f0; line-height: 1.45;
}
.vocab-trainer[data-deck-kind="definition"] .vt-option {
  font-size: 0.98rem; line-height: 1.35;
}
