/* Trang vào Bee Duel — màn hình đầu tiên đơn giản nhất: chọn môn + lớp, rồi bấm một ô to. */
.trang { max-width: 72rem; margin: 0 auto; padding: 14px 16px 28px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.dau-trang { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.thuong-hieu { display: flex; align-items: center; gap: 12px; }
.thuong-hieu h1 { margin: 0; }
.thuong-hieu p { margin: 0; }
.ong-logo { line-height: 0; }
#chinh { display: flex; flex-direction: column; gap: 14px; }
.hang-lop { margin-top: 10px; }

/* thẻ chọn cách chơi: to, rõ, vùng chạm lớn */
.luoi-the { display: grid; grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr)); gap: 12px; }
.the-chon {
  appearance: none;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 120px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--vien);
  background: var(--the);
  color: var(--chu);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
}
.the-chon .bieu-tuong { font-size: 1.9rem; line-height: 1; }
.the-chon .tieu-de { font-weight: 800; font-size: 1.15rem; }
.the-chon .mo-ta { color: var(--chu-phu); font-size: 1rem; }
.the-chon.noi-bat { border-color: #c99100; background: var(--vang); color: var(--tren-vang); }
.the-chon.noi-bat .mo-ta { color: var(--tren-vang); }
.the-chon:active { filter: brightness(.95); transform: translateY(1px); }
.the-chon[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.the-chon .nhan-sap, .the-chon .nhan-goi-y { align-self: flex-start; margin-top: auto; }
.the-chon[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--vang); }

/* chuẩn bị */
.khoi-ban { border: 1px solid var(--vien); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: var(--nen-2); }
.khoi-ban h3 { margin-bottom: 8px; }
.luoi-ban-danh { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.2rem, 1fr)); gap: 8px; }
.luoi-ban-danh .chip { justify-content: center; padding: 6px 8px; min-width: 0; }
.hang-nhap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hang-nhap .o-nhap { max-width: 11rem; font-size: 1.4rem; letter-spacing: .25em; text-align: center; }
.hang-ma { display: grid; gap: 8px; max-width: 34rem; }
.hang-ma label { font-weight: 700; }
#ket-qua-ma { margin-top: 10px; display: grid; gap: 8px; }
.luoi-cai-dat { display: grid; gap: 10px; }
.hang-cd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hang-nut-cd { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.nut-bat-dau { width: 100%; margin-top: 8px; flex-direction: column; gap: 2px; line-height: 1.2; }
.nut-bat-dau .bat-dau-phu { font-size: max(16px, .72em); font-weight: 600; }
.chan { text-align: center; margin-top: 4px; font-size: .9375rem; }
details.nang-cao { margin: 8px 0 12px; }
details.nang-cao summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.gach-ngang { border: 0; border-top: 1px solid var(--vien); margin: 10px 0; }

details.chon-bd { margin: 4px 0 10px; }
details.chon-bd summary { cursor: pointer; font-weight: 700; min-height: 48px; display: flex; align-items: center; padding: 0 12px; border: 2px solid var(--vien); border-radius: 12px; background: var(--the); }
details.chon-bd[open] summary { margin-bottom: 8px; }

/* Điện thoại: nút BẮT ĐẦU nổi sát đáy màn hình — em không phải cuộn qua mọi cách chơi mới thấy nút (quy tắc: 1 nút to). */
@media (max-width: 520px) {
  .nut-bat-dau {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    margin: 0;
    z-index: 30;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  }
  .trang { padding-bottom: 112px; }
}

/* hồ sơ biệt danh: ảnh đại diện = biểu tượng ong/thú + viền màu em chọn; không có ô gõ chữ nào */
.ho-so-the { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ho-so-chu { display: flex; flex-direction: column; gap: 2px; flex: 1 1 12rem; min-width: 0; }
.ho-so-chu strong { font-size: 1.2rem; }
.ho-so-anh {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  border: 4px solid var(--vang);
  background: var(--the);
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  line-height: 1;
}
.ho-so-thanh {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  margin-bottom: 6px;
  background: var(--the);
  border-bottom: 1px solid var(--vien);
}
.ho-so-thanh .nut { margin-left: auto; white-space: nowrap; padding: 8px 12px; font-size: 1rem; min-width: 0; }
.ho-so-thanh .ho-so-chu strong { font-size: 1.05rem; }
.luoi-ho-so { grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); }
.luoi-ho-so .chip { font-size: 0.9375rem; padding: 4px 4px; line-height: 1.15; text-align: center; flex-wrap: wrap; justify-content: center; }
.hang-mau { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.o-mau {
  appearance: none;
  font: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  border: 3px solid var(--vien);
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  padding: 0;
}
.o-mau[aria-pressed="true"] { border-color: var(--chu); box-shadow: 0 0 0 3px var(--vang); }
.o-mau:focus-visible { outline: 3px solid var(--vang); outline-offset: 2px; }
.o-mau:active { filter: brightness(.92); }
#noi-dung-ho-so .hang-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ---- Tiếng Anh tiểu học (Movers / Flyers): hai thẻ to đầu bước 1, chữ to cho em nhỏ ---- */
/* Khối cấp nằm Ở ĐẦU TRANG, trước "Hồ sơ của em" (màn hình đầu tiên của điện thoại nhỏ phải thấy thẻ cấp, không bị nút BẮT ĐẦU nổi che) */
.khoi-cap-the { padding-top: 10px; padding-bottom: 12px; }
.khoi-cap-the > h2 { margin: 0 0 8px; }
.khoi-cap { margin-bottom: 0; }
.nhan-nhom { margin: 0 0 8px; font-weight: 800; font-size: 1.0625rem; color: var(--chu-phu); }
.khoi-cap > .chu-phu { margin: 8px 0 0; font-size: 1rem; }
.luoi-cap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.luoi-cap.mot-the { grid-template-columns: 1fr; }
.the-cap {
  appearance: none;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 88px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 3px solid var(--vien);
  background: var(--the);
  color: var(--chu);
  cursor: pointer;
  touch-action: manipulation;
}
.the-cap .cap-bieu { font-size: 1.9rem; line-height: 1; }
.the-cap .cap-ten { font-weight: 900; font-size: 1.5rem; line-height: 1.15; }
.the-cap .cap-phu { color: var(--chu-phu); font-size: 1rem; line-height: 1.25; }
.the-cap:active { filter: brightness(.95); transform: translateY(1px); }
.the-cap:focus-visible { outline: 3px solid var(--vang); outline-offset: 3px; }
.the-cap[aria-pressed="true"] { border-color: #c99100; background: var(--vang); color: var(--tren-vang); box-shadow: 0 0 0 3px var(--vang); }
.the-cap[aria-pressed="true"] .cap-phu { color: var(--tren-vang); }
@media (max-width: 400px) {
  .luoi-cap { gap: 8px; }
  .the-cap { padding: 8px 10px; }
  .the-cap .cap-ten { font-size: 1.4rem; }
}

/* Môn cấp: chữ phụ của trang vào >= 16px (dòng lưu ý luyện tập, số phiên bản, chú thích); môn lớp 6-9 không có html[data-cap] nên không đổi */
html[data-cap] .luu-y-luyen-tap, html[data-cap] .chan, html[data-cap] .chu-phu { font-size: max(16px, 1rem); }
/* nhãn nhỏ "Gợi ý cho điện thoại" (shared/giao-dien.css: .nhan-nho 15px) hiện ở thẻ "Tia chớp · một mình" khi vào bằng điện thoại */
html[data-cap] .nhan-nho { font-size: max(16px, 1rem); }
/* chip biệt danh trong trình soạn hồ sơ ("Chọn một biệt danh ong") đặt riêng 0,9375rem = 15px */
html[data-cap] .luoi-ho-so .chip { font-size: max(16px, 1rem); }
