/* ================= Bé Vui Học – giao diện ================= */
:root {
  --bg: #FFF7E8;
  --ink: #2B2D42;
  --muted: #6B7280;
  --line: #EADFCB;
  --math: #4F8DF5; --math-d: #2F6BD8; --math-l: #E3EEFF;
  --letters: #FF6B8B; --letters-d: #DB4468; --letters-l: #FFE4EA;
  --accent: var(--math); --accent-d: var(--math-d); --accent-l: var(--math-l);
  --ok: #22C55E; --ok-l: #DCFCE7; --bad: #EF4444; --sel: #FBBF24;
  --n1: #EF4444; --n2: #F97316; --n3: #D49B00; --n4: #16A34A; --n5: #0D9488;
  --n6: #2563EB; --n7: #4F46E5; --n8: #9333EA; --n9: #DB2777; --n10: #B45309;
  --vowel: #E11D48; --cons: #2563EB;
  --font: "Baloo 2", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-letter: "Andika", "Baloo 2", "Segoe UI", Roboto, Arial, sans-serif;
  --sh: 0 4px 0 rgba(43, 45, 66, .07), 0 10px 24px rgba(43, 45, 66, .10);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(255, 170, 60, .16) 2px, transparent 2.6px),
    radial-gradient(rgba(79, 141, 245, .12) 2px, transparent 2.6px);
  background-size: 52px 52px;
  background-position: 0 0, 26px 26px;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; }

#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.mod-math { --accent: var(--math); --accent-d: var(--math-d); --accent-l: var(--math-l); }
.mod-letters { --accent: var(--letters); --accent-d: var(--letters-d); --accent-l: var(--letters-l); }

/* ---------- Thanh trên cùng ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 0 var(--accent-d);
  position: relative; z-index: 5;
}
.topbar .title {
  flex: 1; min-width: 0;
  font-size: clamp(20px, 3.2vw, 30px); font-weight: 800; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .22); color: #fff;
  transition: transform .12s, background .2s;
}
.icon-btn:active { transform: scale(.88); }
.icon-btn svg { width: 28px; height: 28px; }
.icon-btn[hidden] { display: none; }
.icon-btn.light { background: #fff; color: var(--ink); box-shadow: var(--sh); }

.progress { display: flex; gap: 6px; align-items: center; }
.pdot {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  display: grid; place-items: center; line-height: 1;
  transition: transform .3s, background .3s;
}
.pdot.cur { background: #fff; transform: scale(1.15); }
.pdot.done { background: none; transform: scale(1.25); }
.pdot.done::before { content: "⭐"; font-size: 17px; }
.pcount { display: none; font-weight: 800; font-size: 20px; background: rgba(255, 255, 255, .22); border-radius: 99px; padding: 2px 12px; }
@media (max-width: 640px) {
  .progress { display: none; }
  .pcount { display: block; }
  .title-ic { display: none; }
}

/* ---------- Lời cô (bong bóng) ---------- */
.bubble-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px 2px; }
.mascot {
  flex: none; font-size: clamp(44px, 7vmin, 66px); line-height: 1;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .08));
  transform-origin: 50% 90%;
}
.mascot.talk { animation: talk .45s ease-in-out infinite alternate; }
@keyframes talk { from { transform: rotate(-7deg); } to { transform: rotate(7deg) scale(1.06); } }
.bubble {
  position: relative; flex: 1; max-width: 980px;
  background: #fff; border-radius: 22px; padding: 10px 20px;
  font-size: clamp(19px, 2.9vw, 30px); font-weight: 700; line-height: 1.3;
  box-shadow: var(--sh);
}
.bubble::before {
  content: ""; position: absolute; left: -11px; top: 50%; margin-top: -11px;
  border-style: solid; border-width: 11px 12px 11px 0; border-color: transparent #fff transparent transparent;
}
.bubble.pop { animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
.hl { color: var(--accent); font-size: 1.2em; }
.lt { font-family: var(--font-letter); }

/* ---------- Sân chơi ---------- */
.stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 12px 16px max(16px, env(safe-area-inset-bottom));
  overflow: hidden; position: relative;
}
/* Khung nội dung: JS (B.Fitter) đặt bề rộng và phóng to cho vừa khít sân chơi */
.fit {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.fit > * { flex: none; animation: enter .4s ease; }
.fit.fill { position: relative; flex: 1; min-height: 0; width: 100%; transform: none; }
.fit.fill > * { flex: 1; }
@keyframes enter { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- Thẻ số / chữ ---------- */
.tile {
  --c: var(--ink);
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--ts, 96px); height: var(--ts, 96px);
  font-size: calc(var(--ts, 96px) * .58); font-weight: 800; line-height: 1;
  color: var(--c); background: #fff; border-radius: 22px;
  border: 3px solid rgba(43, 45, 66, .07);
  box-shadow: 0 6px 0 rgba(43, 45, 66, .12), 0 12px 20px rgba(43, 45, 66, .08);
  transition: transform .12s ease, box-shadow .12s ease, background .2s, opacity .3s, border-color .2s;
  touch-action: none; cursor: pointer;
}
.tile:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(43, 45, 66, .12), 0 6px 12px rgba(43, 45, 66, .08); }
.tile.letter { font-family: var(--font-letter); font-weight: 700; padding-bottom: .08em; }
.tile.vowel { --c: var(--vowel); }
.tile.cons { --c: var(--cons); }
.c1 { --c: var(--n1); } .c2 { --c: var(--n2); } .c3 { --c: var(--n3); } .c4 { --c: var(--n4); } .c5 { --c: var(--n5); }
.c6 { --c: var(--n6); } .c7 { --c: var(--n7); } .c8 { --c: var(--n8); } .c9 { --c: var(--n9); } .c10 { --c: var(--n10); }
.tile.correct { background: var(--ok-l); border-color: var(--ok); animation: bounce .6s; }
.tile.dim { opacity: .3; pointer-events: none; }
.tile.selected { outline: 5px solid var(--sel); outline-offset: 3px; transform: translateY(-5px) scale(1.06); }
.tile.dragging { z-index: 60; cursor: grabbing; box-shadow: 0 18px 30px rgba(0, 0, 0, .22); transition: none; }
.tile.placed { cursor: default; }
.shake { animation: shake .45s !important; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-3deg); }
  40% { transform: translateX(10px) rotate(3deg); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(6px); }
}
@keyframes bounce { 0% { transform: scale(1); } 30% { transform: scale(1.18); } 60% { transform: scale(.95); } 100% { transform: scale(1); } }

.choice-grid { --gap: clamp(14px, 3vmin, 30px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); max-width: 980px; }
.choice-grid[data-cols] { max-width: none; width: calc(var(--cols, 4) * var(--ts) + (var(--cols, 4) - 1) * var(--gap)); }
.choice-grid.big { --ts: clamp(92px, 19vmin, 180px); }
.choice-grid.med { --ts: clamp(78px, 15vmin, 140px); }

/* ô trống để thả */
.slot {
  --ts: 84px;
  width: var(--ts); height: var(--ts); flex: none;
  display: grid; place-items: center;
  border-radius: 20px; border: 4px dashed #CBD5E1; background: rgba(255, 255, 255, .7);
  color: #CBD5E1; font-size: calc(var(--ts) * .45); font-weight: 800;
  transition: border-color .2s, background .2s, transform .2s;
}
.slot > .tile {
  width: 100%; height: 100%; border: 0; box-shadow: none; background: transparent;
  font-size: calc(var(--ts) * .56);
}
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-l); }
.drop-hover, .has-selected .slot:not(.filled), .has-selected .group:not(.filled), .has-selected .frame:not(.filled) {
  border-color: var(--sel) !important;
}
.slot.drop-hover, .group.drop-hover, .frame.drop-hover { transform: scale(1.05); background: #FFFBEB; }

/* nhóm đồ vật */
.objs {
  display: grid; grid-template-columns: repeat(var(--cols, 5), auto);
  justify-content: center; align-content: center; gap: 0 4px;
  font-size: var(--os, 34px); line-height: 1.2;
}
.obj { display: inline-block; }

/* ---------- Bài 2 Toán: kéo số vào nhóm ---------- */
.m2 { display: flex; gap: clamp(16px, 3vw, 40px); align-items: center; justify-content: center; width: 100%; max-width: 1100px; }
.bank {
  --ts: clamp(54px, 9vmin, 82px);
  display: grid; grid-template-columns: repeat(2, var(--ts)); gap: 14px;
  padding: 16px; background: rgba(255, 255, 255, .65); border-radius: 26px; border: 3px dashed var(--line);
}
.bank .tile { border-radius: 18px; }
.groups { display: flex; flex-direction: column; gap: 14px; flex: 1; max-width: 600px; }
.group {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: 24px; padding: 10px 14px 10px 18px;
  box-shadow: var(--sh); border: 4px solid transparent; cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
}
.group .objs { flex: 1; --os: clamp(26px, 4.6vmin, 40px); }
.group .slot { --ts: clamp(62px, 9.5vmin, 86px); }
.group.filled { border-color: var(--ok); background: #F6FFF8; }
@media (orientation: portrait) {
  .m2 { flex-direction: column; }
  .bank { grid-template-columns: repeat(5, var(--ts)); }
  .groups { width: 100%; }
}

/* ---------- Bài 3 Toán: đếm ---------- */
.count-field {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  width: min(100%, 760px); height: min(46vh, 380px);
  background: #fff; border-radius: 30px; box-shadow: var(--sh); padding: 10px;
}
.count-item {
  position: relative; display: grid; place-items: center;
  font-size: clamp(36px, 7.4vmin, 70px); line-height: 1;
  transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg));
  touch-action: manipulation;
}
.count-item::before {
  content: ""; position: absolute; width: 1.35em; height: 1.35em; border-radius: 50%;
  left: 50%; top: 50%; margin: -.675em 0 0 -.675em; z-index: -1;
  transition: background .2s, box-shadow .2s;
}
.count-item.counted::before { background: #FEF3C7; box-shadow: inset 0 0 0 4px var(--sel); }
.count-item.counted::after {
  content: attr(data-k); position: absolute; top: 2%; right: 8%;
  min-width: 30px; height: 30px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 19px; font-weight: 800; line-height: 30px; text-align: center;
  font-family: var(--font); animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
.tip { margin: 0; color: var(--muted); font-size: clamp(16px, 2.2vmin, 20px); font-weight: 600; }
.answer-row { display: flex; gap: clamp(14px, 3vmin, 28px); --ts: clamp(80px, 14vmin, 124px); }

/* ---------- Nối (Toán 4, Chữ 5) ---------- */
.match-board {
  position: relative; display: flex; justify-content: center; align-items: stretch;
  max-width: 100%; gap: clamp(80px, 18vw, 260px);
}
.match-col { display: flex; flex-direction: column; justify-content: space-around; gap: clamp(12px, 2.4vh, 22px); flex: none; }
.match-col.left { align-items: flex-end; }
.match-col.right { align-items: flex-start; }
.match-col.right .match-item { min-width: clamp(130px, 20vmin, 200px); }
.match-item {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: clamp(70px, 11vmin, 100px); min-width: clamp(84px, 12vmin, 120px);
  background: #fff; border-radius: 22px; padding: 6px 16px;
  box-shadow: var(--sh); border: 4px solid transparent; cursor: pointer; touch-action: none;
  transition: border-color .2s, transform .15s;
}
.match-item.selected { border-color: var(--sel); transform: scale(1.05); }
.match-item.matched { border-color: var(--lc, var(--ok)); cursor: default; }
.match-item .dot {
  position: absolute; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%;
  background: #fff; border: 6px solid var(--lc, #94A3B8);
}
.match-col.left .dot { right: -14px; }
.match-col.right .dot { left: -14px; }
.big-num { font-size: clamp(46px, 8vmin, 70px); font-weight: 800; line-height: 1; color: var(--c); }
.big-letter { font-family: var(--font-letter); font-size: clamp(40px, 7vmin, 62px); font-weight: 700; line-height: 1; color: var(--c); }
.match-item .objs { --os: clamp(24px, 4.2vmin, 38px); }
.pic-item { flex-direction: column; gap: 0; padding: 6px 18px; }
.pic-item .pic { font-size: clamp(44px, 8vmin, 70px); line-height: 1.1; }
.pic-word { font-family: var(--font-letter); font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--muted); max-height: 0; opacity: 0; transition: .35s; }
.pic-item.matched .pic-word { max-height: 40px; opacity: 1; }
.pic-word b { color: var(--accent); }
svg.lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
svg.lines line { stroke-width: 7; stroke-linecap: round; }
svg.lines line.temp { stroke: var(--sel); stroke-dasharray: 1 13; stroke-width: 8; }
svg.lines line.miss { stroke: var(--bad); animation: fadeout .7s forwards; }
svg.lines line.ok { animation: draw .35s ease-out; }
@keyframes fadeout { to { opacity: 0; } }
@keyframes draw { from { opacity: 0; } }

/* ---------- Bài 5 Toán: so sánh ---------- */
.compare { display: flex; flex-direction: column; gap: 14px; width: min(100%, 940px); }
.cmp-row {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border-radius: 26px; padding: 10px 16px;
  box-shadow: var(--sh); border: 4px solid #BFDBFE;
  transition: border-color .2s, background .2s, transform .15s;
}
.cmp-row.B { border-color: #FBCFE8; }
.cmp-row:active { transform: scale(.99); }
.cmp-label { flex: none; width: clamp(64px, 11vmin, 96px); display: flex; flex-direction: column; align-items: center; font-size: 15px; font-weight: 700; color: var(--muted); line-height: 1.1; text-align: center; }
.cmp-items { flex: 1; display: grid; grid-template-columns: repeat(var(--cols), 1fr); justify-items: center; font-size: clamp(28px, 5.4vmin, 52px); line-height: 1.2; }
.cmp-count {
  flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 32px; font-weight: 800;
  display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: .35s cubic-bezier(.3, 1.6, .5, 1);
}
.compare.reveal .cmp-count { opacity: 1; transform: none; }
.eq-btn {
  align-self: center; display: flex; align-items: center; gap: 10px;
  padding: 8px 30px; background: #fff; border-radius: 99px;
  font-size: clamp(22px, 3vmin, 28px); font-weight: 800;
  box-shadow: var(--sh); border: 4px solid #FDE68A;
}
.eq-sign { font-size: 1.6em; line-height: 1; color: #F59E0B; }
.cmp-row.correct, .eq-btn.correct { border-color: var(--ok); background: var(--ok-l); }

/* ---------- Sắp xếp (Toán 6, Chữ 8) ---------- */
.sort { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vh, 26px); width: 100%; }
.sort-slots { display: flex; align-items: flex-end; gap: clamp(8px, 2vw, 18px); --ts: clamp(68px, 13vmin, 124px); }
.sort-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sort-slots .slot { --ts: inherit; width: var(--ts); height: var(--ts); }
.stair {
  width: calc(var(--ts) + 12px);
  background: linear-gradient(#FDE68A, #FBBF24); border-radius: 10px 10px 4px 4px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .08);
}
.sort-legend { display: flex; align-items: center; gap: 12px; font-size: clamp(20px, 2.8vmin, 26px); font-weight: 800; color: var(--muted); }
.sort-legend svg { width: 90px; height: 24px; color: var(--accent); }
.pool {
  --ts: clamp(68px, 13vmin, 124px);
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;
  min-height: calc(var(--ts) + 36px); min-width: 50%;
  padding: 14px 20px; background: rgba(255, 255, 255, .65); border-radius: 26px; border: 3px dashed var(--line);
}
.hint-btn { padding: 6px 18px; border-radius: 99px; background: #FEF3C7; color: #92400E; font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 #FCD34D; }
.alpha-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 900px; }
.alpha-strip span { font-family: var(--font-letter); font-size: 22px; font-weight: 700; width: 34px; height: 38px; display: grid; place-items: center; background: #fff; border-radius: 10px; box-shadow: 0 2px 0 rgba(0, 0, 0, .06); color: var(--c); }
.alpha-strip[hidden] { display: none; }

/* ---------- Bài 7 Toán: vị trí ---------- */
.pos-wrap { display: flex; gap: clamp(14px, 3vw, 30px); align-items: center; justify-content: center; }
.scene {
  width: 560px;
  aspect-ratio: 4 / 3; flex: none;
  background: #fff; border-radius: 28px; box-shadow: var(--sh); overflow: hidden;
  border: 5px solid #fff;
}
.scene svg { width: 100%; height: 100%; }
.pos-opts { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 12px; }
.pos-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: clamp(96px, 14vmin, 136px); padding: 8px 10px 6px;
  background: #fff; border-radius: 20px; box-shadow: var(--sh); border: 4px solid transparent;
  font-size: clamp(19px, 2.8vmin, 24px); font-weight: 800; line-height: 1.1;
  transition: transform .12s, border-color .2s, background .2s, opacity .3s;
}
.pos-btn svg { width: clamp(64px, 10vmin, 90px); height: auto; }
.pos-btn:active { transform: scale(.95); }
.pos-btn.correct { border-color: var(--ok); background: var(--ok-l); animation: bounce .6s; }
.pos-btn.dim { opacity: .35; pointer-events: none; }
@media (orientation: portrait) {
  .pos-wrap { flex-direction: column; }
  .scene { width: 400px; }
}

/* ---------- Chữ cái ---------- */
.model-card {
  display: flex; flex-direction: column; align-items: center;
  background: #fff; border-radius: 30px; box-shadow: var(--sh); padding: 4px 38px 10px;
  border: 5px solid var(--accent-l);
}
.model-letter { font-family: var(--font-letter); font-size: clamp(90px, 19vmin, 170px); font-weight: 700; line-height: 1.12; color: var(--accent); }
.model-cap { font-size: clamp(18px, 2.4vmin, 22px); font-weight: 800; color: var(--muted); }

.word-wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vh, 24px); }
.pic-card {
  width: clamp(140px, 27vmin, 230px); aspect-ratio: 1;
  background: #fff; border-radius: 34px; box-shadow: var(--sh);
  display: grid; place-items: center; font-size: clamp(88px, 17vmin, 150px); line-height: 1;
}
.word-tiles { display: flex; gap: 10px; --ts: clamp(62px, 11.5vmin, 108px); flex-wrap: wrap; justify-content: center; }
.word-tiles .gap { width: 22px; }
.tile.found { background: #FEF3C7; border-color: #F59E0B; animation: bounce .6s; }

.l4 { display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3vh, 28px); width: 100%; }
.frames { display: flex; gap: clamp(12px, 3vw, 30px); flex-wrap: wrap; justify-content: center; }
.frame {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: clamp(130px, 22vmin, 200px); padding: 10px 16px 14px;
  background: #fff; border-radius: 26px; box-shadow: var(--sh); border: 4px solid transparent; cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s;
}
.frame-pic { font-size: clamp(60px, 11vmin, 104px); line-height: 1.12; }
.frame-word {
  display: flex; align-items: center; gap: 3px;
  font-family: var(--font-letter); font-size: clamp(30px, 5vmin, 46px); font-weight: 700; color: var(--ink);
  --ts: clamp(54px, 8.5vmin, 74px);
}
.frame-word .rest { white-space: pre; }
.frame .slot { --ts: inherit; }
.frame.filled { border-color: var(--ok); background: #F6FFF8; }
.letter-bank {
  --ts: clamp(62px, 11vmin, 96px);
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  padding: 14px 20px; background: rgba(255, 255, 255, .65); border-radius: 26px; border: 3px dashed var(--line);
}

.listen-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 30px; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: clamp(22px, 3vmin, 28px); font-weight: 800;
  box-shadow: 0 6px 0 var(--accent-d); transition: transform .12s;
}
.listen-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-d); }
.listen-btn .ear { font-size: 1.6em; line-height: 1; }

.hide-card {
  position: relative; display: grid; place-items: center; overflow: hidden;
  width: clamp(190px, 34vmin, 300px); aspect-ratio: 1;
  background: #fff; border-radius: 34px; box-shadow: var(--sh);
}
.hide-letter {
  position: relative; display: inline-block;
  font-family: var(--font-letter); font-weight: 700; line-height: 1;
  font-size: clamp(140px, 27vmin, 250px); color: var(--accent);
}
.cover {
  position: absolute; display: grid; place-items: center;
  background-color: #A78BFA;
  background-image: radial-gradient(rgba(255, 255, 255, .4) 17%, transparent 19%);
  background-size: 24px 24px;
  color: #fff; font-family: var(--font); font-size: 48px; font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  transition: transform .8s cubic-bezier(.5, -0.35, .4, 1.2), opacity .8s;
}
.cover-top { left: -400%; right: -400%; top: -40%; height: 88%; }
.cover-bottom { left: -400%; right: -400%; bottom: -40%; height: 85%; }
.cover-left { top: -60%; bottom: -60%; left: -300%; width: 350%; }
.cover-right { top: -60%; bottom: -60%; right: -300%; width: 350%; }
.cover-top { padding-top: 20%; } .cover-bottom { padding-bottom: 20%; }
.cover-left { padding-left: 260%; } .cover-right { padding-right: 260%; }
.revealed .cover-top { transform: translateY(-140%) rotate(-8deg); opacity: 0; }
.revealed .cover-bottom { transform: translateY(140%) rotate(8deg); opacity: 0; }
.revealed .cover-left { transform: translateX(-140%) rotate(-8deg); opacity: 0; }
.revealed .cover-right { transform: translateX(140%) rotate(8deg); opacity: 0; }

/* ---------- Tô màu ---------- */
.paint-wrap { flex: 1; min-height: 0; width: 100%; display: flex; gap: 16px; align-items: center; justify-content: center; }
.paint-board {
  position: relative; flex: none;
  background-color: #EEF4FB;
  background-image: linear-gradient(rgba(79, 141, 245, .08) 2px, transparent 2px), linear-gradient(90deg, rgba(79, 141, 245, .08) 2px, transparent 2px);
  background-size: 40px 40px;
  border-radius: 30px; box-shadow: var(--sh); overflow: hidden; touch-action: none; cursor: crosshair;
  border: 5px solid #fff;
}
.paint-board canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; }
.paint-board canvas.guide { pointer-events: none; }
.palette {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; padding: 12px; border-radius: 26px; box-shadow: var(--sh);
}
.swatches { display: grid; grid-template-columns: repeat(2, 44px); gap: 9px; }
.swatch {
  width: 44px; height: 44px; border-radius: 50%; background: var(--sw);
  border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .12); transition: transform .15s, box-shadow .15s;
}
.swatch.on { box-shadow: 0 0 0 4px var(--ink); transform: scale(1.12); }
.tools { display: grid; grid-template-columns: repeat(2, 44px); gap: 9px; }
.tool {
  width: 44px; height: 44px; border-radius: 14px; background: #F3F4F6;
  display: grid; place-items: center; font-size: 22px; font-weight: 800; line-height: 1;
}
.tool.on { background: var(--accent); color: #fff; }
.tool .dotsz { border-radius: 50%; background: currentColor; }
.done-btn { padding: 6px 16px; border-radius: 99px; background: var(--ok); color: #fff; font-size: 20px; font-weight: 800; box-shadow: 0 4px 0 #15803D; }
@media (orientation: portrait) {
  .paint-wrap { flex-direction: column; }
  .palette { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .swatches { grid-template-columns: repeat(5, 40px); }
  .swatch { width: 40px; height: 40px; }
  .tools { grid-template-columns: repeat(4, 44px); }
}

/* ---------- Nút tiếp tục ---------- */
.next-btn {
  position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 20;
  animation: pop .4s cubic-bezier(.3, 1.6, .5, 1), glow 1.1s ease-in-out .4s infinite alternate;
}
@keyframes glow { to { transform: scale(1.07); } }

/* ---------- Nút chung ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 99px;
  font-size: clamp(19px, 2.6vmin, 23px); font-weight: 800; line-height: 1;
  background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--accent-d);
  transition: transform .12s, box-shadow .12s; text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-d); }
.btn svg { width: 24px; height: 24px; }
.btn.alt { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #E5E7EB, inset 0 0 0 3px #E5E7EB; }
.btn.small { padding: 8px 16px; font-size: 17px; }

/* ---------- Kết quả ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(43, 45, 66, .45); animation: fadein .25s;
}
.result {
  width: min(470px, 100%); padding: 24px 30px 30px; text-align: center;
  background: #fff; border-radius: 36px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: pop .45s cubic-bezier(.3, 1.6, .5, 1);
}
.result-emoji { font-size: 82px; line-height: 1; }
.result h2 { margin: 6px 0 0; font-size: 42px; line-height: 1.1; color: var(--accent); }
.result-txt { margin: 4px 0 0; font-size: 20px; font-weight: 600; color: var(--muted); }
.result-txt b { color: var(--ink); }
.result-stars { display: flex; justify-content: center; gap: 8px; margin: 12px 0 20px; font-size: 62px; line-height: 1; }
.result-stars span { filter: grayscale(1); opacity: .25; transform: scale(.6); transition: .45s cubic-bezier(.3, 1.6, .5, 1); }
.result-stars span.on { filter: none; opacity: 1; transform: none; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Hiệu ứng ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.particle { position: absolute; width: 1em; height: 1em; margin: -.5em 0 0 -.5em; line-height: 1; text-align: center; }
.praise {
  position: absolute; left: 50%; top: 46%; width: 1em; margin: -.5em 0 0 -.5em; text-align: center;
  font-size: min(28vmin, 220px); line-height: 1; animation: praise 1.15s ease forwards;
}
@keyframes praise {
  0% { transform: scale(.2) rotate(-20deg); opacity: 0; }
  25% { transform: scale(1.1) rotate(6deg); opacity: 1; }
  45% { transform: scale(1) rotate(0); }
  80% { opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.confetti { position: absolute; top: -24px; width: 11px; height: 18px; border-radius: 3px; }
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 300;
  transform: translateX(-50%); max-width: min(92vw, 560px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 18px;
  font-size: 17px; font-weight: 600; line-height: 1.35; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: fadein .25s;
}

/* ---------- Trang chủ ---------- */
.home { align-items: center; justify-content: center; gap: clamp(10px, 2.4vh, 28px); padding: clamp(12px, 2.2vh, 24px) 20px; overflow: auto; }
.home-top { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; display: flex; gap: 10px; z-index: 2; }
.home-top .icon-btn { background: #fff; color: var(--ink); box-shadow: var(--sh); }
.install-btn { display: inline-flex; align-items: center; gap: 6px; height: 52px; padding: 0 18px; border-radius: 99px; background: #fff; box-shadow: var(--sh); font-weight: 800; font-size: 17px; }
.install-btn svg { width: 22px; height: 22px; }
.install-btn[hidden] { display: none; }
.hero { text-align: center; }
.hero-mascot { font-size: clamp(52px, min(14vmin, 10.5vh), 120px); line-height: 1; animation: float 3s ease-in-out infinite; display: inline-block; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-4deg); } }
.logo { margin: 4px 0 0; font-size: clamp(40px, min(9.5vmin, 8.2vh), 92px); font-weight: 800; line-height: 1; letter-spacing: 1px; }
.logo span { display: inline-block; text-shadow: 0 5px 0 rgba(0, 0, 0, .08); }
.logo span:nth-child(odd) { transform: rotate(-4deg); }
.logo span:nth-child(even) { transform: rotate(4deg) translateY(4px); }
.tagline { margin: 6px 0 0; font-size: clamp(17px, min(2.6vmin, 2.4vh), 24px); font-weight: 600; color: var(--muted); }
.modules { display: flex; gap: clamp(18px, 4vw, 44px); flex-wrap: wrap; justify-content: center; }
.module-btn {
  width: clamp(250px, 36vmin, 340px); padding: clamp(14px, 2.4vh, 24px) 18px clamp(12px, 2.2vh, 22px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none;
  background: var(--accent); color: #fff; border-radius: 38px;
  box-shadow: 0 10px 0 var(--accent-d), 0 22px 40px rgba(0, 0, 0, .12);
  transition: transform .15s, box-shadow .15s;
}
.module-btn:active { transform: translateY(7px); box-shadow: 0 3px 0 var(--accent-d), 0 10px 20px rgba(0, 0, 0, .1); }
.chips { display: flex; gap: 10px; }
.chip {
  width: clamp(48px, min(8vmin, 7vh), 70px); height: clamp(48px, min(8vmin, 7vh), 70px); border-radius: 18px;
  display: grid; place-items: center; background: #fff; color: var(--c);
  font-size: clamp(34px, 5.4vmin, 46px); font-weight: 800; line-height: 1;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .14);
}
.chip:nth-child(1) { transform: rotate(-6deg); }
.chip:nth-child(3) { transform: rotate(6deg); }
.chip.lt { font-weight: 700; padding-bottom: 4px; }
.module-btn .mt { margin-top: 8px; font-size: clamp(27px, 4vmin, 36px); font-weight: 800; line-height: 1.1; }
.module-btn .md { font-size: 17px; font-weight: 600; opacity: .92; }
.home-foot { font-size: 14px; color: var(--muted); font-weight: 500; text-align: center; }

/* ---------- Danh sách bài ---------- */
.cards {
  flex: 1; min-height: 0; overflow: auto; width: 100%; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 16px; padding: 20px; align-content: start;
}
.card {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: #fff; border-radius: 26px; box-shadow: var(--sh);
  text-decoration: none; color: inherit; border: 3px solid transparent;
  transition: transform .15s, border-color .2s; animation: enter .4s ease backwards;
}
.card:hover { border-color: var(--accent-l); }
.card:active { transform: scale(.97); }
.card .ic { flex: none; width: 80px; height: 80px; border-radius: 22px; background: var(--tint, var(--accent-l)); display: grid; place-items: center; font-size: 44px; line-height: 1; }
.card-body { min-width: 0; }
.card .num { font-size: 14px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .6px; }
.card h3 { margin: 0; font-size: 23px; line-height: 1.12; }
.card p { margin: 3px 0 0; font-size: 15px; font-weight: 500; line-height: 1.25; color: var(--muted); }
.card .stars { margin-top: 4px; font-size: 15px; letter-spacing: 1px; line-height: 1; }
.card .stars .off { filter: grayscale(1); opacity: .25; }

/* ---------- Cài đặt ---------- */
.sheet {
  width: min(580px, 100%); max-height: 100%; overflow: auto;
  background: #fff; border-radius: 30px; padding: 18px 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .3s cubic-bezier(.3, 1.4, .5, 1);
  -webkit-user-select: text; user-select: text;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sheet-head h2 { margin: 0; font-size: 30px; }
.sheet-head .icon-btn { background: #F3F4F6; color: var(--ink); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 12px 0; border-bottom: 2px solid #F3F4F6; }
.set-label { font-size: 19px; font-weight: 700; line-height: 1.2; }
.set-sub { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #F3F4F6; border-radius: 99px; }
.seg button { padding: 6px 14px; border-radius: 99px; font-size: 16px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 0 var(--accent-d); }
.set-select { font: inherit; font-size: 15px; padding: 6px 10px; border-radius: 12px; border: 2px solid #E5E7EB; max-width: 100%; background: #fff; color: var(--ink); }
.rate-line { display: flex; gap: 8px; align-items: center; flex: 1 1 300px; min-width: 0; justify-content: flex-end; }
.rate-range { flex: 1 1 80px; width: 80px; min-width: 0; max-width: 240px; height: 34px; accent-color: var(--accent); cursor: pointer; }
.rate-line .btn.small { white-space: nowrap; }
.voice-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 16px; background: #FFFBEB; font-size: 14.5px; font-weight: 500; line-height: 1.45; color: #57534E; }
.note.warn { background: #FEF2F2; color: #991B1B; }
.note b { color: var(--ink); }
.link-btn { color: var(--bad); font-weight: 700; font-size: 16px; text-decoration: underline; }

/* ---------- Tài khoản phụ huynh ---------- */
input, textarea { -webkit-user-select: text; user-select: text; }
.card { position: relative; }
.card .lock { position: absolute; top: 10px; right: 12px; font-size: 22px; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 52px; max-width: 46vw; padding: 0 18px 0 6px;
  border-radius: 99px; background: #fff; box-shadow: var(--sh); font-weight: 800; font-size: 18px;
}
.acct-chip .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--math-l); font-size: 26px; line-height: 1; flex: none; }
.acct-chip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-chip:active { transform: scale(.95); }
@media (max-width: 520px) { .acct-chip .nm { display: none; } .acct-chip { padding: 0 6px; } }

.small-sheet { width: min(520px, 100%); }
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.kid-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px;
  border-radius: 24px; background: #F9FAFB; border: 3px solid #EEF0F3; transition: transform .12s;
}
.kid-pick:active { transform: scale(.95); }
.kid-pick.on { border-color: var(--math); background: var(--math-l); }
.kid-pick .av { font-size: 58px; line-height: 1.1; }
.kid-pick .nm { font-size: 21px; font-weight: 800; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.kid-pick .st { font-size: 15px; font-weight: 700; color: var(--muted); }
.sheet-foot { display: flex; justify-content: center; margin-top: 12px; }

.acct-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.acct { width: min(600px, 100%); margin: 0 auto; padding: 18px 16px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.acct.wide { width: min(980px, 100%); }
.acct-card { background: #fff; border-radius: 26px; padding: 18px 20px 20px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 12px; }
.acct-card h3 { margin: 0; font-size: 23px; }
.acct-card p { margin: 0; }
.acct .note { margin-top: 0; }
.muted { color: var(--muted); font-weight: 500; font-size: 16px; line-height: 1.4; }
.muted.small { font-size: 14.5px; text-align: center; }
.auth-tabs { align-self: center; }
.auth-tabs button { padding: 8px 20px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 16px; font-weight: 700; }
.field input, .admin-search {
  font: inherit; font-size: 19px; font-weight: 600; color: var(--ink); width: 100%;
  padding: 11px 16px; border-radius: 16px; border: 3px solid #E5E7EB; background: #fff; outline: none;
}
.field input:focus, .admin-search:focus { border-color: var(--math); }
.field input::placeholder, .admin-search::placeholder { color: #B6BCC6; font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--muted); cursor: pointer; align-self: flex-start; }
.check input { width: 20px; height: 20px; accent-color: var(--math); }
.err { color: var(--bad); font-weight: 700; font-size: 16px; }
.err:empty { display: none; }
.btn.wide { justify-content: center; width: 100%; }
.btn:disabled { opacity: .6; pointer-events: none; }
.btn[hidden] { display: none; }
.more-btn { align-self: center; }
.btn.danger { background: var(--bad); box-shadow: 0 5px 0 #B91C1C; }
.badge { display: inline-block; padding: 3px 12px; border-radius: 99px; background: #F3F4F6; color: var(--muted); font-size: 14px; font-weight: 800; white-space: nowrap; }
.badge.ok { background: var(--ok-l); color: #15803D; }
.badge.gold { background: #FEF3C7; color: #92400E; }
.badge.bad { background: #FEE2E2; color: #B91C1C; }

.parent-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.parent-av { width: 60px; height: 60px; border-radius: 50%; background: var(--math-l); display: grid; place-items: center; font-size: 34px; flex: none; }
.parent-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.parent-info b { font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.parent-info span { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.sync-line { font-size: 15px; font-weight: 600; color: #15803D; background: var(--ok-l); border-radius: 14px; padding: 8px 12px; }
.sync-line.wait { color: #92400E; background: #FEF3C7; }

.kid-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; background: #F9FAFB; border: 3px solid transparent; flex-wrap: wrap; }
.kid-row.on { border-color: var(--math-l); background: #F5F9FF; }
.kid-av { font-size: 46px; line-height: 1; flex: none; }
.kid-info { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.kid-info b { font-size: 21px; line-height: 1.15; overflow-wrap: anywhere; }
.kid-info span { font-size: 15px; font-weight: 600; color: var(--muted); }
.kid-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn.soft { width: 44px; height: 44px; background: #fff; color: var(--ink); box-shadow: 0 2px 0 #E5E7EB, inset 0 0 0 2px #E5E7EB; font-size: 20px; }
.add-kid { align-self: flex-start; }
.kid-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 18px; padding: 10px 6px 4px; }
.kd-title { font-weight: 800; font-size: 17px; margin: 4px 0; }
.kd-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #EEF0F3; font-size: 15px; font-weight: 600; }
.kd-ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.kd-name { flex: 1; min-width: 0; line-height: 1.2; }
.kd-stars { font-size: 12px; letter-spacing: 1px; flex: none; }
.kd-stars .off { filter: grayscale(1); opacity: .25; }
.kd-plays { color: var(--muted); font-size: 13.5px; width: 56px; text-align: right; flex: none; }
.kid-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 20px; background: #F9FAFB; border: 3px solid var(--math-l); }
.kid-form h4 { margin: 0; font-size: 19px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.avatar-grid button { height: 58px; border-radius: 18px; font-size: 34px; line-height: 1; background: #fff; border: 3px solid #EEF0F3; }
.avatar-grid button.on { border-color: var(--math); background: var(--math-l); transform: scale(1.06); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-row { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 6px; border-top: 2px solid #EEF0F3; }
.danger-row .link-btn { font-size: 15px; }
.sec-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sec-btns .link-btn { margin-left: auto; font-size: 15px; }

/* ---------- Quản trị ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 20px; padding: 12px 16px; box-shadow: var(--sh); display: flex; flex-direction: column; }
.stat b { font-size: 30px; line-height: 1.1; color: var(--math-d); }
.stat span { font-size: 14px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-row { padding: 12px 14px; border-radius: 18px; background: #F9FAFB; display: flex; flex-direction: column; gap: 6px; }
.user-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-main b { font-size: 19px; }
.user-login { color: var(--muted); font-weight: 600; margin-left: auto; overflow-wrap: anywhere; }
.user-meta { font-size: 14.5px; font-weight: 500; color: var(--muted); }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-actions .btn.small { font-size: 15px; padding: 7px 14px; }
.big-code { font-size: 38px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 12px; margin: 10px 0; border-radius: 18px; background: var(--math-l); color: var(--math-d); -webkit-user-select: all; user-select: all; }

/* ================= Trò chơi trí tuệ ================= */
:root {
  --memory: #8B5CF6; --memory-d: #6D28D9; --memory-l: #EDE9FE;
  --logic: #0D9488; --logic-d: #0F766E; --logic-l: #CCFBF1;
  --observe: #E8730C; --observe-d: #B45309; --observe-l: #FFEDD5;
}
.mod-memory { --accent: var(--memory); --accent-d: var(--memory-d); --accent-l: var(--memory-l); }
.mod-logic { --accent: var(--logic); --accent-d: var(--logic-d); --accent-l: var(--logic-l); }
.mod-observe { --accent: var(--observe); --accent-d: var(--observe-d); --accent-l: var(--observe-l); }

/* Trang chủ: căn giữa nhưng vẫn cuộn được khi màn thấp */
.home { justify-content: flex-start; }
.home > .hero { margin-top: auto; }
.home > .home-foot { margin-bottom: auto; }
.brain { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 12px); width: 100%; max-width: 820px; }
.brain-head { font-size: clamp(19px, min(3vmin, 2.6vh), 26px); font-weight: 800; color: var(--ink); line-height: 1.2; }
.brain-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.4vw, 22px); width: 100%; }
.brain-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; text-decoration: none;
  padding: 14px 10px 12px; border-radius: 28px; background: var(--accent); color: #fff;
  box-shadow: 0 7px 0 var(--accent-d), 0 16px 30px rgba(0, 0, 0, .1); transition: transform .15s, box-shadow .15s;
}
.brain-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--accent-d), 0 8px 16px rgba(0, 0, 0, .1); }
.brain-btn .bi { font-size: clamp(36px, 6vmin, 50px); line-height: 1.1; }
.brain-btn .bt { font-size: clamp(20px, 3vmin, 26px); font-weight: 800; line-height: 1.15; }
.brain-btn .bd { font-size: 14px; font-weight: 600; opacity: .92; line-height: 1.25; }
@media (max-width: 520px) { .brain-btn .bd { display: none; } .brain-btn { padding: 12px 6px 10px; border-radius: 22px; } }
/* Màn ngang đủ rộng: 6 nút trí tuệ trên một hàng để cả trang vừa khít chiều cao (không phải cuộn) */
@media (min-width: 980px) and (orientation: landscape) {
  .brain { max-width: 1240px; }
  .brain-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 18px); }
  .brain-btn { padding: clamp(10px, 1.6vh, 14px) 8px clamp(10px, 1.4vh, 12px); border-radius: 24px; justify-content: center; }
  .brain-btn .bi { font-size: clamp(34px, 5vh, 48px); }
  .brain-btn .bt { font-size: clamp(18px, 2.4vh, 22px); }
  .brain-btn .bd { display: none; }
}
@media (min-width: 1500px) and (min-height: 760px) and (orientation: landscape) {
  .brain-btn .bd { display: block; font-size: 13px; }
}
/* Màn hẹp (điện thoại): chừa chỗ cho các nút góc trên để không đè lên cú Mèo;
   hai nút Toán – Chữ cái nằm cạnh nhau cho cả trang vừa một màn hình */
@media (max-width: 640px) {
  .home { padding-top: max(70px, calc(env(safe-area-inset-top) + 62px)); gap: 16px; }
  .modules { width: 100%; max-width: 520px; flex-wrap: nowrap; gap: 12px; }
  .module-btn { width: auto; flex: 1 1 0; min-width: 0; padding: 14px 8px 12px; gap: 4px; border-radius: 28px; }
  .module-btn .chips { gap: 6px; }
  .module-btn .chip { width: 38px; height: 38px; font-size: 25px; border-radius: 12px; }
  .module-btn .mt { margin-top: 4px; font-size: 20px; text-align: center; }
  .module-btn .md { font-size: 13px; text-align: center; line-height: 1.3; }
}
.pay-note { margin: 14px auto 0; width: calc(100% - 40px); max-width: 1200px; padding: 10px 16px; border-radius: 18px; background: #FFFBEB; color: #78350F; font-size: 16px; font-weight: 600; }

/* Thẻ hình (emoji) dùng chung */
.tile.pic-tile { font-size: calc(var(--ts, 96px) * .6); font-weight: 400; }
.tile.pic-tile.selected { background: #FFFBEB; }

/* Lật thẻ tìm cặp */
.mem-grid { --mc: 112px; display: grid; grid-template-columns: repeat(var(--cols), var(--mc)); gap: 16px; }
.mem-card { width: var(--mc); height: calc(var(--mc) * 1.2); perspective: 700px; touch-action: none; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.mem-card.up .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 20px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: var(--sh);
}
.mem-back { background: var(--accent); background-image: radial-gradient(rgba(255, 255, 255, .2) 3px, transparent 3.6px); background-size: 20px 20px; font-size: 50px; border: 4px solid #fff; }
.mem-front { background: #fff; font-size: 66px; transform: rotateY(180deg); border: 4px solid transparent; }
.mem-card.done .mem-front { border-color: var(--ok); background: var(--ok-l); }
.mem-card.done .mem-inner { animation: memdone .6s; }
@keyframes memdone { 40% { transform: rotateY(180deg) scale(1.12); } }

/* Cái gì biến mất */
.bm-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bm-board { position: relative; border-radius: 26px; }
.bm-table { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 18px 22px; max-width: 560px; background: #fff; border-radius: 26px; box-shadow: var(--sh); border: 4px solid var(--accent-l); }
.bm-slot { width: 96px; height: 96px; border-radius: 20px; background: #FAF5FF; display: grid; place-items: center; font-size: 62px; line-height: 1; }
.bm-slot.empty { background: none; border: 4px dashed #D8CCF0; }
.bm-slot.empty .bm-obj { visibility: hidden; }
.bm-slot.back { animation: bounce .6s; background: var(--ok-l); }
.bm-cover { position: absolute; inset: 0; display: grid; place-items: center; font-size: 70px; border-radius: 26px; background: var(--accent); background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 22px, transparent 22px 44px); transform: scaleY(0); transform-origin: top; transition: transform .35s ease; }
.bm-board.covered .bm-cover { transform: scaleY(1); }
.bm-timer { width: 260px; height: 12px; border-radius: 99px; background: #EDE9FE; overflow: hidden; }
.bm-timer i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; }
.bm-timer.run i { animation: bmtime linear forwards; }
.bm-timer:not(.run) i { transform: scaleX(0); }
@keyframes bmtime { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.bm-opts { visibility: hidden; }
.bm-opts.show { visibility: visible; animation: enter .4s ease; }
.bm-again[hidden] { display: none; }

/* Nhớ thứ tự */
.simon { display: grid; grid-template-columns: repeat(2, 150px); gap: 20px; }
.simon-pad {
  width: 150px; height: 150px; border-radius: 36px; background: var(--pc); opacity: .5;
  display: grid; place-items: center; font-size: 80px; line-height: 1; touch-action: none;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .2); transition: transform .12s, opacity .12s, box-shadow .12s;
}
.simon-pad span { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .15)); }
.simon-pad.lit { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 8px #fff, 0 0 46px var(--pc); }
.simon.watch .simon-pad { cursor: default; }
.simon-dots { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.simon-dots span { width: 24px; height: 24px; border-radius: 50%; background: #E5E7EB; transition: background .2s, transform .2s; }
.simon-dots span.on { background: var(--ok); transform: scale(1.15); }

/* Tìm quy luật */
.pat-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 900px; padding: 14px 18px; background: #fff; border-radius: 26px; box-shadow: var(--sh); }
.pat-cell { width: 84px; height: 84px; border-radius: 18px; background: #F0FDFA; display: grid; place-items: center; font-size: 56px; line-height: 1; }
.pat-cell.hole { border: 4px dashed var(--accent); background: #fff; color: var(--accent); font-size: 50px; font-weight: 800; }
.pat-cell.hole.filled { border-style: solid; border-color: var(--ok); background: var(--ok-l); animation: bounce .6s; }

/* Sudoku hình */
.sdk-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; }
.sdk { --cs: 96px; display: grid; grid-template-columns: repeat(var(--n), var(--cs)); gap: 6px; padding: 10px; background: var(--accent); border-radius: 24px; box-shadow: 0 6px 0 var(--accent-d); }
.sdk-cell { width: var(--cs); height: var(--cs); border-radius: 14px; background: #fff; display: grid; place-items: center; font-size: 62px; line-height: 1; touch-action: none; transition: transform .15s, background .2s; }
.sdk-cell.shade { background: #CCFBF1; }
.sdk-cell.given { cursor: default; }
.sdk-cell.empty { background: #FEFCE8; box-shadow: inset 0 0 0 4px #FDE68A; }
.sdk-cell.empty.selected, .has-sym .sdk-cell.empty { box-shadow: inset 0 0 0 5px var(--sel); }
.sdk-cell.selected { transform: scale(1.05); }
.sdk-cell.drop-hover { background: #FEF3C7; transform: scale(1.06); }
.sdk-cell.filled { background: var(--ok-l); animation: bounce .5s; }
.sdk-pal { display: grid; grid-template-columns: repeat(2, 96px); gap: 14px; --ts: 96px; }

/* Tìm điểm khác nhau */
.diff-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.diff-panel { display: grid; grid-template-columns: repeat(var(--cols), 80px); gap: 8px; padding: 12px; background: #fff; border-radius: 24px; box-shadow: var(--sh); border: 4px solid var(--accent-l); }
.diff-cell { position: relative; width: 80px; height: 80px; border-radius: 16px; background: #FFF7ED; display: grid; place-items: center; font-size: 50px; line-height: 1; }
.diff-cell span { display: inline-block; }
.diff-cell .mirror { transform: scaleX(-1); }
.diff-cell .small { transform: scale(.55); }
.diff-cell.found::after { content: ""; position: absolute; inset: 3px; border: 5px solid var(--ok); border-radius: 50%; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
.diff-vs { font-size: 34px; font-weight: 800; color: var(--muted); }

/* Mê cung */
.mz { position: relative; touch-action: none; border-radius: 12px; background: #F0FDF4; box-shadow: var(--sh); }
.mz-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); }
.mz-cell { position: relative; }
.mz-cell.trail::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); opacity: .35; }
.mz-walls { position: absolute; inset: -4px; pointer-events: none; }
.mz-walls svg { width: 100%; height: 100%; overflow: visible; }
.mz-walls rect { fill: none; stroke: #7C2D12; stroke-width: 8; }
.mz-walls line { stroke: #7C2D12; stroke-width: 8; stroke-linecap: round; }
.mz-hero, .mz-goal { position: absolute; left: 0; top: 0; width: 64px; height: 64px; display: grid; place-items: center; font-size: 44px; line-height: 1; pointer-events: none; }
.mz-hero { z-index: 2; transition: transform .12s linear; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .18)); }
.mz-goal { animation: glow .9s ease-in-out infinite alternate; }
.mz-goal.got { animation: bounce .6s; }

/* Tìm bóng */
.shape-item .pic { font-size: clamp(48px, 8vmin, 70px); line-height: 1.1; }
.pic.shadow { filter: brightness(0); opacity: .78; transition: filter .5s, opacity .5s; }
.match-item.matched .pic.shadow { filter: none; opacity: 1; }

/* Ghép hình */
.jig { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; }
.jig-board { position: relative; flex: none; border-radius: 14px; background: #fff; box-shadow: var(--sh); outline: 4px solid var(--accent-l); }
.jig-guide { position: absolute; inset: 0; overflow: hidden; border-radius: 14px; opacity: .1; filter: grayscale(.4); transition: opacity .4s; }
.jig-board.ghost .jig-guide { opacity: .28; }
.jig-board.done .jig-guide { opacity: 0; }
.jig-slot { position: absolute; border: 2px dashed rgba(0, 0, 0, .22); transition: background .2s; }
.jig-slot.filled { border-color: transparent; }
.has-selected .jig-slot:not(.filled), .jig-slot.drop-hover { background: rgba(251, 191, 36, .25); }
.jig-pic { position: absolute; left: 0; top: 0; width: 300px; height: 300px; overflow: hidden; }
.jig-pic span { position: absolute; transform: translate(-50%, -50%); line-height: 1; }
.jig-tray { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 12px; max-width: 360px; }
.jig-piece { position: relative; flex: none; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 5px 12px rgba(0, 0, 0, .2); touch-action: none; cursor: grab; }
.jig-piece.selected { outline: 5px solid var(--sel); outline-offset: 2px; }
.jig-piece.dragging { z-index: 60; cursor: grabbing; box-shadow: 0 18px 30px rgba(0, 0, 0, .25); }
.jig-slot > .jig-piece { position: absolute; left: 0; top: 0; border-radius: 0; box-shadow: none; cursor: default; }
.jig-board.done .jig-slot { border: 0; }
.jig-board.done { animation: bounce .7s; }

/* ---------- Quản trị: online, khách, tính phí ---------- */
.stat small { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.stat.live b { color: #15803D; }
.live-dot, .off-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.live-dot { background: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); animation: livepulse 1.6s ease-in-out infinite; }
.off-dot { background: #D1D5DB; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, .05); } }
.badge.kid { background: #EEF2FF; color: #4338CA; }
.pay-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-head h3 { margin-right: auto; }
.pay-mods { display: flex; flex-direction: column; gap: 6px; }
.pay-mod { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px; border-radius: 14px; background: #F9FAFB; font-size: 15px; }
.pay-mod span { color: var(--muted); font-weight: 500; }

/* ================= Trò chơi trí tuệ – đợt 2 ================= */
:root {
  --mathlogic: #4F46E5; --mathlogic-d: #3730A3; --mathlogic-l: #E0E7FF;
  --world: #16A34A; --world-d: #15803D; --world-l: #DCFCE7;
  --shapes: #DB2777; --shapes-d: #9D174D; --shapes-l: #FCE7F3;
}
.mod-mathlogic { --accent: var(--mathlogic); --accent-d: var(--mathlogic-d); --accent-l: var(--mathlogic-l); }
.mod-world { --accent: var(--world); --accent-d: var(--world-d); --accent-l: var(--world-l); }
.mod-shapes { --accent: var(--shapes); --accent-d: var(--shapes-d); --accent-l: var(--shapes-l); }
.brain-btn .bt { overflow-wrap: anywhere; }
@media (max-width: 520px) { .brain-btn .bt { font-size: 17px; } }

/* Nhớ vị trí */
.mv-grid { display: grid; grid-template-columns: repeat(var(--n), 92px); gap: 10px; padding: 12px; background: #fff; border-radius: 24px; box-shadow: var(--sh); border: 4px solid var(--accent-l); }
.mv-cell { width: 92px; height: 92px; border-radius: 18px; background: #FAF5FF; display: grid; place-items: center; font-size: 58px; line-height: 1; transition: background .2s, transform .15s; }
.mv-cell span { transition: opacity .3s; }
.mv-grid.hidden .mv-cell span { opacity: 0; }
.mv-grid.hidden .mv-cell.hit span { opacity: 1; }
.mv-cell.hit { background: var(--ok-l); box-shadow: inset 0 0 0 4px var(--ok); animation: bounce .5s; }

/* Ai đổi chỗ? */
.dc-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 18px 22px; max-width: 640px; background: #fff; border-radius: 26px; box-shadow: var(--sh); border: 4px solid var(--accent-l); }
.dc-cell { width: 96px; height: 96px; border-radius: 20px; background: #FAF5FF; display: grid; place-items: center; font-size: 62px; line-height: 1; }
.dc-cell.hit { background: var(--ok-l); box-shadow: inset 0 0 0 4px var(--ok); animation: bounce .5s; }

/* Xếp từ nhỏ đến to */
.tile .sz { line-height: 1; display: inline-block; }

/* Cân thăng bằng */
.scales { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.scale { position: relative; width: 300px; height: 230px; flex: none; background: #fff; border-radius: 26px; box-shadow: var(--sh); }
.scale-svg, .scale-svg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sc-item { position: absolute; transform: translate(-50%, -50%); font-size: 46px; line-height: 1; }

/* Tìm tất cả */
.th-top { display: flex; align-items: center; gap: 12px; padding: 6px 16px; border-radius: 99px; background: #fff; box-shadow: var(--sh); font-size: 20px; font-weight: 700; color: var(--muted); }
.th-sample { font-size: 44px; line-height: 1; }
.th-count { color: var(--accent); font-size: 24px; }
.th-field { display: grid; grid-template-columns: repeat(var(--cols), 70px); gap: 6px; padding: 12px; background: #FFF7ED; border-radius: 24px; box-shadow: var(--sh); }
.th-cell { position: relative; width: 70px; height: 70px; display: grid; place-items: center; font-size: 44px; line-height: 1; border-radius: 50%; }
.th-cell span { display: inline-block; transform: rotate(var(--rot)); }
.th-cell:disabled { cursor: default; }
.th-cell.found { background: var(--ok-l); box-shadow: inset 0 0 0 4px var(--ok); animation: bounce .5s; }

/* Ghép nửa hình */
.half { display: inline-block; width: .5em; height: 1.2em; overflow: hidden; font-size: clamp(56px, 9vmin, 76px); line-height: 1.2; transition: width .4s; }
.half > i { display: inline-flex; justify-content: center; width: 1em; font-style: normal; transition: margin .4s; }
.half.right > i { margin-left: -.5em; }
.match-item.matched .half { width: 1em; }
.match-item.matched .half.right > i { margin-left: 0; }
.halves .match-col.left .match-item { justify-content: flex-end; padding: 6px 22px 6px 26px; }
.halves .match-col.right .match-item { justify-content: flex-start; padding: 6px 26px 6px 22px; min-width: clamp(84px, 12vmin, 120px); }
/* Đường cắt nét đứt cho thấy đây là nửa hình; ghép đúng thì liền lại */
.half.left { border-right: 3px dashed #CBD5E1; }
.half.right { border-left: 3px dashed #CBD5E1; }
.match-item.matched .half { border-color: transparent; }

/* Cộng trừ bằng hình */
.ar-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.ar-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 14px 8px; background: #fff; border-radius: 22px; box-shadow: var(--sh); min-width: 90px; }
.ar-box.num-only, .ar-box.ask { justify-content: center; min-height: 120px; }
.ar-grp { display: grid; grid-template-columns: repeat(var(--cols), 44px); gap: 4px; }
.ar-obj { font-size: 38px; line-height: 1.1; text-align: center; position: relative; }
.ar-obj.out { opacity: .35; }
.ar-obj.out::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--bad); font-size: 34px; font-weight: 800; }
.ar-n { font-size: 30px; line-height: 1; color: var(--accent); }
.ar-op { font-size: 46px; font-weight: 800; color: var(--muted); }
.ar-q { font-size: 56px; line-height: 1; color: var(--accent); }
.ar-box.ask { border: 4px dashed var(--accent); }
.ar-box.ask.done { border-style: solid; border-color: var(--ok); background: var(--ok-l); animation: bounce .6s; }

/* Số còn thiếu: đoàn tàu */
.train { display: flex; align-items: flex-end; gap: 8px; padding: 10px 6px 0; }
.train .engine { font-size: 78px; line-height: 1; }
.car { position: relative; width: 86px; height: 76px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 5px 0 var(--accent-d); margin-bottom: 14px; }
.car b { font-size: 40px; line-height: 1; }
.car .wheels::before, .car .wheels::after { content: ""; position: absolute; bottom: -14px; width: 22px; height: 22px; border-radius: 50%; background: #374151; border: 4px solid #9CA3AF; }
.car .wheels::before { left: 10px; }
.car .wheels::after { right: 10px; }
.car.hole { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent), 0 5px 0 var(--accent-d); }
.car.hole.filled { background: var(--ok-l); color: #15803D; box-shadow: inset 0 0 0 4px var(--ok), 0 5px 0 #15803D; animation: bounce .6s; }

/* Chia đều */
.cd { display: flex; flex-direction: column; align-items: center; gap: 20px; --ts: 66px; }
.cd-plates { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.cd-plate { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 14px; border-radius: 26px; background: #fff; box-shadow: var(--sh); border: 4px solid transparent; transition: transform .15s, background .2s; }
.cd-friend { font-size: 54px; line-height: 1; }
.cd-dish { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 6px; width: 228px; min-height: 92px; padding: 8px; border-radius: 50%; background: radial-gradient(#FFFFFF 55%, #E5E7EB 56% 62%, #F3F4F6 63%); }
.has-selected .cd-plate, .cd-plate.drop-hover { background: #FFFBEB; border-color: var(--sel); }
.cd-plate.drop-hover { transform: scale(1.04); }
.cd-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 520px; min-height: 66px; }
.cd-dish .tile { box-shadow: none; background: none; }

/* Nhà của ai? */
.hb { display: flex; flex-direction: column; align-items: center; gap: 18px; --ts: 78px; }
.hb-zones { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.hb-zone { width: 220px; min-height: 190px; border-radius: 26px; padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--sh); border: 4px solid rgba(255, 255, 255, .7); transition: transform .15s, border-color .2s; }
.hb-head { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 22px; font-weight: 800; color: #1F2937; }
.hb-ic { font-size: 40px; line-height: 1; }
.hb-list { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 8px; }
.has-selected .hb-zone, .hb-zone.drop-hover { border-color: var(--sel); }
.hb-zone.drop-hover { transform: scale(1.04); }
.hb-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 78px; }

/* Đồ dùng của ai? */
.job-item { flex-direction: column; gap: 0; padding: 6px 18px; }
.job-item .pic, .tool-item .pic { font-size: clamp(44px, 8vmin, 66px); line-height: 1.1; }
.job-name { font-size: 18px; font-weight: 700; color: var(--muted); line-height: 1.15; text-align: center; }

/* Thời tiết */
.wt-scene { position: relative; width: 360px; height: 190px; border-radius: 28px; box-shadow: var(--sh); overflow: hidden; }
.wt-sky { position: absolute; left: 26px; top: 16px; font-size: 92px; line-height: 1; }
.wt-kid { position: absolute; right: 40px; bottom: 10px; font-size: 104px; line-height: 1; }
.wt-name { position: absolute; left: 22px; bottom: 16px; padding: 4px 14px; border-radius: 99px; background: rgba(255, 255, 255, .85); font-size: 24px; }

/* Màu sắc & Hình khối */
.paint { display: block; width: 72%; height: 72%; border-radius: 48% 52% 46% 54% / 54% 46% 54% 46%; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .14), 0 3px 0 rgba(0, 0, 0, .08); }
.shp-wrap { display: grid; place-items: center; width: 78%; height: 78%; }
.shp { width: 100%; height: 100%; overflow: visible; }
.pl { display: flex; flex-direction: column; align-items: center; gap: 18px; --ts: 76px; }
.pl-baskets { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.pl-basket { width: 210px; min-height: 170px; padding: 10px; border-radius: 26px; background: #FFF7ED; box-shadow: var(--sh); border: 4px dashed #E7C9A0; display: flex; flex-direction: column; gap: 8px; transition: transform .15s, border-color .2s; }
.pl-label { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 20px; font-weight: 800; }
.pl-swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15); }
.pl-outline { width: 34px; height: 34px; }
.pl-list { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 8px; }
.has-selected .pl-basket, .pl-basket.drop-hover { border-color: var(--sel); }
.pl-basket.drop-hover { transform: scale(1.04); }
.pl-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 76px; }
.pl-item .shp { width: 74%; height: 74%; }
