/* ==========================================================================
   Luyện Từ (luyentu.com clone) — Tích hợp chuẩn giao diện school.unizvn.com
   Hỗ trợ đầy đủ Light/Dark Mode, Hiệu ứng Particle Theme, 11 Chế độ Game & SRS
   ========================================================================== */

.lt-app {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 20px 48px;
  min-height: calc(100vh - var(--header-h, 64px));
  z-index: 1;
}

/* Particle Layer (Sakura / Snow / Firefly) */
.lt-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.lt-particle {
  position: absolute;
  top: -24px;
  user-select: none;
  pointer-events: none;
  animation: ltFall linear infinite;
}
@keyframes ltFall {
  0% {
    transform: translateY(-20px) translateX(0) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: translateY(50vh) translateX(25px) rotate(180deg);
    opacity: 0.85;
  }
  100% {
    transform: translateY(105vh) translateX(-15px) rotate(360deg);
    opacity: 0.1;
  }
}

/* Top Status & Sub-Navbar */
.lt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.lt-brand-group {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1 1 340px;
  min-width: 0;
}

.lt-avatar-badge {
  width: 116px;
  height: 116px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.26);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lt-avatar-badge:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 26px rgba(217, 119, 6, 0.35);
}

.lt-brand-title {
  min-width: 0;
}
.lt-brand-title h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
}
.lt-brand-title p {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--text-soft);
}

.lt-status-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.lt-status-pills.is-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
}
.lt-status-pills.is-grid-2x2 .lt-pill {
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  font-size: 14.5px;
  border-radius: 16px;
}

.lt-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.15s ease;
}
.lt-pill.is-clickable {
  cursor: pointer;
}
.lt-pill.is-clickable:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.lt-pill.pill-exam {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.lt-pill.pill-streak {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}
.lt-pill.pill-coins {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

/* Main Navigation Tabs */
.lt-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.lt-nav-tabs::-webkit-scrollbar {
  display: none;
}

.lt-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lt-tab-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.lt-tab-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.lt-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
}
.lt-tab-btn.is-active .lt-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Layout Switcher Bar on #home / #video-personal */
.lt-layout-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.lt-layout-sw-lbl {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.lt-layout-sw-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lt-layout-sw-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.lt-layout-sw-btn:hover {
  color: var(--text);
  border-color: var(--primary);
}
.lt-layout-sw-btn.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(240, 81, 35, 0.25);
}

/* Phương án 2 & 4: 50% - 50% Equal Split Grid */
.lt-home-split-50 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .lt-home-split-50 {
    grid-template-columns: 1fr;
  }
}

/* Phương án 3: Tiến độ (Left) + Lịch Tháng (Right) */
.lt-home-split-month {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .lt-home-split-month {
    grid-template-columns: 1fr;
  }
}

/* Monthly Calendar Card (Phương án 3) */
.lt-mcal-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lt-mcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.lt-mcal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-soft);
  padding: 2px 0 4px;
}
.lt-mcal-day {
  height: 30px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  position: relative;
}
.lt-mcal-day.is-empty {
  background: transparent;
  border-color: transparent;
}
.lt-mcal-day.is-done {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.42);
  color: #15803d;
  font-weight: 800;
}
.lt-mcal-day.is-freeze {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #0284c7;
}
.lt-mcal-day.is-today {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  color: var(--text);
  font-weight: 800;
}
.lt-mcal-ico {
  font-size: 11px;
  line-height: 1;
}

/* Phương án 4: Compact 1-Line SRS Action Bar */
.lt-srs-quickbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
}
.lt-srs-qb-items {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lt-srs-qb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

/* Anki-style 365-Day Review Heatmap */
.lt-hm-parallel-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.lt-hm-horiz-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 8px 0;
  min-width: 0;
}
.lt-hm-grid-horiz {
  display: grid;
  grid-template-columns: repeat(var(--hm-weeks, 53), minmax(0, 1fr));
  grid-template-rows: repeat(7, 11px);
  grid-auto-flow: column;
  gap: 2.2px;
  width: 100%;
}
.lt-hm-parallel-card.is-fullwidth-hm .lt-hm-grid-horiz {
  grid-template-rows: repeat(7, 13.5px);
  gap: 3px;
}
.lt-hm-cell {
  width: 100%;
  height: 11px;
  border-radius: 2.5px;
  background: rgba(148, 163, 184, 0.22);
  transition: transform 0.12s ease;
}
.lt-hm-parallel-card.is-fullwidth-hm .lt-hm-cell {
  height: 13.5px;
  border-radius: 3px;
}
.lt-hm-cell:hover:not(.is-pad) {
  transform: scale(1.3);
  z-index: 2;
}
.lt-hm-cell.is-pad {
  background: transparent;
  pointer-events: none;
}
.lt-hm-cell.lv-1 {
  background: #86efac;
}
.lt-hm-cell.lv-2 {
  background: #bef264;
}
.lt-hm-cell.lv-3 {
  background: #4ade80;
}
.lt-hm-cell.lv-4 {
  background: #15803d;
}
.lt-hm-cell.is-freeze {
  background: #38bdf8;
}
.lt-hm-cell.is-today {
  outline: 1.8px solid var(--text);
  outline-offset: -1px;
}
.lt-hm-stats-row4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.lt-hm-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-width: 0;
}
.lt-hm-stat-item span {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-hm-stat-item strong {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.lt-hm-stat-item .hm-green {
  color: #16a34a;
}
.lt-hm-stat-item .hm-cur {
  color: var(--text);
}
.lt-hm-stat-item.is-streak-highlight {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(234, 88, 12, 0.06));
  border-color: rgba(249, 115, 22, 0.35);
}
.lt-hm-stat-item.is-streak-highlight .hm-cur {
  color: #ea580c;
}

.lt-suggest-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240, 81, 35, 0.12), rgba(249, 115, 22, 0.1));
  border: 1px solid rgba(240, 81, 35, 0.28);
  color: var(--primary, #f05123);
  font-size: 12px;
  font-weight: 700;
}

.lt-app .btn-xs {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
  white-space: nowrap;
}

.lt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.lt-stats-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.lt-stats-1x4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.lt-stats-1x3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 980px) {
  .lt-stats-1x4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .lt-stats-1x3 {
    grid-template-columns: 1fr;
  }
}
.lt-progress-hero-card,
.lt-progress-hero-card.bg-slate {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.lt-progress-hero-card.bg-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.07);
}
.lt-progress-hero-card.bg-coral {
  background: linear-gradient(135deg, #fff5f2 0%, #ffe4d6 100%);
  border-color: #fdba74;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.07);
}
.lt-progress-hero-card.bg-dark {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
}
.lt-progress-hero-card.bg-dark .lt-prog-title {
  color: #f8fafc;
}
:root[data-theme="dark"] .lt-progress-hero-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: var(--shadow-sm);
}
.lt-stat-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lt-progress-hero-card .lt-stat-box {
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
:root[data-theme="dark"] .lt-progress-hero-card .lt-stat-box {
  border-color: rgba(255, 255, 255, 0.08);
}
.lt-stat-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.lt-stat-box .lbl {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}
.lt-stat-box .val {
  font-size: 27px;
  font-weight: 800;
  margin-top: 4px;
  font-family: var(--mono);
  line-height: 1.15;
}
.lt-stat-box .sub {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 3px;
  font-weight: 500;
  line-height: 1.35;
}
.lt-stat-box.st-blue .val { color: #2563eb; }
.lt-stat-box.st-red .val { color: #dc2626; }
.lt-stat-box.st-green .val { color: #16a34a; }
.lt-stat-box.st-purple .val { color: #6d28d9; }
.lt-stat-box.st-orange .val { color: #b45309; }

/* 7-Day Streak Week Tracker */
.lt-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
  width: 100%;
}
.lt-day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 2px;
  min-width: 0;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}
.lt-day-col.is-today {
  border-color: var(--primary);
  background: rgba(240, 81, 35, 0.05);
}
.lt-day-dot {
  width: 28px;
  height: 28px;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  background: var(--surface-3);
  color: var(--muted);
}
.lt-day-col.is-done .lt-day-dot {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
}
.lt-day-col.is-freeze .lt-day-dot {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
}

/* Quick Actions 4-Card Row */
.lt-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 860px) {
  .lt-quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}
.lt-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}
.lt-quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.lt-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--primary-soft);
  flex-shrink: 0;
}
.lt-quick-card strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}
.lt-quick-card small {
  font-size: 12px;
  color: var(--text-soft);
}

/* Section Headers & Filter Pills */
.lt-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lt-sec-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lt-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.lt-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lt-chip:hover {
  border-color: var(--primary);
  color: var(--text);
}
.lt-chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Roadmaps Grid (84 Bộ) */
.lt-roadmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 14px;
}
.lt-comm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}
.lt-roadmap-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.16s ease;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.lt-roadmap-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.lt-rm-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  min-width: 0;
}
.lt-rm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  background: var(--surface-2);
  color: var(--text-soft);
}
.lt-pin-btn {
  border: none;
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
}
.lt-pin-btn.is-pinned {
  background: #fef3c7;
  color: #92400e;
}
.lt-rm-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.4;
}
.lt-rm-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.lt-comm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.lt-comm-actions .btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 11px;
  min-width: 0;
}
.lt-progress-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-bottom: 12px;
}
.lt-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #16a34a);
  transition: width 0.3s ease;
}

/* 11 Game Modes Selection Grid */
.lt-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 13px;
  margin-top: 14px;
}
.lt-game-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.lt-game-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.lt-game-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.lt-game-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lt-game-icon {
  font-size: 28px;
}
.lt-game-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
}

/* Game Runner Stage */
.lt-game-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lt-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* 3D Flashcard Flip */
.lt-flashcard-wrap {
  perspective: 1200px;
  max-width: 560px;
  width: 100%;
  margin: 12px auto 20px;
}
.lt-flashcard {
  width: 100%;
  min-height: 290px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 2px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.35s ease, border-color 0.2s ease;
  position: relative;
}
.lt-flashcard:hover {
  border-color: var(--primary);
}
.lt-fc-word {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
}
.lt-fc-ipa {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.lt-fc-pos {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 14px;
}
.lt-fc-meaning {
  font-size: 22px;
  font-weight: 800;
  color: var(--ok);
  margin: 10px 0;
}
.lt-fc-example {
  font-size: 14.5px;
  color: var(--text-soft);
  max-width: 460px;
  line-height: 1.55;
  margin-top: 8px;
}

/* FSRS 4-Button Rating Bar */
.lt-rate-wrap {
  max-width: 560px;
  width: 100%;
  margin: 14px auto 4px;
}
.lt-rate-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 10px;
  text-align: center;
}
.lt-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.lt-rate-btn {
  appearance: none;
  font-family: inherit;
  height: auto;
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}
.lt-rate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.lt-rate-btn .lt-rate-ivl {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0.9;
}
.lt-rate-btn .lt-rate-lbl {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}
.lt-rate-btn.is-again {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
}
.lt-rate-btn.is-hard {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(217, 119, 6, 0.06);
  color: #92400e;
}
.lt-rate-btn.is-good {
  border-color: rgba(22, 163, 74, 0.5);
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}
.lt-rate-btn.is-easy {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.06);
  color: #1e40af;
}

/* Multiple Choice Options */
.lt-quiz-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 680px;
  width: 100%;
  margin: 18px auto;
}
@media (max-width: 640px) {
  .lt-quiz-choices {
    grid-template-columns: 1fr;
  }
}
.lt-choice-btn {
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lt-choice-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface);
}
.lt-choice-btn.is-correct {
  border-color: #16a34a;
  background: var(--ok-soft);
  color: #15803d;
}
.lt-choice-btn.is-wrong {
  border-color: #dc2626;
  background: var(--danger-soft);
  color: #b91c1c;
}

/* Matching Grid */
.lt-matching-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}
@media (max-width: 680px) {
  .lt-matching-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.lt-match-card {
  min-height: 88px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lt-match-card.is-picked {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.lt-match-card.is-matched {
  opacity: 0.25;
  pointer-events: none;
  border-color: var(--ok);
}
.lt-match-card.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* Spreadsheet Table & Inputs */
.lt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.lt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.lt-table th,
.lt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.lt-table th {
  background: var(--surface-2);
  font-weight: 800;
  font-size: 12.5px;
  color: var(--text-soft);
  white-space: nowrap;
}
.lt-inp {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}
.lt-inp:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

/* SRS Level Badges (Lv0 -> Lv5) */
.lt-srs-bars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 16px 0;
}
@media (max-width: 720px) {
  .lt-srs-bars {
    grid-template-columns: repeat(3, 1fr);
  }
}
.lt-srs-col {
  padding: 14px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.lt-srs-lv {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  margin-bottom: 6px;
}
.lv-0 { background: #f1f5f9; color: #334155; }
.lv-1 { background: #fee2e2; color: #991b1b; }
.lv-2 { background: #ffedd5; color: #9a3412; }
.lv-3 { background: #fef3c7; color: #92400e; }
.lv-4 { background: #dbeafe; color: #1e40af; }
.lv-5 { background: #dcfce7; color: #166534; }

/* Arcade Arena (Meteor Shooter & Flappy Bird & Com Tam Shop) */
.lt-arcade-arena {
  position: relative;
  width: 100%;
  min-height: 220px;
  height: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  overflow: hidden;
  border: 2px solid #334155;
  margin-bottom: 14px;
}
.lt-meteor-item {
  position: absolute;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316, #dc2626);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transform: translateX(-50%);
}

/* Modal Dialog */
.lt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}
.lt-modal-backdrop[hidden] {
  display: none !important;
}
.lt-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px;
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Luyện từ 2 — Học qua Video & Phim (Video Courses & Player)
   ========================================================================== */
.lt-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.lt-video-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
}
.lt-video-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}
.lt-video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  overflow: hidden;
  cursor: pointer;
}
.lt-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.lt-video-card:hover .lt-video-thumb {
  transform: scale(1.04);
}
.lt-video-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  text-align: center;
  padding: 16px;
}
.lt-video-flag-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lt-video-media-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.lt-video-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.lt-video-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-soft);
}
.lt-video-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--primary);
  border: 1px solid var(--border);
}
.lt-video-card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}
.lt-video-card-title:hover {
  color: var(--primary);
}
.lt-video-card-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.lt-video-card-progress {
  margin-top: auto;
  margin-bottom: 14px;
}
.lt-video-progress-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 4px;
}
.lt-video-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  transition: width 0.3s ease;
}
.lt-video-progress-text {
  font-size: 11.5px;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
}
.lt-video-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Course Detail & Unit Grid */
.lt-video-hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.lt-video-hero-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: center;
}
@media (max-width: 768px) {
  .lt-video-hero-grid {
    grid-template-columns: 1fr;
  }
}
.lt-video-hero-poster {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.lt-video-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.lt-video-unit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.lt-video-unit-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Video Flashcard Player */
.lt-player-container {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lt-player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.lt-player-screen-card {
  position: relative;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.lt-video-elem {
  width: 100%;
  max-height: 460px;
  display: block;
  background: #000;
  outline: none;
}
.lt-audio-backdrop-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 380px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lt-audio-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
}
.lt-audio-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lt-audio-elem {
  width: 90%;
  margin: 12px auto;
  display: block;
  outline: none;
  border-radius: 999px;
}
.lt-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: ltPulse 1.4s infinite;
}
@keyframes ltPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Subtitles & Transcript Card */
.lt-subtitles-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.lt-sub-context {
  font-size: 13.5px;
  color: var(--text-soft);
  font-style: italic;
  margin: 4px 0;
  line-height: 1.45;
}
.lt-target-line {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--text);
  margin: 12px 0 14px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}
.lt-ruby {
  ruby-position: over;
}
.lt-ruby rt {
  font-size: 0.52em;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.lt-video-trans-card {
  margin: 14px auto 0;
  max-width: 680px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  text-align: left;
}
.lt-video-trans-text {
  font-size: 16px;
  font-weight: 700;
  color: #059669;
  line-height: 1.5;
  margin-top: 4px;
}
.lt-video-vocab-block {
  margin-top: 14px;
  text-align: left;
}
.lt-vocab-tag {
  display: inline-block;
  padding: 4px 10px;
  margin: 4px 6px 4px 0;
  border-radius: 8px;
  background: rgba(240, 81, 35, 0.08);
  border: 1px solid rgba(240, 81, 35, 0.2);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.45;
}

/* FSRS Rating Buttons in Video Player */
.lt-video-rate-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lt-video-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .lt-video-rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}
.lt-video-rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 16px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.lt-video-rate-btn.is-again {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}
.lt-video-rate-btn.is-again:hover {
  background: #dc2626;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
}
.lt-video-rate-btn.is-hard {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.3);
  color: #d97706;
}
.lt-video-rate-btn.is-hard:hover {
  background: #d97706;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35);
}
.lt-video-rate-btn.is-good {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}
.lt-video-rate-btn.is-good:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}
.lt-video-rate-btn.is-easy {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #2563eb;
}
.lt-video-rate-btn.is-easy:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.lt-video-rate-key {
  font-size: 11px;
  font-weight: 800;
  opacity: 0.8;
  letter-spacing: 0.5px;
}
.lt-video-rate-lbl {
  font-size: 16px;
  font-weight: 800;
}
.lt-video-rate-ivl {
  font-size: 11.5px;
  opacity: 0.85;
}
.lt-video-shortcuts-hint {
  font-size: 12px;
  color: var(--text-soft);
  text-align: center;
  margin-top: 4px;
}

.lt-quick-learn-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 3;
  padding: 5px 11px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary, #f05123);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.lt-quick-learn-btn:hover {
  background: #ffffff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ==================== MOBILE RESPONSIVE OVERRIDES (<= 720px) ==================== */
@media (max-width: 720px) {
  .lt-app {
    padding: 12px 12px 28px;
  }
  .lt-topbar {
    padding: 16px;
    border-radius: 18px;
    gap: 14px;
    margin-bottom: 14px;
  }
  .lt-brand,
  .lt-brand-group {
    flex: 1 1 100%;
    min-width: 0;
    gap: 12px;
    width: 100%;
    align-items: flex-start;
  }
  .lt-avatar-badge {
    width: 58px;
    height: 58px;
    font-size: 32px;
    border-radius: 16px;
  }
  .lt-brand-title,
  .lt-brand-title h1 {
    font-size: 18px;
    line-height: 1.3;
  }
  .lt-brand-sub,
  .lt-brand-title p {
    font-size: 12px;
    margin-top: 4px;
  }
  .lt-status-pills,
  .lt-status-pills.is-grid-2x2 {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .lt-status-pills .lt-pill,
  .lt-status-pills.is-grid-2x2 .lt-pill {
    padding: 8px 10px;
    font-size: 12.5px;
  }
  .lt-card {
    padding: 16px;
    border-radius: 16px;
  }
  .lt-hm-stats-row4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .lt-hm-stat-item {
    padding: 8px 10px;
  }
  .lt-comm-grid,
  .lt-video-grid,
  .lt-roadmap-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .lt-new-cat-grid,
  .lt-classes-grid,
  .lt-lb-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .lt-flashcard,
  .lt-fc-card {
    min-height: 220px;
    padding: 20px 16px;
  }
  .lt-fc-word {
    font-size: 26px;
  }
  .lt-video-player-wrap {
    gap: 10px;
  }
  .lt-video-player-topbar {
    padding: 8px 12px;
    gap: 8px;
  }
  .lt-video-sub-box {
    padding: 14px 12px;
    min-height: 100px;
  }
  .lt-video-sub-target {
    font-size: 18px;
  }
  .lt-video-sub-vi {
    font-size: 15px;
  }
  .lt-video-rate-btn {
    padding: 10px 6px;
    border-radius: 12px;
  }
  .lt-video-rate-key {
    display: none;
  }
  .lt-video-rate-lbl {
    font-size: 14px;
  }
  .lt-video-rate-ivl {
    font-size: 11px;
  }
  .lt-video-shortcuts-hint {
    display: none;
  }
  .lt-tree-layout {
    grid-template-columns: 1fr !important;
  }
  .lt-tree-stage-canvas {
    min-height: 360px !important;
  }
}

/* ==================== TAB TRỒNG CÂY HOA PHƯỢNG (PHOENIX TREE GARDEN) ==================== */
.lt-tree-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.lt-tree-stage-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.lt-tree-stage-canvas {
  position: relative;
  min-height: 440px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  user-select: none;
  transition: background 0.5s ease, box-shadow 0.25s ease;
  overflow: hidden;
  container: lt-tree-canvas / inline-size;
}
.lt-tree-stage-canvas.stage-bg-seedling {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0fdf4 68%, #d9f99d 100%);
}
.lt-tree-stage-canvas.stage-bg-bare {
  background: linear-gradient(180deg, #cbd5e1 0%, #e2e8f0 68%, #d6d3d1 100%);
}
.lt-tree-stage-canvas.stage-bg-sprouting {
  background: linear-gradient(180deg, #bae6fd 0%, #ecfccb 68%, #bef264 100%);
}
.lt-tree-stage-canvas.stage-bg-lush {
  background: linear-gradient(180deg, #7dd3fc 0%, #dcfce7 66%, #86efac 100%);
}
.lt-tree-stage-canvas.stage-bg-blooming {
  background: linear-gradient(180deg, #fed7aa 0%, #ffe4e6 58%, #bbf7d0 100%);
}
.lt-tree-stage-canvas.is-drag-over {
  box-shadow: inset 0 0 0 4px #10b981, 0 0 30px rgba(16, 185, 129, 0.35);
}
.lt-tree-drop-zone {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 310px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.25s ease;
}
.lt-tree-stage-canvas.is-drag-over .lt-tree-drop-zone {
  transform: scale(1.04);
}
.lt-tree-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.14));
}
/* Xô nước & phân bón: hình trần không viền, đứng hai bên gốc cây, kéo thả vào cây */
.lt-tree-tool-item {
  --lt-tree-tool-offset: -96px;
  position: absolute;
  bottom: 18px;
  z-index: 5;
  font-size: 46px;
  line-height: 1;
  cursor: grab;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.22));
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}
.lt-tree-tool-item.is-water {
  left: var(--lt-tree-tool-offset);
}
.lt-tree-tool-item.is-fertilize {
  right: var(--lt-tree-tool-offset);
}
.lt-tree-tool-item:hover {
  transform: translateY(-4px) scale(1.08);
}
.lt-tree-tool-item:active {
  cursor: grabbing;
}
.lt-tree-tool-item.is-ready.is-water {
  filter: drop-shadow(0 0 10px rgba(2, 132, 199, 0.75));
}
.lt-tree-tool-item.is-ready.is-fertilize {
  filter: drop-shadow(0 0 10px rgba(22, 163, 74, 0.75));
}
.lt-tree-tool-item:not(.is-ready):not(.is-done) {
  opacity: 0.5;
  filter: grayscale(0.7);
}
.lt-tree-tool-item.is-done {
  opacity: 0.6;
  cursor: pointer;
}
/* Canvas hẹp (không đủ chỗ hai bên vùng cây 440px) thì kéo hình vào trong mép vùng cây */
@container lt-tree-canvas (max-width: 680px) {
  .lt-tree-tool-item {
    --lt-tree-tool-offset: 0px;
    font-size: 38px;
  }
}
.lt-tree-fx-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  z-index: 6;
  animation: ltTreeFxPop 1.2s ease forwards;
}
@keyframes ltTreeFxPop {
  0% { opacity: 0; transform: translateY(-24px) scale(0.6); }
  35% { opacity: 1; transform: translateY(0) scale(1.15); }
  100% { opacity: 0; transform: translateY(20px) scale(1); }
}
.lt-tree-slogan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 18px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(240, 81, 35, 0.1) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.28);
}

/* ==================== TỜ NOTE ƯỚC MƠ (STICKY WISH NOTES ON TREE) ==================== */
.lt-tree-wish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 920px) {
  .lt-tree-wish-layout {
    grid-template-columns: 1fr;
  }
}

.lt-wish-pad-card {
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 24px;
  padding: 18px 16px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lt-wish-pad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lt-wish-pad-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text, #0f172a);
  display: flex;
  align-items: center;
  gap: 6px;
}
.lt-wish-pad-sub {
  font-size: 12px;
  color: var(--text-soft, #64748b);
  line-height: 1.45;
  margin-top: -6px;
}

.lt-sticky-sheet {
  position: relative;
  border-radius: 6px 6px 22px 6px;
  padding: 0 14px 14px;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.13),
    0 2px 5px rgba(15, 23, 42, 0.06),
    inset 0 -2px 0 rgba(15, 23, 42, 0.06);
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(15, 23, 42, 0.09);
}
.lt-sticky-sheet::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(15, 23, 42, 0.14) 52%, transparent 53%);
  border-top-left-radius: 6px;
  pointer-events: none;
}

.lt-note-color-yellow {
  background: linear-gradient(165deg, #fef9c3 0%, #fef08a 100%);
  color: #422006;
}
.lt-note-color-pink {
  background: linear-gradient(165deg, #ffe4e6 0%, #fecdd3 100%);
  color: #4c0519;
}
.lt-note-color-mint {
  background: linear-gradient(165deg, #dcfce7 0%, #bbf7d0 100%);
  color: #052e16;
}
.lt-note-color-sky {
  background: linear-gradient(165deg, #e0f2fe 0%, #bae6fd 100%);
  color: #082f49;
}
.lt-note-color-lavender {
  background: linear-gradient(165deg, #f3e8ff 0%, #e9d5ff 100%);
  color: #3b0764;
}

.lt-sticky-drag-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 6px 7px;
  margin: 0 -6px 6px;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.14);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.lt-sticky-drag-handle.dragging {
  cursor: grabbing;
}
.lt-sticky-drag-pin {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
.lt-sticky-drag-hint {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.78;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lt-wish-textarea {
  width: 100%;
  min-height: 108px;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: inherit;
  outline: none;
}
.lt-wish-textarea::placeholder {
  color: rgba(15, 23, 42, 0.42);
  font-weight: 500;
}

.lt-wish-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.lt-wish-color-dots,
.lt-wish-pin-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lt-wish-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.lt-wish-color-btn.is-active {
  transform: scale(1.18);
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.14);
}
.lt-wish-pin-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--surface-2, #f8fafc);
  cursor: pointer;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.lt-wish-pin-btn.is-active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  transform: translateY(-1px);
}

.lt-wish-pad-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lt-wish-pin-submit-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lt-wish-pin-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.34);
}

.lt-tree-wish-notes-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}

.lt-pinned-wish-note {
  position: absolute;
  width: 104px;
  min-height: 76px;
  max-height: 92px;
  padding: 18px 8px 8px;
  border-radius: 4px 4px 15px 4px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.16),
    0 2px 4px rgba(15, 23, 42, 0.08);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.lt-pinned-wish-note::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(15, 23, 42, 0.15) 52%, transparent 53%);
  border-top-left-radius: 4px;
  pointer-events: none;
}
.lt-pinned-wish-note:hover {
  transform: scale(1.08) rotate(0deg) !important;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.24);
  z-index: 15;
}
.lt-note-del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 50%;
  background: #fff;
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 3;
}
.lt-pinned-wish-note:hover .lt-note-del,
.lt-pinned-wish-note:focus-within .lt-note-del,
.lt-note-del:focus-visible {
  opacity: 1;
}
.lt-note-del:hover {
  background: #fee2e2;
}
@media (hover: none) {
  .lt-note-del {
    opacity: 1;
  }
}
.lt-pinned-wish-note.dragging {
  cursor: grabbing;
  transition: none !important;
  z-index: 25;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.3);
}
.lt-pinned-note-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
  pointer-events: none;
}
.lt-pinned-note-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  pointer-events: none;
}

.lt-wish-drag-ghost {
  position: fixed;
  width: 116px;
  min-height: 82px;
  padding: 18px 10px 10px;
  border-radius: 5px 5px 16px 5px;
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.3);
  pointer-events: none;
  z-index: 9999;
  transform: rotate(-4deg) scale(1.04);
  opacity: 0.94;
}

/* Native <dialog> popup khi bấm vào tờ note trên cây */
#lt-wish-note-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 420px;
  width: calc(100vw - 32px);
  margin: auto;
  overflow: visible;
}
#lt-wish-note-dialog:modal {
  overscroll-behavior: contain;
}
#lt-wish-note-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(4px);
}
.lt-wish-dialog-sheet {
  position: relative;
  border-radius: 10px 10px 30px 10px;
  padding: 28px 22px 22px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.35);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
}
.lt-wish-dialog-pin {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}

/* ==================== TƯƠNG TÁC CÂY (LIKE, BÌNH LUẬN & VƯỜN CÂY TOP 30) ==================== */
.lt-visiting-tree-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto 16px;
  padding: 14px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border: 1.5px solid #6ee7b7;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

.lt-tree-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid rgba(225, 29, 72, 0.25);
  background: rgba(255, 255, 255, 0.94);
  color: #be123c;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.1);
}
.lt-tree-like-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.18);
}
.lt-tree-like-btn.is-liked {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  border-color: #e11d48;
  box-shadow: 0 6px 18px rgba(225, 29, 72, 0.28);
}

/* Dưới màn hình đầu (below-the-fold): sử dụng content-visibility: auto kèm contain-intrinsic-size */
.lt-community-trees-section {
  max-width: 1120px;
  margin: 26px auto 12px;
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 420px;
}

.lt-community-trees-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.24);
}

.lt-community-trees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 14px;
}
@media (max-width: 540px) {
  .lt-community-trees-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

.lt-comm-tree-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
.lt-comm-tree-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 14px 28px rgba(16, 185, 129, 0.15);
}
.lt-comm-tree-card.is-visiting {
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.65) 0%, var(--surface, #fff) 100%);
}

.lt-comm-tree-mini-stage {
  position: relative;
  width: 100%;
  height: 138px;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 8px 0;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.lt-comm-tree-mini-stage.stage-bg-seedling {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0fdf4 68%, #dcfce7 100%);
}
.lt-comm-tree-mini-stage.stage-bg-sprouting {
  background: linear-gradient(180deg, #bae6fd 0%, #ecfdf5 65%, #bbf7d0 100%);
}
.lt-comm-tree-mini-stage.stage-bg-lush {
  background: linear-gradient(180deg, #7dd3fc 0%, #d1fae5 62%, #86efac 100%);
}
.lt-comm-tree-mini-stage.stage-bg-blooming {
  background: linear-gradient(180deg, #fecdd3 0%, #fff1f2 60%, #dcfce7 100%);
}
.lt-comm-tree-mini-svg-wrap {
  width: 130px;
  height: 122px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.lt-comm-mini-note-dot {
  position: absolute;
  width: 16px;
  height: 14px;
  border-radius: 2px 2px 5px 2px;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.12);
  pointer-events: none;
}

/* Hiệu ứng động cho đồ trang trí cây & hào quang mốc chuỗi ẩn */
.tree-svg-swing {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: ltTreeSwing 3.4s ease-in-out infinite alternate;
}
.tree-svg-lantern {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: ltTreeSwing 4.2s ease-in-out infinite alternate;
}
.tree-svg-chime {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: ltTreeSwing 2.6s ease-in-out infinite alternate-reverse;
}
.tree-svg-note {
  animation: ltTreeNoteFloat 2.8s ease-in-out infinite;
}
.tree-svg-cicada-wave {
  animation: ltTreeCicadaPulse 1.8s ease-out infinite;
}
.tree-streak-aura-group {
  animation: ltTreeAuraBreathe 4s ease-in-out infinite alternate;
}
@keyframes ltTreeSwing {
  0% { transform: rotate(-3.5deg); }
  100% { transform: rotate(3.5deg); }
}
@keyframes ltTreeNoteFloat {
  0%, 100% { transform: translateY(0) scale(0.95); opacity: 0.72; }
  50% { transform: translateY(-6px) scale(1.08); opacity: 1; }
}
@keyframes ltTreeCicadaPulse {
  0% { opacity: 0.9; transform: translateX(0); }
  100% { opacity: 0.15; transform: translateX(4px); }
}
@keyframes ltTreeAuraBreathe {
  0% { opacity: 0.78; }
  100% { opacity: 1; }
}

/* ==========================================================================
   Bảng điều khiển dọc bên cạnh (Left Side Control Panel) & Các Popup FSRS/Anki
   ========================================================================== */
.lt-home-with-sidebar {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1024px) {
  .lt-home-with-sidebar {
    grid-template-columns: 1fr;
  }
}

.lt-home-left-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  padding: 18px 14px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.lt-side-panel-head {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
  padding: 2px 6px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lt-side-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 1024px) {
  .lt-side-menu-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}
.lt-side-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
}
.lt-side-menu-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft, rgba(240, 81, 35, 0.08));
  transform: translateY(-1px);
}
.lt-side-menu-btn.is-primary-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}
.lt-side-menu-btn.is-primary-accent:hover {
  filter: brightness(1.05);
}
.lt-side-menu-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.lt-side-menu-ico {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.lt-side-menu-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  white-space: nowrap;
}
.lt-side-menu-btn.is-primary-accent .lt-side-menu-badge {
  background: rgba(255, 255, 255, 0.22);
  border-color: transparent;
  color: #fff;
}

/* Anki Dark/Light Popup Modals (Thứ tự hiển thị, Ngày dễ, Dự báo, Chuỗi học tập, Cài đặt FSRS) */
.lt-anki-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}
.lt-anki-modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  padding: 24px 26px;
  position: relative;
}
.lt-anki-modal-card.is-wide {
  max-width: 960px;
}
.lt-anki-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.lt-anki-modal-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

/* Easy Days Sliders (Ngày dễ) */
.lt-easy-day-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.lt-easy-day-lbl {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.lt-easy-slider-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lt-easy-slider {
  width: 100%;
  accent-color: #60a5fa;
  cursor: pointer;
  height: 6px;
}
.lt-easy-tick-mid {
  width: 2px;
  height: 6px;
  background: var(--text-soft);
  margin: 4px auto 0;
  opacity: 0.65;
}






/* Tab trong popup gộp (Thống kê / Cài đặt) */
.lt-modal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.lt-modal-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lt-modal-tab:hover {
  color: var(--text);
  border-color: var(--primary, #f05123);
}
.lt-modal-tab.is-active {
  background: var(--primary, #f05123);
  border-color: var(--primary, #f05123);
  color: #fff;
}
/* Tinh chỉnh bảng điều khiển bên trái: gọn, cân đối, chữ căn trái cạnh icon */
.lt-home-with-sidebar {
  grid-template-columns: 224px minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1024px) {
  .lt-home-with-sidebar {
    grid-template-columns: 1fr;
  }
}
.lt-home-left-panel {
  height: auto;
  align-self: start;
  gap: 12px;
  padding: 16px 14px 14px;
}
.lt-home-left-panel > h4 {
  margin: 0;
  padding: 2px 4px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}
.lt-side-menu-btn {
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 14px;
  min-height: 54px;
  border-radius: 16px;
  position: relative;
}
.lt-side-menu-btn::after {
  content: "›";
  margin-left: auto;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  color: var(--text-soft);
  opacity: 0.55;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.lt-side-menu-btn:hover::after,
.lt-side-menu-btn.is-active::after {
  transform: translateX(2px);
  opacity: 1;
}
.lt-side-menu-btn .sm-ico {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.lt-side-menu-btn .sm-txt {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.005em;
  color: var(--text);
}
.lt-side-menu-btn.is-active {
  border-color: var(--primary);
  background: var(--primary-soft, rgba(240, 81, 35, 0.1));
}
.lt-side-menu-btn.is-active .sm-ico {
  border-color: transparent;
  background: #fff;
}
@media (max-width: 1024px) {
  .lt-side-menu-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .lt-side-menu-list {
    grid-template-columns: 1fr;
  }
}

/* Hàng trên: Bảng điều khiển (dọc, bên trái) cao bằng khung Tiến độ; Lộ trình bên dưới full chiều rộng */
.lt-home-with-sidebar {
  display: block;
}
.lt-home-top-row {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}
.lt-home-top-row > .lt-home-left-panel {
  height: auto;
  align-self: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 14px 12px 12px;
}
.lt-home-top-row > .lt-home-left-panel .lt-side-menu-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.lt-home-top-row > .lt-home-left-panel .lt-side-menu-btn {
  flex: 1;
  min-height: 46px;
  padding: 8px 12px;
}
.lt-home-top-row > .lt-progress-hero-card {
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}
.lt-home-top-row > .lt-progress-hero-card .lt-stats-1x3,
.lt-home-top-row > .lt-progress-hero-card .lt-stats-1x4 {
  flex: 1;
  align-items: stretch;
}
@media (max-width: 900px) {
  .lt-home-top-row {
    grid-template-columns: 1fr;
  }
  .lt-home-top-row > .lt-home-left-panel .lt-side-menu-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .lt-home-top-row > .lt-home-left-panel .lt-side-menu-list {
    grid-template-columns: 1fr;
  }
}
.lt-hm-stats-row4.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .lt-hm-stats-row4.is-three {
    grid-template-columns: 1fr;
  }
}

/* Các tab trong cùng một popup (Thống kê / Cài đặt) có kích thước cố định, chuyển tab không bị đổi cỡ */
.lt-anki-modal-card.is-fixed {
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}
.lt-anki-modal-card.fixed-settings {
  max-width: 880px;
  height: 680px;
  max-height: 92vh;
}
.lt-anki-modal-card.fixed-stats {
  max-width: 800px;
  height: 680px;
  max-height: 92vh;
}
/* 3 ô Giới Hạn / Học / Đến Hạn: bớt trống, số to hơn và nằm gọn dưới tiêu đề */
.lt-stats-1x3 .lt-stat-box {
  justify-content: center !important;
  gap: 14px !important;
  padding: 18px 22px !important;
}
.lt-stats-1x3 .lt-stat-box .val {
  font-size: 40px !important;
  line-height: 1.05;
  font-weight: 800;
}
.lt-stats-1x3 .lt-stat-box .val small {
  font-size: 17px !important;
}
/* ==========================================================================
   Điện thoại: bản tối giản cho Luyện từ (bỏ banner/biểu đồ, màn học gọn)
   ========================================================================== */
@media (max-width: 700px) {
  #lt-root .hero-courses-banner {
    display: none;
  }
  .lt-pie-card {
    display: none;
  }
}
@media (max-width: 640px) {
  .lt-game-stage {
    padding: 8px 4px;
  }
  .lt-stage-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .lt-stage-header .lt-stage-tools {
    width: 100%;
    gap: 10px !important;
  }
  .lt-stage-header .lt-progress-bar {
    flex: 1;
    width: auto !important;
    min-width: 0;
  }
  .lt-kbd-hint {
    display: none;
  }
  .lt-game-stage .btn {
    max-width: 100%;
    box-sizing: border-box;
  }
  #lt-fc-btn-flip {
    width: 100%;
    min-height: 50px;
    white-space: normal;
    line-height: 1.3;
    font-size: 14px;
  }
}

/* ==========================================================================
   Điện thoại: học Flashcard chỉ còn thẻ (chạm để lật) + nút đánh giá + nút thoát
   ========================================================================== */
@media (max-width: 640px) {
  body:has(.lt-game-stage #lt-fc-card) .header,
  body:has(.lt-game-stage #lt-fc-card) .mobile-bottom-nav,
  body:has(.lt-game-stage #lt-fc-card) .footer {
    display: none !important;
  }
  body:has(.lt-game-stage #lt-fc-card) .layout {
    padding-top: 0;
  }
  body:has(.lt-game-stage #lt-fc-card) .main {
    padding-bottom: 0;
  }
  body:has(.lt-game-stage #lt-fc-card) .container {
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .lt-game-stage:has(#lt-fc-card) {
    border: 0;
    box-shadow: none;
    background: none;
    padding: 0;
  }
  .lt-game-stage:has(#lt-fc-card) .lt-stage-title,
  .lt-game-stage:has(#lt-fc-card) .lt-progress-bar,
  .lt-game-stage:has(#lt-fc-card) #lt-fc-btn-flip {
    display: none;
  }
  .lt-game-stage:has(#lt-fc-card) .lt-stage-header {
    flex-direction: row;
    justify-content: flex-end;
    margin: 0 0 6px;
    padding: 0;
    border: 0;
  }
  .lt-game-stage:has(#lt-fc-card) .lt-stage-tools {
    width: auto;
  }
  .lt-game-stage:has(#lt-fc-card) #lt-btn-exit-game {
    min-height: 36px;
    padding: 0 14px;
  }
  .lt-game-stage:has(#lt-fc-card) .lt-flashcard {
    min-height: calc(100dvh - 120px);
    justify-content: center;
    cursor: pointer;
  }
  .lt-game-stage:has(#lt-fc-card):has(.lt-rate-btn) .lt-flashcard {
    min-height: calc(100dvh - 250px);
  }
  .lt-game-stage:has(#lt-fc-card) .lt-fc-word {
    font-size: 36px;
    line-height: 1.2;
  }
  .lt-game-stage:has(#lt-fc-card) .lt-flashcard:not(:has(.lt-fc-meaning))::after {
    content: "Chạm vào thẻ để lật";
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
  }
}

/* ==========================================================================
   Modal <dialog> Thêm từ lên Bộ từ Cộng đồng
   ========================================================================== */
dialog.lt-comm-dialog {
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 22px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  max-width: 680px;
  width: calc(100vw - 28px);
  max-height: min(88dvh, 760px);
  padding: 0;
  margin: auto;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}
dialog.lt-comm-dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog.lt-comm-dialog:modal {
  overscroll-behavior: contain;
}
dialog.lt-comm-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
}
.lt-comm-dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.lt-comm-dlg-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lt-comm-dlg-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  border-radius: 0 0 22px 22px;
}
.lt-comm-word-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.75fr 36px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
}
@media (max-width: 640px) {
  .lt-comm-word-row {
    grid-template-columns: 1fr 1fr;
  }
  .lt-comm-dlg-head,
  .lt-comm-dlg-body,
  .lt-comm-dlg-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* Bảng Xếp Hạng Khóa Học (theo giáo viên): một danh sách liền khối, top 3 có huy hiệu vàng / bạc / đồng */
.lt-trank-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.lt-trank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}
.lt-trank-row + .lt-trank-row {
  border-top: 1px solid var(--border);
}
.lt-trank-row:hover {
  background: var(--surface-2);
}
.lt-trank-row .lib-avatar {
  width: 40px;
  height: 40px;
  font-size: 17px;
}
.lt-trank-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.lt-trank-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-trank-row.is-top1 { background: rgba(245, 158, 11, 0.09); }
.lt-trank-row.is-top2 { background: rgba(148, 163, 184, 0.12); }
.lt-trank-row.is-top3 { background: rgba(194, 120, 62, 0.09); }
.lt-trank-row.is-top1 .lt-trank-no { background: #f59e0b; color: #fff; }
.lt-trank-row.is-top2 .lt-trank-no { background: #94a3b8; color: #fff; }
.lt-trank-row.is-top3 .lt-trank-no { background: #c2783e; color: #fff; }
.lt-trank-row.is-top1 .lt-trank-name,
.lt-trank-row.is-top2 .lt-trank-name,
.lt-trank-row.is-top3 .lt-trank-name {
  font-weight: 700;
}
.lt-trank-row.is-top1 {
  padding-top: 14px;
  padding-bottom: 14px;
}
.lt-trank-row.is-top1 .lib-avatar {
  width: 48px;
  height: 48px;
  font-size: 20px;
}
.lt-trank-row.is-top1 .lt-trank-name {
  font-size: 16.5px;
}

/* Thẻ lộ trình trong danh mục: tên trên bìa và dưới bìa tối đa 2 dòng để các thẻ thẳng hàng */
.lt-rm-grid {
  margin-top: 4px;
}
.lt-rm-card {
  color: inherit;
  text-decoration: none;
}
.lt-rm-card .card-cover-title,
.lt-rm-card .card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.lt-rm-card .card-title {
  min-height: 2.6em;
  line-height: 1.3;
}
