/* ==========================================================
   Bé Học Vui – giao diện sặc sỡ cho học sinh tiểu học
   ========================================================== */
:root {
  --pink: #ff5fa2;   --pink-d: #e0428a;
  --orange: #ff9f1c; --orange-d: #e07f00;
  --yellow: #ffd23f; --yellow-d: #e6b400;
  --green: #22c55e;  --green-d: #16a34a;
  --teal: #14b8a6;   --teal-d: #0f8f82;
  --blue: #3a86ff;   --blue-d: #1f66d6;
  --purple: #8b5cf6; --purple-d: #6d3fe0;
  --red: #ff4d6d;    --red-d: #d93250;
  --ink: #2b2d42;    --ink-2: #5c5f7a; --ink-3: #9497b3;
  --card: #ffffff;   --line: #ece8ff;
  --bg1: #8fd3ff;    --bg2: #c7b8ff; --bg3: #ffd1ec;
  --nghe: var(--blue); --noi: var(--orange); --doc: var(--teal); --viet: var(--purple);
  --radius: 22px;
  --font-title: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 17px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.55) 0 60px, transparent 61px),
    radial-gradient(circle at 92% 20%, rgba(255,255,255,.45) 0 90px, transparent 91px),
    radial-gradient(circle at 80% 85%, rgba(255,255,255,.35) 0 70px, transparent 71px),
    radial-gradient(circle at 15% 78%, rgba(255,255,255,.35) 0 50px, transparent 51px),
    linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue-d); }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Khung ---------- */
.topbar {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 0 rgba(139,92,246,.15);
}
.brand {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  font-family: var(--font-title); font-weight: 800; font-size: 1.35rem; color: var(--purple-d);
}
.brand .logo { width: 40px; height: 40px; }
.brand span b { color: var(--pink); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: #fff; font-weight: 800; font-size: .95rem;
  box-shadow: 0 3px 0 rgba(0,0,0,.08);
  border: 0; white-space: nowrap;
}
.chip.points { background: #fff6cc; color: #a16207; }
.chip.streak { background: #ffe4e6; color: #be123c; }
.chip.me { padding: 4px 12px 4px 4px; }
.chip.me .av { width: 32px; height: 32px; font-size: 20px; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 14px; border: 0;
  background: #fff; font-size: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.08);
  display: inline-grid; align-items: center; justify-items: center;
}
.iconbtn:active { transform: translateY(2px); box-shadow: none; }

main#view { max-width: 1100px; margin: 0 auto; padding: 18px 16px 120px; }

/* ---------- Thẻ & nút ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 8px 0 rgba(43,45,66,.08), 0 14px 30px rgba(43,45,66,.08);
}
.card + .card { margin-top: 16px; }
.btn {
  --c: var(--blue); --cd: var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 18px;
  padding: 14px 22px; min-height: 54px;
  font-family: var(--font-title); font-weight: 800; font-size: 1.15rem; letter-spacing: .2px;
  color: #fff; background: var(--c);
  box-shadow: 0 6px 0 var(--cd);
  transition: transform .08s, box-shadow .08s, filter .15s;
  text-decoration: none; user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd); }
.btn:disabled { filter: grayscale(.8) opacity(.6); cursor: not-allowed; transform: none; }
.btn.pink { --c: var(--pink); --cd: var(--pink-d); }
.btn.orange { --c: var(--orange); --cd: var(--orange-d); }
.btn.green { --c: var(--green); --cd: var(--green-d); }
.btn.teal { --c: var(--teal); --cd: var(--teal-d); }
.btn.purple { --c: var(--purple); --cd: var(--purple-d); }
.btn.red { --c: var(--red); --cd: var(--red-d); }
.btn.yellow { --c: var(--yellow); --cd: var(--yellow-d); color: #5b4300; }
.btn.white { --c: #fff; --cd: #d9d4f2; color: var(--ink); }
.btn.ghost { --c: #f3f0ff; --cd: #ddd6fe; color: var(--purple-d); }
.btn.sm { padding: 8px 14px; min-height: 40px; font-size: 1rem; border-radius: 14px; box-shadow: 0 4px 0 var(--cd); }
.btn.lg { padding: 18px 30px; min-height: 66px; font-size: 1.35rem; border-radius: 22px; }
.btn.block { width: 100%; }

.grid { display: grid; gap: 16px;  grid-gap: 16px;}
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ---------- Avatar ---------- */
.av {
  width: 56px; height: 56px; border-radius: 50%;
  display: inline-grid; align-items: center; justify-items: center; font-size: 32px;
  background: var(--avc, #ffe0f0); flex-shrink: 0;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08);
}

/* ---------- Màn hình chọn hồ sơ ---------- */
.welcome { text-align: center; padding-top: 10px; }
.welcome h1 { font-size: 2.4rem; color: #fff; text-shadow: 0 4px 0 rgba(109,63,224,.45); }
.profiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin: 26px 0; }
.profile {
  width: 170px; padding: 18px 10px 16px; border: 0; border-radius: 28px;
  background: #fff; box-shadow: 0 8px 0 rgba(0,0,0,.1);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--font-title); font-weight: 800; font-size: 1.3rem;
  transition: transform .15s;
}
.profile:hover { transform: translateY(-6px) rotate(-2deg); }
.profile .av { width: 110px; height: 110px; font-size: 66px; }
.profile .lock { font-size: .8rem; color: var(--ink-3); font-family: var(--font-body); }

/* ---------- Trang chủ ---------- */
.hero {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(120deg, #fff 0%, #fff7fd 100%);
  border-radius: 28px; padding: 18px 22px; margin-bottom: 18px;
  box-shadow: 0 8px 0 rgba(43,45,66,.08);
}
.hero .mascot { width: 120px; height: 120px; flex-shrink: 0; }
.hero h1 { font-size: 1.8rem; margin-bottom: 4px; }
.bubble {
  position: relative; background: #f3f0ff; border-radius: 18px; padding: 10px 14px;
  font-weight: 700; color: var(--purple-d); display: inline-block;
}
.goal-ring { width: 92px; height: 92px; flex-shrink: 0; position: relative; }
.goal-ring svg { transform: rotate(-90deg); }
.goal-ring .lbl { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; align-items: center; justify-items: center; text-align: center; font-weight: 900; font-size: 1.05rem; line-height: 1.05; }
.goal-ring .lbl small { display: block; font-size: .65rem; color: var(--ink-2); font-weight: 700; }

.subject {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: 22px; min-height: 170px; color: #fff; border: 0; text-align: left;
  background: var(--sc, var(--blue));
  box-shadow: 0 8px 0 rgba(0,0,0,.15);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .15s;
}
.subject:hover { transform: translateY(-4px); }
.subject .ico { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.subject h3 { font-size: 1.5rem; margin: 10px 0 2px; }
.subject .soon { background: rgba(255,255,255,.3); padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem; align-self: flex-start; }
.subject::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,.15);
}
.subject.disabled { filter: saturate(.55); opacity: .85; }
.bar { height: 14px; border-radius: 999px; background: rgba(255,255,255,.35); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: #fff; width: 0; transition: width .6s; }
.bar.dark { background: #eee9ff; }
.bar.dark > i { background: linear-gradient(90deg, var(--green), var(--teal)); }

.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px;  grid-gap: 14px;}
.quick button {
  border: 0; border-radius: 22px; background: #fff; padding: 16px 10px;
  font-family: var(--font-title); font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 6px 0 rgba(0,0,0,.08); display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.quick button span { font-size: 36px; }
.quick button:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.08); }

/* ---------- Tiêu đề trang ---------- */
.pagehead { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: #fff; }
.pagehead h1 { margin: 0; text-shadow: 0 3px 0 rgba(0,0,0,.15); }
.pagehead .sub { opacity: .95; font-weight: 700; }
.back {
  width: 48px; height: 48px; border-radius: 16px; border: 0; background: #fff; font-size: 24px;
  box-shadow: 0 4px 0 rgba(0,0,0,.12); flex-shrink: 0; color: var(--ink);
}
.back:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  border: 0; border-radius: 16px; padding: 10px 16px; background: rgba(255,255,255,.6);
  font-weight: 800; font-family: var(--font-title); font-size: 1.05rem;
}
.tab.on { background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.1); color: var(--purple-d); }

/* ---------- Bản đồ Unit ---------- */
.unitcard {
  display: flex; align-items: center; gap: 16px; width: 100%;
  border: 0; text-align: left; background: #fff; border-radius: 26px; padding: 16px 18px;
  box-shadow: 0 7px 0 rgba(0,0,0,.08); transition: transform .15s;
  border-left: 12px solid var(--uc, var(--blue));
}
.unitcard:hover { transform: translateX(6px); }
.unitcard .num {
  width: 70px; height: 70px; border-radius: 22px; flex-shrink: 0;
  display: grid; align-items: center; justify-items: center; font-size: 38px; background: var(--uc, var(--blue));
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.15);
}
.unitcard h3 { margin: 0; font-size: 1.3rem; }
.unitcard .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.unitcard .bar { width: 100%; margin-top: 8px; }
.unitlist { display: flex; flex-direction: column; gap: 14px; }
.unitlist .unitcard:nth-child(even) { margin-left: 26px; width: calc(100% - 26px); }

.stars { color: #ffc300; letter-spacing: 1px; font-size: 1.05rem; white-space: nowrap; }
.stars .off { color: #e3defa; }

/* ---------- Bài học ---------- */
.lessoncard {
  border: 0; background: #fff; border-radius: 24px; padding: 16px; text-align: left;
  box-shadow: 0 7px 0 rgba(0,0,0,.08); display: flex; gap: 14px; align-items: center;
  transition: transform .15s;
}
.lessoncard:hover { transform: translateY(-4px); }
.lessoncard .ico { font-size: 40px; width: 64px; height: 64px; border-radius: 20px; background: #f3f0ff; display: grid; align-items: center; justify-items: center; flex-shrink: 0; }
.lessoncard h3 { font-size: 1.1rem; margin: 0 0 2px; }
.lessoncard .vi { color: var(--ink-2); font-size: .92rem; font-weight: 700; }

.skilltag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 900; color: #fff;
  background: var(--k, var(--ink-3));
}
.skilltag.nghe { --k: var(--nghe); } .skilltag.noi { --k: var(--noi); }
.skilltag.doc { --k: var(--doc); } .skilltag.viet { --k: var(--viet); } .skilltag.mix { --k: var(--pink); }

.actcard {
  border: 0; border-radius: 22px; padding: 16px 14px; text-align: center; color: #fff;
  background: var(--k, var(--pink)); box-shadow: 0 7px 0 rgba(0,0,0,.15);
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 150px;
  font-family: var(--font-title); font-weight: 800; transition: transform .15s; position: relative;
}
.actcard:hover { transform: translateY(-4px) scale(1.02); }
.actcard .ico { font-size: 40px; }
.actcard .t { font-size: 1.05rem; line-height: 1.2; }
.actcard .stars { background: rgba(255,255,255,.9); border-radius: 999px; padding: 2px 10px; }
.actcard.nghe { --k: var(--nghe); } .actcard.noi { --k: var(--noi); }
.actcard.doc { --k: var(--doc); } .actcard.viet { --k: var(--viet); }
.actcard .done { position: absolute; top: 8px; right: 10px; font-size: 22px; }

.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;  grid-gap: 12px;}
.word {
  border: 0; background: #fff8e6; border-radius: 18px; padding: 12px 8px; text-align: center;
  box-shadow: 0 4px 0 #ffe3a3; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.word .e { font-size: 40px; line-height: 1.1; }
.word .fr { font-weight: 900; font-size: 1.05rem; color: var(--ink); }
.word .vi { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.word:active { transform: translateY(3px); box-shadow: 0 1px 0 #ffe3a3; }
.phrase {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: #eef6ff; border-radius: 16px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 3px 0 #cfe3ff;
}
.phrase .fr { font-weight: 900; } .phrase .vi { color: var(--ink-2); font-size: .9rem; }
.memo {
  background: linear-gradient(135deg, #fff9db, #fff3bf); border-radius: 20px; padding: 16px 18px;
  border: 3px dashed #ffd43b;
}
.memo h4 { color: #b45309; margin-bottom: 6px; }
.memo ul { margin: 6px 0 0; padding-left: 20px; }
.audiochips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Trình phát bài nghe ---------- */
.player {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(120deg, #e0f2ff, #ede9fe); border-radius: 22px; padding: 12px 14px;
  box-shadow: 0 5px 0 #c7d7fe;
}
.player .pp {
  width: 64px; height: 64px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--blue); color: #fff; font-size: 28px; box-shadow: 0 5px 0 var(--blue-d);
}
.player .pp:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-d); }
.player .track { flex: 1; min-width: 0; }
.player .ttl { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .prog { height: 12px; background: #fff; border-radius: 999px; overflow: hidden; margin-top: 6px; cursor: pointer; }
.player .prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--purple)); border-radius: 999px; }
.player .time { font-size: .8rem; color: var(--ink-2); font-weight: 700; margin-top: 2px; }
.player .tools { display: flex; gap: 6px; }
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; width: calc(100% - 24px); max-width: 760px; z-index: 60; }

.tracklist { display: flex; flex-direction: column; gap: 8px; }
.trackrow {
  display: flex; align-items: center; gap: 12px; border: 0; width: 100%; text-align: left;
  background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 3px 0 rgba(0,0,0,.06);
}
.trackrow .n {
  width: 44px; height: 44px; border-radius: 14px; background: #e0f2ff; color: var(--blue-d);
  display: grid; align-items: center; justify-items: center; font-weight: 900; flex-shrink: 0;
}
.trackrow.on { background: #e0f2ff; box-shadow: 0 3px 0 #bfdbfe; }
.trackrow.on .n { background: var(--blue); color: #fff; }

/* ---------- Màn làm bài ---------- */
.playwrap { max-width: 820px; margin: 0 auto; }
.playtop { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress { flex: 1; height: 22px; background: rgba(255,255,255,.6); border-radius: 999px; overflow: hidden; box-shadow: inset 0 3px 0 rgba(0,0,0,.06); }
.progress i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .4s; background: linear-gradient(90deg, var(--yellow), var(--orange), var(--pink)); }
.timer { font-weight: 900; background: #fff; border-radius: 14px; padding: 8px 12px; min-width: 84px; text-align: center; box-shadow: 0 3px 0 rgba(0,0,0,.08); }
.timer.warn { background: var(--red); color: #fff; animation: pulse 1s infinite; }
.qcard { background: #fff; border-radius: 30px; padding: 26px 22px; box-shadow: 0 10px 0 rgba(43,45,66,.08); min-height: 360px; position: relative; }
.qkind { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.qtitle { font-family: var(--font-title); font-size: 1.45rem; font-weight: 800; margin: 4px 0 16px; line-height: 1.3; }
.qtitle .fr { color: var(--blue-d); }
.bigemoji { font-size: 96px; text-align: center; line-height: 1.1; margin: 6px 0 12px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.08)); }
.sayrow { display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.saybtn {
  width: 92px; height: 92px; border-radius: 50%; border: 0; font-size: 42px;
  background: var(--blue); color: #fff; box-shadow: 0 7px 0 var(--blue-d);
}
.saybtn.slow { width: 70px; height: 70px; font-size: 30px; background: var(--teal); box-shadow: 0 6px 0 var(--teal-d); align-self: center; }
.saybtn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--blue-d); }
.saybtn.playing { animation: pulse .8s infinite; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;  grid-gap: 14px;}
.options.one { grid-template-columns: 1fr; }
.opt {
  border: 3px solid #e6e1fb; background: #fff; border-radius: 22px; padding: 16px 14px; min-height: 76px;
  font-weight: 800; font-size: 1.15rem; box-shadow: 0 6px 0 #e6e1fb; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .1s;
}
.opt:hover { border-color: var(--purple); }
.opt:active { transform: translateY(4px); box-shadow: 0 2px 0 #e6e1fb; }
.opt .oe { font-size: 52px; line-height: 1; }
.opt.emoji { flex-direction: column; min-height: 130px; }
.opt.emoji .ol { font-size: .95rem; color: var(--ink-2); }
.opt.sel { border-color: var(--purple); background: #f3f0ff; }
.opt.ok { border-color: var(--green); background: #dcfce7; box-shadow: 0 6px 0 #86efac; animation: pop .35s; }
.opt.bad { border-color: var(--red); background: #ffe4e6; box-shadow: 0 6px 0 #fda4af; animation: shake .4s; }
.opt[disabled] { cursor: default; }
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;  grid-gap: 16px;}
.tf .opt { min-height: 110px; font-size: 1.35rem; flex-direction: column; }
.tf .opt b { font-size: 46px; }

.typebox {
  width: 100%; font-size: 1.6rem; font-weight: 800; padding: 14px 18px; border-radius: 20px;
  border: 4px solid #e6e1fb; outline: none; text-align: center; background: #fbfaff;
}
.typebox:focus { border-color: var(--purple); background: #fff; }
.typebox.ok { border-color: var(--green); background: #dcfce7; }
.typebox.bad { border-color: var(--red); background: #ffe4e6; animation: shake .4s; }
.hintline { text-align: center; letter-spacing: 6px; font-weight: 900; color: var(--ink-3); font-size: 1.2rem; margin: 10px 0; }
.accents { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.accents button {
  border: 0; background: #f3f0ff; color: var(--purple-d); font-weight: 900; font-size: 1.2rem;
  width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 3px 0 #ddd6fe;
}
.accents button:active { transform: translateY(2px); box-shadow: none; }
.prefix { display: flex; align-items: center; gap: 10px; }
.prefix .art { font-size: 1.6rem; font-weight: 900; color: var(--blue-d); }

.tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 64px; }
.answerline {
  min-height: 78px; border-radius: 20px; border: 3px dashed #d9d2fb; padding: 10px; margin-bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; background: #fbfaff;
}
.answerline.ok { border-color: var(--green); background: #dcfce7; }
.answerline.bad { border-color: var(--red); background: #ffe4e6; }
.tile {
  border: 0; background: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 900; font-size: 1.2rem;
  box-shadow: 0 5px 0 #d9d2fb; border: 2px solid #e6e1fb; animation: pop .25s;
}
.tile:active { transform: translateY(3px); box-shadow: 0 2px 0 #d9d2fb; }
.tile.used { visibility: hidden; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px;  grid-gap: 12px;}
.match .col { display: flex; flex-direction: column; gap: 12px; }
.mitem {
  border: 3px solid #e6e1fb; background: #fff; border-radius: 18px; padding: 10px; min-height: 70px;
  font-weight: 900; font-size: 1.1rem; box-shadow: 0 5px 0 #e6e1fb;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mitem .oe { font-size: 40px; }
.mitem.sel { border-color: var(--purple); background: #f3f0ff; transform: scale(1.03); }
.mitem.ok { border-color: var(--green); background: #dcfce7; box-shadow: 0 5px 0 #86efac; opacity: .75; }
.mitem.bad { border-color: var(--red); background: #ffe4e6; animation: shake .4s; }

.flash { perspective: 1000px; max-width: 420px; margin: 0 auto; }
.flash .inner {
  position: relative; height: 300px; transition: transform .5s; transform-style: preserve-3d; cursor: pointer;
}
.flash.flipped .inner { transform: rotateY(180deg); }
.flash .face {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(150deg, #fff7d6, #ffe1f0); box-shadow: 0 8px 0 #ffd0e6; padding: 16px; text-align: center;
}
.flash .flipface { transform: rotateY(180deg); background: linear-gradient(150deg, #dff5ff, #e9e2ff); box-shadow: 0 8px 0 #cfd8ff; }
.flash .e { font-size: 110px; line-height: 1; }
.flash .fr { font-family: var(--font-title); font-weight: 800; font-size: 2rem; color: var(--blue-d); }
.flash .vi { font-weight: 800; font-size: 1.5rem; }
.flashnav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; }

.speakbox { text-align: center; }
.speakbox .target { font-family: var(--font-title); font-size: 1.9rem; font-weight: 800; color: var(--blue-d); margin: 8px 0 4px; }
.speakbox .tvi { color: var(--ink-2); font-weight: 700; margin-bottom: 14px; }
.ctx { background: #f8f7ff; border-radius: 16px; padding: 10px 14px; margin-bottom: 14px; text-align: left; }
.ctx .line { margin: 4px 0; }
.ctx .who { font-weight: 900; color: var(--purple-d); }
.mic {
  width: 120px; height: 120px; border-radius: 50%; border: 0; font-size: 54px; color: #fff;
  background: var(--orange); box-shadow: 0 8px 0 var(--orange-d); margin: 10px auto; display: grid; align-items: center; justify-items: center;
}
.mic.on { background: var(--red); box-shadow: 0 8px 0 var(--red-d); animation: pulse 1s infinite; }
.mic:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--orange-d); }
.heard { min-height: 40px; font-size: 1.2rem; font-weight: 800; margin: 8px 0; }
.heard .w-ok { color: var(--green-d); } .heard .w-bad { color: var(--red); text-decoration: underline wavy; }
.selfrate { display: flex; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.selfrate button { border: 0; background: #fff; border-radius: 18px; padding: 10px 14px; font-weight: 800; box-shadow: 0 5px 0 #e6e1fb; border: 3px solid #e6e1fb; }
.selfrate button span { display: block; font-size: 38px; }

.readtext {
  background: #fffdf3; border: 3px solid #ffe8a3; border-radius: 20px; padding: 14px 18px; margin-bottom: 16px;
  font-size: 1.12rem; line-height: 1.6; white-space: pre-line;
}

/* Thanh phản hồi đúng / sai */
.feedback {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  padding: 16px 18px 22px; display: flex; align-items: center; gap: 14px;
  transform: translateY(110%); transition: transform .25s ease-out;
  box-shadow: 0 -6px 20px rgba(0,0,0,.12);
}
.feedback.show { transform: translateY(0); }
.feedback.ok { background: #dcfce7; color: #166534; }
.feedback.bad { background: #ffe4e6; color: #9f1239; }
.feedback.neutral { background: #ede9fe; color: var(--purple-d); }
.feedback .fbicon { font-size: 46px; }
.feedback .fbtxt { flex: 1; min-width: 0; }
.feedback .fbtitle { font-family: var(--font-title); font-weight: 800; font-size: 1.45rem; }
.feedback .fbmore { font-weight: 700; }
.feedback-inner { max-width: 820px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.checkbar { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Kết quả ---------- */
.result { text-align: center; }
.result .bigstars { font-size: 76px; letter-spacing: 6px; margin: 4px 0; min-height: 90px; }
.result .bigstars span { display: inline-block; opacity: .18; filter: grayscale(1); transform: scale(.6); transition: all .35s cubic-bezier(.2,1.6,.4,1); }
.result .bigstars span.lit { opacity: 1; filter: none; transform: scale(1); }
.result .grade { font-family: var(--font-title); font-weight: 800; font-size: 3.4rem; color: var(--purple-d); line-height: 1; }
.result .grade small { font-size: 1.4rem; color: var(--ink-3); }
.result .msg { font-family: var(--font-title); font-size: 1.6rem; font-weight: 800; margin: 8px 0; }
.result .mascot { width: 150px; height: 150px; margin: 0 auto; display: block; }
.earned { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.reviewlist { text-align: left; margin-top: 18px; }
.rv { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; margin-bottom: 8px; background: #f8f7ff; align-items: flex-start; }
.rv.ok { background: #effdf3; } .rv.bad { background: #fff1f3; }
.rv .i { font-size: 22px; }
.rv .exp { color: var(--green-d); font-weight: 800; }
.rv .ans { color: var(--red-d); font-weight: 800; }

/* ---------- Lịch sử & huy hiệu ---------- */
.hist { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border-radius: 18px; margin-bottom: 10px; box-shadow: 0 4px 0 rgba(0,0,0,.05); border: 0; width: 100%; text-align: left; }
.hist .si { width: 48px; height: 48px; border-radius: 16px; display: grid; align-items: center; justify-items: center; font-size: 26px; background: var(--k, #eee); color: #fff; flex-shrink: 0; }
.hist .si.nghe { --k: var(--nghe); } .hist .si.noi { --k: var(--noi); } .hist .si.doc { --k: var(--doc); } .hist .si.viet { --k: var(--viet); } .hist .si.mix { --k: var(--pink); }
.hist .t { font-weight: 900; } .hist .s { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.hist .sc { font-family: var(--font-title); font-weight: 800; font-size: 1.35rem; text-align: right; }
.daylabel { color: #fff; font-weight: 900; margin: 16px 4px 8px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.skillbars { display: grid; gap: 10px;  grid-gap: 10px;}
.skillbar { display: grid; grid-template-columns: 90px 1fr 52px; align-items: center; gap: 10px; font-weight: 800;  grid-gap: 10px;}
.skillbar .bar { height: 18px; background: #f1eefe; }
.skillbar .bar i { background: var(--k); }
.days { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.days .d { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.days .d i { width: 100%; max-width: 30px; background: linear-gradient(180deg, var(--pink), var(--purple)); border-radius: 8px 8px 4px 4px; min-height: 4px; }
.days .d small { font-size: .7rem; color: var(--ink-3); font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;  grid-gap: 14px;}
.badge { background: #fff; border-radius: 22px; padding: 16px 10px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.06); }
.badge .bi { font-size: 56px; }
.badge.off { opacity: .5; filter: grayscale(1); }
.badge b { display: block; font-family: var(--font-title); font-size: 1.1rem; }
.badge small { color: var(--ink-2); font-weight: 700; }
.stat { background: #fff; border-radius: 22px; padding: 16px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.06); }
.stat b { display: block; font-family: var(--font-title); font-size: 2rem; color: var(--purple-d); }
.stat span { font-weight: 800; color: var(--ink-2); font-size: .9rem; }

/* ---------- Hộp thoại, thông báo ---------- */
.modal-bg {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(43,45,66,.45); z-index: 100;
  display: grid; align-items: center; justify-items: center; padding: 16px; animation: fade .2s;
}
.modal {
  background: #fff; border-radius: 30px; padding: 24px; width: 100%; max-width: 480px;
  box-shadow: 0 12px 0 rgba(0,0,0,.12); animation: pop .3s; max-height: 90vh; overflow: auto; text-align: center;
}
.modal.wide { width: 100%; max-width: 760px; text-align: left; }
.modal h2 { margin-bottom: 8px; }
.modal .mascot { width: 120px; height: 120px; margin: 0 auto; display: block; }
.modal .actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; margin-top: 14px;  grid-gap: 12px;}
.pinpad button { height: 64px; border-radius: 18px; border: 0; background: #f3f0ff; font-size: 1.6rem; font-weight: 900; box-shadow: 0 4px 0 #ddd6fe; }
.pindots { display: flex; gap: 12px; justify-content: center; margin: 10px 0; }
.pindots i { width: 18px; height: 18px; border-radius: 50%; background: #e6e1fb; }
.pindots i.on { background: var(--purple); }
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-20px); z-index: 120;
  background: #fff; padding: 12px 20px; border-radius: 18px; font-weight: 800; opacity: 0;
  box-shadow: 0 6px 0 rgba(0,0,0,.1); transition: all .3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.badgepop .bi { font-size: 100px; animation: spinpop 1s; display: block; }

canvas#confetti { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 150; }

.empty { text-align: center; padding: 30px 16px; }
.empty .e { font-size: 72px; }
.loading { text-align: center; padding: 60px 0; font-size: 3rem; animation: bounce 1s infinite; }

/* ---------- Linh vật ---------- */
.mascot { overflow: visible; }
.mascot .body-g { transform-origin: 60px 110px; animation: breathe 2.6s ease-in-out infinite; }
.mascot.happy .body-g { animation: jump .6s ease-in-out 3; }
.mascot.sad .body-g { animation: sway 1.2s ease-in-out 2; }
.mascot .eyes-happy, .mascot .eyes-sad { display: none; }
.mascot.happy .eyes-normal, .mascot.sad .eyes-normal { display: none; }
.mascot.happy .eyes-happy { display: inline; }
.mascot.sad .eyes-sad { display: inline; }
.mascot .wing-l { transform-origin: 26px 66px; }
.mascot .wing-r { transform-origin: 94px 66px; }
.mascot.happy .wing-l { animation: flapL .25s ease-in-out 8; }
.mascot.happy .wing-r { animation: flapR .25s ease-in-out 8; }

/* ---------- Hiệu ứng ---------- */
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .98); } }
@keyframes jump { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-16px) scale(1.05); } }
@keyframes sway { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes flapL { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-35deg); } }
@keyframes flapR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(35deg); } }
@keyframes spinpop { 0% { transform: scale(0) rotate(-180deg); } 70% { transform: scale(1.2) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
.enter { animation: pop .35s ease-out; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .brand span { display: none; }
  .hero { flex-wrap: wrap; justify-content: center; text-align: center; }
  .hero .mascot { width: 90px; height: 90px; }
  .qcard { padding: 20px 14px; border-radius: 24px; }
  .qtitle { font-size: 1.2rem; }
  .opt { font-size: 1rem; min-height: 64px; padding: 12px 8px; }
  .opt .oe { font-size: 42px; }
  .bigemoji { font-size: 76px; }
  .unitlist .unitcard:nth-child(even) { margin-left: 0; width: 100%; }
  .unitcard .num { width: 56px; height: 56px; font-size: 30px; }
  .profile { width: 140px; }
  .profile .av { width: 88px; height: 88px; font-size: 52px; }
  .match { gap: 10px 12px; }
  .mitem { font-size: .95rem; }
  .feedback .fbtitle { font-size: 1.2rem; }
  .result .bigstars { font-size: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Thư viện nhân vật ---------- */
.mascotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 10px;  grid-gap: 12px;}
.mascotopt { border: 4px solid transparent; background: #f3f0ff; border-radius: 22px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; box-shadow: 0 5px 0 #ddd6fe; }
.mascotopt .mascot { width: 84px; height: 84px; }
.mascotopt:hover { transform: translateY(-3px); }
.mascotopt.on { border-color: var(--purple); background: #fff; }
img.mascot { object-fit: contain; }
img.mascot.happy { animation: jump .6s ease-in-out 3; }
img.mascot.sad { animation: sway 1.2s ease-in-out 2; }
.brand .mascot.logo { width: 42px; height: 42px; }

/* ---------- Chọn hình đại diện / màu (dùng cho bé và phụ huynh) ---------- */
.pickgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pickgrid button { width: 52px; height: 52px; border-radius: 16px; border: 4px solid transparent; background: #f3f0ff; font-size: 28px; box-shadow: 0 4px 0 #ddd6fe; }
.pickgrid button.on { border-color: var(--purple); background: #fff; transform: scale(1.08); }
.pickgrid.colors button { font-size: 0; box-shadow: 0 4px 0 rgba(0,0,0,.15); }

/* ---------- Chọn màu nền ---------- */
.themegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;  grid-gap: 10px;}
.themeopt { height: 64px; border-radius: 18px; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(0,0,0,.15); color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0,0,0,.3); display: grid; align-items: end; justify-items: start; padding: 6px 10px; }
.themeopt.on { border-color: var(--purple); transform: scale(1.05); }
.pickgrid button[title="Theo bạn đồng hành"] { width: auto; padding: 0 12px; }

/* ---------- Buổi học ---------- */
.sessbox { background: #f8f7ff; border-radius: 20px; padding: 14px 16px; margin-top: 14px; text-align: left; }
.secrow { display: grid; grid-template-columns: minmax(130px, 40%) 1fr 56px; gap: 10px; align-items: center; padding: 5px 0; font-weight: 800;  grid-gap: 10px;}
.secrow .bar { height: 16px; }
.secrow.test { border-top: 2px dashed #d9d2fb; margin-top: 6px; padding-top: 10px; }
.passbox { border-radius: 14px; padding: 10px 14px; font-weight: 800; margin-top: 10px; }
.passbox.ok { background: #dcfce7; color: #166534; }
.passbox.bad { background: #fff1f3; color: #9f1239; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.steps .st { background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; box-shadow: 0 3px 0 rgba(0,0,0,.07); font-size: .92rem; }
@media (max-width: 640px) { .secrow { grid-template-columns: 1fr 70px 48px; } }


/* ===== iPad cũ (Safari < 14.5): gap cho flexbox được thay bằng margin ===== */
.no-flexgap .row > * { margin: 6px; }
.no-flexgap .topbar > * { margin: 5px; }
.no-flexgap .brand > * { margin: 4px; }
.no-flexgap .chip > * { margin: 3px; }
.no-flexgap .btn > * { margin: 4px; }
.no-flexgap .profiles > * { margin: 11px; }
.no-flexgap .profile > * { margin: 5px; }
.no-flexgap .hero > * { margin: 9px; }
.no-flexgap .quick button > * { margin: 3px; }
.no-flexgap .pagehead > * { margin: 6px; }
.no-flexgap .tabs > * { margin: 4px; }
.no-flexgap .unitcard > * { margin: 8px; }
.no-flexgap .unitcard .meta > * { margin: 5px; }
.no-flexgap .unitlist > * { margin: 7px; }
.no-flexgap .lessoncard > * { margin: 7px; }
.no-flexgap .skilltag > * { margin: 2px; }
.no-flexgap .actcard > * { margin: 3px; }
.no-flexgap .word > * { margin: 2px; }
.no-flexgap .phrase > * { margin: 6px; }
.no-flexgap .audiochips > * { margin: 4px; }
.no-flexgap .player > * { margin: 6px; }
.no-flexgap .player .tools > * { margin: 3px; }
.no-flexgap .tracklist > * { margin: 4px; }
.no-flexgap .trackrow > * { margin: 6px; }
.no-flexgap .playtop > * { margin: 6px; }
.no-flexgap .qkind > * { margin: 3px; }
.no-flexgap .sayrow > * { margin: 7px; }
.no-flexgap .opt > * { margin: 5px; }
.no-flexgap .accents > * { margin: 3px; }
.no-flexgap .prefix > * { margin: 5px; }
.no-flexgap .tiles > * { margin: 5px; }
.no-flexgap .answerline > * { margin: 5px; }
.no-flexgap .match .col > * { margin: 6px; }
.no-flexgap .mitem > * { margin: 4px; }
.no-flexgap .flash .face > * { margin: 5px; }
.no-flexgap .flashnav > * { margin: 5px; }
.no-flexgap .selfrate > * { margin: 6px; }
.no-flexgap .feedback > * { margin: 7px; }
.no-flexgap .feedback-inner > * { margin: 7px; }
.no-flexgap .checkbar > * { margin: 5px; }
.no-flexgap .earned > * { margin: 5px; }
.no-flexgap .rv > * { margin: 5px; }
.no-flexgap .hist > * { margin: 6px; }
.no-flexgap .days > * { margin: 3px; }
.no-flexgap .days .d > * { margin: 2px; }
.no-flexgap .modal .actions > * { margin: 5px; }
.no-flexgap .pindots > * { margin: 6px; }
.no-flexgap .mascotopt > * { margin: 3px; }
.no-flexgap .pickgrid > * { margin: 4px; }
.no-flexgap .steps > * { margin: 4px; }

/* ---------- Đổi quà ---------- */
.rewardcard { transition: transform .15s; }
.rewardcard.can { box-shadow: 0 8px 0 #86efac, 0 14px 30px rgba(34,197,94,.25); }
.rewardcard:hover { transform: translateY(-4px); }
button.chip { border: 0; cursor: pointer; }

.rewardcard h3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Thẻ môn học: nhận biết môn (EN/FR + hình + lời chào) và lớp (huy hiệu màu theo lớp) */
.subject .subjtop { display: flex; align-items: center; margin-bottom: 8px; }
.subject .subjtop .stag { background: rgba(255,255,255,.92); color: var(--sc, #333); font-weight: 900; font-size: .95rem; padding: 3px 12px; border-radius: 999px; margin-right: 8px; letter-spacing: 1px; }
.subject .gbadge { font-weight: 900; font-size: 1.05rem; padding: 3px 14px; border-radius: 999px; color: #fff; border: 3px solid #fff; background: #ff9f1c; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.gbadge.g1 { background: #f59e0b; } .gbadge.g2 { background: #ec4899; } .gbadge.g3 { background: #8b5cf6; } .gbadge.g4 { background: #0ea5a4; } .gbadge.g5 { background: #ef4444; }
.subject .subjart { display: flex; align-items: center; }
.subject .subjart .ico { margin-right: 10px; }
.subject .bubble { position: relative; background: #fff; color: #333; font-weight: 900; font-size: 1rem; padding: 6px 14px; border-radius: 16px 16px 16px 4px; box-shadow: 0 3px 0 rgba(0,0,0,.15); }

.subject .gnum { position: absolute; right: 18px; top: 44px; font-size: 84px; font-weight: 900; line-height: 1; color: rgba(255,255,255,.38); text-shadow: 0 5px 0 rgba(0,0,0,.12); pointer-events: none; }

.subjtop .stag { background: rgba(255,255,255,.92); font-weight: 900; font-size: .95rem; padding: 3px 12px; border-radius: 999px; margin-right: 8px; letter-spacing: 1px; }
.subjtop { display: flex; align-items: center; }
.subjtop .gbadge { font-weight: 900; font-size: 1.05rem; padding: 3px 14px; border-radius: 999px; color: #fff; border: 3px solid #fff; background: #ff9f1c; box-shadow: 0 3px 0 rgba(0,0,0,.18); }

/* ---------- Lịch sử học (trang của bé) ---------- */
.hstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; grid-gap: 14px; margin-bottom: 16px; }
.hstats .stat { padding: 14px 10px; }
.hstats .stat b { font-size: 1.7rem; line-height: 1.2; }
.hstats .stat b small { font-size: .55em; color: var(--ink-2); }
.hcharts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; grid-gap: 16px; margin-bottom: 16px; }
.hcharts .card { min-width: 0; }
.hcharts h3 { margin: 0 0 2px; }
.hsub { margin: 0 0 12px; font-weight: 700; }
.hdays { display: flex; align-items: flex-end; height: 128px; }
.hdays .hd { flex: 1 1 0; min-width: 0; height: 100%; margin: 0 1px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.hdays .hd .n { font-size: .72rem; font-weight: 900; color: var(--purple-d); min-height: 14px; line-height: 14px; }
.hdays .hd i { display: block; width: 72%; max-width: 26px; min-height: 4px; margin: 2px 0 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--pink), var(--purple)); }
.hdays .hd i.zero { background: #ebe7fb; }
.hdays .hd .dd { font-size: .72rem; font-weight: 900; color: var(--ink-2); line-height: 1.25; }
.hdays .hd .wd { font-size: .6rem; font-weight: 800; color: var(--ink-3); line-height: 1.2; }
.hdays .hd.today .dd, .hdays .hd.today .wd { color: var(--pink); }
.hday { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; color: #fff; font-weight: 900; margin: 18px 4px 8px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.hday .hdaysum { font-size: .85rem; }
.hist .hmain { flex: 1; min-width: 0; }
.hist .t { line-height: 1.3; }
.hist .s { margin-top: 4px; line-height: 1.9; }
.hist .s > span, .histmodal .s > span { display: inline-block; margin-right: 10px; white-space: nowrap; }
.ctag { border: 2px solid var(--cc, #7c3aed); color: var(--cc, #7c3aed); background: #fff; border-radius: 999px; padding: 0 8px; font-size: .78rem; font-weight: 900; line-height: 1.5; }
.hist .sc { flex-shrink: 0; min-width: 78px; }
.hist .sc .g { line-height: 1.1; }
.hist .sc .g small { font-size: .7rem; color: var(--ink-3); }
.hist .sc .g.hi { color: var(--green-d); } .hist .sc .g.mid { color: #d97706; } .hist .sc .g.lo { color: #db2777; }
.hist .sc .pts { font-family: var(--font-body); font-size: .78rem; font-weight: 800; color: #a16207; white-space: nowrap; margin-top: 2px; }
.histmodal .mclose { float: right; width: 44px; height: 44px; margin: -8px -8px 6px 10px; border: 0; border-radius: 14px; background: #f3f0ff; color: var(--ink-2); font-size: 20px; font-weight: 900; }
.histmodal .hm-head { display: flex; align-items: center; }
.histmodal .si { width: 52px; height: 52px; border-radius: 16px; display: grid; align-items: center; justify-items: center; font-size: 28px; background: var(--k, #eee); flex-shrink: 0; margin-right: 12px; }
.histmodal .si.nghe { --k: var(--nghe); } .histmodal .si.noi { --k: var(--noi); } .histmodal .si.doc { --k: var(--doc); } .histmodal .si.viet { --k: var(--viet); } .histmodal .si.mix { --k: var(--pink); }
.histmodal h2 { margin: 0 0 4px; line-height: 1.25; }
.histmodal .s { font-weight: 800; color: var(--ink-2); font-size: .9rem; line-height: 1.9; }
.histmodal .hm-sum { margin-top: 12px; }
.histmodal .hm-sum .chip { margin: 0 6px 6px 0; background: #f8f7ff; }
.histmodal .hm-sum .chip.points { background: #fff6cc; }
.histmodal .tab { background: #f3f0ff; }
.histmodal .tab.on { background: var(--purple); color: #fff; }
.histmodal .reviewlist { margin-top: 10px; }
.histmodal .hm-empty { font-weight: 700; margin: 16px 0 0; }
@media (max-width: 720px) {
  .hcharts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hstats { grid-template-columns: 1fr 1fr; gap: 10px; grid-gap: 10px; }
  .hstats .stat b { font-size: 1.35rem; }
  .hist .sc { min-width: 62px; }
  .histmodal .si { width: 44px; height: 44px; font-size: 24px; }
}
