:root {
  --sky-top: #7fd1ff;
  --sky-bottom: #e8f8ff;
  --card-bg: #ffffff;
  --ink: #243447;
  --muted: #5c7085;
  --primary: #2b8af7;
  --primary-dark: #1968c4;
  --good: #2fbf71;
  --good-dark: #219657;
  --bad: #ff5c6c;
  --warn: #ffb703;
  --radius: 24px;
  --shadow: 0 10px 26px rgba(28, 72, 117, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Baloo 2', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 65%, #d6f5d6 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

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

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  filter: blur(1px);
  animation: drift 42s linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.c1 { width: 150px; height: 48px; top: 8%; left: -160px; animation-duration: 48s; }
.c1::before { width: 64px; height: 64px; top: -28px; left: 24px; }
.c1::after { width: 52px; height: 52px; top: -20px; right: 26px; }
.c2 { width: 190px; height: 56px; top: 20%; left: -210px; animation-duration: 62s; animation-delay: -22s; opacity: .7; }
.c2::before { width: 78px; height: 78px; top: -36px; left: 32px; }
.c2::after { width: 62px; height: 62px; top: -24px; right: 32px; }
.c3 { width: 130px; height: 42px; top: 34%; left: -140px; animation-duration: 54s; animation-delay: -35s; opacity: .6; }
.c3::before { width: 56px; height: 56px; top: -24px; left: 22px; }

@keyframes drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 320px)); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(20, 60, 100, 0.08);
  flex-wrap: wrap;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  color: #1c5db5;
}
.brand b { color: #ff6b35; }
.brand-icon { width: 32px; height: 32px; }

.pill-btn {
  border: 0;
  background: #f0f6ff;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 #d1e3fb;
  transition: transform 0.1s ease, background 0.15s;
}
.pill-btn:hover { background: #e3efff; }
.pill-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d1e3fb; }
.pill-btn.active { background: #ffe9b3; box-shadow: 0 3px 0 #e6bd5c; }

.star-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff4cc;
  border: 2px solid #ffd15c;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  color: #b56500;
}
.star-badge img { width: 22px; height: 22px; }

.container {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.loading {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
}

.hero {
  text-align: center;
  margin-bottom: 26px;
}
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.15;
  color: #164b91;
}
.hero p {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.island-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.island-card {
  position: relative;
  border: 0;
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  text-align: center;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.16), var(--shadow);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.island-card:hover { transform: translateY(-4px); }
.island-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.16); }
.island-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18));
}
.island-card .title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.island-card .sub {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.92;
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 10px;
  border-radius: 999px;
}

.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #164b91;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab-btn {
  border: 0;
  background: #edf4fc;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--primary-dark);
  transition: transform 0.1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--primary-dark); }
.btn.good { background: var(--good); box-shadow: 0 5px 0 var(--good-dark); }
.btn.good:active { box-shadow: 0 2px 0 var(--good-dark); }
.btn.soft { background: #edf4fc; color: var(--ink); box-shadow: 0 4px 0 #d0e1f7; }

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
}
.letter-tile {
  border: 2px solid #e2eefc;
  background: #f9fcff;
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.letter-tile:hover { transform: translateY(-3px); border-color: var(--primary); background: #eff7ff; }
.letter-tile .big-ch { font-size: 38px; font-weight: 800; line-height: 1; color: #ff6b35; }
.letter-tile img { width: 46px; height: 46px; object-fit: contain; margin: 6px auto 2px; display: block; }
.letter-tile .word { font-size: 14px; font-weight: 700; color: var(--muted); }

.quiz-box {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.prompt-card {
  background: #f4faff;
  border: 2px solid #d9ecff;
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
}
.prompt-text {
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 800;
  margin: 0 0 12px;
  color: #164b91;
}
.prompt-img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 16px;
  margin: 8px auto;
  display: block;
}
.prompt-img.photo {
  width: 220px;
  height: 160px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.choice-btn {
  border: 3px solid #dbe9fb;
  background: #fff;
  border-radius: 20px;
  padding: 16px 12px;
  font-family: inherit;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 5px 0 #d5e4f7;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.choice-btn:hover { border-color: var(--primary); }
.choice-btn:active { transform: translateY(3px); }
.choice-btn img { width: 78px; height: 78px; object-fit: contain; }
.choice-btn img.photo { width: 120px; height: 90px; object-fit: cover; border-radius: 12px; }
.choice-btn.correct { background: #dff9ea; border-color: var(--good); color: #167944; }
.choice-btn.wrong { background: #ffe4e7; border-color: var(--bad); animation: shake 0.3s; }

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

.count-stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  min-height: 150px;
  align-items: center;
}
.count-item {
  width: 66px;
  height: 66px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.15s;
}
.count-item.counted { transform: scale(1.16) rotate(-6deg); filter: drop-shadow(0 0 8px #ffb703); }

.trace-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.trace-canvas {
  width: 100%;
  max-width: 420px;
  height: 360px;
  background: #fffdf7;
  border: 3px dashed #8bc5ff;
  border-radius: 22px;
  touch-action: none;
  cursor: crosshair;
}
.swatch-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.swatch.active { transform: scale(1.2); border-color: #243447; }

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.story-card {
  border: 2px solid #e2eefc;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.12s;
}
.story-card:hover { transform: translateY(-3px); border-color: #ff8a5b; }
.story-card img { width: 72px; height: 72px; object-fit: contain; }
.story-card .st-title { font-size: 16px; font-weight: 800; margin-top: 6px; color: var(--ink); }

.story-page {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.story-imgs { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 14px 0; }
.story-imgs img { width: 112px; height: 112px; object-fit: contain; }
.story-lines { font-size: 24px; font-weight: 700; line-height: 1.5; color: #1d3557; margin: 14px 0 20px; }

.topic-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 14px;
}
.vocab-card {
  border: 2px solid #e2eefc;
  background: #f9fcff;
  border-radius: 18px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}
.vocab-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.vocab-card img { width: 82px; height: 82px; object-fit: contain; border-radius: 12px; }
.vocab-card img.photo { width: 116px; height: 86px; object-fit: cover; }
.vocab-card .en { font-size: 20px; font-weight: 800; margin-top: 6px; color: #164b91; }
.color-dot { width: 68px; height: 68px; border-radius: 50%; margin: 6px auto; border: 3px solid rgba(0, 0, 0, 0.12); }

.memory-grid {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin: 12px auto 0;
}
.mem-card {
  aspect-ratio: 1;
  border: 3px solid #cce3ff;
  border-radius: 18px;
  background: linear-gradient(135deg, #4fb3ff, #2b8af7);
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: transform 0.15s;
}
.mem-card.open, .mem-card.matched {
  background: #fff;
  color: var(--ink);
  border-color: var(--good);
}
.mem-card img { width: 64%; height: 64%; object-fit: contain; }
.mem-card span { font-size: 13px; font-weight: 700; margin-top: 2px; }

.feedback {
  min-height: 32px;
  font-size: 20px;
  font-weight: 800;
  margin-top: 12px;
}
.feedback.ok { color: var(--good-dark); }
.feedback.err { color: var(--bad); }

.footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 14px 16px 28px;
  font-size: 14px;
  color: var(--muted);
}
.link-btn {
  border: 0;
  background: none;
  color: #1968c4;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 32, 56, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal {
  background: #fff;
  border-radius: 22px;
  max-width: 680px;
  width: 100%;
  max-height: 82vh;
  overflow: auto;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.credits-list {
  font-size: 13px;
  line-height: 1.5;
  max-height: 46vh;
  overflow: auto;
  background: #f7fafd;
  border-radius: 12px;
  padding: 12px;
}

.hidden { display: none !important; }

#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.confetti {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 3px;
  animation: fall 1.3s ease-in forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: 0; }
}

/* ---- Block Coding (Lập trình kéo thả) ---- */
.code-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 760px) {
  .code-layout { grid-template-columns: 1fr; }
}

.code-board {
  display: grid;
  gap: 6px;
  background: #b7e8a8;
  padding: 10px;
  border-radius: 22px;
  border: 4px solid #8bd478;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.08);
  aspect-ratio: 1;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.code-cell {
  background: #e9fae1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid #cef0c0;
}
.code-cell.rock { background: #d6dde5; border-color: #bcc6d1; }
.code-cell.watered { background: #fff8d6; border-color: #ffd15c; }
.code-cell img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  transition: transform 0.22s ease;
}
.code-cell .robot-img {
  position: absolute;
  width: 82%;
  height: 82%;
  z-index: 3;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
}
.code-cell .dir-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 13px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0 4px;
  line-height: 1.2;
}

.code-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.code-box {
  background: #f6faff;
  border: 2px solid #d7e8fb;
  border-radius: 18px;
  padding: 14px;
}
.code-box h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #164b91;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cmd-block {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  cursor: grab;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.12s, box-shadow 0.12s, outline 0.12s;
}
.cmd-block:active { cursor: grabbing; transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.cmd-block.cmd-move { background: #339af0; }
.cmd-block.cmd-turn { background: #845ef7; }
.cmd-block.cmd-jump { background: #f59f00; }
.cmd-block.cmd-water { background: #20c997; }
.cmd-block.running { outline: 4px solid #ffb703; transform: scale(1.08); }

.program-track {
  min-height: 92px;
  background: #fff;
  border: 3px dashed #9fc9f7;
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.program-track.drag-over {
  background: #e7f3ff;
  border-color: #2b8af7;
}
.program-empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 20px 8px;
  pointer-events: none;
}
.prog-chip {
  position: relative;
  padding-right: 26px;
}
.prog-chip .rm {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.85;
}
.code-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Numbers module (Học số) ---- */
.num-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.num-dots {
  font-size: 11px;
  letter-spacing: 2px;
  color: #ff8a5b;
  margin: 4px 0 2px;
  line-height: 1.3;
  word-break: break-all;
}
.order-done {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 20px;
  font-weight: 800;
  color: #167944;
}
.order-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  background: #dff9ea;
  border: 2px solid #2fbf71;
  color: #167944;
}

/* ---- Toddler Modules: Colors/Shapes, Shadow Match, Rainbow Piano ---- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}
.color-card {
  border: 3px solid #e2eefc;
  background: #fff;
  border-radius: 20px;
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.color-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.color-card .label { font-size: 18px; font-weight: 800; color: var(--ink); }
.color-swatch-big {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}
.shape-svg { width: 76px; height: 76px; display: block; }

.shadow-target {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin: 8px auto;
  display: block;
  filter: brightness(0) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
  transition: filter 0.35s ease, transform 0.35s ease;
}
.shadow-target.revealed {
  filter: none;
  transform: scale(1.12);
}

.piano-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  max-width: 760px;
  margin: 18px auto 8px;
  padding: 16px 12px 20px;
  background: #f4f9ff;
  border: 3px solid #d5e8fc;
  border-radius: 26px;
}
@media (max-width: 600px) {
  .piano-stage { gap: 5px; padding: 12px 6px 16px; }
}
.piano-key {
  border: 0;
  border-radius: 16px 16px 24px 24px;
  min-height: 190px;
  color: #fff;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 16px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  user-select: none;
  position: relative;
}
.piano-key:active, .piano-key.pressed {
  transform: translateY(6px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  filter: brightness(1.12);
}
.piano-key.guide {
  animation: pulse-key 0.8s infinite alternate;
  outline: 5px solid #ffd15c;
  outline-offset: 2px;
}
.piano-key .dot-top {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  position: absolute;
  top: 14px;
}
@keyframes pulse-key {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-6px) scale(1.04); }
}
.song-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.note-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dbe8f8;
}
.note-dot.done { background: #2fbf71; }
.note-dot.curr { background: #ff8a5b; transform: scale(1.3); }

/* ---- Bubble Pop (Đập bong bóng) ---- */
.bubble-stage {
  position: relative;
  height: 440px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, #a5dcff 0%, #ddf3ff 65%, #c2f0fc 100%);
  border: 3px solid #96d1fa;
  user-select: none;
  touch-action: manipulation;
}
.bubble-item {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset -8px -10px 18px rgba(0, 0, 0, 0.08), inset 8px 8px 16px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(20, 80, 140, 0.14);
  transition: transform 0.08s ease;
  will-change: transform, left, top;
}
.bubble-item::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 18px;
  width: 20px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  transform: rotate(-28deg);
  pointer-events: none;
}
.bubble-item img { width: 54px; height: 54px; object-fit: contain; pointer-events: none; }
.bubble-item .b-num { font-size: 38px; font-weight: 800; color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); pointer-events: none; }
.bubble-pop-ring {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 5px solid #fff;
  pointer-events: none;
  animation: pop-ring 0.35s ease-out forwards;
}
@keyframes pop-ring {
  from { transform: scale(0.8); opacity: 1; }
  to { transform: scale(1.65); opacity: 0; }
}
.bubble-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  background: #f4faff;
  border: 2px solid #d7eaff;
  border-radius: 18px;
  padding: 10px 16px;
  font-size: 18px;
  font-weight: 800;
}

/* ---- Virtual Pet Care (Chăm thú cưng) ---- */
.pet-room {
  position: relative;
  border-radius: 24px;
  padding: 26px 18px 22px;
  text-align: center;
  background: linear-gradient(180deg, #d7f3ff 0%, #eefaff 62%, #cdeeb9 62%, #b5e49d 100%);
  border: 3px solid #b5e0fa;
  overflow: hidden;
  transition: background 0.5s ease;
}
.pet-room.night {
  background: linear-gradient(180deg, #1b2845 0%, #274060 62%, #2c4a3e 62%, #20382e 100%);
  color: #fff;
}
.pet-bars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 18px;
}
.pet-bar {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}
.pet-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e4eef7;
  overflow: hidden;
  margin-top: 5px;
}
.pet-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}
.pet-stage {
  position: relative;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pet-avatar {
  width: 164px;
  height: 164px;
  object-fit: contain;
  cursor: pointer;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.18));
  transition: transform 0.2s ease;
  user-select: none;
}
.pet-avatar.hop { animation: pet-hop 0.45s ease; }
.pet-avatar.sleep { transform: scale(0.94) rotate(-5deg); filter: brightness(0.92); }
@keyframes pet-hop {
  0% { transform: scale(1) translateY(0); }
  35% { transform: scale(1.12, 0.92) translateY(-22px); }
  70% { transform: scale(0.95, 1.06) translateY(4px); }
  100% { transform: scale(1) translateY(0); }
}
.pet-float {
  position: absolute;
  font-size: 32px;
  pointer-events: none;
  animation: float-up 1s ease-out forwards;
}
@keyframes float-up {
  from { transform: translateY(0) scale(0.8); opacity: 1; }
  to { transform: translateY(-75px) scale(1.25); opacity: 0; }
}
.soap-foam {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, rgba(215, 245, 255, 0.85));
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  animation: pulse-key 0.9s infinite alternate;
}
.pet-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.pet-action-btn {
  border: 2px solid #dbe9fb;
  background: #fff;
  border-radius: 18px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 0 #d0e1f7;
  transition: transform 0.1s;
}
.pet-action-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #d0e1f7; }
.pet-action-btn img { width: 28px; height: 28px; object-fit: contain; }

/* ---- Coloring Book (Tô màu) ---- */
.coloring-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 780px) {
  .coloring-layout { grid-template-columns: 1fr; }
}
.coloring-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 400 / 360;
  margin: 0 auto;
  background: #fff;
  border: 4px solid #cbe2fa;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(28, 72, 117, 0.1);
}
.coloring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.coloring-svg * {
  stroke: #243447;
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.coloring-svg .fill-region {
  cursor: pointer;
  transition: fill 0.16s ease;
}
.coloring-svg .fill-region:hover {
  filter: brightness(0.96);
}
.coloring-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  pointer-events: none;
}
.coloring-canvas.brush-active {
  pointer-events: auto;
  cursor: crosshair;
}
.coloring-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 10px;
  background: #f5faff;
  border: 2px solid #d7e8fb;
  border-radius: 18px;
  padding: 12px;
}
.color-dot-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.12s;
  margin: 0 auto;
}
.color-dot-btn.active {
  transform: scale(1.22);
  border-color: #243447;
}
.template-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

