@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #090e1c;
  --bg-soft: rgba(13, 20, 38, .72);
  --panel: rgba(21, 30, 52, .62);
  --panel-2: rgba(30, 42, 70, .58);
  --panel-3: rgba(44, 60, 96, .60);
  --text: #f2f5ff;
  --muted: #a8b4d0;
  --muted-2: #7d8aa8;
  --line: rgba(255, 255, 255, .13);
  --accent: #8b7cff;
  --accent-2: #22d3ee;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --shadow: 0 20px 60px rgba(3, 7, 18, .38);
  --glass-shadow: 0 18px 50px rgba(3, 7, 18, .26), inset 0 1px 0 rgba(255, 255, 255, .12);
  --glass-blur: blur(18px) saturate(145%);
  --glass-sheen: rgba(255, 255, 255, .18);
  --glass-pointer: rgba(255, 255, 255, .2);
  --hero-bg: radial-gradient(900px 320px at 100% 0%, rgba(34, 211, 238, .20), transparent 58%),
             radial-gradient(700px 340px at 0% 100%, rgba(139, 124, 255, .26), transparent 60%),
             linear-gradient(125deg, #191c44, #12223c 72%);
  --hero-text: #c8d2ee;
  --ring-bg: #151d34;
  --radius: 20px;
}

[data-theme="light"] {
  --bg: #eef2fb;
  --bg-soft: rgba(255, 255, 255, .66);
  --panel: rgba(255, 255, 255, .62);
  --panel-2: rgba(255, 255, 255, .76);
  --panel-3: rgba(232, 238, 252, .80);
  --text: #151c33;
  --muted: #5d6a86;
  --muted-2: #8792a8;
  --line: rgba(255, 255, 255, .78);
  --shadow: 0 18px 50px rgba(45, 62, 110, .14);
  --glass-shadow: 0 16px 44px rgba(45, 62, 110, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-sheen: rgba(139, 124, 255, .11);
  --glass-pointer: rgba(139, 124, 255, .14);
  --hero-bg: radial-gradient(800px 300px at 95% 0%, rgba(34, 211, 238, .28), transparent 58%),
             radial-gradient(650px 320px at 0% 100%, rgba(139, 124, 255, .24), transparent 60%),
             linear-gradient(125deg, #e9edff, #eaf7ff 72%);
  --hero-text: #4d5876;
  --ring-bg: #ffffff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

/* Bộ icon SVG — nét, đều và ăn màu theo theme */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 18px; height: 18px; display: inline-block; flex: none; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic-lg { width: 24px; height: 24px; vertical-align: -5px; }
.button .ic { width: 16px; height: 16px; }
.badge .ic { width: 13px; height: 13px; vertical-align: -2px; }
.icon-btn .ic, .ghost-btn .ic, .user-chip .ic { width: 17px; height: 17px; }
.search-box > .ic { width: 19px; height: 19px; }
.streak-chip .ic { width: 16px; height: 16px; color: var(--amber); }
.ni .ic { width: 19px; height: 19px; }
.bottom-nav button span { display: grid; place-items: center; height: 20px; }
.bottom-nav button span .ic { width: 18px; height: 18px; }
.play-badge .ic, .video-thumb .ic { width: 24px; height: 24px; }
.player-empty .ic, .em-icon .ic { width: 34px; height: 34px; }
.ach .ic { width: 26px; height: 26px; vertical-align: middle; }
.lb-rank .ic { width: 22px; height: 22px; vertical-align: -4px; }
.lb-rank .medal-1 { color: #fbbf24; filter: drop-shadow(0 0 6px rgba(251,191,36,.45)); }
.lb-rank .medal-2 { color: #cbd5e1; }
.lb-rank .medal-3 { color: #d97757; }
.linkish .ic, .feedback .ic, .tab .ic { vertical-align: -2px; }
.streak-big .ic { vertical-align: -3px; }
.feedback.no .ic { color: var(--red); }
.feedback.ok .ic { color: var(--green); }
.ach-icon { display: grid; place-items: center; height: 30px; }

body {
  margin: 0;
  background:
    radial-gradient(1000px 620px at 8% -8%, rgba(139, 124, 255, .22), transparent 62%),
    radial-gradient(900px 560px at 100% 0%, rgba(34, 211, 238, .16), transparent 58%),
    radial-gradient(800px 620px at 60% 110%, rgba(139, 124, 255, .14), transparent 60%),
    var(--bg);
  background-size: 140% 140%, 130% 130%, 130% 130%, auto;
  background-attachment: fixed;
  animation: aurora 26s ease-in-out infinite alternate;
  color: var(--text);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  transition: background-color .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); }
::selection { background: rgba(139, 124, 255, .35); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 124, 255, .35); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 124, 255, .55); background-clip: padding-box; }

.app-shell { min-height: 100vh; position: relative; }
@keyframes aurora {
  from { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
  to { background-position: 18% 12%, 82% 18%, 42% 82%, 0 0; }
}
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 252px; z-index: 40;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 40%), var(--bg-soft);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line); box-shadow: var(--glass-shadow);
  display: flex; flex-direction: column; padding: 22px 16px; gap: 20px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--text); text-align: left; padding: 4px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 8px 24px rgba(139,124,255,.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: -.3px; }
.brand-text small { color: var(--muted); font-size: 11px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px;
  border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--muted); font-weight: 600; text-align: left;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.nav-item:hover { background: rgba(139, 124, 255, .1); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(139,124,255,.28), rgba(34,211,238,.12));
  border-color: rgba(139,124,255,.32); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 8px 24px rgba(139,124,255,.14);
}
.nav-item.active .ni { color: var(--accent); }
.ni { width: 20px; display: grid; place-items: center; }
.side-block { border-top: 1px solid var(--line); padding-top: 16px; }
.side-label { margin: 0 0 10px; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.side-sections { display: flex; flex-direction: column; gap: 6px; }
.side-section {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--muted); text-align: left; font-size: 13px; font-weight: 600;
}
.side-section:hover { background: var(--panel); color: var(--text); }
.side-section .dot { width: 9px; height: 9px; border-radius: 50%; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.goal-mini { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 12px; }
.goal-mini strong { color: var(--accent-2); font-size: 16px; }
.ghost-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 11px; padding: 9px; font-size: 12px; }
.ghost-btn:hover { color: var(--text); }
.side-note { margin: 0; font-size: 10px; color: var(--muted-2); text-align: center; line-height: 1.5; }
.side-note b { color: var(--text); }
.side-note a { color: var(--accent-2); text-decoration: none; }
.side-note a:hover { text-decoration: underline; }
.about-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.about-card .button { white-space: nowrap; }

.main-wrap { margin-left: 252px; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 72px; padding: 0 34px;
  display: flex; align-items: center; gap: 18px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line); box-shadow: 0 8px 30px rgba(3, 7, 18, .14);
}
.search-box { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 42px; color: var(--muted); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,255,.16), inset 0 1px 0 rgba(255,255,255,.12); }
.search-box span { font-size: 20px; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); min-width: 0; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.streak-chip, .score-chip { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
.score-chip { color: var(--accent-2); }
.score-chip small { color: var(--muted); font-weight: 500; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 13px; width: 38px; height: 38px; display: grid; place-items: center; font-size: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.1); transition: color .2s, transform .2s; }
.icon-btn:hover { color: var(--text); transform: translateY(-1px); }
.menu-btn { display: none; }
.app-view { padding: 28px 34px 90px; max-width: 1320px; margin: 0 auto; outline: none; }
.bottom-nav { display: none; }

/* Lớp kính dùng chung cho các bề mặt nổi */
.card, .stat, .skill-row, .video-item, .option, .feedback, .review-item, .example,
.search-box, .streak-chip, .score-chip, .icon-btn, .goal-mini, .ghost-btn, .user-chip,
.auth-card, .modal, .toast, .bottom-nav, .lb-card, .streak-card {
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.card, .stat, .skill-row, .video-item, .option, .feedback, .review-item, .example,
.auth-card, .modal, .lb-card, .streak-card { box-shadow: var(--glass-shadow); }

/* Kính lỏng: điểm sáng chạy theo chuột + lướt sáng định kỳ */
.card, .button, .auth-card, .modal { position: relative; isolation: isolate; }
.card::before, .button::before, .auth-card::before, .modal::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 34%, var(--glass-sheen) 47%, rgba(255,255,255,.03) 57%, transparent 70%);
  background-size: 240% 100%; background-position: -120% 0;
  animation: sheen 9s ease-in-out infinite;
}
.card::after, .button::after, .auth-card::after, .modal::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), var(--glass-pointer), transparent 65%);
  opacity: 0; transition: opacity .25s ease;
}
.card:hover::after, .button:hover::after, .auth-card:hover::after, .modal:hover::after { opacity: 1; }
@keyframes sheen { 0%, 58% { background-position: -120% 0; } 82%, 100% { background-position: 220% 0; } }

/* Common */
.eyebrow { margin: 0 0 6px; color: var(--accent-2); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.4px; }
h1 { font-size: clamp(26px, 3vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 30px 0 16px; }
.section-head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.06), transparent), var(--panel-2); color: var(--text); padding: 10px 16px; border-radius: 13px; font-weight: 700; font-size: 13px; text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .18s, filter .18s, box-shadow .18s; }
.button:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 10px 24px rgba(3,7,18,.18); }
.button.primary { background: linear-gradient(120deg, #9b8bff, #6d5ef0 62%, #22d3ee); border-color: transparent; color: #fff; box-shadow: 0 12px 28px rgba(139,124,255,.3), inset 0 1px 0 rgba(255,255,255,.35); }
.button.cyan { background: linear-gradient(120deg, #5eead4, #22d3ee); border-color: transparent; color: #052027; box-shadow: 0 12px 28px rgba(34,211,238,.25), inset 0 1px 0 rgba(255,255,255,.45); }
.button.green { background: rgba(52,211,153,.15); border-color: rgba(52,211,153,.3); color: var(--green); }
.button.small { padding: 7px 12px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 700; }
.badge.green { background: rgba(52,211,153,.13); color: var(--green); }
.badge.amber { background: rgba(251,191,36,.13); color: var(--amber); }
.badge.red { background: rgba(251,113,133,.13); color: var(--red); }
.card {
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.012)), var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.bar { height: 7px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s ease; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .em-icon { font-size: 34px; margin-bottom: 8px; }

/* Hero */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center;
  padding: 34px 36px; border-radius: 26px; background: var(--hero-bg);
  border: 1px solid rgba(139,124,255,.3); box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.hero:before { content: ''; position: absolute; width: 250px; height: 250px; left: -90px; top: -130px; border-radius: 50%; background: rgba(34,211,238,.2); filter: blur(14px); animation: float 13s ease-in-out infinite alternate; }
.hero:after { content: ''; position: absolute; width: 280px; height: 280px; right: -90px; bottom: -170px; border-radius: 50%; background: rgba(139,124,255,.2); filter: blur(14px); animation: float 16s ease-in-out infinite alternate-reverse; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 620px; }
.hero p { color: var(--hero-text); margin-top: 12px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-right { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.score-ring { --p: 0; width: 176px; height: 176px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent-2) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); position: relative; box-shadow: 0 14px 40px rgba(34,211,238,.18); }
.score-ring:before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--ring-bg); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.score-ring-inner { position: relative; text-align: center; }
.score-ring-inner strong { font-size: 38px; line-height: 1; display: block; }
.score-ring-inner small { color: var(--muted); font-size: 11px; }
.ring-caption { font-size: 12px; color: var(--hero-text); }
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.stat { background: linear-gradient(145deg, rgba(255,255,255,.05), transparent), var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 15px 17px; }
@keyframes float { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(26px,18px,0) scale(1.12); } }
.stat strong { display: block; font-size: 24px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12px; }

/* Section & skill cards */
.section-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .18s, border-color .18s; }
.section-card:hover { transform: translateY(-3px); border-color: rgba(139,124,255,.5); }
.section-top { display: flex; align-items: center; gap: 12px; }
.section-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; font-size: 21px; font-weight: 700; flex: none; }
.section-card h3 { font-size: 16px; }
.section-card .section-desc { color: var(--muted); font-size: 12px; min-height: 38px; }
.section-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.skill-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, transform .15s; }
.skill-row:hover { border-color: rgba(139,124,255,.5); transform: translateX(3px); }
.skill-index { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--panel-3); color: var(--accent-2); font-weight: 800; font-size: 13px; }
.skill-info { flex: 1; min-width: 0; }
.skill-info strong { display: block; font-size: 14px; }
.skill-info small { color: var(--muted); font-size: 11px; }
.skill-progress { width: 130px; flex: none; }
.skill-progress .small { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 6px; font-size: 10px; }
.skill-arrow { color: var(--muted-2); }

/* Skill detail */
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.crumb button { border: 0; background: none; color: var(--muted); padding: 0; }
.crumb button:hover { color: var(--text); }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.detail-title { display: flex; align-items: center; gap: 14px; }
.detail-title .section-icon { width: 52px; height: 52px; font-size: 24px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 8px 0 22px; overflow-x: auto; }
.tab { border: 0; background: none; color: var(--muted); padding: 11px 15px; font-weight: 700; font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent-2); border-color: var(--accent-2); }
.panel { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.video-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.video-thumb { width: 92px; height: 58px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-size: 22px; background: linear-gradient(135deg, #ef4444, #8b5cf6); }
.video-item .vi-body { flex: 1; min-width: 0; }
.video-item strong { display: block; font-size: 13px; }
.video-item small { color: var(--muted); font-size: 11px; }
.video-list { display: flex; flex-direction: column; gap: 10px; }
.resource-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.key-list { display: flex; flex-direction: column; gap: 10px; }
.key-item { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; background: var(--panel-2); border-left: 3px solid var(--accent); font-size: 14px; }
.key-item .bullet { color: var(--accent); font-weight: 800; }
.example { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.example-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 17px; border: 0; background: none; color: var(--text); text-align: left; font-weight: 700; }
.example-body { padding: 0 17px 16px; }
.example-problem { background: var(--panel-3); padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }
.step { display: flex; gap: 10px; padding: 5px 0; color: var(--muted); font-size: 13px; }
.step b { color: var(--accent-2); flex: none; }

/* Quiz */
.quiz-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-text { font-size: 16px; font-weight: 700; line-height: 1.55; margin-bottom: 16px; }
.q-passage { background: var(--panel-2); border-left: 3px solid var(--accent-2); padding: 13px 15px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.options { display: flex; flex-direction: column; gap: 9px; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 14px; }
.option:hover:not(:disabled) { border-color: var(--accent); }
.option .letter { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--panel-3); font-size: 12px; font-weight: 800; color: var(--muted); }
.option.selected { border-color: var(--accent); background: rgba(139,124,255,.12); }
.option.correct { border-color: var(--green); background: rgba(52,211,153,.12); }
.option.wrong { border-color: var(--red); background: rgba(251,113,133,.12); }
.feedback { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.feedback.ok { border-color: rgba(52,211,153,.4); }
.feedback.no { border-color: rgba(251,113,133,.4); }
.feedback strong { display: block; margin-bottom: 4px; }
.quiz-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.result-hero { text-align: center; padding: 26px; }
.result-score { font-size: 56px; font-weight: 800; line-height: 1; background: linear-gradient(120deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.review-item { padding: 15px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; }
.review-item .q-text { font-size: 14px; margin-bottom: 8px; }
.review-item .answer-line { font-size: 12px; color: var(--muted); }

/* Mock */
.mock-layout { display: grid; grid-template-columns: 1fr 250px; gap: 18px; align-items: start; }
.mock-side { position: sticky; top: 92px; }
.q-nav-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.q-num { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.q-num.done { background: rgba(139,124,255,.25); color: var(--text); border-color: var(--accent); }
.q-num.current { outline: 2px solid var(--accent-2); }
.q-num.flag { border-color: var(--amber); color: var(--amber); }
.mock-timer { font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 800; }
.mock-setup { max-width: 680px; }
.setup-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setup-row:last-child { border: 0; }

/* Progress */
.prog-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.prog-bar-row { margin-bottom: 16px; }
.prog-bar-row .lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.achievements { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ach { text-align: center; padding: 16px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); opacity: .45; }
.ach.unlocked { opacity: 1; border-color: rgba(251,191,36,.4); }
.ach .ach-icon { font-size: 26px; }
.ach small { display: block; color: var(--muted); font-size: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-row input[type="number"] { width: 110px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 8px 10px; }

/* Streak & leaderboard */
.streak-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.streak-big { font-size: 28px; font-weight: 800; color: var(--amber); }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
.week-day { text-align: center; color: var(--muted); font-size: 11px; }
.week-day span, .week-day small { display: block; }
.week-day i { display: block; height: 8px; margin: 6px auto; width: 80%; max-width: 30px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.week-day.active i { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px rgba(251,191,36,.35); }
.week-day.active { color: var(--text); }
.lb-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lb-toolbar .tabs { margin: 0; border: 0; }
.lb-card { padding: 8px 16px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row.me { background: rgba(139,124,255,.1); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.lb-rank { width: 42px; text-align: center; font-weight: 800; }
.lb-avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; color: var(--accent-2); }
.lb-info { flex: 1; min-width: 0; }
.lb-info small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-value { font-weight: 800; color: var(--accent-2); white-space: nowrap; }
.empty-state { text-align: center; padding: 40px 12px; }
.empty-state strong { display: block; margin-top: 8px; }

/* Search */
.search-results .card { margin-bottom: 10px; }
.hit-mark { background: rgba(251,191,36,.2); color: var(--amber); border-radius: 3px; }

/* Video library */
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.video-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, border-color .18s; }
.video-card:hover { transform: translateY(-3px); border-color: rgba(139,124,255,.5); }
.video-card-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border: 0; padding: 0; background: linear-gradient(135deg, #1f2a49, #121a2e); overflow: hidden; }
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.play-badge { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 26px; text-shadow: 0 2px 12px #000; }
.video-card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.video-card-body strong { font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.video-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.video-card.compact .video-card-body strong { -webkit-line-clamp: 2; }
@media (max-width: 1100px) { .video-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 620px) { .video-grid { grid-template-columns: 1fr; } }

/* Đề thật College Board */
.notice-card { border-left: 3px solid var(--accent); }
.notice-card > strong { display: flex; align-items: center; gap: 8px; }
.notice-card p { margin: 10px 0 14px; }
.official-link { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); transition: transform .18s, border-color .18s; }
.official-link:hover { transform: translateY(-3px); border-color: rgba(139,124,255,.5); }

/* Từ vựng SAT */
.vocab-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.vocab-toolbar .search-box { flex: 1; min-width: 220px; max-width: none; }
.vocab-count { margin: 6px 0 12px; }
.vocab-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-row {
  display: grid; grid-template-columns: minmax(140px, .8fr) minmax(0, 2fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
}
.vocab-row.learned { border-color: rgba(52,211,153,.32); }
.vocab-term strong { display: block; font-size: 15px; color: var(--accent-2); }
.vocab-term small { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.vocab-mean { min-width: 0; }
.vocab-mean strong { display: block; font-size: 13px; }
.vocab-mean small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vocab-actions { display: flex; gap: 6px; align-items: center; }
.vocab-more { margin-top: 14px; }
.flash-wrap { max-width: 660px; margin: 0 auto; }
.flashcard { perspective: 1000px; height: 320px; cursor: pointer; outline: none; }
.flashcard:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; border-radius: 20px; }
.flash-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.8,.2,1); }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.06), transparent), var(--panel);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--glass-shadow);
}
.flash-face h2 { font-size: clamp(28px, 5vw, 48px); color: var(--accent-2); }
.flash-face h3 { font-size: 22px; }
.flash-face small, .flash-face p { color: var(--muted); max-width: 480px; }
.flash-back { transform: rotateY(180deg); }
.flash-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.result-card { text-align: center; padding: 40px 20px; }
.result-card .hero-actions { justify-content: center; margin-top: 20px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.check-field input { width: auto; accent-color: var(--accent); }
.admin-form .check-field input { width: auto; padding: 0; }

/* Modal / overlay / toast */
.overlay { position: fixed; inset: 0; z-index: 60; background: radial-gradient(circle at 50% 30%, rgba(139,124,255,.18), transparent 60%), rgba(4, 8, 18, .68); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal { position: fixed; z-index: 70; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(780px, calc(100vw - 32px)); max-height: min(92vh, 900px); overflow: auto; background: linear-gradient(145deg, rgba(255,255,255,.06), transparent), var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--glass-shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.player { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; }
.player iframe { width: 100%; height: 100%; border: 0; }
.player .player-empty { height: 100%; display: grid; place-items: center; text-align: center; color: #cbd5f5; padding: 20px; }
.video-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.note-box label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.note-box textarea { width: 100%; resize: vertical; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 12px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.toast-wrap { position: fixed; z-index: 100; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; box-shadow: var(--shadow); font-size: 13px; animation: fade .2s ease; }

@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .achievements { grid-template-columns: repeat(2, 1fr); }
  .mock-layout { grid-template-columns: 1fr; }
  .mock-side { position: static; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; gap: 10px; height: 62px; }
  .app-view { padding: 20px 16px 100px; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .hero-right { align-items: flex-start; }
  .score-ring { width: 140px; height: 140px; }
  .score-ring-inner strong { font-size: 30px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; position: fixed; z-index: 35; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, rgba(255,255,255,.05), transparent), var(--bg-soft); border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); justify-content: space-around; box-shadow: 0 -12px 40px rgba(3,7,18,.18); }
  .bottom-nav button { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; border-radius: 12px; padding: 4px 8px; transition: color .2s, background .2s; }
  .bottom-nav button span { font-size: 18px; }
  .bottom-nav button.active { color: var(--accent-2); background: rgba(139,124,255,.14); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
  .top-actions .streak-chip { display: none; }
  .detail-head { flex-direction: column; }
  .skill-progress { width: 90px; }
  #top-theme { display: none; }
}
@media (max-width: 480px) {
  .score-chip { display: none; }
  .page-head { flex-direction: column; }
  .q-nav-grid { grid-template-columns: repeat(8, 1fr); }
  .grid.cols-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .bottom-nav button { font-size: 8px; }
  .bottom-nav button span { font-size: 16px; }
  .lb-row { gap: 8px; }
  .lb-rank { width: 32px; }
  .lb-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  .vocab-row { grid-template-columns: 1fr; gap: 6px; }
  .vocab-actions { justify-content: flex-end; }
  .flashcard { height: 280px; }
}

/* Accounts & admin */
body.auth-mode .sidebar, body.auth-mode .topbar, body.auth-mode .bottom-nav { display: none; }
body.auth-mode .main-wrap { margin-left: 0; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); background: linear-gradient(150deg, rgba(255,255,255,.08), rgba(255,255,255,.015)), var(--panel); border: 1px solid var(--line); border-radius: 26px; padding: 28px; box-shadow: var(--glass-shadow); animation: modalIn .35s ease both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 44px; height: 44px; }
.auth-card .tabs { margin-top: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea, .admin-form input, .admin-form select, .admin-form textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus,
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,124,255,.16), inset 0 1px 0 rgba(255,255,255,.08);
}
[data-theme="light"] .field input, [data-theme="light"] .field select,
[data-theme="light"] .field textarea, [data-theme="light"] .admin-form input,
[data-theme="light"] .admin-form select, [data-theme="light"] .admin-form textarea,
[data-theme="light"] .setting-row input[type="number"], [data-theme="light"] .search-box {
  border-color: rgba(90, 105, 145, .28);
}
.field textarea { resize: vertical; min-height: 90px; }
.auth-foot { margin-top: 18px; text-align: center; }
.linkish { border: 0; background: none; color: var(--accent-2); font-weight: 700; padding: 0; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.auth-msg { margin: 14px 0 0; font-size: 13px; color: var(--green); }
.auth-dev { margin-top: 14px; padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.auth-dev a { display: block; margin-top: 6px; font-size: 12px; color: var(--accent-2); word-break: break-all; }
.user-chip { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700; }
.user-box { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.user-box .who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-box .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .who .badge { margin-left: auto; }
.user-box .row { display: flex; gap: 6px; }
.user-box .row .button { flex: 1; padding: 6px 8px; font-size: 11px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.admin-row { display: grid; grid-template-columns: 1.5fr .8fr .8fr .8fr 1fr 1.4fr; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; }
.admin-row select { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 6px; font-size: 12px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.admin-form .full { grid-column: 1 / -1; }
.admin-form .button { justify-self: start; }
@media (max-width: 820px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-row { grid-template-columns: 1fr 1fr; }
  .admin-head { display: none; }
  .admin-form { grid-template-columns: 1fr; }
  .user-chip { font-size: 11px; padding: 6px 9px; }
}

.modal { animation: modalInGlass .28s ease both; }
@keyframes modalInGlass {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.toast { animation: modalIn .22s ease both; }

/* Thông báo toàn app + khóa ứng dụng */
.button.danger {
  background: linear-gradient(120deg, #fb7185, #e11d48);
  border-color: transparent; color: #fff;
  box-shadow: 0 12px 28px rgba(225,29,72,.28), inset 0 1px 0 rgba(255,255,255,.35);
}
.announce-bar {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(139,124,255,.16), rgba(34,211,238,.1));
}
.announce-inner { display: flex; align-items: center; gap: 14px; padding: 12px 34px; flex-wrap: wrap; }
.announce-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; background: rgba(139,124,255,.18); color: var(--accent-2);
}
.announce-icon .ic { width: 20px; height: 20px; }
.announce-text { flex: 1; min-width: 200px; }
.announce-text strong { display: block; font-size: 13px; margin-bottom: 2px; }
.announce-text p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.announce-close { margin-left: auto; }
.announce-preview { margin-top: 14px; border: 1px dashed var(--line); border-radius: 16px; background: var(--panel-2); overflow: hidden; }
.announce-preview .announce-inner { padding: 12px 14px; }
.announce-preview .announce-text p { color: var(--muted); }

body.lock-mode .sidebar, body.lock-mode .topbar, body.lock-mode .bottom-nav, body.lock-mode .announce-bar { display: none; }
body.lock-mode .main-wrap { margin-left: 0; }
.lock-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lock-card {
  width: min(560px, 100%); text-align: center;
  background: linear-gradient(150deg, rgba(255,255,255,.08), rgba(255,255,255,.015)), var(--panel);
  border: 1px solid var(--line); border-radius: 26px; padding: 34px 28px;
  box-shadow: var(--glass-shadow); animation: modalIn .35s ease both;
}
.lock-icon {
  width: 72px; height: 72px; margin: 0 auto 16px; display: grid; place-items: center;
  border-radius: 22px; border: 1px solid rgba(251,113,133,.3);
  background: linear-gradient(140deg, rgba(251,113,133,.2), rgba(139,124,255,.18)); color: #fb7185;
}
.lock-icon .ic { width: 32px; height: 32px; }
.lock-icon.power { color: var(--amber); border-color: rgba(251,191,36,.3); background: linear-gradient(140deg, rgba(251,191,36,.2), rgba(139,124,255,.14)); }
.lock-card h1 { margin: 6px 0 10px; font-size: 27px; letter-spacing: -.4px; }
.lock-msg { color: var(--muted); line-height: 1.65; white-space: pre-line; margin: 0 auto 8px; max-width: 440px; }
.lock-notice { margin: 18px 0 4px; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(34,211,238,.28); background: rgba(34,211,238,.07); }
.lock-notice strong { display: flex; align-items: center; gap: 8px; }
.lock-notice p { margin: 8px 0 10px; color: var(--muted); font-size: 13px; white-space: pre-line; }
.lock-actions { justify-content: center; margin-top: 20px; }
.auth-lock {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 12px; font-weight: 600;
  color: var(--amber); background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.24);
  display: flex; gap: 8px; align-items: center;
}
@media (max-width: 820px) {
  .announce-inner { padding: 12px 16px; }
  .lock-card { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body, .hero:before, .hero:after { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
