/* Bé Vui Học — hệ thiết kế (#1053 B1, nhận diện #1033: bevuihoc-nhan-dien.md mục 1–3).
   Màu "chính" của môn chỉ cho mảng lớn / trang trí (tv-chinh, ta-chinh < 3:1 trên trắng); "đậm" cho nút chữ trắng và viền
   thành phần tương tác; "nhạt" làm nền; "chữ" cho tiêu đề trên nền nhạt. Không đặt chữ trắng lên màu "chính".
   Chữ nội dung ≥ 20 px, nút ≥ 56 px, mobile-first (390 px → 1366 px), tôn trọng prefers-reduced-motion. */

/* ---------- Font tự host (SIL OFL 1.1, giấy phép trong /fonts/) ---------- */
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url(/fonts/baloo-2-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url(/fonts/baloo-2-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2';
  font-style: normal;
  font-display: swap;
  font-weight: 400 800;
  src: url(/fonts/baloo-2-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Biến (bảng màu #1033 mục 2) ---------- */
:root {
  --nen: #fff9ef;
  --be-mat: #ffffff;
  --chu: #1f2a44;
  --chu-phu: #4a5573;

  --toan-chinh: #2f80ed;
  --toan-dam: #1859b8;
  --toan-nhat: #e7f0fd;
  --toan-chu: #0f4a99;
  --tv-chinh: #ff9a3d;
  --tv-dam: #b54708;
  --tv-nhat: #fff0e0;
  --tv-chu: #8f3a06;
  --ta-chinh: #34c26b;
  --ta-dam: #177a3f;
  --ta-nhat: #e5f7ec;
  --ta-chu: #11612f;

  --vang-sao: #ffc93c;
  --hong: #ff7aa8;
  --tim: #7b61ff;
  --tim-dam: #5b3fd9;
  --dung-nen: #e5f7ec;
  --dung-chu: #11612f;
  --sai-nen: #ffede6;
  --sai-chu: #b4380c;

  /* Linh vật Kè Kè đổi màu theo môn (trang chủ: tím). */
  --mascot-fill: var(--tim);
  --mascot-shade: var(--tim-dam);

  --font-tieu-de: 'Baloo 2', system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-noi-dung: 'Nunito', system-ui, 'Segoe UI', Roboto, sans-serif;
  --bo-goc: 20px;
  --bong: 0 6px 0 rgba(31, 42, 68, 0.12), 0 10px 24px rgba(31, 42, 68, 0.08);
  --cao-nut: 56px;
}

/* Màu theo môn: đặt trên phần tử bất kỳ (thẻ môn, thẻ trò chơi, body). */
[data-mon='toan'] {
  --mon-chinh: var(--toan-chinh);
  --mon-dam: var(--toan-dam);
  --mon-nhat: var(--toan-nhat);
  --mon-chu: var(--toan-chu);
}
[data-mon='tieng-viet'] {
  --mon-chinh: var(--tv-chinh);
  --mon-dam: var(--tv-dam);
  --mon-nhat: var(--tv-nhat);
  --mon-chu: var(--tv-chu);
}
[data-mon='tieng-anh'] {
  --mon-chinh: var(--ta-chinh);
  --mon-dam: var(--ta-dam);
  --mon-nhat: var(--ta-nhat);
  --mon-chu: var(--ta-chu);
}
body[data-mon='toan'] {
  --mascot-fill: var(--toan-chinh);
  --mascot-shade: var(--toan-dam);
}
body[data-mon='tieng-viet'] {
  --mascot-fill: var(--tv-chinh);
  --mascot-shade: var(--tv-dam);
}
body[data-mon='tieng-anh'] {
  --mascot-fill: var(--ta-chinh);
  --mascot-shade: var(--ta-dam);
}

/* ---------- Nền tảng ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--nen);
  color: var(--chu);
  font-family: var(--font-noi-dung);
  font-size: 20px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
h1,
h2,
h3 {
  font-family: var(--font-tieu-de);
  font-weight: 800;
  /* Dấu chồng (ẫ, ặ, ổ, ữ) của Baloo 2 không đè dòng trên (#1033 mục 3). */
  line-height: 1.3;
  margin: 0 0 0.4em;
}
h1 {
  font-size: clamp(34px, 7vw, 52px);
}
h2 {
  font-size: clamp(28px, 4.5vw, 36px);
}
h3 {
  font-size: 26px;
}
p {
  margin: 0 0 1em;
}
a {
  color: var(--tim-dam);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
img,
svg {
  max-width: 100%;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 4px solid var(--tim-dam);
  outline-offset: 3px;
  border-radius: 12px;
}
.an-di {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.bo-qua {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 10;
  background: var(--tim-dam);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 800;
}
.bo-qua:focus {
  top: 8px;
}
.khung {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 768px) {
  .khung {
    padding: 0 32px;
  }
}

/* ---------- Đầu trang / chân trang ---------- */
.dau-trang {
  background: var(--be-mat);
  box-shadow: 0 2px 0 rgba(31, 42, 68, 0.08);
}
.dau-trang .khung {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chu);
  text-decoration: none;
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  min-height: 56px;
}
.logo img {
  width: 48px;
  height: 48px;
}
.logo b {
  color: var(--tim-dam);
}
.menu {
  display: flex;
  gap: 4px;
}
.menu a {
  display: inline-flex;
  align-items: center;
  min-height: var(--cao-nut);
  padding: 0 14px;
  border-radius: 999px;
  color: var(--chu);
  font-weight: 800;
  text-decoration: none;
}
.menu a:hover,
.menu a[aria-current='page'] {
  background: var(--nen);
  color: var(--tim-dam);
}
.chan-trang {
  margin-top: 48px;
  background: var(--be-mat);
  color: var(--chu-phu);
  padding: 24px 0 32px;
}
.chan-trang .khung {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.chan-trang nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.chan-trang a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--chu);
  font-weight: 700;
}
.chan-trang p {
  margin: 0;
}

/* ---------- Linh vật Kè Kè ---------- */
.ke-ke .than,
.ke-ke .duoi-mau {
  fill: var(--mascot-fill);
  stroke: var(--mascot-fill);
  transition: fill 0.4s ease, stroke 0.4s ease;
}
.ke-ke .than {
  stroke: var(--chu);
}
.ke-ke .cham {
  fill: var(--mascot-shade);
  transition: fill 0.4s ease;
}
.ke-ke .duoi-vien {
  stroke: var(--chu);
}
.ke-ke-nhun {
  animation: nhun 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes nhun {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ---------- Trang chủ ---------- */
.mo-dau {
  padding: 24px 0 8px;
}
.mo-dau .khung {
  display: grid;
  gap: 16px;
  align-items: center;
}
.mo-dau-linh-vat {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.mo-dau-linh-vat svg {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
}
.bong-thoai {
  position: relative;
  flex: 1;
  background: var(--be-mat);
  border: 3px solid var(--chu);
  border-radius: 24px;
  padding: 14px 18px;
  font-family: var(--font-tieu-de);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.35;
  margin-bottom: 40px;
  box-shadow: var(--bong);
}
.bong-thoai::before {
  content: '';
  position: absolute;
  left: -16px;
  bottom: 18px;
  border: 14px solid transparent;
  border-right-color: var(--chu);
  border-left: 0;
}
.bong-thoai::after {
  content: '';
  position: absolute;
  left: -10px;
  bottom: 21px;
  border: 11px solid transparent;
  border-right-color: var(--be-mat);
  border-left: 0;
}
.gioi-thieu-ngan {
  color: var(--chu-phu);
  max-width: 46ch;
}
@media (min-width: 768px) {
  .mo-dau {
    padding-top: 40px;
  }
  .mo-dau .khung {
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
  }
  .mo-dau-linh-vat svg {
    width: 200px;
    height: 200px;
  }
}

.buoc {
  padding: 20px 0;
}
.buoc-tieu-de {
  display: flex;
  align-items: center;
  gap: 12px;
}
.so-buoc {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tim-dam);
  color: #fff;
  font-family: var(--font-tieu-de);
  font-size: 24px;
  line-height: 1;
}

/* Chọn lớp: 5 nút to trên một hàng (390 px vẫn vừa). */
.chon-lop {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nut-lop {
  width: 100%;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--be-mat);
  color: var(--chu);
  border: 3px solid var(--tim-dam);
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  font-family: var(--font-tieu-de);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.nut-lop span {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
}
.nut-lop b {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.05;
}
.nut-lop:hover {
  transform: translateY(-2px);
}
.nut-lop[aria-pressed='true'] {
  background: var(--tim-dam);
  color: #fff;
}
@media (min-width: 768px) {
  .chon-lop {
    gap: 16px;
  }
  .nut-lop {
    min-height: 112px;
  }
  .nut-lop b {
    font-size: 48px;
  }
}

/* Chọn môn: 3 thẻ to. */
.chon-mon {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .chon-mon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}
.the-mon {
  position: relative;
  width: 100%;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--mon-nhat);
  color: var(--mon-chu);
  border: 3px solid var(--mon-dam);
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  font-family: var(--font-tieu-de);
  font-size: 30px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.the-mon:hover {
  transform: translateY(-2px);
}
.the-mon[aria-pressed='true'] {
  box-shadow: 0 0 0 5px var(--mon-dam), var(--bong);
}
.bieu-tuong-mon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--mon-chinh);
  color: var(--chu);
  font-size: 28px;
  line-height: 1;
}
.dau-chon {
  margin-left: auto;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--mon-dam);
  color: #fff;
  font-size: 24px;
}
.the-mon[aria-pressed='true'] .dau-chon {
  display: inline-grid;
}
@media (min-width: 640px) {
  .the-mon {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-height: 168px;
  }
  .dau-chon {
    position: absolute;
    top: 10px;
    right: 10px;
  }
}

/* Ô tìm kiếm (không dấu). */
.tim-kiem {
  position: relative;
  margin: 0 0 16px;
}
.tim-kiem label {
  display: block;
  font-family: var(--font-tieu-de);
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 6px;
}
.tim-kiem input {
  width: 100%;
  min-height: var(--cao-nut);
  padding: 10px 20px 10px 52px;
  font: inherit;
  font-size: 20px;
  color: var(--chu);
  background: var(--be-mat);
  border: 3px solid var(--chu-phu);
  border-radius: 999px;
  appearance: none;
}
.tim-kiem input::placeholder {
  color: var(--chu-phu);
  opacity: 1;
}
.tim-kiem input:focus-visible {
  outline: 4px solid var(--tim-dam);
  outline-offset: 2px;
  border-color: var(--tim-dam);
}
.tim-kiem svg {
  position: absolute;
  left: 18px;
  bottom: 16px;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

/* Danh sách trò chơi. */
.ds-tro-choi {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .ds-tro-choi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .ds-tro-choi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.the-tro-choi {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 180px;
  padding: 20px 20px 18px;
  background: var(--be-mat);
  color: var(--chu);
  border: 3px solid var(--mon-dam, var(--chu-phu));
  border-top-width: 14px;
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  text-decoration: none;
  transition: transform 0.15s ease;
}
a.the-tro-choi:hover {
  transform: translateY(-3px);
}
.the-tro-choi h3 {
  margin: 0 0 6px;
  font-size: 26px;
}
.the-tro-choi p {
  margin: 0;
  color: var(--chu-phu);
}
.the-tro-choi .mon-nho {
  margin-top: auto;
  padding-top: 12px;
  color: var(--mon-chu, var(--chu-phu));
  font-weight: 800;
}
.the-tro-choi.sap-ra-mat {
  border-style: dashed;
  border-top-style: solid;
  background: var(--nen);
}
.nhan {
  align-self: flex-start;
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 12px;
  border-radius: 999px;
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.5;
}
.nhan-moi {
  background: var(--vang-sao);
  color: var(--chu);
}
.nhan-sap {
  background: var(--be-mat);
  color: var(--chu-phu);
  border: 2px solid var(--chu-phu);
}
.thong-bao-trong {
  padding: 20px;
  background: var(--be-mat);
  border: 3px dashed var(--chu-phu);
  border-radius: var(--bo-goc);
  color: var(--chu-phu);
  font-weight: 700;
}

/* Thử thách hôm nay (B2 điền) + hồ sơ bé (B3 điền): khung để sẵn. */
.thu-thach {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--bo-goc);
  background: var(--tim-dam);
  color: #fff;
  box-shadow: var(--bong);
}
.thu-thach h2 {
  font-size: 28px;
  margin: 0;
}
.thu-thach p {
  margin: 0;
}
.thu-thach .ngoi-sao {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
}

/* ---------- Trang nội dung (giới thiệu) ---------- */
.bai-viet {
  max-width: 760px;
  padding-top: 32px;
}
.bai-viet h2 {
  margin-top: 1.2em;
  font-size: 30px;
}
.bai-viet ul {
  padding-left: 1.2em;
}
.bai-viet li {
  margin-bottom: 0.4em;
}
.bai-viet .mo-dau-linh-vat svg {
  width: 112px;
  height: 112px;
}
.nut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--cao-nut);
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  background: var(--tim-dam);
  color: #fff;
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 22px;
  text-decoration: none;
  box-shadow: var(--bong);
  cursor: pointer;
}

/* ---------- Thử thách hôm nay (#1055 B2) ---------- */
.thu-thach {
  flex-wrap: wrap;
}
.thu-thach > div {
  flex: 1 1 220px;
}
.nut.nut-thu-thach {
  background: #fff;
  color: var(--tim-dam);
}

/* ---------- Nút phụ / nút tiếng ---------- */
.nut-phu,
.nut.nut-phu {
  background: var(--be-mat);
  color: var(--tim-dam);
  border: 3px solid var(--tim-dam);
}
.nut:disabled {
  opacity: 0.6;
  cursor: default;
}
.nut-tieng {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--cao-nut);
  padding: 0 14px;
  border: 3px solid var(--chu-phu);
  border-radius: 999px;
  background: var(--be-mat);
  color: var(--chu);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.nut-tieng svg {
  width: 26px;
  height: 26px;
}
.nut-tieng .bieu-tuong-tat,
.nut-tieng[aria-pressed='true'] .bieu-tuong-bat {
  display: none;
}
.nut-tieng[aria-pressed='true'] .bieu-tuong-tat {
  display: inline;
}
@media (max-width: 479px) {
  .nut-tieng .chu-nut-tieng {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .menu a {
    padding: 0 10px;
  }
}

/* ---------- Trang trò chơi: chọn cấp ---------- */
.man {
  padding-top: 20px;
}
.duong-dan {
  margin: 0 0 8px;
}
.duong-dan a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-weight: 800;
}
.nhan-mon {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--mon-nhat, var(--nen));
  color: var(--mon-chu, var(--chu));
  border: 2px solid var(--mon-dam, var(--chu-phu));
  font-weight: 800;
}
.cach-choi {
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--be-mat);
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
}
.cach-choi h2 {
  font-size: 26px;
  margin-bottom: 4px;
}
.cach-choi p {
  margin: 0;
}
.che-do {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--mon-nhat, var(--nen));
  color: var(--chu);
  border: 2px dashed var(--mon-dam, var(--chu-phu));
}
.gioi-thieu-tro-choi {
  margin: 24px 0 0;
  color: var(--chu-phu);
}
.bang-cap {
  display: grid;
  gap: 16px;
}
.hang-lop h3 {
  font-size: 24px;
  margin: 0 0 6px;
}
.ds-cap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .ds-cap {
    gap: 16px;
  }
}
.nut-cap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--be-mat);
  color: var(--chu);
  border: 3px solid var(--mon-dam, var(--tim-dam));
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.nut-cap:hover {
  transform: translateY(-2px);
}
.nut-cap .ten-muc {
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.2;
  color: var(--mon-chu, var(--chu));
}
.nut-cap .ky-nang {
  font-size: 18px;
  line-height: 1.3;
  color: var(--chu-phu);
}
@media (min-width: 768px) {
  .nut-cap .ky-nang {
    font-size: 18px;
  }
}
.nut-cap .sao-cap {
  color: #b07800;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1;
}
.nut-cap .sao-cap:empty {
  display: none;
}
.nut-cap.bi-khoa {
  background: var(--nen);
  border-style: dashed;
  cursor: not-allowed;
}
.nut-cap.bi-khoa:hover {
  transform: none;
}
.khoa-cap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 16px;
  color: var(--chu-phu);
}
.khoa-cap svg {
  width: 20px;
  height: 20px;
}
.nut-cap.goi-y-hom-nay {
  box-shadow: 0 0 0 5px var(--vang-sao), var(--bong);
}

/* ---------- Trang trò chơi: lượt chơi ---------- */
.thanh-tren {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.thanh-tren .nut {
  font-size: 20px;
  padding: 0 18px;
}
.ten-cap-dang-choi {
  font-family: var(--font-tieu-de);
  font-weight: 800;
  color: var(--mon-chu, var(--chu));
}
.tien-do {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.tien-do-ngoai {
  flex: 1;
  height: 20px;
  border-radius: 999px;
  background: var(--be-mat);
  border: 3px solid var(--chu);
  overflow: hidden;
}
.tien-do-trong {
  width: 0;
  height: 100%;
  background: var(--mon-chinh, var(--tim));
  transition: width 0.3s ease;
}
.so-cau {
  font-weight: 800;
  white-space: nowrap;
}
.the-cau-hoi {
  padding: 20px;
  background: var(--be-mat);
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
}
.de-bai-hang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.de-bai {
  margin: 0;
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}
.de-bai:focus {
  outline: none;
}
.nut-loa {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--mon-dam, var(--tim-dam));
  background: var(--mon-nhat, var(--nen));
  color: var(--mon-chu, var(--chu));
  cursor: pointer;
}
.nut-loa svg {
  width: 30px;
  height: 30px;
}
.lua-chon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .lua-chon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}
.nut-lua-chon {
  width: 100%;
  min-height: 72px;
  padding: 8px;
  background: var(--mon-nhat, var(--nen));
  color: var(--chu);
  border: 3px solid var(--mon-dam, var(--tim-dam));
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: clamp(24px, 6vw, 34px);
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.nut-lua-chon:hover:not(:disabled) {
  transform: translateY(-2px);
}
.nut-lua-chon:disabled {
  cursor: default;
  opacity: 0.75;
}
.nut-lua-chon.dung {
  background: var(--dung-nen);
  color: var(--dung-chu);
  border-color: var(--dung-chu);
  opacity: 1;
}
.nut-lua-chon.sai {
  background: var(--sai-nen);
  color: var(--sai-chu);
  border-color: var(--sai-chu);
  opacity: 1;
}
.phan-hoi {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--bo-goc);
  border: 3px solid var(--chu);
  background: var(--be-mat);
}
.phan-hoi[data-ket-qua='dung'] {
  background: var(--dung-nen);
  border-color: var(--dung-chu);
}
.phan-hoi[data-ket-qua='sai'] {
  background: var(--sai-nen);
  border-color: var(--sai-chu);
}
.phan-hoi-chu {
  margin: 0 0 8px;
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 26px;
}
.phan-hoi[data-ket-qua='dung'] .phan-hoi-chu {
  color: var(--dung-chu);
}
.phan-hoi[data-ket-qua='sai'] .phan-hoi-chu {
  color: var(--sai-chu);
}
.goi-y {
  margin: 0 0 12px;
}

/* ---------- Trang trò chơi: kết quả ---------- */
.the-ket-qua {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
  background: var(--be-mat);
  border-radius: var(--bo-goc);
  box-shadow: var(--bong);
  text-align: center;
}
.the-ket-qua h2:focus {
  outline: none;
}
.sao-ket-qua {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 12px;
}
.sao-ket-qua svg {
  width: 72px;
  height: 72px;
  fill: var(--nen);
  stroke: var(--chu);
  stroke-width: 3;
  stroke-linejoin: round;
}
.sao-ket-qua[data-sao='1'] svg:nth-child(-n + 1),
.sao-ket-qua[data-sao='2'] svg:nth-child(-n + 2),
.sao-ket-qua[data-sao='3'] svg:nth-child(-n + 3) {
  fill: var(--vang-sao);
}
.so-dung {
  font-family: var(--font-tieu-de);
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 4px;
}
.trang-thai-luu {
  font-weight: 700;
  color: var(--chu-phu);
}
.sticker-moi {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.sticker-moi li {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
}
.moi-dang-ky {
  margin: 12px 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--nen);
  border: 2px solid var(--chu-phu);
  text-align: left;
}
.moi-dang-ky p {
  margin-bottom: 12px;
}
.nut-ket-qua {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Pháo giấy khi qua cấp (tắt khi prefers-reduced-motion — JS không tạo, CSS cũng tắt hoạt ảnh). */
.phao-giay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}
.phao-giay i {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  animation-name: phao-roi;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}
@keyframes phao-roi {
  to {
    transform: translate(var(--troi, 0), 105vh) rotate(var(--xoay, 360deg));
    opacity: 0.9;
  }
}

/* ---------- Album sticker ---------- */
.ds-sticker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}
@media (min-width: 640px) {
  .ds-sticker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
}
.sticker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  background: var(--be-mat);
  border: 3px dashed var(--chu-phu);
  border-radius: var(--bo-goc);
  text-align: center;
}
.sticker img {
  filter: grayscale(1);
  opacity: 0.45;
}
.sticker.co {
  border-style: solid;
  border-color: var(--tim-dam);
  box-shadow: var(--bong);
}
.sticker.co img {
  filter: none;
  opacity: 1;
}
.sticker b {
  font-family: var(--font-tieu-de);
  font-size: 22px;
  line-height: 1.2;
}
.sticker span {
  font-size: 18px;
  color: var(--chu-phu);
}
.album .moi-dang-ky {
  margin-bottom: 20px;
}

/* ---------- Giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
