/* ===== AI Kids Lab — shared playful styles ===== */
:root {
  --pink: #ff6b9d;
  --purple: #9b5de5;
  --blue: #4ea8ff;
  --green: #2ec4b6;
  --yellow: #ffd166;
  --orange: #ff8c42;
  --ink: #2b2d42;
  --paper: #fff;
  --soft: #fff7fb;
  --radius: 28px;
  --shadow: 0 10px 0 rgba(0,0,0,.12), 0 18px 40px rgba(0,0,0,.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Comic Sans MS", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #ffe3f1 0%, #e7f0ff 50%, #e3fff4 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* floating background blobs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(8px);
  opacity: .35;
  z-index: 0;
  animation: float 9s ease-in-out infinite;
}
body::before { width: 240px; height: 240px; background: var(--yellow); top: -60px; right: -40px; }
body::after  { width: 300px; height: 300px; background: var(--green); bottom: -80px; left: -60px; animation-delay: 2s; }
@keyframes float { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-24px) } }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 18px 120px;
}

/* ---- Header ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.logo {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  text-shadow: 3px 3px 0 #fff;
}
.logo .dot { color: var(--pink); }

h1.title {
  text-align: center;
  font-size: clamp(34px, 7vw, 72px);
  margin: 6px 0 2px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.subtitle {
  text-align: center;
  font-size: clamp(18px, 3vw, 26px);
  margin: 0 0 18px;
  opacity: .85;
}

/* ---- Big round buttons ---- */
.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(6px) scale(.98); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.btn:hover { filter: brightness(1.06); }

.btn-xl {
  font-size: clamp(22px, 3.5vw, 30px);
  padding: 22px 28px;
}

/* circle helper buttons (listen, home, etc.) */
.fab {
  position: fixed;
  bottom: 22px;
  z-index: 50;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  font-size: 38px;
  display: grid;
  place-items: center;
}
.fab.home  { left: 22px;  background: var(--orange); }
.fab.listen{ right: 22px; background: var(--purple); }
.fab.lang  { right: 120px; background: var(--blue); font-size: 26px; font-weight: 900; }

/* sticker badge */
.sticker-badge {
  position: fixed; top: 16px; right: 16px; z-index: 40;
  background: #fff; border-radius: 999px; padding: 8px 16px;
  box-shadow: var(--shadow); font-weight: 900; font-size: 20px;
}

/* mixer slots */
.mix-slots { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.mix-slot {
  width: 150px; height: 150px; border-radius: 24px; background: var(--soft);
  border: 5px dashed var(--purple); display: grid; place-items: center;
  font-size: 80px; cursor: pointer;
}
.mix-plus { font-size: 44px; font-weight: 900; }

/* coloring */
#paint { width: 100%; max-width: 700px; height: 460px; border-radius: 22px; background: #fff;
  box-shadow: var(--shadow); touch-action: none; cursor: crosshair; display: block; margin: 0 auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.2); cursor: pointer; }
.swatch.sel { outline: 4px solid var(--ink); }

/* story book */
.book { max-width: 620px; margin: 0 auto; }
.book-page { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.book-page img { width: 100%; max-width: 520px; border-radius: 18px; }
.book-text { font-size: clamp(20px, 3vw, 26px); line-height: 1.5; margin-top: 12px; min-height: 2.2em; }
.book-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.page-dots { font-size: 18px; font-weight: 900; opacity: .7; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.gallery-grid img { width: 100%; border-radius: 16px; box-shadow: var(--shadow); }

/* ---- Card grid (hub) ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 18px;
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease;
  border: 6px solid transparent;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.card:hover { transform: translateY(-8px) rotate(-1deg); }
.card .emoji { font-size: 84px; display: block; line-height: 1; }
.card .label { font-size: 26px; font-weight: 900; margin-top: 10px; }
.card .hint { font-size: 17px; opacity: .7; margin-top: 4px; }

.card.c1 { border-color: var(--pink); }
.card.c2 { border-color: var(--blue); }
.card.c3 { border-color: var(--green); }
.card.c4 { border-color: var(--orange); }
.card.c5 { border-color: var(--purple); }
.card.c6 { border-color: var(--yellow); }

/* ---- Age zone pills ---- */
.zones { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 6px 0 4px; }
.zone {
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
}
.zone.a { background: var(--pink); }
.zone.b { background: var(--blue); }
.zone.c { background: var(--green); }

/* ---- Activity panel ---- */
.panel {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-top: 16px;
}
.big-input {
  width: 100%;
  font-family: inherit;
  font-size: clamp(20px, 3vw, 28px);
  padding: 18px 22px;
  border-radius: 22px;
  border: 4px solid var(--purple);
  outline: none;
}
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.center { justify-content: center; }

/* suggestion chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.chip {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 4px 0 rgba(0,0,0,.08);
}
.chip:active { transform: translateY(3px); }

/* output image */
.stage {
  margin-top: 18px;
  min-height: 220px;
  border-radius: 22px;
  background: var(--soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.stage img { width: 100%; max-width: 560px; border-radius: 22px; display: block; }

/* loading dots */
.loading { font-size: 26px; font-weight: 900; }
.loading span { display: inline-block; animation: bounce .8s infinite; }
.loading span:nth-child(2){ animation-delay: .1s }
.loading span:nth-child(3){ animation-delay: .2s }
@keyframes bounce { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(-12px) } }

/* speech bubble for story/chat */
.bubble {
  background: var(--soft);
  border-radius: 22px;
  padding: 22px 24px;
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.5;
  margin-top: 16px;
  white-space: pre-wrap;
}

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* teacher curriculum */
.doc { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; margin-top: 16px; }
.doc h2 { font-size: 30px; margin-top: 26px; }
.doc h3 { font-size: 23px; color: var(--purple); }
.doc ul { font-size: 19px; line-height: 1.6; }
.band { border-left: 10px solid var(--pink); padding-left: 16px; margin: 18px 0; }
.band.b2 { border-color: var(--blue); }
.band.b3 { border-color: var(--green); }

@media (max-width: 520px) {
  .fab { width: 72px; height: 72px; font-size: 30px; }
}
