/* ---------- Modo Kids ---------- */
/* Tema próprio, claro e colorido, igual em qualquer configuração de cor do sistema. */

.kids {
  --k-bg: #fff8e7;
  --k-sky: #d9f0ff;
  --k-card: #ffffff;
  --k-text: #2b2350;
  --k-muted: #6b6390;
  --k-line: #eadfc8;
  --k-primary: #7c4dff;
  --k-primary-text: #ffffff;
  --k-green: #2eb872;
  --k-red: #f0525e;
  --k-yellow: #ffc83d;
  --k-shadow: 0 4px 0 rgba(43, 35, 80, .12);
  color-scheme: light;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--k-sky) 0, var(--k-bg) 260px);
  color: var(--k-text);
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  font-size: 18px;
}

body.kids-mode { background: #fff8e7; }
body.kids-mode > .topbar,
body.kids-mode > main#app { display: none; }

.kids button { font-family: inherit; color: inherit; }

.kbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(217, 240, 255, .9);
  backdrop-filter: blur(6px);
}
.kbar-space { flex: 1; }
.kwho {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: var(--k-card);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  box-shadow: var(--k-shadow);
  cursor: pointer;
  font-size: 1rem;
}
#kids-who-pic { font-size: 1.4rem; }
.kwho-stars { color: #b07a00; }

.kmain { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; }

/* Palco do Pipo */
.kstage {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.kmascot { border: 0; background: none; padding: 0; cursor: pointer; flex: none; }
.avatar-kids { width: 104px; height: 104px; }
.kbubble {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--k-card);
  border: 3px solid var(--k-line);
  border-radius: 22px 22px 22px 6px;
  padding: 12px 14px;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--k-shadow);
}
#kids-bubble { flex: 1; min-width: 0; }
#kids-bubble p { margin: 0 0 4px; }
#kids-bubble p:last-child { margin-bottom: 0; }
.kids em.en { color: var(--k-primary); font-style: normal; font-weight: 800; }
.kbubble-en { font-weight: 800; color: var(--k-primary); }
.kbubble-pt { color: var(--k-muted); font-size: .95rem; font-weight: 500; }

/* Pipo (corujinha) */
.avatar-owl .av-bg { fill: #ffe7a8; }
.owl-body { fill: #8d5b3a; }
.owl-wing { fill: #6e4329; transform-box: fill-box; }
.owl-wing-l { transform-origin: top right; }
.owl-wing-r { transform-origin: top left; }
.owl-belly { fill: #f3d6ae; }
.owl-dots { fill: none; stroke: #c99a6a; stroke-width: 2; stroke-linecap: round; }
.owl-face { fill: #f6e2c4; }
.owl-eye-white { fill: #ffffff; stroke: #e2c49e; stroke-width: 1.5; }
.owl-shine { fill: #ffffff; }
.owl-brow { fill: none; stroke: #6e4329; stroke-width: 3; stroke-linecap: round; }
.avatar-owl .av-eye { fill: #2b2350; }
.avatar-owl .av-cheek { fill: #ff8fa3; }
.avatar-owl .m-neutral, .avatar-owl .m-happy, .avatar-owl .m-thinking,
.avatar-owl .m-surprised, .avatar-owl .m-talk { fill: #ffa726; stroke: #e07b00; stroke-width: 1; }
.avatar-owl.mood-happy .owl-wing-l { animation: owl-flap-l .35s ease-in-out 3; }
.avatar-owl.mood-happy .owl-wing-r { animation: owl-flap-r .35s ease-in-out 3; }
@keyframes owl-flap-l { 50% { transform: rotate(25deg); } }
@keyframes owl-flap-r { 50% { transform: rotate(-25deg); } }

/* Títulos */
.ktitle { margin: 8px 0 4px; font-size: 1.5rem; text-align: center; }
.ksub { margin: 0 0 12px; text-align: center; color: var(--k-muted); }

/* Cartões grandes */
.kgrid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.kbig-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 14px 10px;
  border: 0;
  border-radius: 26px;
  background: var(--k-card);
  box-shadow: var(--k-shadow);
  cursor: pointer;
  text-align: center;
  transition: transform .1s ease;
}
.kbig-card:active { transform: translateY(3px); box-shadow: none; }
.kbig-card .kpic { font-size: 3.4rem; line-height: 1.1; }
.kcard-title { font-weight: 800; font-size: 1.1rem; }
.kcard-sub { color: var(--k-muted); font-size: .9rem; font-weight: 700; }
.kc-1 { background: #ffe1ec; }
.kc-2 { background: #e3f4d7; }
.kc-3 { background: #dff0ff; }
.kc-4 { background: #fff0c2; }

/* Botões */
.kbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  min-width: 54px;
  padding: 8px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--k-card);
  box-shadow: var(--k-shadow);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.kbtn:active { transform: translateY(3px); box-shadow: none; }
.kbtn:disabled { opacity: .45; cursor: default; transform: none; }
.kbtn-primary { background: var(--k-primary); color: var(--k-primary-text) !important; }
.kbtn-round { border-radius: 50%; padding: 0; width: 54px; }
.kbtn-sm { min-height: 40px; min-width: 40px; width: 40px; font-size: .95rem; flex: none; }
.kbtn-big { min-height: 64px; font-size: 1.25rem; padding: 10px 26px; }
.kbtn-mic { background: var(--k-green); color: #fff !important; }
.kbtn-mic.listening { background: var(--k-red); animation: pulse 1.2s ease-in-out infinite; }
.kbtn-yes { background: var(--k-green); color: #fff !important; min-width: 140px; min-height: 70px; font-size: 1.4rem; }
.kbtn-no { background: var(--k-red); color: #fff !important; min-width: 140px; min-height: 70px; font-size: 1.4rem; }
.kbtn-lock { background: rgba(255, 255, 255, .7); font-size: 1.1rem; width: 44px; min-width: 44px; min-height: 44px; }
.kbtn-link { background: none; box-shadow: none; color: var(--k-muted) !important; font-weight: 600; text-decoration: underline; }

.krow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 12px 0; }
.knav { justify-content: space-between; }
.knav .kbtn-primary { flex: 1; max-width: 260px; }

/* Figuras */
.kpic { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.kpic-md { font-size: 2.6rem; }
.kpic-lg { font-size: 3.6rem; }
.kpic-xl { font-size: 6rem; }
.kpic-scene { letter-spacing: 4px; }
.kpic-digit { font-weight: 900; color: var(--k-primary); }
.kpic-color .kcolor { display: block; width: 1em; height: 1em; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .15); }
.kpic-number { flex-direction: column; gap: 4px; }
.knum { font-weight: 900; color: var(--k-primary); }
.kdots { font-size: .22em; letter-spacing: 2px; color: var(--k-yellow); max-width: 4.5em; text-align: center; word-break: break-all; line-height: 1.2; }

.kplay { display: flex; flex-direction: column; align-items: stretch; }
.kcard-big {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 220px;
  padding: 18px 26px;
  background: var(--k-card);
  border-radius: 30px;
  box-shadow: var(--k-shadow);
}
.kcard-big.kpop { animation: kpop .4s ease; }
@keyframes kpop { 50% { transform: scale(1.08); } }
.kword { margin: 6px 0 0; font-size: 2.2rem; font-weight: 900; color: var(--k-primary); text-align: center; }
.kword-sm { font-size: 1.5rem; }
.kword-pt { margin: 0; color: var(--k-muted); font-size: 1.1rem; font-weight: 700; }

.kdots-row { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.kdot { width: 12px; height: 12px; border-radius: 50%; background: var(--k-line); }
.kdot.done { background: var(--k-green); }
.kdot.now { background: var(--k-primary); transform: scale(1.25); }

.kmic { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0; }
.kmic-echo {
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: var(--k-muted);
  width: 100%;
  pointer-events: none;
}

/* Escolhas com figura */
.kgrid { display: grid; gap: 14px; margin: 12px 0; }
.kgrid-2 { grid-template-columns: repeat(2, 1fr); }
.kgrid-3 { grid-template-columns: repeat(3, 1fr); }
.kgrid-4 { grid-template-columns: repeat(2, 1fr); }
.kchoice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  border: 4px solid transparent;
  border-radius: 26px;
  background: var(--k-card);
  box-shadow: var(--k-shadow);
  cursor: pointer;
}
.kchoice.right { border-color: var(--k-green); background: #e3f8ec; animation: kpop .4s ease; }
.kchoice.wrong { border-color: var(--k-red); background: #ffe8ea; animation: kshake .4s ease; opacity: .7; }
.kchoice-label { font-weight: 800; }
@keyframes kshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Memória */
.kmemory { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); margin: 8px 0; }
.kmem {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 0;
  border-radius: 18px;
  background: var(--k-primary);
  box-shadow: var(--k-shadow);
  cursor: pointer;
  padding: 4px;
}
.kmem-back { font-size: 2rem; }
.kmem-face { display: none; }
.kmem.open, .kmem.matched { background: var(--k-card); }
.kmem.open .kmem-back, .kmem.matched .kmem-back { display: none; }
.kmem.open .kmem-face, .kmem.matched .kmem-face { display: flex; align-items: center; justify-content: center; height: 100%; }
.kmem.matched { outline: 4px solid var(--k-green); }
.kmem-word { font-weight: 900; color: var(--k-primary); font-size: 1rem; overflow-wrap: anywhere; }

/* Soletrar */
.kslots, .ktiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0; }
.kslot {
  width: 48px;
  height: 56px;
  display: grid;
  place-items: center;
  border-bottom: 4px solid var(--k-line);
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: lowercase;
}
.kslot.full { border-color: var(--k-primary); color: var(--k-primary); }
.kslots.right .kslot { border-color: var(--k-green); color: var(--k-green); }
.kslots.wrong .kslot { border-color: var(--k-red); color: var(--k-red); }
.ktile {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 14px;
  background: var(--k-yellow);
  box-shadow: var(--k-shadow);
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
}
.ktile:disabled { opacity: .25; cursor: default; }
.kanswer { font-size: 1.6rem; font-weight: 900; color: var(--k-green); margin: 0; }

/* Conversa */
.kline { margin: 4px 0; text-align: center; font-size: 1.4rem; font-weight: 800; color: var(--k-primary); }
.kline-pt { margin: 0 0 8px; text-align: center; color: var(--k-muted); }
.koptions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0; }
.koption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  min-height: 110px;
  border: 4px solid transparent;
  border-radius: 24px;
  background: var(--k-card);
  box-shadow: var(--k-shadow);
  cursor: pointer;
}
.koption.right { border-color: var(--k-green); background: #e3f8ec; }
.koption.wrong { border-color: var(--k-red); background: #ffe8ea; animation: kshake .4s ease; }
.koption-text { font-weight: 800; font-size: 1.05rem; }
.koption-pt { color: var(--k-muted); font-size: .85rem; }
.ktype {
  flex: 1;
  min-width: 0;
  max-width: 360px;
  height: 54px;
  padding: 0 14px;
  border: 3px solid var(--k-line);
  border-radius: 16px;
  font: inherit;
  background: var(--k-card);
  color: var(--k-text);
}

/* Histórias */
.kstory-title { text-align: center; font-weight: 800; color: var(--k-muted); margin: 0 0 4px; }
.kstory-scene { text-align: center; font-size: 5.5rem; letter-spacing: 6px; line-height: 1.2; margin: 6px 0; }
.kstory-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 4px; margin: 8px 0; }
.kstory-word {
  border: 0;
  background: none;
  padding: 2px 3px;
  border-radius: 8px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--k-text);
  cursor: pointer;
}
.kstory-word:hover, .kstory-word:focus-visible { background: #efe7ff; color: var(--k-primary); }
.kstory-pt { text-align: center; color: var(--k-muted); font-size: 1.1rem; margin: 0 0 6px; }

/* Recompensa e álbum */
.kreward { text-align: center; padding-top: 12px; }
.kreward-stars { font-size: 4rem; display: flex; justify-content: center; gap: 8px; }
.kreward-stars span { animation: kstar .6s ease both; }
.kreward-stars .off { filter: grayscale(1); opacity: .3; }
@keyframes kstar { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1) rotate(0); } }
.ksticker-new { margin: 10px 0; font-weight: 800; }
.ksticker-new p { margin: 4px 0 0; }
.ksticker-pic { font-size: 5rem; display: inline-block; animation: kstar .8s ease .8s both; }
.kalbum { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 10px; }
.ksticker {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  background: var(--k-card);
  border-radius: 18px;
  box-shadow: var(--k-shadow);
}
.ksticker.locked { color: var(--k-line); font-weight: 900; font-size: 1.6rem; background: #fbf4e4; box-shadow: none; }

/* Trava */
.kpin-dots { text-align: center; font-size: 2rem; letter-spacing: 10px; margin: 8px 0; color: var(--k-primary); }
.kpin-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; margin: 10px 0; }
.kpin-key {
  height: 64px;
  border: 0;
  border-radius: 18px;
  background: var(--k-card);
  box-shadow: var(--k-shadow);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}
.kpin-math { display: flex; flex-direction: column; align-items: center; gap: 10px; }

@media (max-width: 480px) {
  .kids { font-size: 17px; }
  .avatar-kids { width: 84px; height: 84px; }
  .kbig-card { min-height: 130px; }
  .kbig-card .kpic { font-size: 2.8rem; }
  .kpic-xl { font-size: 5rem; }
  .kstory-scene { font-size: 4.2rem; }
  .kmemory-12 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .kchoice { min-height: 100px; }
  .kslots { gap: 5px; flex-wrap: nowrap; }
  .kslot { width: 36px; font-size: 1.5rem; }
  .ktile { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .kreward-stars span, .ksticker-pic, .kchoice.right, .kchoice.wrong, .koption.wrong, .kcard-big.kpop { animation: none; }
}

/* ---------- Painel dos pais (parte adulta) ---------- */

.parents { display: grid; gap: 12px; }
.pintro p { margin: 6px 0 0; }
.pform { display: flex; flex-direction: column; gap: 10px; }
.pform h3, .pchild h3 { margin: 0; }
.pform p { margin: 0; }
.prow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.prow .field { flex: 1 1 140px; }
.pform input, .pform select {
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
.ppics { display: flex; flex-wrap: wrap; gap: 6px; }
.ppic {
  width: 46px;
  height: 46px;
  font-size: 1.6rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}
.ppic.on { border-color: var(--primary); background: var(--surface-2); }
.pchild-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pchild-pic { font-size: 2.4rem; }
.pchild-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.pstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.pstat { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.pstat-value { font-size: 1.3rem; font-weight: 800; }
.pstat-label { color: var(--muted); font-size: .8rem; }
.pthemes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pthemes li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.pbar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pbar > span { display: block; height: 100%; background: var(--great); }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pchips .chip { cursor: default; }
.plog { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.plog li { display: grid; grid-template-columns: 110px 1fr auto; gap: 8px; }

.kbig-card.klocked { filter: grayscale(.7); opacity: .75; }
