/* Buddy Talk — giao diện "Ấm áp & tươi sáng" (theo thiết kế design/*.dc.html) */
:root {
  --bg: #FBF8F3;
  --card: #FFFFFF;
  --ink: #2A2622;
  --muted: #7A7168;
  --faint: #A79C91;
  --line: #E5DCD2;
  --line-soft: #EFE7DE;
  --coral: #F2795A;
  --coral-dark: #C4553A;
  --coral-soft: #FFE3D6;
  --teal: #3FB8AE;
  --teal-dark: #1E7F77;
  --teal-soft: #E4F5F3;
  --display: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; }
a { color: var(--coral-dark); font-weight: 700; text-decoration: none; }
a:hover { color: var(--coral); }
.hidden { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 800; margin: 0; }
h1 { font-size: 40px; line-height: 1.15; }
h2 { font-size: 30px; }
.muted { color: var(--muted); }
.brand { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--coral); }

/* ---------- nút ---------- */
.btn { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer;
  background: var(--ink); color: #fff; display: inline-flex; align-items: center; gap: 8px; transition: .15s; }
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn.coral { background: var(--coral); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 7px 14px; font-size: 14px; }
.btn.icon { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
.btn.icon.mic { width: 64px; height: 64px; background: var(--coral); box-shadow: 0 8px 20px rgba(242,121,90,.35); }
.btn.icon.mic.rec { background: #E0362E; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.btn svg { width: 20px; height: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- avatar chữ cái ---------- */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; color: #fff; flex-shrink: 0; }
.avatar.lg { width: 84px; height: 84px; font-size: 38px; }
.avatar.md { width: 40px; height: 40px; font-size: 20px; }
.avatar.xl { width: 96px; height: 96px; font-size: 44px; background: var(--coral-soft); color: var(--coral); }

/* ---------- màn hình chung ---------- */
.screen { min-height: 100vh; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px;
  padding: 40px 24px; position: relative; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; z-index: 0; }
.blob.a { top: -140px; right: -120px; width: 420px; height: 420px; background: var(--coral-soft); }
.blob.b { bottom: -160px; left: -100px; width: 380px; height: 380px; background: #D8F1EE; }
.center > *:not(.blob) { position: relative; z-index: 1; }  /* không đè position:absolute của .blob */
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hero .sub { font-size: 18px; color: var(--muted); }

.card-list { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.card { width: 220px; background: var(--card); border-radius: 24px; padding: 28px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(42,38,34,.08); cursor: pointer; transition: .15s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(42,38,34,.12); }
.card .name { font-family: var(--display); font-weight: 700; font-size: 24px; }
.card .sub { font-size: 14px; color: var(--muted); }
.card .streak { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--teal); font-weight: 700; }
.card.add { background: transparent; border: 2px dashed var(--line); box-shadow: none; color: var(--muted); justify-content: center; }
.card.add .avatar { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.card.add:hover { border-color: var(--coral); color: var(--coral); }

/* ---------- tạo hồ sơ (2 cột) ---------- */
.split { display: flex; min-height: 100vh; }
.split .side { width: 400px; background: var(--coral); color: #fff; padding: 48px 40px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 24px; }
.split .side h1 { color: #fff; font-size: 36px; }
.split .side .lead { font-size: 17px; opacity: .92; line-height: 1.5; }
.preview { background: rgba(255,255,255,.16); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.preview .who { display: flex; gap: 12px; align-items: center; }
.preview .who .avatar { width: 56px; height: 56px; font-size: 26px; background: #fff; color: var(--coral); }
.preview .who b { font-family: var(--display); font-size: 20px; display: block; }
.preview .who span { font-size: 14px; opacity: .9; }
.preview .bubble { background: #fff; color: var(--ink); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 15px; line-height: 1.5; }
.split .main { flex: 1; padding: 48px 64px; display: flex; flex-direction: column; gap: 22px; max-width: 760px; }
.form { display: flex; flex-direction: column; gap: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.field input, .field textarea { font: inherit; font-weight: 400; font-size: 16px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 10px 18px; font-size: 15px;
  font-weight: 600; cursor: pointer; user-select: none; }
.pill.on { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); font-weight: 700; }
.opt { border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px; cursor: pointer; }
.opt b { display: block; font-size: 15px; }
.opt span { font-size: 13px; color: var(--muted); }
.opt.on { border-color: var(--teal); background: var(--teal-soft); }
.opt.on b { color: var(--teal-dark); }
.swatches { display: flex; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.swatch.on { border-color: var(--ink); }

/* ---------- chat ---------- */
.chat { display: flex; height: 100vh; }
.sidebar { width: 300px; background: var(--card); border-right: 1px solid var(--line-soft); padding: 24px; display: flex;
  flex-direction: column; gap: 22px; }
.sidebar .back { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.sidebar .buddy { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sidebar .buddy .bname { font-family: var(--display); font-weight: 800; font-size: 26px; }
.badge { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--teal-dark); background: var(--teal-soft);
  border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.panel { background: var(--bg); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel .t { font-size: 13px; color: var(--muted); font-weight: 700; }
.panel .kv { display: flex; justify-content: space-between; font-size: 15px; }
.panel .kv b.teal { color: var(--teal-dark); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); transition: width .4s; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.sidebar .grow { flex: 1; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 32px; border-bottom: 1px solid var(--line-soft); }
.chat-head .who { display: flex; gap: 12px; align-items: center; }
.chat-head .who b { display: block; }
.chat-head .who span { font-size: 13px; color: var(--muted); }
.toggle { display: inline-flex; gap: 8px; align-items: center; background: var(--teal-soft); color: var(--teal-dark); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle.off { background: var(--line-soft); color: var(--muted); }
.messages { flex: 1; overflow-y: auto; padding: 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 600px; padding: 14px 18px; font-size: 17px; line-height: 1.5; white-space: pre-wrap; }
.msg.model { align-self: flex-start; background: var(--card); border-radius: 20px 20px 20px 6px; box-shadow: 0 4px 14px rgba(42,38,34,.05); }
.msg.user { align-self: flex-end; background: var(--coral-soft); border-radius: 20px 20px 6px 20px; }
.msg.system { align-self: center; background: var(--teal-soft); color: var(--teal-dark); border-radius: 14px; font-size: 15px; }
.msg-wrap { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; max-width: 600px; }
.msg-wrap .msg { max-width: none; }
.tools { display: flex; gap: 14px; padding-left: 6px; font-size: 13px; color: var(--faint); }
.tools button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; padding: 0; }
.tools button:hover { color: var(--coral-dark); }
.tools svg { width: 14px; height: 14px; }
.status { min-height: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.chat-input { display: flex; gap: 12px; align-items: center; padding: 12px 32px 24px; }
.chat-input input { flex: 1; font: inherit; font-size: 16px; padding: 16px 22px; border: 2px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); }
.chat-input input:focus { outline: none; border-color: var(--teal); }

/* ---------- phụ huynh ---------- */
.parent { max-width: 1100px; margin: 0 auto; padding: 36px 32px; display: flex; flex-direction: column; gap: 24px; }
.parent .head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.parent .head .kicker { font-size: 14px; color: var(--muted); font-weight: 700; }
.pin-box { max-width: 420px; margin: 60px auto; display: flex; flex-direction: column; gap: 16px; background: var(--card); padding: 28px; border-radius: 24px; }
/* GĐ 8: đăng nhập gia đình + bảng quản trị */
.auth-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; background: var(--card); padding: 28px; border-radius: 24px; position: relative; }
.auth-box .btn { width: 100%; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--card); border-radius: 18px; padding: 18px 20px; }
.stat .t { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 32px; }
.stat .v.coral { color: var(--coral); } .stat .v.teal { color: var(--teal-dark); }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.col { display: flex; flex-direction: column; gap: 14px; }
.box { background: var(--card); border-radius: 20px; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.box.warm { background: #FFF3EC; }
.box .t { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.box .hint { font-size: 13px; color: var(--muted); }
.box textarea { font: inherit; font-size: 15px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; resize: vertical; }
.sess { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.5; }
.sess .d { width: 96px; flex-shrink: 0; font-size: 13px; color: var(--muted); font-weight: 700; padding-top: 2px; }
.item { display: flex; justify-content: space-between; font-size: 15px; }
.item span { font-size: 12px; color: var(--muted); }
.item span.ok { color: var(--teal-dark); font-weight: 700; }
select { font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--card); }
.log { max-height: 320px; overflow: auto; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.log div { padding: 4px 0; border-bottom: 1px dashed var(--line-soft); }
.log .flag { color: #B91C1C; font-weight: 700; }
.usage-row { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.usage-row .bar { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .split { flex-direction: column; } .split .side { width: auto; padding: 32px 24px; }
  .split .main { padding: 24px; }
  .chat { flex-direction: column; height: 100vh; height: 100dvh; }
  .sidebar { width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
  .sidebar .panel, .sidebar .topic { display: none; }
  .sidebar .buddy { flex-direction: row; } .sidebar .buddy .avatar.xl { width: 44px; height: 44px; font-size: 22px; }
  .chat-main { flex: 1; } .messages { padding: 16px; } .chat-input { padding: 10px 16px 16px; }
  .stats { grid-template-columns: 1fr 1fr; } .cols { grid-template-columns: 1fr; }
  h1 { font-size: 30px; } .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ---------- feedback / gợi ý / roleplay / báo cáo (mẫu TalkPal, Loora, Speak, Duolingo) ---------- */
.msg.user { position: relative; }
.msg.user.has-fb { cursor: pointer; padding-right: 34px; }
.msg.user .dot { position: absolute; top: 10px; right: 12px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.msg.user .pron { text-decoration: underline wavy var(--coral-dark); text-underline-offset: 3px; cursor: help; }
.fb-card { align-self: flex-end; max-width: 600px; background: var(--card); border: 2px solid var(--coral-soft); border-radius: 16px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.fb-card .k { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.fb-card .orig { color: var(--muted); text-decoration: line-through; }
.fb-card .corr { font-weight: 700; color: var(--teal-dark); }
.fb-card .native { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-card .pron-list { display: flex; flex-direction: column; gap: 4px; }
.fb-card button { font: inherit; font-size: 13px; font-weight: 700; color: var(--coral-dark); background: var(--coral-soft);
  border: 0; border-radius: 999px; padding: 4px 10px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.fb-card button svg { width: 14px; height: 14px; }
.suggest { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 0 32px; }
.suggest .lbl { font-size: 13px; color: var(--muted); font-weight: 700; }
.suggest .chip { cursor: pointer; background: var(--teal-soft); border-color: var(--teal-soft); color: var(--teal-dark); font-weight: 600;
  display: inline-flex; gap: 6px; align-items: center; }
.suggest .chip:hover { border-color: var(--teal); }
.suggest .chip svg { width: 14px; height: 14px; }
.tasks .task { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.tasks .task i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; color: #fff; }
.tasks .task.done i { background: var(--teal); border-color: var(--teal); }
.tasks .task.done { color: var(--muted); text-decoration: line-through; }
.modal { position: fixed; inset: 0; background: rgba(42,38,34,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--bg); border-radius: 24px; padding: 28px; max-width: 720px; width: 100%; max-height: 92vh; overflow: auto;
  display: flex; flex-direction: column; gap: 16px; }
.modal-box h2 { text-align: center; }
.mode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mode { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.mode:hover { border-color: var(--coral); }
.mode.free { background: var(--coral-soft); border-color: var(--coral-soft); }
.mode .e { font-size: 28px; }
.mode b { font-size: 16px; }
.mode span { font-size: 13px; color: var(--muted); }
.report .stat-mini { display: flex; flex-direction: column; align-items: center; background: var(--card); border-radius: 14px; padding: 10px 16px; flex: 1; }
.report .stat-mini b { font-family: var(--display); font-size: 26px; color: var(--teal-dark); }
.report .stat-mini span { font-size: 12px; color: var(--muted); }
.report .fb-row { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.report .fb-row .orig { color: var(--muted); text-decoration: line-through; }
.report .fb-row .corr { font-weight: 700; color: var(--teal-dark); }
.report .fb-row .ex { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .suggest { padding: 0 16px; } .sidebar .tasks { display: flex; width: 100%; } }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
/* ---------- lộ trình ---------- */
.goal { background: var(--teal-soft); }
.rm-chart { display: flex; flex-direction: column; gap: 6px; }
.rm-row { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.rm-row .d { width: 64px; flex-shrink: 0; }
.rm-row .bar { flex: 1; }
.rm-row .v { width: 150px; flex-shrink: 0; }
.rm-row.plan .bar i { background: var(--line); }
.rm-row.milestone .bar i { background: var(--coral-soft); }
.rm-row.milestone .v { color: var(--coral-dark); font-weight: 700; }
.rm-row.now .bar i, .rm-row.test .bar i { background: var(--teal); }
.rm-row.now .v, .rm-row.test .v { color: var(--teal-dark); font-weight: 700; }
.rm-row.test em { font-style: normal; font-weight: 400; color: var(--muted); }
/* ---------- luyện đọc (GĐ 3a) ---------- */
.practice { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.practice .back { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; font-size: 14px; cursor: pointer; }
.practice-body { flex: 1; overflow-y: auto; padding: 24px 32px; max-width: 860px; width: 100%; margin: 0 auto; position: relative; }
.rd-text { font-size: 19px; line-height: 1.75; background: var(--card); border-radius: 20px; padding: 22px 26px; margin-top: 12px; }
.rd-text p { margin: 0 0 14px; }
.rd-text .s { cursor: pointer; border-radius: 6px; padding: 1px 2px; transition: .15s; }
.rd-text .s:hover { background: var(--teal-soft); }
.rd-text .s.reading { background: #FFF1B8; }
.rd-text .w { cursor: pointer; }
.rd-text .w:hover { text-decoration: underline dotted var(--coral-dark); text-underline-offset: 3px; }
.rd-text .w.gl { border-bottom: 2px dotted var(--teal); }
.tip { position: fixed; z-index: 60; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 14px; max-width: 320px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.tip b { color: #FFD9C7; }
.tip .ex { color: #cfc9c2; font-style: italic; }
.q { background: var(--card); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.q .qt { font-weight: 700; }
.q label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); cursor: pointer; font-size: 15px; }
.q label:hover { border-color: var(--teal); }
.q label.ok { border-color: var(--teal); background: var(--teal-soft); }
.q label.bad { border-color: var(--coral); background: var(--coral-soft); }
.q .ex { font-size: 13px; color: var(--muted); }
.mode.practice-card { background: var(--teal-soft); border-color: var(--teal-soft); }
/* ---------- luyện viết (GĐ 3b) ---------- */
.crit { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.crit .k { width: 110px; font-weight: 700; flex-shrink: 0; }
.crit .bar { flex: 1; }
.crit .n { color: var(--muted); flex: 2; }
.corr { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.corr .orig { color: var(--muted); text-decoration: line-through; }
.corr .fix { font-weight: 700; color: var(--teal-dark); }
.corr .ex { font-size: 13px; color: var(--muted); }
.delta { font-size: 13px; color: var(--teal-dark); font-weight: 700; }
/* ---------- luyện nghe (GĐ 3c) ---------- */
.dict { display: flex; gap: 10px; align-items: center; }
.dict .n { width: 24px; font-weight: 700; color: var(--muted); }
.dict input { flex: 1; font: inherit; font-size: 16px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; }
.dict input:focus { outline: none; border-color: var(--teal); }
.dict .pl { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.dict .pl:disabled { opacity: .4; cursor: not-allowed; }
.dict .pl svg { width: 18px; height: 18px; }
.dw { display: inline-block; margin: 0 3px 4px 0; padding: 1px 6px; border-radius: 6px; }
.dw.ok { background: var(--teal-soft); color: var(--teal-dark); }
.dw.bad { background: var(--coral-soft); color: var(--coral-dark); text-decoration: underline; }
.dres { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.dres .typed { font-size: 13px; color: var(--muted); }
/* ---------- GĐ 4: sao, cấp buddy, huy hiệu, hoạt động ---------- */
.card .lvl { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.card .lvl .stars { color: #C98A00; font-weight: 700; }
.card .today { font-size: 12px; color: var(--teal-dark); font-weight: 700; }
.stars-line { text-align: center; font-family: var(--display); font-size: 22px; font-weight: 800; color: #C98A00; }
.stars-line small { display: block; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); }
.badge-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; background: var(--card); }
.badge-chip.off { opacity: .4; filter: grayscale(1); }
.act { display: flex; gap: 4px; align-items: flex-end; height: 70px; }
.act .d { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; height: 100%; }
.act .d i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--teal); }
.act .d i.p { background: var(--teal-soft); border-radius: 0; }
.act .d span { font-size: 10px; color: var(--muted); }
.alert { border-radius: 14px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.alert.warn { background: #FFF1E6; border-left: 4px solid var(--coral); }
.alert.tip { background: var(--teal-soft); border-left: 4px solid var(--teal); }
.alert.ok { background: var(--teal-soft); color: var(--teal-dark); }
.alert.info { background: var(--line-soft); }
.sidebar .lvl-line { font-size: 13px; color: var(--muted); text-align: center; }
/* ---------- GĐ 5: IELTS mode ---------- */
.mode.ielts { background: #EEF0FF; border-color: #EEF0FF; }
.mode.ielts:hover { border-color: #6C8CF5; }
#rp-ielts .crit .k { width: 120px; }

/* ---------- GĐ 7: trò chơi từ vựng + test trình độ ---------- */
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 320px)); gap: 16px; justify-content: center; margin-top: 8px; }
.game-card { background: var(--card); border: 2px solid var(--line-soft); border-radius: 20px; padding: 22px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; transition: .15s; }
.game-card:hover { transform: translateY(-3px); border-color: var(--coral); box-shadow: 0 12px 28px rgba(42,38,34,.1); }
.game-card .e { font-size: 40px; }
.game-card b { font-family: var(--display); font-size: 19px; }
.game-card span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.mode.challenge { border: 2px solid var(--coral); background: var(--coral-soft); }
.mode.game-mode { border: 2px dashed var(--teal); }

.match-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; max-width: 720px; margin: 0 auto; }
.tile { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 16px 10px; text-align: center;
  font-weight: 700; cursor: pointer; user-select: none; transition: .12s; font-size: 16px; }
.tile.en { color: var(--coral-dark); }
.tile.sel { border-color: var(--teal); background: var(--teal-soft); transform: scale(1.04); }
.tile.done { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); opacity: .55; cursor: default; }
.tile.bad { border-color: #E0362E; background: #FDE8E7; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.spell-box, .scr-box, .rush-box { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px;
  background: var(--card); border-radius: 20px; padding: 24px; }
.spell-box input { font: inherit; font-size: 20px; text-align: center; padding: 14px; border: 2px solid var(--line);
  border-radius: 14px; letter-spacing: 1px; }
.spell-box input:focus { outline: none; border-color: var(--teal); }
.spell-box .btn, .scr-box .btn { align-self: center; }

.scr-line { min-height: 52px; border: 2px dashed var(--line); border-radius: 14px; padding: 8px; display: flex;
  gap: 8px; flex-wrap: wrap; align-items: center; background: var(--bg); }
.scr-pool { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 40px; }
.chip.scr { font-size: 16px; font-weight: 700; padding: 8px 14px; cursor: pointer; border-width: 2px; user-select: none; }
.chip.scr:hover { border-color: var(--teal); }

.rush-word { font-family: var(--display); font-weight: 800; font-size: 42px; text-align: center; color: var(--coral-dark); }
.t-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-btn { font: inherit; font-weight: 600; font-size: 15px; padding: 14px 12px; border: 2px solid var(--line);
  border-radius: 14px; background: var(--card); cursor: pointer; transition: .12s; text-align: center; color: var(--ink); }
.opt-btn:hover:not(:disabled) { border-color: var(--teal); }
.opt-btn.good { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); animation: pop .25s; }
.opt-btn.bad2 { border-color: #E0362E; background: #FDE8E7; animation: shake .3s; }
.opt-btn.sel2 { border-color: var(--teal); background: var(--teal-soft); }
@keyframes pop { 50% { transform: scale(1.06); } }

.gw { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px 14px; text-align: left; }
.gw b { min-width: 110px; }
.gw span { flex: 1; color: var(--muted); }
.gw.ok { border-left: 4px solid var(--teal); }
.gw.bad { border-left: 4px solid var(--coral); }
.gw button { background: none; border: 0; cursor: pointer; color: var(--muted); display: inline-flex; }
.gw button svg { width: 16px; height: 16px; }

.t-q { max-width: 560px; margin: 0 auto; width: 100%; }
.t-word { font-family: var(--display); font-weight: 800; font-size: 36px; color: var(--coral-dark);
  display: flex; align-items: center; gap: 10px; }
.t-word .pl { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--card);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.t-word .pl svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .games-grid { grid-template-columns: 1fr; }
  .t-opts { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr 1fr; }
  .rush-word { font-size: 32px; }
}

/* ---------- GĐ 7c: combo + sao bay khi trả lời đúng liên tiếp ---------- */
/* đặt ở đáy màn hình: không che từ / câu hỏi đang hiển thị */
#combo-pop { position: fixed; bottom: 12%; left: 50%; transform: translate(-50%, 0); z-index: 80; pointer-events: none;
  font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; background: var(--coral);
  border-radius: 999px; padding: 10px 22px; box-shadow: 0 10px 26px rgba(242,121,90,.4); opacity: 0; }
#combo-pop.show { animation: comboPop 1.1s ease-out; }
@keyframes comboPop {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  22%  { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  40%  { transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -22px) scale(1); }
}
.star-fly { position: fixed; z-index: 79; pointer-events: none; font-size: 22px; opacity: 0;
  animation: starFly 1.2s ease-out forwards; }
@keyframes starFly {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6) rotate(0deg); }
  20%  { opacity: 1; transform: translate(calc(var(--dx) * .3), -14px) scale(1.15) rotate(15deg); }
  100% { opacity: 0; transform: translate(var(--dx), -76px) scale(.85) rotate(45deg); }
}
@media (prefers-reduced-motion: reduce) {
  .star-fly { display: none; }
  #combo-pop.show { animation-duration: .4s; }
}

/* GĐ 10b: nút "Học hôm nay" trên thẻ hồ sơ; bảng chọn chế độ gấp bớt */
.card .today-btn { margin-top: 10px; width: 100%; justify-content: center; padding: 12px 16px; font-size: 16px; }
.mode-list .mode-more-btn { grid-column: 1 / -1; justify-self: center; margin: 4px 0; }
.mode-list .mode-more { display: contents; }
.mode-list .mode-more.hidden { display: none; }

/* GĐ 11: màn đăng nhập Google / mã của con, khối gia đình và thiết bị */
.auth-box .t-login { font-weight: 700; font-size: 15px; text-align: center; color: var(--muted); }
.g-btn { display: flex; justify-content: center; min-height: 44px; }
.auth-box .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.auth-box .or::before, .auth-box .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.code-input { font: inherit; font-size: 34px; letter-spacing: 12px; text-align: center; padding: 12px; border: 2px solid var(--line); border-radius: 16px; width: 100%; }
.code-input:focus { outline: none; border-color: var(--teal); }
.link-code { background: var(--teal-soft); border-radius: 16px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.link-code .code { font-size: 40px; font-weight: 800; letter-spacing: 10px; color: var(--teal-dark); }
.fam-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.fam-row .muted { font-size: 12px; color: var(--muted); }
.modal-box.privacy p { line-height: 1.55; margin: 0 0 12px; }
.admin-table td.info { font-size: 12px; color: var(--muted); max-width: 220px; white-space: pre-line; }
