/*# Giao diện từng màn hình, chế độ Bé Nam/Bé Nữ, viết tay + đặt tính, hoạt ảnh, tablet/màn ngang */
/* Riêng từng màn hình: bản đồ, nhiệm vụ hôm nay, trung tâm bài học, kết quả, bộ sưu tập. */
.hero {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--yellow);
}

.hero .mascot {
  width: 92px;
  flex: none;
}

.hero h2 {
  font-size: 1.6rem;
}

.hero p {
  margin: 4px 0 10px;
  font-size: 1.05rem;
}

.reg {
  border: 2.5px solid var(--theme-border);
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg,#fff,var(--tint,#fff));
  border-radius: 25px;
  box-shadow: 0 5px 0 var(--theme-border),0 14px 24px var(--shadow);
}

.reg>header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2.5px solid var(--ink);
  border: 0;
  margin-top: -34px;
  position: relative;
  padding: 29px 16px 10px;
  text-shadow: 0 2px 2px #fff;
  background: linear-gradient(180deg,rgba(255,255,255,0),var(--hdc) 58%);
}

.reg>header h2 {
  flex: 1;
  text-shadow: 0 2px 0 rgba(255,255,255,.7);
  font-size: 1.3rem;
  line-height: 1.1;
}

.reg>header small {
  font-weight: 800;
  font-size: .95rem;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px;
  box-shadow: 0 2px 0 var(--ink);
}

.nodes {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px 6px;
  padding: 16px 8px 12px;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 4px 2px;
  text-align: center;
}

.node .c {
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 86px;
  height: 86px;
  background-image: radial-gradient(circle at 32% 26%,rgba(255,255,255,.85) 0,rgba(255,255,255,0) 46%),linear-gradient(180deg,rgba(255,255,255,0) 55%,rgba(31,42,68,.12));
  box-shadow: 0 6px 0 var(--ink),0 12px 16px var(--shadow);
  transition: transform .15s;
}

.node .c svg {
  width: 34px;
  height: 34px;
}

.node.lock .c {
  filter: saturate(.35) brightness(1.04);
  border-color: #6E7487;
  color: #5B6478;
  background-image: radial-gradient(circle at 32% 26%, rgba(255,255,255,.7) 0, rgba(255,255,255,0) 46%);
  box-shadow: 0 4px 0 #9A97A8;
}

.node.cur .c {
  outline-offset: 4px;
  outline: 0;
  animation: pulse 1.4s infinite;
  box-shadow: 0 6px 0 var(--ink),0 0 0 7px rgba(255,210,63,.65),0 0 24px 8px rgba(255,210,63,.7);
}

.node .nm {
  font-weight: 800;
  font-size: .95rem;
  line-height: 1.15;
  background: rgba(255,255,255,.95);
  border: 1px solid #fff;
  border-radius: 12px;
  padding: 2px 8px;
  min-height: 0;
  box-shadow: 0 2px 0 rgba(31,42,68,.18);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 132px;
}

.node .st {
  display: flex;
  gap: 1px;
  background: rgba(255,255,255,.85);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 6px;
  height: 22px;
  align-items: center;
}

.node .st svg {
  width: 16px;
  height: 16px;
}

.node.soon .c {
  background: #F3EEE0;
  border-style: dashed;
  box-shadow: none;
  color: #8E8A80;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.stp {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2.5px solid var(--ink);
  text-align: left;
  width: 100%;
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--ink),0 10px 18px var(--shadow);
  background: linear-gradient(180deg,#fff,#F6F9FF);
  position: relative;
  transition: transform .1s,box-shadow .1s;
  padding: 12px 16px 12px 12px;
}

.stp .n {
  flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2';
  font-weight: 800;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  box-shadow: 0 3px 0 var(--ink);
  background-image: radial-gradient(circle at 32% 26%,rgba(255,255,255,.7),transparent 50%);
}

.stp b {
  display: block;
  font-family: 'Baloo 2';
  font-size: 1.3rem;
  line-height: 1.05;
}

.stp small {
  display: block;
  font-size: .95rem;
  color: var(--ink2);
  font-weight: 700;
}

.stp.lock {
  background: #EAE5DA;
  box-shadow: 0 3px 0 #8E8A80;
  opacity: .6;
}

.big-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.big-stars svg {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 5px 0 rgba(31,42,68,.25));
}

.big-stars svg.pop {
  animation: starpop .6s both;
}

.nb-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 12px;
}

.nb-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nb-grid figcaption {
  font-size: .9rem;
  font-weight: 800;
}

.stp .n.t1 {
  background: var(--green);
}

.stp .n.t2 {
  background: #FFB020;
}

.stp .n.t3 {
  background: #FF7A7F;
}

.scene {
  display: block;
  width: 100%;
  height: 165px;
  object-fit: cover;
  object-position: center;
  border-bottom: 2px solid rgba(255,255,255,.65);
}

.path {
  position: relative;
  padding: 6px 0;
  margin: 0 -2px;
  background: linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.53));
}

.path>svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.path .node {
  position: absolute;
  width: 112px;
  transform: translateX(-50%);
  z-index: 2;
}

.path .node .owl {
  position: absolute;
  top: -8px;
  width: 62px;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(31,42,68,.2));
  animation: bob 2s ease-in-out infinite;
  z-index: 2;
}

.mission {
  background: #fff;
}

.mission .it {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  background: rgba(255,255,255,.65);
  border-radius: 18px;
  padding: 8px 10px;
  margin: 6px 0;
}

.mission .ck {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex: none;
  box-shadow: 0 2px 0 var(--ink);
}

.mission .ck.on {
  background: linear-gradient(180deg,#8FE6B3,#35B56B);
  color: #fff;
  font-weight: 900;
}

.coll {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 8px;
  text-align: center;
}

.coll .ci {
  background: #fff;
  border: 2.5px solid var(--ink);
  padding: 8px 2px;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.15;
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s;
}

.coll .ci b {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-size: 2rem;
  line-height: 1.1;
}

.coll .ci.lock {
  background: #EAE5DA;
  border-style: dashed;
  color: #8E8A80;
}

.coll .ci.lock b {
  filter: grayscale(1) brightness(.55);
  opacity: .5;
}

.coll .ci.new {
  animation: pop .6s;
}

.path .dec {
  position: absolute;
  font-size: 2.1rem;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(31,42,68,.15));
  animation: flt 3.6s ease-in-out infinite alternate;
  z-index: 2;
}

.node:active .c {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--ink);
}

.node .c>span {
  filter: drop-shadow(0 2px 0 rgba(31,42,68,.25));
  font-size: 2.2rem!important;
}

.node .ck2 {
  position: absolute;
  right: -6px;
  top: -4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg,#8FE6B3,#35B56B);
  border: 2.5px solid var(--ink);
  color: #fff;
  font: 900 1rem/25px 'Nunito';
  font-style: normal;
  text-align: center;
}

.node .go {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--mode-accent);
  color: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 12px;
  font: 800 .9rem 'Baloo 2';
  box-shadow: 0 3px 0 var(--ink);
  animation: bounce 1.1s infinite;
}

.node .go:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
  border-bottom: 0;
}

.stp:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}

.stp:after {
  content: "▶";
  font-size: 1rem;
  color: var(--ink2);
  margin-left: 4px;
}

.stp .st {
  margin-left: auto;
}

.stp .st+* {
  display: none;
}

.stp:has(.st):after {
  display: none;
}

.resc {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,#FFF8D6,#FFE9A8 60%,#FFD7B0);
}

.resc>*:not(.rays) {
  position: relative;
  z-index: 1;
}

.rays {
  position: absolute!important;
  left: 50%;
  top: 70px;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  background: repeating-conic-gradient(rgba(255,255,255,.7) 0 10deg,rgba(255,255,255,0) 10deg 20deg);
  border-radius: 50%;
  animation: spin 24s linear infinite;
  -webkit-mask-image: radial-gradient(circle,#000 20%,transparent 68%);
  mask-image: radial-gradient(circle,#000 20%,transparent 68%);
  opacity: .55;
}

.big-stars svg:nth-child(2) {
  transform: translateY(-12px);
}

.big-stars svg.pop:nth-child(2) {
  animation-name: starpop2;
}

.coll .ci:not(.lock) {
  animation: pop .5s both;
}

.coll .ci:not(.lock):active {
  transform: scale(1.1) rotate(-3deg);
}

.coll .ci.c0:not(.lock) {
  background: var(--y-soft);
}

.coll .ci.c1:not(.lock) {
  background: var(--g-soft);
}

.coll .ci.c2:not(.lock) {
  background: var(--b-soft);
}

.coll .ci.c3:not(.lock) {
  background: var(--p-soft);
}

.coll .ci.c4:not(.lock) {
  background: var(--pu-soft);
}

.coll .ci.c5:not(.lock) {
  background: var(--o-soft);
}

.coll .ci:not(.lock) b {
  filter: drop-shadow(0 3px 0 rgba(31,42,68,.2));
}

/* --- Trang chủ: 1 nút chính, dải nhiệm vụ gập, chọn vùng --- */
.cta { display: grid; grid-template-columns: 84px 1fr; gap: 6px 12px; align-items: center; padding: 14px; border: 2.5px solid var(--theme-border); border-radius: 26px; background: linear-gradient(135deg,var(--hero1),var(--hero2) 55%,var(--hero3)); box-shadow: 0 5px 0 var(--theme-border), 0 14px 24px var(--shadow); }
.cta .cm .mascot { width: 84px; height: auto; display: block; }
.cta .ct small { display: block; font-weight: 800; color: var(--ink2); font-size: .95rem; }
.cta .ct b { display: block; font-size: 1.45rem; line-height: 1.15; }
.cta .btn { grid-column: 1 / -1; font-size: 1.35rem; padding: 14px; }
.mstrip { border: 2.5px solid var(--ink); border-radius: 20px; padding: 0 12px; }
.mstrip summary { display: flex; align-items: center; gap: 10px; min-height: 52px; cursor: pointer; list-style: none; font-family: 'Baloo 2'; font-size: 1rem; white-space: nowrap; }
.mstrip summary::-webkit-details-marker { display: none; }
.mstrip summary::after { content: "▾"; margin-left: 4px; color: var(--ink2); }
.mstrip[open] summary::after { content: "▴"; }
.mstrip .cnt { margin-left: auto; font-weight: 800; color: var(--ink2); }
.mstrip .dots3 { display: inline-flex; gap: 5px; }
.mstrip .dots3 i { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--ink); background: #fff; font-style: normal; font-size: .8rem; line-height: 17px; text-align: center; color: #fff; font-weight: 900; }
.mstrip .dots3 i.on { background: #35B56B; }
.mstrip .mbody { padding-bottom: 10px; }
.rtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rtabs button { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 2px 4px; border: 2.5px solid var(--theme-border); border-radius: 18px; background: #fff; opacity: .75; }
.rtabs button span { font-size: 1.9rem; line-height: 1.15; }
.rtabs button small { font-weight: 800; font-size: .85rem; color: var(--ink2); }
.rtabs button.on { opacity: 1; background: var(--tint-tab, #FFF3B8); box-shadow: 0 4px 0 var(--theme-border); transform: translateY(-2px); }
/* nút bài bị khoá vẫn có màu vùng, chỉ nhạt đi và có ổ khoá nhỏ */
.node .lk { position: absolute; right: -4px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); font-style: normal; font-size: .85rem; line-height: 23px; text-align: center; }
.node.lock .c > span { opacity: .55; }
.node.lock .nm { color: var(--ink2); }
/* Chế độ giao diện Bé Nam / Bé Nữ: khung chọn, tranh vùng, icon bài và quà.
   Màu của hai chế độ nằm ở tokens.css (html[data-theme="girl"]); ở đây chỉ có bố cục các phần tử mới. */

/* ---- khung chọn chế độ ---- */
.mode-panel {
  background: linear-gradient(125deg,rgba(255,255,255,.96),rgba(255,255,255,.82));
  border: 2.5px solid var(--theme-border);
  border-radius: 24px;
  box-shadow: 0 5px 0 var(--theme-border),0 14px 24px var(--shadow);
  padding: 14px;
  overflow: hidden;
}

.mode-panel.compact {
  box-shadow: none;
  padding: 10px;
}

.mode-banner {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
}

.mode-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.mode-title strong {
  font: 800 1.1rem/1.2 'Baloo 2','Nunito',sans-serif;
}

.mode-title span {
  color: var(--ink2);
  font-size: .85rem;
}

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 14px 8px 8px;
  border: 2.5px solid #99CBED;
  border-radius: 20px;
  background: linear-gradient(140deg,#F2FAFF,#DFF1FF);
  box-shadow: 0 3px 0 #8DAECF;
  text-align: left;
}

.mode-choice[data-mode="girl"] {
  border-color: #ECA4D0;
  background: linear-gradient(140deg,#FFF4FB,#FFE2F3);
  box-shadow: 0 3px 0 #D29BC8;
}

.mode-choice.selected {
  outline: 3px solid var(--mode-accent);
  outline-offset: -2px;
}

.mode-owl {
  width: 46px;
  height: 56px;
  object-fit: contain;
  flex: none;
}

.mode-txt {
  flex: 1;
  min-width: 0;
}

.mode-txt b,.mode-txt small {
  display: block;
  line-height: 1.2;
}

.mode-txt b {
  font-size: 1rem;
  white-space: nowrap;
}

.mode-txt small {
  font-size: .85rem;
  color: var(--ink2);
  margin-top: 3px;
}

.choice-ind {
  position: absolute;
  top: -9px;
  right: -7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--mode-accent);
  color: #fff;
  font-weight: 900;
  font-size: .9rem;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 2px 4px var(--shadow);
}

.choice-ind:empty {
  display: none;
}

.mode-panel p {
  margin: 10px 0 0;
  font-size: .85rem;
  color: var(--ink2);
  line-height: 1.3;
}

.mode-panel.compact .mode-owl {
  width: 38px;
  height: 46px;
}

/* ---- hộp thoại nhập tên: tranh nền + Cú Tí ---- */
.welcome-art {
  position: relative;
  height: 140px;
  border-radius: 18px;
  overflow: hidden;
  background: #7FC8FF;
}

.banner-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-art .mascot {
  position: absolute;
  bottom: -4px;
  left: calc(50% - 48px);
  width: 96px;
}

/* ---- tranh vùng, icon bài, icon quà ---- */
.path-scenery {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .17;
  pointer-events: none;
}

.node .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lesson-art {
  width: 1.6em;
  height: 1.6em;
  object-fit: contain;
  vertical-align: middle;
}

.node .ico .lesson-art {
  width: 70px;
  height: 70px;
}

.lesson-art.sm {
  width: 30px;
  height: 30px;
  margin: -4px 2px -4px 0;
}

.lesson-art.lg {
  width: 76px;
  height: 76px;
  flex: none;
}

.ti .lesson-art.sm {
  width: 36px;
  height: 36px;
  margin: 0;
}

.reward-art {
  width: 54px;
  height: 54px;
  object-fit: contain;
  vertical-align: middle;
}

.reward-art.sm {
  width: 28px;
  height: 28px;
}

/* ---- Bé Nữ: tách màu nút chính / nút phụ, thanh dưới, thanh tiến độ ---- */
html[data-theme="girl"] .btn.pri {
  background: linear-gradient(180deg,#FFA6D5,#EF65AC);
}

html[data-theme="girl"] .btn.blu {
  background: linear-gradient(180deg,#D5BBFF,#9B6BEB);
}

html[data-theme="girl"] nav.bar button.on {
  background: linear-gradient(180deg,#FFE9F6,#FFB4DD);
}

html[data-theme="girl"] .path {
  background: linear-gradient(180deg,rgba(255,239,250,.12),rgba(255,235,250,.5));
}

@media (max-width:390px) {
  .mode-owl {
    width: 40px;
    height: 48px;
  }
  .mode-txt b {
    font-size: .9rem;
  }
  .mode-txt small {
    font-size: .8rem;
  }
  .scene {
    height: 130px;
  }
}

/* ---- màn luyện tập: nút Kiểm tra luôn dính đáy màn hình ---- */
.tprac .pad,.tprac>#ans>.btn.grn.block[data-act="check"] {
  position: sticky;
  bottom: 0;
  z-index: 5;
}

/* ---- màn bài học: nút chính + mục "Xem thêm" ---- */
.lcta {
  font-size: 1.3rem;
  padding: 14px;
}

details.more {
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  padding: 0 12px;
  background: #fff;
}

details.more>summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-family: 'Baloo 2';
  font-size: 1.05rem;
}

details.more>summary::-webkit-details-marker {
  display: none;
}

details.more>summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--ink2);
}

details.more[open]>summary::after {
  content: "▴";
}

details.more>*:not(summary) {
  margin: 0 0 12px;
}
/* Chế độ làm bài: viết tay và phiếu đặt tính. */
.inkwrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  max-width: 720px;
  margin: 0 auto;
}

.inkhead {
  padding: calc(8px + var(--sat)) 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 2.5px solid var(--ink);
  background: #fff;
}

.inkq {
  font-size: 1.15rem;
  line-height: 1.4;
  font-weight: 700;
  max-height: 5.6em;
  overflow: auto;
}

.inkq.open {
  max-height: 40dvh;
}

.paper {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.sheetpaper {
  position: relative;
  width: 100%;
  background-color: #fff;
  background-image: linear-gradient(#BFD3F2 1.5px,transparent 1.5px),linear-gradient(90deg,#E6EDF9 1px,transparent 1px);
  background-size: 100% 40px,40px 100%;
  background-position: 0 38px,0 0;
  box-shadow: inset 3px 0 0 #F5A5A5;
}

.sheetpaper canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.inktools {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px calc(8px + var(--sab));
  background: #fff;
  border-top: 2.5px solid var(--ink);
  overflow-x: auto;
  justify-content: center;
}

.swatch {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.swatch.on {
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
  transform: translateY(-3px);
}

.cmp {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.snap {
  width: 100%;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  display: block;
}

.stepchk {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  flex-wrap: wrap;
}

.stepchk .ln {
  flex: 1;
  min-width: 60%;
  font-size: 1.1rem;
}

.stepchk.ok {
  background: var(--g-soft);
}

.stepchk.no {
  background: #FFE0E0;
}

.mini {
  width: 70px;
  min-height: 48px;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  text-align: center;
  font-family: 'Baloo 2';
  font-weight: 800;
  font-size: 1.3rem;
  background: #fff;
}

.inktools .ibtn,.inktools .swatch {
  flex: none;
}

.inktools .swatch {
  width: 42px;
  height: 42px;
}

.workwrap .paper {
  background: var(--paper);
}

.wk {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 12px 10px;
  max-width: 420px;
  margin: 0 auto;
}

.wk .grid {
  display: grid;
  gap: 4px;
  align-items: center;
  justify-items: center;
}

.wk .dg {
  font-family: 'Baloo 2';
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1.1;
  min-height: 52px;
  display: flex;
  align-items: center;
}

.wk .dg.op {
  color: var(--orange);
  font-size: 1.6em;
  line-height: 1;
}

.wk .hl {
  height: 4px;
  background: var(--ink);
  border-radius: 2px;
  margin: 2px 0;
}

.cell {
  width: 100%;
  max-width: 62px;
  min-height: 60px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  font-family: 'Baloo 2';
  font-weight: 800;
  font-size: 2rem;
  padding: 0;
}

.cell.small {
  min-height: 36px;
  max-width: 44px;
  font-size: 1.2rem;
  border-width: 2.5px;
  border-color: #E39A5A;
  color: var(--orange);
  border-style: dashed;
}

.cell.sel {
  background: var(--y-soft);
  box-shadow: 0 0 0 4px var(--yellow);
}

.cell.ok {
  background: var(--g-soft);
  border-color: var(--ok);
}

.cell.no {
  background: #FFE0E0;
  border-color: var(--bad);
}

.workwrap .fig svg {
  max-height: 36vh;
  width: 100%;
}
/* Hoạt ảnh, hiệu ứng thưởng, nền động. Tôn trọng prefers-reduced-motion. */
@keyframes pulse{50%{transform:scale(1.05)}}

@keyframes pop{0%{transform:scale(.9);opacity:0}100%{transform:none;opacity:1}}

@keyframes up{from{transform:translateY(40px);opacity:0}}

@keyframes starpop{0%{transform:scale(0) rotate(-40deg)}70%{transform:scale(1.25) rotate(8deg)}100%{transform:none}}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(110px + var(--sab));
  transform: translateX(-50%);
  color: #fff;
  border-radius: 16px;
  padding: 10px 18px;
  font-weight: 800;
  z-index: 70;
  max-width: 90%;
  text-align: center;
  animation: pop .3s;
  background: linear-gradient(180deg,#34406A,#1F2A44);
  border: 2.5px solid #fff;
  box-shadow: 0 6px 16px var(--shadow);
}

@keyframes bounce{50%{transform:translateY(-6px)}}

@media (prefers-reduced-motion:reduce){.fig svg *{transition:none}.node.cur .c,.bounce{animation:none}}

@keyframes jump{50%{transform:translateY(-9px)}}

@keyframes tilt{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(4deg)}}

@keyframes bob{50%{transform:translateY(-4px)}}

@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}

@media (prefers-reduced-motion:reduce){.mascot{animation:none!important}}

.bgfx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bgfx i {
  position: absolute;
  display: block;
  background: #fff;
  border-radius: 999px;
  opacity: .75;
  filter: blur(.3px);
}

.bgfx i:before,.bgfx i:after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

.bgfx .b1 {
  width: 110px;
  height: 34px;
  top: 90px;
  left: -130px;
  animation: cdrift 70s linear infinite;
}

.bgfx .b1:before {
  width: 54px;
  height: 54px;
  left: 16px;
  top: -26px;
}

.bgfx .b1:after {
  width: 40px;
  height: 40px;
  left: 58px;
  top: -18px;
}

.bgfx .b2 {
  width: 80px;
  height: 26px;
  top: 210px;
  left: -100px;
  animation: cdrift 95s linear infinite -40s;
  opacity: .55;
}

.bgfx .b2:before {
  width: 38px;
  height: 38px;
  left: 12px;
  top: -18px;
}

.bgfx .b2:after {
  width: 30px;
  height: 30px;
  left: 40px;
  top: -12px;
}

.bgfx .b3 {
  width: 70px;
  height: 22px;
  top: 380px;
  left: -90px;
  animation: cdrift 120s linear infinite -80s;
  opacity: .4;
}

.bgfx .b3:before {
  width: 34px;
  height: 34px;
  left: 10px;
  top: -16px;
}

.bgfx .b3:after {
  width: 26px;
  height: 26px;
  left: 36px;
  top: -10px;
}

@keyframes cdrift{to{transform:translateX(calc(100vw + 260px))}}

@keyframes rise{from{opacity:0;transform:translateY(18px) scale(.98)}to{opacity:1;transform:none}}

@keyframes glow{50%{filter:brightness(1.07) saturate(1.1)}}

@keyframes tw{50%{transform:scale(1.5) rotate(20deg);opacity:.35}}

@keyframes flt{from{transform:translate(-50%,-4px) rotate(-5deg)}to{transform:translate(-50%,5px) rotate(5deg)}}

@keyframes fglow{50%{box-shadow:0 0 0 7px rgba(255,210,63,.55)}}

.spk {
  position: fixed;
  z-index: 80;
  font-size: 1.5rem;
  pointer-events: none;
  transform: translate(-50%,-50%);
  animation: spk .9s ease-out forwards;
}

@keyframes spk{0%{opacity:1;transform:translate(-50%,-50%) scale(.4)}60%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.3) rotate(120deg)}}

@keyframes spin{to{transform:rotate(360deg)}}

@keyframes starpop2{0%{transform:translateY(-12px) scale(0) rotate(-40deg)}70%{transform:translateY(-12px) scale(1.25) rotate(8deg)}100%{transform:translateY(-12px)}}

@media (prefers-reduced-motion:reduce){.bgfx i,.rays,.path .dec,.btn,.field.act,.node .go{animation:none!important}main>*{animation:none}}

/* --- chế độ "Giảm hiệu ứng" (Cài đặt) cho máy yếu: tắt mọi hoạt ảnh lặp và nền động --- */
html.calm .bgfx { display: none; }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; }
html.calm .fig svg * { transition: none; }
/* Tablet / màn ngang. */
@media (min-width:700px){html{font-size:22px}}

@media (min-width:700px){.cmp{grid-template-columns:1fr 1fr}}

@media (max-width:520px){.inkhead [data-r=hint]{display:none}}

@media (min-width:760px){html{font-size:24px}
  #app{max-width:880px}
  .field.fr2{min-width:130px;max-width:170px}
  .field.fr2 .sub{min-height:56px}
  .pad button{min-height:70px}}

@media (min-width:1000px) and (orientation:landscape){html{font-size:22px}
  #app{max-width:1240px}
  main.two{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;column-gap:24px}
  main.tprac>.q,main.tprac>#qfig{grid-column:1}
  main.tprac>#ans{grid-column:2;grid-row:1 / span 4}
  main.tteach>#figbox{grid-column:1;grid-row:1 / span 8;position:sticky;top:8px}
  main.tteach>*:not(#figbox){grid-column:2}}

@media (min-width:760px){.reg .scene{height:150px}.node .c{width:92px;height:92px}.big-stars svg{width:110px;height:110px}}

