﻿/* ═══════════════════════════════════════════════════════════
   TOEIC THẦY SANG — vocabulary.css
   Từ vựng page: word list + games
   Design: đồng nhất với style.css (Be Vietnam Pro, navy/yellow/blue)
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   HERO HEADER — compact progress strip
   ───────────────────────────────────────────── */
.vocab-hero {
  background: #fff;
  padding: calc(var(--nav-h, 60px) + 20px) 20px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.vocab-hero-inner {
  max-width: 560px;
  margin: 0 auto;
}
.vocab-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.vpm-count {
  font-size: .82rem;
  font-weight: 700;
  color: #334155;
}
.vpm-count span {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a2a2e;
}
.vpm-pct {
  font-size: .75rem;
  font-weight: 700;
  color: #16a34a;
}
.vocab-progress-bar {
  width: 100%;
  height: 8px;
  background: #e9f0f4;
  border-radius: 999px;
  overflow: hidden;
}
.vocab-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #16a34a 100%);
  border-radius: 999px;
  width: 0%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ─────────────────────────────────────────────
   MAIN TABS — segmented pill control
   ───────────────────────────────────────────── */
.vocab-tabs-wrap {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: var(--nav-h, 60px);
  z-index: 100;
  padding: 12px 20px;
}
.vocab-segment {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  background: #f1f5f9;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.vocab-seg-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
  white-space: nowrap;
}
.vocab-seg-btn:hover:not(.active) { color: #64748b; }
.vocab-seg-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 6px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04);
}
.vsb-count {
  font-size: .7rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  line-height: 1.4;
}
.vocab-seg-btn:not(.active) .vsb-count {
  background: #e2e8f0;
  color: #64748b;
}

/* ─────────────────────────────────────────────
   PAGE BODY
   ───────────────────────────────────────────── */
.vocab-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 80px;
}

/* Focus mode khi đang chơi game */
body.game-focus-mode .vocab-hero,
body.game-focus-mode .vocab-tabs-wrap,
body.game-focus-mode .footer { display: none; }
body.game-focus-mode .game-quit-btn { display: none; }
body.game-focus-mode .vocab-body {
  margin: 0;
  padding: var(--nav-h, 60px) 0 0;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.game-focus-mode .vocab-pane.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  background: var(--bg, #f5f7fb);
}
body.game-focus-mode #gameContainer {
  width: 100%;
  max-width: 640px;
  margin: 28px auto 0;
  padding: 28px 24px 40px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(15,23,42,.09), 0 1px 0 rgba(15,23,42,.03);
}
@media (max-width: 640px) {
  body.game-focus-mode #gameContainer {
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100%;
    flex: 1;
  }
}
.vocab-pane { display: none; }
.vocab-pane.active { display: block; }

/* ─────────────────────────────────────────────
   BANNER CẢNH BÁO CHƯA ĐĂNG NHẬP
   ───────────────────────────────────────────── */
.vocab-ls-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}
.dark .vocab-ls-banner {
  background: #2d2107;
  border-color: #854d0e;
  color: #fbbf24;
}
.vocab-ls-banner svg { color: #d97706; }
.dark .vocab-ls-banner svg { color: #fbbf24; }
.vocab-ls-banner span { flex: 1; }
.vocab-ls-banner-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  background: #d97706;
  border: none;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity .14s;
  align-self: center;
}
.vocab-ls-banner-btn:hover { opacity: .85; }

/* ─────────────────────────────────────────────
   FILTER BAR
   ───────────────────────────────────────────── */
.vocab-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.vf-search {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.vf-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.vf-search input {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 9px 12px 9px 36px;
  font-family: inherit;
  font-size: 16px;
  color: #1a2a2e;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.vf-search input:focus { border-color: var(--primary); }
.vf-search input::placeholder { color: #cbd5e1; }
.vf-chips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vf-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.vf-chip {
  padding: 7px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.vf-chip:hover { border-color: var(--primary); color: var(--primary); }
.vf-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.vf-chip.chip-known.active  { background: #16a34a; border-color: #16a34a; color: #fff; }
.vf-chip.chip-forgot.active { background: #dc2626; border-color: #dc2626; color: #fff; }
.vf-chip.chip-wrong.active  { background: #d97706; border-color: #d97706; color: #fff; }
.vf-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vf-search-row .vf-search { flex: 1; min-width: 0; }
.vf-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.vf-chip-add:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ─────────────────────────────────────────────
   WORD CARDS
   ───────────────────────────────────────────── */
.vocab-list {
  display: flex;
  flex-direction: column;
}
.vocab-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow .18s, border-color .18s;
  animation: vcFadeUp .3s ease both;
}
.vocab-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  border-color: #d1d9e2;
}
@keyframes vcFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.vc-left { flex: 1; min-width: 0; }
.vc-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.vc-word {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a2a2e;
  word-break: break-word;
}
.vc-type {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.vc-type-noun      { background: #dbeafe; color: #1d4ed8; }
.vc-type-verb      { background: #dcfce7; color: #166534; }
.vc-type-adjective { background: #fef9c3; color: #854d0e; }
.vc-type-adverb    { background: #f3e8ff; color: #6b21a8; }
.vc-type-phrase    { background: #ffedd5; color: #c2410c; }
.vc-type-other     { background: #f1f5f9; color: #475569; }
.vc-meaning {
  font-size: .95rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
  line-height: 1.5;
}
.vc-context {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: .72rem;
  color: #94a3b8;
  font-weight: 500;
}
.vc-ctx-sep { color: #cbd5e1; }
.vc-ctx-part {
  background: rgba(26,26,46,.07);
  color: #475569;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .7rem;
}

/* Status buttons */
.vc-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}
.vc-status-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.vc-status-btn {
  padding: 5px 12px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}
.vc-btn-known {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.vc-btn-known:hover,
.vc-btn-known.active {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.vc-btn-forgot1 {
  background: #fff7ed;
  color: #ea580c;
  border-color: #fed7aa;
}
.vc-btn-forgot1:hover,
.vc-btn-forgot1.active {
  background: #ea580c;
  color: #fff;
  border-color: #ea580c;
}
.vc-btn-forgot2 {
  background: #fff1f2;
  color: #dc2626;
  border-color: #fecaca;
}
.vc-btn-forgot2:hover,
.vc-btn-forgot2.active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.vc-delete-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color .15s, background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vc-delete-btn:hover { color: #ef4444; background: #fee2e2; }

/* ─────────────────────────────────────────────
   DATE HEADERS
   ───────────────────────────────────────────── */
.vd-date-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 18px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.vd-date-header:first-child { margin-top: 0; }
.vd-line { flex: 1; height: 1px; background: #e8ecf0; }
.vd-label { white-space: nowrap; color: #64748b; }
.vd-count {
  background: #f1f5f9;
  color: #94a3b8;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .65rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   WORD ROWS — 1 hàng ngang, căn thẳng dọc
   [toggle 40] [speaker 28] [word 160] [ipa 160] [meaning 1fr] [edit 28] [del 28] [info 28]
   ───────────────────────────────────────────── */
.vocab-row {
  display: grid;
  grid-template-columns: 40px 28px 160px 160px 1fr 28px 28px 28px;
  align-items: center;
  column-gap: 10px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: box-shadow .18s, border-color .18s, background .22s ease, max-height .26s ease, padding .26s ease, margin-bottom .26s ease, opacity .2s ease;
  animation: vcFadeUp .3s ease both;
  position: relative;
  z-index: 0;
}
.vocab-row:hover {
  box-shadow: 0 2px 14px rgba(0,0,0,.06);
  border-color: #d1d9e2;
}
.vocab-row.is-known {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.vocab-row.is-known:hover {
  border-color: #86efac;
  box-shadow: 0 2px 14px rgba(22,163,74,.08);
}
/* Toggle switch (iOS style) */
.vr-toggle-sw {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: none;
  background: #ef4444;
  cursor: pointer;
  position: relative;
  padding: 0;
  flex-shrink: 0;
  transition: background .22s ease;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.15);
  justify-self: start;
}
.vr-toggle-sw.known { background: #22c55e; }
.vr-sw-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .22s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  pointer-events: none;
}
.vr-toggle-sw.known .vr-sw-knob { transform: translateX(18px); }

/* Từ vựng — cột cố định, xuống dòng nếu quá dài */
.vr-word {
  font-size: .95rem;
  font-weight: 800;
  color: #1a2a2e;
  display: block;
  line-height: 1.3;
  word-break: break-word;
  min-width: 0;
}
.vocab-row.is-known .vr-word { color: #166534; }

/* Phiên âm — cột cố định, xuống dòng nếu quá dài */
.vr-ipa {
  font-size: .75rem;
  color: #475569;
  letter-spacing: .02em;
  display: block;
  word-break: break-all;
  min-width: 0;
}

/* Nghĩa Việt — căn trái, truncate */
.vr-meaning {
  font-size: .85rem;
  font-weight: 500;
  color: #334155;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  justify-self: start;
  width: 100%;
}

/* Icon buttons dùng chung */
.vr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #c2cdd6;
  cursor: pointer;
  padding: 0;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  justify-self: center;
}
.vr-icon-btn:hover           { background: #f1f5f9; color: #64748b; }
.vr-speak-btn:hover          { background: #e0f2fe; color: #0284c7; }
.vr-edit-btn:hover           { background: #ede9fe; color: #6366f1; }
.vr-del-btn:hover            { background: #fee2e2; color: #ef4444; }
.vr-info-btn:hover           { background: #f0f9ff; color: #0284c7; }
.vr-info-btn:disabled        { opacity: .28; cursor: default; pointer-events: none; }

/* Info popup */
.vr-info-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}
.vr-info-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 13px;
  min-width: 175px;
  max-width: 270px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  z-index: 300;
}
.vr-info-popup.open {
  display: block;
  animation: vrInfoIn .14s ease;
}
@keyframes vrInfoIn {
  from { opacity: 0; transform: translateY(-3px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.vr-info-popup::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
  transform: rotate(45deg);
}
.vri-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  font-size: .75rem;
  font-weight: 500;
  color: #475569;
}
.vri-line svg { color: #94a3b8; flex-shrink: 0; }
.vri-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vri-line + .vri-line {
  border-top: 1px solid #f1f5f9;
  margin-top: 3px;
  padding-top: 7px;
}

/* Inline edit row */
.vocab-row-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #fafbff;
  border: 1.5px solid #6366f1;
  border-radius: 12px;
  animation: vcFadeUp .2s ease both;
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}
.vre-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.vre-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vre-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
}
.vre-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 11px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #1a2a2e;
  outline: none;
  transition: border-color .15s;
  background: #fff;
}
.vre-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.vre-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.vre-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  min-width: 68px;
  justify-content: center;
}
.vre-save-btn:hover:not(:disabled) { background: var(--primary-dark); }
.vre-save-btn:disabled { opacity: .6; cursor: not-allowed; }
.vre-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.vre-cancel-btn:hover { border-color: #cbd5e1; color: #475569; }

/* ─────────────────────────────────────────────
   EMPTY STATES
   ───────────────────────────────────────────── */
.vocab-empty {
  text-align: center;
  padding: 56px 20px;
}
.ve-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.ve-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2a2e;
  margin-bottom: 8px;
}
.ve-sub {
  font-size: .9rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto 20px;
}
.ve-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.ve-cta:hover { background: var(--primary-dark); }

/* Auth prompt */
.vocab-auth-prompt {
  text-align: center;
  padding: 56px 20px;
}
.vap-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2a2e, #0f3460);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #ffc000;
}
.vap-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2a2e;
  margin-bottom: 8px;
}
.vap-sub {
  font-size: .9rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto 24px;
}
.vap-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: #1a2a2e;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.vap-login-btn:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border-color: #cbd5e1;
}

/* ─────────────────────────────────────────────
   GAME TAB
   ───────────────────────────────────────────── */
.game-pane { display: none; }
.game-pane.active { display: block; }

/* ── Step 1: chọn từ ── */
.game-step {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 32px;
  box-shadow: 0 8px 40px rgba(15,23,42,.08), 0 1px 0 rgba(15,23,42,.03);
}
@media (max-width: 640px) {
  .game-step { padding: 22px 18px 26px; border-radius: 18px; }
}
.game-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a2a2e;
  margin-bottom: 6px;
}
.game-step-sub {
  font-size: .85rem;
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
}
/* ── Chọn nhanh: chưa thuộc / theo bộ đề / theo ngày / tất cả / bỏ chọn ── */
.gs-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.gs-quick-btn {
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.gs-quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.gs-quick-btn:active { transform: scale(.97); }
.gs-quick-btn.gs-quick-clear { color: #94a3b8; }

/* ── Dropdown chọn nhanh tuỳ biến (thay <select> native), giống nút "Sắp xếp" ── */
.gs-dd { position: relative; }
.gs-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.gs-dd-trigger:hover { border-color: var(--primary); color: var(--primary); }
.gs-dd.open .gs-dd-trigger { border-color: var(--primary); color: var(--primary); }
.gs-dd-chevron { color: #94a3b8; transition: transform .15s; flex-shrink: 0; }
.gs-dd.open .gs-dd-chevron { transform: rotate(180deg); }
.gs-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 32px rgba(0,0,0,.13);
  z-index: 300;
  flex-direction: column;
  gap: 2px;
}
.gs-dd.open .gs-dd-menu {
  display: flex;
  animation: vrInfoIn .14s ease;
}
.gs-dd-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.gs-dd-opt:hover { background: #f1f5f9; color: var(--primary); }

/* ── Danh sách từ vựng có tick chọn ── */
.gs-word-list { margin-bottom: 16px; }
.vgs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  transition: border-color .15s, background .15s;
}
.vgs-row:hover { border-color: #d1d9e2; }
.vgs-row.checked {
  background: rgba(29,111,242,.05);
  border-color: var(--primary);
}
.vgs-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.vgs-row.checked .vgs-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.vgs-word {
  flex-shrink: 0;
  font-size: .88rem;
  font-weight: 700;
  color: #1a2a2e;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vgs-meaning {
  flex: 1;
  min-width: 0;
  font-size: .84rem;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-selected-count {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.gs-selected-count strong { color: #1a2a2e; }
.gs-next-btn {
  width: 100%;
  padding: 14px;
  background: #ffc000;
  color: #1a2a2e;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(255,192,0,.35);
}
.gs-next-btn:hover {
  background: #d4a000;
  box-shadow: 0 6px 20px rgba(255,192,0,.45);
}
.gs-next-btn:active { transform: scale(.98); }
.gs-next-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}


/* ── Step 2: chọn loại game ── */
.game-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.game-type-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  user-select: none;
}
.game-type-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.game-type-card.selected {
  border-color: var(--primary);
  background: rgba(29,111,242,.04);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.gtc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: #64748b;
}
.game-type-card.selected .gtc-icon { color: var(--primary); }
.gtc-title {
  font-size: .95rem;
  font-weight: 700;
  color: #1a2a2e;
  margin-bottom: 4px;
}
.gtc-desc {
  font-size: .78rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ── Timer selector (trắc nghiệm) ── */
.quiz-timer-sel {
  margin-bottom: 18px;
}
.qts-label {
  font-size: .8rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.qts-btns {
  display: flex;
  gap: 8px;
}
.qts-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: .88rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.qts-btn:focus { outline: none; }
.qts-btn:focus-visible { outline: 2px solid #ffc000; outline-offset: 2px; }
.qts-btn:hover { border-color: #94a3b8; }
.qts-btn.qts-active {
  border-color: #ffc000;
  background: rgba(255,192,0,.08);
  color: #1a2a2e;
}
.qts-diff {
  font-size: .72rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
}
.qts-hard { background: #fee2e2; color: #dc2626; }
.qts-med  { background: #fef3c7; color: #d97706; }
.qts-easy { background: #dcfce7; color: #16a34a; }

/* Quiz mode selector */
.quiz-mode-selector {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.qms-btn {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.qms-btn:hover { border-color: var(--primary); color: var(--primary); }
.qms-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.qms-recommended {
  font-size: .65rem;
  font-weight: 700;
  background: #ffc000;
  color: #1a2a2e;
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* ─────────────────────────────────────────────
   QUIZ GAME
   ───────────────────────────────────────────── */
.quiz-wrap {
  max-width: 560px;
  margin: 0 auto;
}
.quiz-progress-bar {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-bottom: 14px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffc000, #d4a000);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.quiz-meta {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 20px;
}
.quiz-score-live { color: #16a34a; }
.quiz-question-card {
  background: linear-gradient(135deg, #1a2a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(26,26,46,.25);
}
.quiz-q-label {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.quiz-q-word {
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 800;
  color: #ffc000;
  line-height: 1.2;
  word-break: break-word;
}
.quiz-q-type {
  margin-top: 8px;
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.4);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.quiz-option {
  padding: 16px 18px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-left: 4px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: #1a2a2e;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s, transform .1s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-option:hover:not(.answered) {
  border-color: var(--primary);
  background: #f8fafc;
}
.quiz-option.answered { cursor: default; }
.quiz-option.correct {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #166534;
}
.quiz-option.wrong {
  border-color: #dc2626;
  background: #fff1f2;
  color: #991b1b;
}
.quiz-option.reveal {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #166534;
}
@keyframes qShake {
  0%,100%{transform:none}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-4px)}
  80%{transform:translateX(4px)}
}
.quiz-option.shake { animation: qShake .35s ease; }
.quiz-opt-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.quiz-option.correct .quiz-opt-letter { background: #16a34a; color: #fff; }
.quiz-option.wrong   .quiz-opt-letter { background: #dc2626; color: #fff; }
.quiz-option.reveal  .quiz-opt-letter { background: #16a34a; color: #fff; }

/* ─────────────────────────────────────────────
   MATCHING GAME
   ───────────────────────────────────────────── */
.match-wrap {
  max-width: 700px;
  margin: 0 auto;
}
.match-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}
.match-hdr-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .83rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
}
.match-timer {
  font-size: .78rem;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: .01em;
  text-align: center;
  min-width: 48px;
  flex: 1;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.match-card {
  padding: 21px 12px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 18px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a2a2e;
  cursor: pointer;
  text-align: center;
  transition: border-color .12s, background .12s, box-shadow .12s, opacity .35s, transform .35s;
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
}
.match-card:hover:not(.matched):not(.selected):not(.wrong) {
  border-color: #94a3b8;
  background: #f8fafc;
}
.match-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(29,111,242,.18);
  color: var(--primary-dark);
}
@keyframes mcShake {
  0%,100%{transform:none}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-3px)}
  80%{transform:translateX(3px)}
}
.match-card.wrong {
  border-color: #dc2626;
  background: #fff1f2;
  animation: mcShake .35s ease;
}
@keyframes mcFadeOut {
  from { opacity:1; transform:scale(1); }
  to   { opacity:0; transform:scale(.82); }
}
.match-card.matched {
  animation: mcFadeOut .35s ease forwards;
  pointer-events: none;
  border-color: transparent;
}
@keyframes celebFall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(600deg) scale(.6); opacity: 0; }
}
.fc-res-stat-row--time .fc-res-stat-num {
  color: #6366f1;
  font-size: .9rem;
}

/* ─────────────────────────────────────────────
   GAME HEADER — dùng chung cho cả 3 game
   ───────────────────────────────────────────── */
.game-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}
.game-hdr-center {
  font-size: .82rem;
  font-weight: 700;
  color: #64748b;
  text-align: center;
  flex: 1;
}
.game-quit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 0;
  transition: color .15s;
  white-space: nowrap;
}
.game-quit-btn:hover { color: #475569; }

/* ── Nút Thoát trong navbar khi đang chơi game ── */
.nav-game-quit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  flex-shrink: 0;
  order: -1;
}
.nav-game-quit-btn:hover { background: rgba(255,255,255,.22); }

/* ─────────────────────────────────────────────
   DICTATION GAME — Nghe rồi gõ đúng từ
   ───────────────────────────────────────────── */
.dict-wrap { max-width: 560px; margin: 0 auto; }
.dict-card {
  background: linear-gradient(135deg, #1a2a2e 0%, #16213e 100%);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(26,26,46,.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.dict-meaning-label {
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.dict-meaning {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin-top: -8px;
}
.dict-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #ffc000;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.dict-speak-btn:hover  { background: rgba(255,255,255,.14); }
.dict-speak-btn:active { transform: scale(.96); }
.dict-input {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color .15s, background .15s;
}
.dict-input::placeholder { color: rgba(255,255,255,.35); font-weight: 500; }
.dict-input:focus { border-color: #ffc000; background: rgba(255,255,255,.1); }
.dict-input.dict-correct { border-color: #4ade80; background: rgba(74,222,128,.12); color: #4ade80; }
.dict-input.dict-wrong   { border-color: #f87171; background: rgba(248,113,113,.12); color: #f87171; }
.dict-feedback { min-height: 20px; font-size: .88rem; font-weight: 700; }
.dict-fb-ok  { color: #4ade80; }
.dict-fb-err { color: #f87171; }
.dict-fb-err strong { color: #fff; }
.dict-submit-btn {
  width: 100%;
  max-width: 320px;
  padding: 13px;
  background: #ffc000;
  color: #1a2a2e;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.dict-submit-btn:hover  { background: #d4a000; }
.dict-submit-btn:active { transform: scale(.98); }

/* ─────────────────────────────────────────────
   FLASHCARD GAME
   ───────────────────────────────────────────── */
.fc-wrap {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fc-counters {
  display: flex;
  gap: 10px;
  font-size: .82rem;
  font-weight: 700;
}
.fc-cnt-k { color: #16a34a; }
.fc-cnt-u { color: #dc2626; }

.fc-progress-bar {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.fc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a2a2e, #0f3460);
  border-radius: 99px;
  transition: width .4s ease;
}

/* 3D flip scene */
.fc-scene {
  width: 100%;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 0;
  user-select: none;
}
.fc-card-inner {
  position: relative;
  width: 100%;
  min-height: 240px;
  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: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 36px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  gap: 0;
}
.fc-front {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  transition: box-shadow .2s, border-color .2s;
}
.fc-scene:hover .fc-front {
  box-shadow: 0 10px 36px rgba(0,0,0,.11), 0 1px 4px rgba(0,0,0,.04);
  border-color: #cbd5e1;
}
.fc-flip-hint {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: .95rem;
  font-weight: 600;
  color: #94a3b8;
  pointer-events: none;
  transition: opacity .35s;
}
.fc-back {
  background: linear-gradient(135deg, #1a2a2e 0%, #0f3460 100%);
  border: none;
  transform: rotateY(180deg);
}
/* Needs min-height on inner so absolute children are visible */
.fc-card-inner { min-height: 240px; }

.fc-word {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  color: #1a2a2e;
  text-align: center;
  line-height: 1.25;
}
.fc-ipa {
  font-size: .9rem;
  color: #475569;
  margin-top: 10px;
  min-height: 20px;
  text-align: center;
  letter-spacing: .02em;
}
.fc-meaning {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  color: #ffc000;
  text-align: center;
  line-height: 1.25;
}

/* ── Topbar ── */
.fc-topbar {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.fc-status-counter {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a2a2e;
}
.fc-counter-sep { color: #94a3b8; font-weight: 400; margin: 0 2px; }

/* ── Progress wrap (badge trái + bar + badge phải) ── */
.fc-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 32px;
}
.fc-progress-wrap .fc-progress-bar {
  flex: 1;
  margin-bottom: 0;
}
.fc-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

/* ── Card wrapper + floating controls ── */
.fc-card-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 28px;
}
.fc-card-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: 5px 10px;
  border: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.fc-speak-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: background .15s, color .15s;
}
.fc-speak-icon-btn:hover { background: #e0f2fe; color: #0284c7; }
.fc-auto-switch {
  position: relative;
  width: 32px; height: 18px;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.fc-auto-switch.on { background: #22c55e; }
.fc-auto-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.fc-auto-switch.on .fc-auto-knob { transform: translateX(14px); }
.fc-auto-text { font-size: .7rem; font-weight: 600; color: #94a3b8; }

/* ── Badge colors (dùng cho fc-badge-inline trong status row) ── */
.fc-badge-num { font-size: .9rem; font-weight: 800; line-height: 1; }
.fc-badge-u { background: #fff1f2; color: #dc2626; }
.fc-badge-k { background: #f0fdf4; color: #16a34a; }

/* ── Action bar ── */
.fc-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  margin-top: 8px;
}
.fc-act-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.fc-act-item:nth-child(2) { margin-left: 14px; }
.fc-act-item:nth-child(4) { margin-left: 14px; }
.fc-act-label {
  font-size: .72rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.fc-act-item:has(.fc-act-btn:disabled) .fc-act-label { opacity: .35; }
.fc-act-btn {
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  flex-shrink: 0;
}
.fc-act-btn:active:not(:disabled) { transform: scale(.9); }
.fc-act-btn:disabled { opacity: .35; cursor: not-allowed; }
.fc-act-unknown {
  width: 56px; height: 56px;
  background: #fff1f2; border-color: #fecaca; color: #dc2626;
}
.fc-act-unknown:hover:not(:disabled) { background: #fee2e2; border-color: #f87171; box-shadow: 0 4px 14px rgba(220,38,38,.18); }
.fc-act-label-unknown { color: #dc2626; }
.fc-act-known {
  width: 56px; height: 56px;
  background: #f0fdf4; border-color: #bbf7d0; color: #16a34a;
}
.fc-act-known:hover { background: #dcfce7; border-color: #4ade80; box-shadow: 0 4px 14px rgba(22,163,74,.18); }
.fc-act-label-known { color: #16a34a; }
.fc-act-back, .fc-act-shuffle {
  width: 40px; height: 40px;
  background: #f8fafc; border-color: #e2e8f0; color: #94a3b8;
}
.fc-act-back:hover:not(:disabled), .fc-act-shuffle:hover { background: #f1f5f9; color: #64748b; }
.fc-act-shuffle.active {
  background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark);
}
.fc-act-shuffle.active:hover { background: #dbeafe; border-color: var(--primary); }

/* ─────────────────────────────────────────────
   FLASHCARD RESULT SCREEN
   ───────────────────────────────────────────── */
.fc-result-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  width: 100%;
}
.fc-res-circle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.fc-res-ring { width: 100px; height: 100px; }
.fc-res-prog-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a2a2e;
  margin-bottom: 14px;
}
.fc-res-stats { display: flex; flex-direction: column; gap: 10px; }
.fc-res-stat-row { display: flex; align-items: center; gap: 10px; }
.fc-res-stat-lbl {
  font-size: .8rem; font-weight: 600; color: #475569; min-width: 68px;
}
.fc-res-stat-bar-wrap {
  flex: 1; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden;
}
.fc-res-stat-bar { height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.4,0,.2,1); }
.fc-res-stat-bar-known { background: #4ade80; }
.fc-res-stat-bar-unknown { background: #f87171; }
.fc-res-stat-num { font-size: .92rem; font-weight: 800; color: #1a2a2e; min-width: 22px; text-align: right; }

.fc-res-ring-fill {
  transition: stroke-dasharray 1.2s cubic-bezier(.4,0,.2,1);
}

.fc-res-next-col { display: flex; flex-direction: column; gap: 10px; }
.fc-res-next-title {
  font-size: 1rem; font-weight: 700; color: #1a2a2e; margin-bottom: 4px;
}
.fc-res-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; border-radius: 12px;
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
  border: 1.5px solid #e2e8f0; background: #fff; color: #475569;
}
.fc-res-btn:hover { border-color: #cbd5e1; color: #1a2a2e; background: #f8fafc; }
.fc-res-btn-primary {
  background: #ffc000; border-color: #ffc000; color: #1a2a2e;
}
.fc-res-btn-primary:hover { background: #d4a000; border-color: #d4a000; }


/* ─────────────────────────────────────────────
   LOADING SPINNER
   ───────────────────────────────────────────── */
.vocab-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 500;
}
.vocab-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid #e2e8f0;
  border-top-color: #1a2a2e;
  border-radius: 50%;
  animation: vSpin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes vSpin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .vocab-hero { padding: calc(var(--nav-h, 60px) + 14px) 16px 16px; }
  .vocab-tabs-wrap { padding: 10px 16px; }
  .vocab-segment { max-width: 100%; }
  .vocab-seg-btn { padding: 8px 12px; font-size: .82rem; }
  .vocab-body { padding: 20px 12px 64px; }

  /* Word rows: 3 hàng trên mobile */
  .vocab-row {
    grid-template-columns: 36px 26px 1fr 26px 26px 26px;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "toggle speak word  edit del info"
      ".      .     ipa   ipa  ipa  ipa"
      ".      .     meaning meaning meaning .";
    row-gap: 2px;
    column-gap: 8px;
    padding: 10px 12px;
  }
  .vr-toggle-sw { grid-area: toggle; width: 36px; height: 20px; border-radius: 10px; align-self: center; }
  .vr-toggle-sw.known .vr-sw-knob { transform: translateX(16px); }
  .vr-sw-knob   { width: 14px; height: 14px; }
  .vr-word      { grid-area: word; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vr-speak-btn { grid-area: speak; width: 26px; height: 26px; justify-self: center; align-self: center; }
  .vr-ipa       { grid-area: ipa; display: block; font-size: .68rem; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vr-meaning   { grid-area: meaning; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vr-edit-btn  { grid-area: edit;  width: 26px; height: 26px; }
  .vr-del-btn   { grid-area: del;   width: 26px; height: 26px; }
  .vr-info-wrap { grid-area: info; }
  .vr-info-btn  { width: 26px; height: 26px; }
  .vr-info-popup { right: -8px; }
  .vd-date-header { margin: 20px 0 17px; }

  .vre-inputs { grid-template-columns: 1fr; }
  .fc-result-screen { grid-template-columns: 1fr; gap: 24px; }
  .fc-res-ring { width: 80px; height: 80px; }
  .game-type-grid { grid-template-columns: 1fr 1fr; }
  .game-type-card { padding: 16px 12px; }
  .gtc-icon svg { width: 26px; height: 26px; }
  .match-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .match-card { padding: 14px 8px; font-size: .9rem; min-height: 82px; }
  .quiz-question-card { padding: 28px 20px; }
}
@media (max-width: 480px) {
  .match-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .match-card { padding: 16px 10px; font-size: 1rem; min-height: 80px; }
}

/* ─────────────────────────────────────────────
   CONFIRM MODAL (thay thế window.confirm xấu)
   ───────────────────────────────────────────── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: confirm-fade-in .15s ease;
}
@keyframes confirm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.confirm-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  padding: 28px 28px 22px;
  max-width: 340px;
  width: 100%;
  animation: confirm-slide-up .18s cubic-bezier(.34,1.2,.64,1);
}
@keyframes confirm-slide-up {
  from { transform: translateY(12px) scale(.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}
.confirm-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fee2e2;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.confirm-icon svg { width: 22px; height: 22px; color: #ef4444; }
.confirm-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
}
.confirm-msg {
  font-size: .875rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 22px;
}
.confirm-msg strong { color: #0f172a; font-weight: 600; }
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.confirm-btn {
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.confirm-btn-cancel {
  background: #f1f5f9;
  color: #475569;
}
.confirm-btn-cancel:hover { background: #e2e8f0; }
.confirm-btn-danger {
  background: #ef4444;
  color: #fff;
}
.confirm-btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.35); }

/* ─────────────────────────────────────────────
   QUIZ — TIMER BAR (standalone, trên thẻ câu hỏi)
   ───────────────────────────────────────────── */
.quiz-timer-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0;
}
.quiz-timer-fill {
  height: 100%;
  border-radius: 999px;
  transition: background .35s;
}

/* ─────────────────────────────────────────────
   QUIZ — SCORE CHIPS (đúng / sai / streak)
   ───────────────────────────────────────────── */
.quiz-score-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.qs-chip {
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.qs-ok   { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.qs-err  { background: #fff1f2; color: #dc2626; border-color: #fecaca; }
.qs-fire { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }

/* ─────────────────────────────────────────────
   QUIZ — ĐÁP ÁN: 1 tông màu trung tính, đồng nhất A/B/C/D
   (trước đây mỗi đáp án 1 màu riêng nhìn rối mắt)
   ───────────────────────────────────────────── */
.quiz-opt-letter { background: var(--primary-light); color: var(--primary-dark); }
.quiz-option.correct .quiz-opt-letter,
.quiz-option.reveal  .quiz-opt-letter { background: #16a34a; color: #fff; }
.quiz-option.wrong   .quiz-opt-letter { background: #dc2626; color: #fff; }
.quiz-option.correct,
.quiz-option.reveal { border-left-color: #16a34a; }
.quiz-option.wrong  { border-left-color: #dc2626; }

@keyframes quizCorrectBounce {
  0%,100% { transform: none; }
  50%     { transform: scale(1.025); }
}
.quiz-option.correct { animation: quizCorrectBounce .28s ease; }

