/* ============ Kiểm Tra Tiểu Học — styles ============ */
:root{
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #2b3245;
  --muted: #6b7280;
  --primary: #4f7cff;
  --primary-dark: #3a5fd9;
  --green: #2fb673;
  --green-bg: #e8f9f0;
  --red: #ef5757;
  --red-bg: #fdecec;
  --yellow: #f5a524;
  --purple: #9c6df2;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(40, 60, 100, 0.10);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    url('assets/page-bg.png') no-repeat center center / cover,
    linear-gradient(180deg, #eaf5fd 0%, #eef8f1 100%);
  background-attachment: fixed, fixed;
  color: var(--text);
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Baloo 2 cho tiêu đề vui nhộn, Nunito cho nút/điều khiển, Be Vietnam Pro (mặc định ở body)
   cho toàn bộ nội dung học tập (câu hỏi, giải thích, đoạn văn...). */
h1, h2, h3,
.pk-title, .hero h1, .lesson-title, .section-title,
.hm-mode-title, .result-hero .score, .result-hero .level,
.mode-card .title, .hm-subject-name{
  font-family: "Baloo 2", "Be Vietnam Pro", sans-serif;
}
.btn, .pill, .pk-start-btn, .pk-package-card, .pk-back,
.hm-nav-item, .hm-mode-btn, .option-btn, select, input,
.icon-btn, .hm-subjects-tip, .hm-subject-grade{
  font-family: "Nunito", "Be Vietnam Pro", sans-serif;
}

.app{
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 16px 40px;
  display:flex;
  flex-direction: column;
}
/* Nội dung đọc (câu hỏi, form...) tự giới hạn chiều rộng để dễ đọc, còn nền
   trang trí (pk-page/hm-page) vẫn chạy hết chiều ngang .app ở trên. */
.quiz-header, .question-card{ max-width:820px; width:100%; margin-left:auto; margin-right:auto; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:none;
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor:pointer;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover{ transform: translateY(-2px); box-shadow: 0 10px 22px rgba(40,60,100,.14); }
.btn:active{ transform: scale(0.97) translateY(0); }
.btn-primary{
  background: linear-gradient(135deg, var(--primary), #6f8fff);
  color:#fff;
  box-shadow: 0 10px 22px rgba(79,124,255,.35);
}
.btn-primary:hover{ background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: 0 12px 26px rgba(79,124,255,.42); }
.btn-ghost{ background: transparent; box-shadow:none; color: var(--muted); font-weight:600; }
.btn-ghost:hover{ background:#eef1f6; box-shadow:none; transform:none; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.4; cursor:not-allowed; transform:none !important; box-shadow: var(--shadow) !important; }

/* ---------- Top bar ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 18px;
}
.topbar .icon-btn{
  background:var(--card); border:none; border-radius:12px;
  width:44px; height:44px; font-size:1.2rem; cursor:pointer;
  box-shadow: var(--shadow); color: var(--text);
  transition: transform .12s ease, box-shadow .15s ease;
}
.topbar .icon-btn:hover{ transform: translateY(-2px); box-shadow: 0 10px 20px rgba(40,60,100,.16); }
.topbar .icon-btn:active{ transform: scale(0.94);
}
.topbar h1{ font-size:1.15rem; margin:0; text-align:center; flex:1; }

/* ---------- Home screen ---------- */
.hero{
  text-align:center;
  margin: 8px 0 24px;
}
.hero h1{ font-size:1.6rem; margin:0 0 4px; }
.hero p{ color:var(--muted); margin:0; }

.grid-modes{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width:520px){ .grid-modes{ grid-template-columns: 1fr; } }

.mode-card{
  background:var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align:center;
  cursor:pointer;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.mode-card:not(.disabled):hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(40,60,100,.16);
  border-color: #dbe4ff;
}
.mode-card:not(.disabled):active{ transform: translateY(-1px) scale(0.99); }
.mode-card.disabled{ opacity:.45; cursor:not-allowed; }
.mode-card .emoji{ font-size:2.2rem; display:block; margin-bottom:8px; }
.mode-card .title{ font-weight:800; font-size:1.05rem; }
.mode-card .sub{ color:var(--muted); font-size:.85rem; margin-top:4px; }

.side-actions{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:center;
}
.side-actions .btn{ flex:1 1 160px; font-size:1rem; padding:14px; }

/* ---------- Picker (chọn bài) ---------- */
.picker-section{
  background:var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom:16px;
}
.picker-section h2{ margin:0 0 12px; font-size:1.1rem; }
.field{ margin-bottom: 14px; }
.field label{ display:block; font-weight:700; margin-bottom:6px; font-size:.95rem; color:var(--muted); }
.field select{
  width:100%; padding:12px 40px 12px 14px; border-radius:12px; border:2px solid #e6eaf2;
  font-size:1rem; background-color:#fff; color:var(--text);
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor:pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select:hover{ border-color:#c9d3e6; }
.field select:focus{ outline:none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,124,255,.15); }

.pill-group{ display:flex; flex-wrap:wrap; gap:10px; }
.pill{
  position:relative;
  padding:12px 22px; border-radius:999px; border:2px solid #e6eaf2;
  background:#fff; cursor:pointer; font-weight:700; font-size:1rem; color:var(--text);
  transition: transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
}
.pill:hover:not(:disabled){ border-color:#c3d0ff; transform: translateY(-1px); }
.pill.active{
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #6f8fff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79,124,255,.32);
}
.pill.active::before{
  content:"✓ ";
  font-weight:800;
}
.pill:active:not(:disabled){ transform: scale(0.96); }
.pill:disabled{ opacity:.35; cursor:not-allowed; }
.hint-box{
  background:#fff8e8; border:1px solid #f5deac; color:#8a6b16;
  border-radius:12px; padding:10px 14px; font-size:.9rem; margin-top:6px;
}

/* ---------- Quiz screen ---------- */
.quiz-header{ margin-bottom: 14px; }
.quiz-header .lesson-title{ font-weight:800; font-size:1.05rem; margin-bottom:6px; }
.quiz-header .counter-row{ display:flex; align-items:center; justify-content:space-between; }
.counter{ font-weight:700; color: var(--muted); }
.progress-bar{
  height:10px; background:#e6eaf2; border-radius:999px; overflow:hidden; margin-top:8px;
}
.progress-bar > div{ height:100%; background: var(--primary); border-radius:999px; transition: width .3s ease; }

.question-card{
  background:var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 20px; flex:1; display:flex; flex-direction:column;
}
.pk-fun-badge{
  display:inline-block; background:#fff3d6; color:#a16207; font-weight:800; font-size:.8rem;
  padding:8px 14px; border-radius:999px; margin-bottom:14px;
}
.question-text{ font-size:1.35rem; font-weight:700; line-height:1.4; margin-bottom:20px; }
.question-media{ text-align:center; margin-bottom:16px; }
.question-media img{ max-width:100%; border-radius:14px; }

.options{ display:flex; flex-direction:column; gap:12px; }
.option-btn{
  display:flex; align-items:center; gap:14px;
  text-align:left; padding:16px 18px; border-radius:16px;
  border:2px solid #e6eaf2; background:#fff; cursor:pointer;
  font-size:1.15rem; font-weight:600; color:var(--text);
}
.option-btn .badge{
  width:32px; height:32px; border-radius:50%; background:#eef2ff; color:var(--primary-dark);
  display:flex; align-items:center; justify-content:center; font-weight:800; flex-shrink:0;
}
.option-btn:active{ transform: scale(0.99); }
.option-btn.correct{ border-color: var(--green); background: var(--green-bg); }
.option-btn.correct .badge{ background: var(--green); color:#fff; }
.option-btn.wrong{ border-color: var(--red); background: var(--red-bg); }
.option-btn.wrong .badge{ background: var(--red); color:#fff; }
.option-btn.dim{ opacity:.55; }
.option-btn:disabled{ cursor:default; }

.feedback-banner{
  margin-top:16px; padding:14px 16px; border-radius:14px; font-weight:700; font-size:1.05rem;
  display:none; align-items:center; gap:10px;
}
.feedback-banner.show{ display:flex; }
.feedback-banner.correct{ background: var(--green-bg); color:#1c8a57; }
.feedback-banner.wrong{ background: var(--red-bg); color:#c23a3a; }
.explanation{ font-weight:500; font-size:.95rem; margin-top:4px; color:#5a4040; }

.quiz-footer{
  display:flex; justify-content:space-between; align-items:center; margin-top:16px;
}
.quiz-footer .btn{ padding:10px 16px; font-size:.95rem; }

/* ---------- Result screen ---------- */
.result-hero{
  text-align:center; background: linear-gradient(135deg,#4f7cff,#7c9bff);
  color:#fff; border-radius: var(--radius); padding: 28px 20px; margin-bottom:18px;
}
.result-hero .score{ font-size:2.6rem; font-weight:800; margin:6px 0; }
.result-hero .level{ font-size:1.15rem; font-weight:700; }
.result-hero .overall-msg{ margin-top:10px; font-size:.98rem; opacity:.95; line-height:1.5; }

.result-card{
  background:var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom:14px;
}
.result-card h3{ margin:0 0 12px; font-size:1.05rem; }
.skill-row{
  display:flex; align-items:center; justify-content:space-between; padding:10px 0;
  border-bottom:1px solid #eef1f6;
}
.skill-row:last-child{ border-bottom:none; }
.skill-name{ font-weight:700; }
.skill-score{ font-weight:800; }
.skill-tag{ font-size:.78rem; padding:3px 10px; border-radius:999px; font-weight:700; margin-left:8px; }
.tag-good{ background: var(--green-bg); color:#1c8a57; }
.tag-mid{ background:#fff4e0; color:#a16207; }
.tag-weak{ background: var(--red-bg); color:#c23a3a; }

.list-plain{ margin:0; padding-left:20px; }
.list-plain li{ margin-bottom:6px; }

.result-actions{ display:flex; flex-direction:column; gap:10px; margin-top:6px; }

/* ---------- History ---------- */
.history-item{
  background:var(--card); border-radius:16px; box-shadow: var(--shadow);
  padding:14px 16px; margin-bottom:10px; display:flex; justify-content:space-between; align-items:center;
}
.history-item .h-left .h-title{ font-weight:700; }
.history-item .h-left .h-date{ font-size:.8rem; color:var(--muted); }
.history-item .h-score{ font-weight:800; font-size:1.2rem; }

.empty-state{ text-align:center; color:var(--muted); padding:40px 20px; }

/* ---------- misc ---------- */
.section-title{ font-weight:800; font-size:1.1rem; margin: 18px 0 10px; }
.footer-note{ text-align:center; color:var(--muted); font-size:.8rem; margin-top:24px; }

/* ================= Màn "Chọn bài" — thiết kế mới ================= */
.pk-page{
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: transparent; /* để lộ ảnh nền Cover chung của cả trang (body) */
  padding: 18px 16px 28px;
  margin: -20px -16px 0;
}
.pk-bg-cloud{
  position:absolute; background:#fff; border-radius:50%; opacity:.85; filter:blur(0.3px);
}
.pk-back{
  display:inline-flex; align-items:center; gap:6px; background:#fff; border:none;
  border-radius:999px; padding:10px 18px 10px 14px; font-weight:800; font-size:.95rem;
  color:var(--text); box-shadow: var(--shadow); cursor:pointer; position:relative; z-index:2;
}
.pk-hero{ position:relative; z-index:2; text-align:center; margin: 18px auto 20px; padding: 22px 16px; border-radius:26px; max-width:1040px; }
.pk-hero-photo{
  background-image: url('assets/hero-bg.png'); background-size:cover; background-position:center;
  padding: 20px 16px 26px;
}
.pk-hero-graphic{ max-width:100%; height:auto; margin:0 auto; display:block; }
.pk-hero-title-img{ width:min(320px, 62%); }
.pk-hero-sub-img{ width:min(360px, 68%); margin-top:-6px; }
.pk-hero .pk-title{
  font-size:1.9rem; font-weight:800; margin:0; display:flex; align-items:center; justify-content:center; gap:12px; line-height:1.3;
  color:#2b4fc7;
  text-shadow: 0 2px 0 #fff, 0 4px 6px rgba(40,60,100,.25);
}
.pk-hero .pk-sub{ color:#5b6b86; font-weight:700; margin:8px 0 0; font-size:1rem; }
.pk-hero-cloud{
  position:absolute; top:-10px; right:6px; background:#fff8e0; border:2px solid #ffe6a8;
  border-radius:20px; padding:8px 14px; font-size:.78rem; font-weight:800; color:#a16207;
  line-height:1.3; text-align:center; box-shadow: var(--shadow); display:none;
}
@media (min-width:640px){ .pk-hero-cloud{ display:block; } }

.pk-card{
  position:relative; z-index:2; background:#fff; border-radius:26px; box-shadow: var(--shadow);
  padding: 18px; max-width: 760px; margin: 0 auto;
}

.pk-field{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-radius:18px; padding:12px 14px; margin-bottom:12px;
}
.pk-field.c-green{ background:#e3f7ea; }
.pk-field.c-pink{ background:#fdeaf1; }
.pk-field.c-blue{ background:#e6f1fc; }
.pk-field.c-yellow{ background:#fef6df; }
.pk-field-label{ display:flex; align-items:center; gap:10px; font-weight:800; color:#33415c; white-space:nowrap; }
.pk-field-icon{
  width:38px; height:38px; border-radius:50%; background:#fff; display:flex; align-items:center;
  justify-content:center; font-size:1.15rem; flex-shrink:0; box-shadow: 0 2px 6px rgba(40,60,100,.12);
}
.pk-field-value{
  position:relative; flex:1; max-width:320px; background:#fff; border-radius:14px;
  box-shadow: 0 2px 6px rgba(40,60,100,.10);
}
.pk-field-value select{
  width:100%; border:none; background:transparent; appearance:none; -webkit-appearance:none;
  padding:10px 34px 10px 14px; font-weight:700; font-size:.92rem; color:var(--text); cursor:pointer;
}
.pk-field-value::after{
  content:"›"; position:absolute; right:14px; top:50%; transform:translateY(-50%) rotate(90deg);
  color:#9aa5b8; font-weight:900; font-size:1rem; pointer-events:none;
}

.pk-section-title{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:1.05rem; margin:18px 2px 8px; }
.pk-tip{
  background:#fff8e3; border:1px solid #ffe6a8; color:#8a6b16; border-radius:14px;
  padding:8px 14px; font-size:.82rem; font-weight:700; margin-bottom:12px;
}

.pk-package-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin-bottom:14px; }
@media (max-width:640px){ .pk-package-grid{ grid-template-columns: repeat(2, 1fr); } }
.pk-package-card{
  position:relative; background:#fff; border:2px solid #e6eaf2; border-radius:18px;
  padding:14px 10px; text-align:center; cursor:pointer; transition: transform .12s ease, box-shadow .15s ease;
}
.pk-package-card:hover{ transform: translateY(-2px); box-shadow: 0 10px 20px rgba(40,60,100,.12); }
.pk-package-card .pk-check{
  position:absolute; top:-8px; right:-8px; width:24px; height:24px; border-radius:50%;
  background:#fff; color:var(--primary); display:none; align-items:center; justify-content:center;
  font-weight:900; font-size:.85rem; box-shadow: var(--shadow);
}
.pk-package-card .pk-num{ font-weight:800; font-size:1.15rem; color:var(--text); }
.pk-package-card .pk-tag{ font-size:.72rem; font-weight:800; margin:6px 0 4px; }
.pk-package-card .pk-desc{ font-size:.68rem; color:var(--muted); font-weight:600; line-height:1.3; }
.pk-package-card.active{
  background: linear-gradient(160deg, var(--primary), #6f8fff); border-color: transparent;
  box-shadow: 0 10px 22px rgba(79,124,255,.35);
}
.pk-package-card.active .pk-check{ display:flex; }
.pk-package-card.active .pk-num,
.pk-package-card.active .pk-tag,
.pk-package-card.active .pk-desc{ color:#fff; }

.pk-info-row{
  display:flex; flex-wrap:wrap; gap:10px; background:#f3f6fb; border-radius:14px;
  padding:12px 14px; font-size:.82rem; font-weight:700; color:#48546b; margin-bottom:16px;
}
.pk-info-row > div{ flex:1 1 220px; display:flex; align-items:flex-start; gap:8px; }
.pk-info-row b{ color:var(--text); }

.pk-start-btn{
  display:flex; align-items:center; justify-content:center; gap:10px; width:100%;
  background: linear-gradient(135deg, var(--primary), #6f8fff); color:#fff; border:none;
  border-radius:18px; padding:16px; font-size:1.05rem; font-weight:800; cursor:pointer;
  box-shadow: 0 12px 24px rgba(79,124,255,.38); transition: transform .12s ease;
}
.pk-start-btn:hover{ transform: translateY(-2px); }
.pk-start-btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; }
.pk-encourage{ text-align:center; color:#5b6b86; font-weight:700; font-size:.85rem; margin:12px 0 0; }

.pk-hint-box{
  background:#fff8e8; border:1px solid #f5deac; color:#8a6b16;
  border-radius:12px; padding:10px 14px; font-size:.85rem; font-weight:700; margin-bottom:14px; text-align:center;
}

.pk-footer{
  position:relative; z-index:2; display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap:14px; background:#fff; border-radius:18px; box-shadow: var(--shadow); padding:14px 16px; margin:22px auto 0;
  font-size:.85rem; font-weight:700; color:#48546b; max-width:1040px;
}
.pk-footer a{ color:#48546b; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.pk-page .pk-footer{ max-width:760px; } /* khớp chiều rộng pk-card ở các trang phụ */
.pk-footer .pk-fb{ color:#d6336c; font-weight:800; }
.pk-footer .pk-divider{ color:#d5dae3; }

.pk-deco-side{ display:none; position:absolute; z-index:2; font-weight:700; color:#8fa6c9; font-size:.85rem; font-family: "Comic Sans MS", cursive, sans-serif; text-align:center; line-height:1.3; }
@media (min-width:1000px){
  .pk-deco-side{ display:block; }
  .pk-deco-left{ left:6px; top:200px; width:110px; }
  .pk-deco-right-top{ right:8px; top:200px; width:110px; }
}
.pk-book-stack{ display:none; position:absolute; right:10px; bottom:80px; z-index:2; flex-direction:column; gap:4px; }
@media (min-width:1000px){ .pk-book-stack{ display:flex; } }
.pk-book-stack span{
  display:block; padding:6px 14px; border-radius:8px 8px 0 0; font-size:.72rem; font-weight:800; color:#fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.pk-mascot{ display:none; position:absolute; left:10px; bottom:70px; z-index:2; font-size:3.2rem; }
@media (min-width:1000px){ .pk-mascot{ display:block; } }

/* ================= Trang chủ — thiết kế mới ================= */
.hm-page{ position:relative; margin:-20px -16px 0; padding-bottom:16px; }

.hm-navbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;
  background:#fff; border-radius:22px; padding:12px 18px; box-shadow: var(--shadow);
  margin: 0 auto 14px; max-width:1040px;
}
.hm-logo{ display:flex; align-items:center; gap:10px; }
.hm-logo-icon{ width:42px; height:42px; border-radius:14px; background:#e6f1fc; display:flex; align-items:center; justify-content:center; font-size:1.3rem; }
.hm-logo-text{ font-weight:800; font-size:1.05rem; color:var(--text); line-height:1.2; }
.hm-logo-tagline{ font-size:.68rem; color:var(--muted); font-weight:600; }
.hm-nav{ display:flex; gap:6px; flex-wrap:wrap; }
.hm-nav-item{
  display:inline-flex; align-items:center; gap:6px; border:none; background:transparent; color:#5b6b86;
  font-weight:700; font-size:.85rem; padding:9px 14px; border-radius:999px; cursor:pointer;
}
.hm-nav-item.active{ background:#e6f1fc; color:var(--primary-dark); }
.hm-nav-item:hover:not(.active){ background:#f3f6fb; }
.hm-avatar{ display:flex; align-items:center; gap:8px; font-weight:700; font-size:.85rem; color:var(--text); }
.hm-avatar-pic{ width:34px; height:34px; border-radius:50%; background:#e6f1fc; display:flex; align-items:center; justify-content:center; font-size:1.1rem; }

.hm-hero{
  position:relative; overflow:hidden; border-radius:26px; padding:28px 16px 46px; text-align:center;
  background: linear-gradient(180deg, #cfe9fd 0%, #dff1fd 55%, #eaf7f0 100%);
  background-image: url('assets/hero-bg.png');
  background-size: cover; background-position: center top;
  margin: 0 auto -30px; max-width: 1040px;
}
/* Từ tablet trở lên: khoá đúng tỉ lệ ảnh nền (2243x701) để không bị crop mất mây/mái trường. */
@media (min-width:760px){
  .hm-hero{ aspect-ratio: 2243 / 701; min-height:230px; background-position:center; display:flex; flex-direction:column; justify-content:center; align-items:center; }
}
.hm-hero-char{ display:none; position:absolute; bottom:0; font-size:4.4rem; }
.hm-hero-char img{ display:block; height:200px; width:auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.15)); }
.hm-hero-char-left{ left:2%; }
.hm-hero-char-right{ right:4%; }
@media (min-width:760px){ .hm-hero-char{ display:block; } }
@media (min-width:1100px){ .hm-hero-char img{ height:240px; } }
.hm-hero-bubble{
  display:none; position:absolute; top:18px; background:#fff; border-radius:18px; padding:8px 14px;
  font-size:.78rem; font-weight:800; color:#c2185b; box-shadow: var(--shadow); text-align:center; line-height:1.25;
}
.hm-hero-bubble.left{ left:1%; }
.hm-hero-bubble.right{ right:14%; color:#8a6b16; }
@media (min-width:760px){ .hm-hero-bubble{ display:block; } }
.hm-hero-title{ margin: 8px 0 4px; line-height:0; }
.hm-hero-title img{ height:64px; width:auto; max-width:90%; }
@media (min-width:760px){ .hm-hero-title img{ height:86px; } }
.hm-hero-sub{ color:#48546b; font-weight:700; font-size:.92rem; margin:0 0 14px; }
.hm-hero-tip{
  display:inline-block; background:#fde4ef; color:#c2185b; font-weight:800; font-size:.8rem;
  padding:8px 16px; border-radius:999px;
}

.hm-resume-card{
  position:relative; z-index:2; background:#fff; border-radius:22px; box-shadow: var(--shadow);
  padding:16px 18px; margin: 0 auto 18px; max-width: 900px;
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.hm-resume-icon{ width:46px; height:46px; border-radius:14px; background:#e6f1fc; display:flex; align-items:center; justify-content:center; font-size:1.4rem; flex-shrink:0; }
.hm-resume-info{ flex:1 1 220px; min-width:180px; }
.hm-resume-title{ font-weight:800; color:var(--text); }
.hm-resume-sub{ font-size:.82rem; color:var(--muted); font-weight:600; margin-top:2px; }
.hm-resume-progress{ flex:1 1 200px; display:flex; align-items:center; gap:10px; min-width:160px; }
.hm-resume-progress .bar{ flex:1; height:10px; background:#e6eaf2; border-radius:999px; overflow:hidden; }
.hm-resume-progress .bar > div{ height:100%; background: linear-gradient(90deg, var(--primary), #6f8fff); }
.hm-resume-progress .num{ font-size:.78rem; font-weight:800; color:var(--muted); white-space:nowrap; }
.hm-resume-actions{ display:flex; gap:10px; }
.hm-resume-actions .btn{ white-space:nowrap; }

.hm-mode-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; margin: 0 auto 18px; max-width:1040px; }
@media (max-width:860px){ .hm-mode-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width:520px){ .hm-mode-grid{ grid-template-columns: 1fr; } }
.hm-mode-card{
  position:relative; border-radius:20px; padding:18px 18px 16px; cursor:pointer;
  transition: transform .12s ease, box-shadow .15s ease;
}
.hm-mode-card:hover{ transform: translateY(-3px); box-shadow: 0 14px 26px rgba(40,60,100,.14); }
.hm-mode-card.c1{ background:#e1f6e8; }
.hm-mode-card.c2{ background:#fff3d6; }
.hm-mode-card.c3{ background:#fde4ec; }
.hm-mode-card.c4{ background:#ece3fb; }
.hm-mode-card.c5{ background:#e1eefd; }
.hm-mode-card.c6{ background:#e9e4fb; }
.hm-mode-corner{ position:absolute; top:16px; right:16px; color:#8a94a8; font-size:1rem; }
.hm-mode-icon{ font-size:1.9rem; margin-bottom:8px; }
.hm-mode-title{ font-weight:800; color:var(--text); font-size:1.02rem; margin-bottom:4px; }
.hm-mode-sub{ font-size:.8rem; color:#5b6b86; font-weight:600; margin-bottom:12px; min-height:2.2em; }
.hm-mode-btn{
  display:inline-flex; align-items:center; gap:6px; background:#fff; color:var(--primary-dark);
  font-weight:800; font-size:.82rem; padding:8px 16px; border-radius:999px; box-shadow: 0 2px 6px rgba(40,60,100,.12);
}

.hm-subjects-card{
  background:#fff; border-radius:22px; box-shadow: var(--shadow); padding:18px; margin:0 auto 18px; max-width:1040px;
}
.hm-subjects-header{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:14px; }
.hm-subjects-header h2{ display:flex; align-items:center; gap:8px; font-size:1.05rem; margin:0; }
.hm-subjects-tip{ background:#fde4ef; color:#c2185b; font-weight:800; font-size:.78rem; padding:6px 14px; border-radius:999px; }
.hm-subject-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap:10px; }
@media (max-width:760px){ .hm-subject-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width:420px){ .hm-subject-grid{ grid-template-columns: repeat(2, 1fr); } }
.hm-subject-tile{ text-align:center; padding:12px 6px; border-radius:16px; background:#f7f9fc; }
.hm-subject-icon{ width:44px; height:44px; margin:0 auto 8px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:1.3rem; }
.hm-subject-name{ font-weight:800; font-size:.85rem; color:var(--text); }
.hm-subject-grade{ font-size:.7rem; color:var(--muted); font-weight:600; }

.hm-thankyou{ font-family:"Nunito","Be Vietnam Pro",sans-serif; color:#c2185b; font-weight:800; font-size:.85rem; }

/* Badge màu pastel cho các đáp án A/B/C/D trong màn làm bài (ghi đè bởi .correct/.wrong khi đã trả lời) */
.badge.b0{ background:#dcf5e3; color:#1c8a57; }
.badge.b1{ background:#fde4ea; color:#c2185b; }
.badge.b2{ background:#e1eefd; color:#1a56b0; }
.badge.b3{ background:#fff3d6; color:#a16207; }
