/* Exploradores do Saber — playful, high-contrast, kid-friendly UI.
   Baloo 2 (display) + Nunito (body). Purple/blue base with warm accents. */
:root {
  --ink: #1E1B4B;
  --violet: #6D28D9;
  --violet-2: #8B5CF6;
  --blue: #3B82F6;
  --accent: #F59E0B;
  --pink: #EC4899;
  --green: #16A34A;
  --red: #DC2626;
  --bg: #F5F3FF;
  --card: #FFFFFF;
  --line: #E9E3FB;
  --muted: #6B7280;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(76, 29, 149, .12);
  --shadow-sm: 0 4px 14px rgba(76, 29, 149, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #EDE9FE 0%, #F5F3FF 40%, #FDF2F8 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3, .brand-name, .btn { font-family: 'Baloo 2', 'Nunito', sans-serif; }
.boot { display: grid; place-items: center; min-height: 100vh; font-size: 22px; color: var(--violet); font-family: 'Baloo 2'; }
.muted { color: var(--muted); }

/* ── Layout ── */
.container { max-width: 1040px; margin: 0 auto; padding: 22px 18px 60px; }
.container.narrow { max-width: 640px; }
.page-title { font-size: 28px; margin: 8px 2px 20px; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 26px; }
.brand-name { font-weight: 800; font-size: 18px; line-height: 1; color: var(--violet); }
.brand-sub { font-size: 11px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 700; color: var(--ink); }

/* ── Buttons ── */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-lg { padding: 14px 22px; font-size: 17px; width: 100%; margin-top: 6px; }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { box-shadow: var(--shadow); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--pink)); color: #fff; box-shadow: var(--shadow-sm); }
.btn-ghost { background: #fff; color: var(--violet); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--violet-2); }
.link-btn { background: none; border: 0; color: var(--violet); font-weight: 700; cursor: pointer; padding: 8px; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }

/* ── Auth ── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-logo { font-size: 54px; }
.auth-card h1 { margin: 6px 0 4px; color: var(--violet); font-size: 26px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 13px; }
.fields { display: grid; gap: 12px; margin: 18px 0 8px; text-align: left; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-weight: 700; font-size: 14px; }
.field input, .field select, .field textarea, .select {
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; font: inherit; background: #fff; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--violet-2); }
/* Visible keyboard focus ring everywhere (mouse focus stays clean via :focus-visible). */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--violet-2); outline-offset: 2px; border-radius: 8px; }
.form-err { color: var(--red); font-weight: 700; font-size: 14px; min-height: 18px; }
.form-err.big { padding: 14px; background: #FEF2F2; border-radius: 14px; margin-top: 14px; }

/* ── Child grid (parent home) ── */
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.child-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 16px; text-align: center;
  cursor: pointer; transition: transform .12s ease, box-shadow .15s; font: inherit; box-shadow: var(--shadow-sm);
}
.child-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--violet-2); }
.child-avatar { font-size: 52px; }
.child-name { font-family: 'Baloo 2'; font-weight: 700; font-size: 20px; margin-top: 6px; }
.child-meta { color: var(--muted); font-size: 13px; }
.child-level { font-weight: 700; font-size: 13px; margin: 8px 0 6px; color: var(--violet); }
.child-card.add { display: grid; place-items: center; gap: 6px; border-style: dashed; color: var(--violet); }
.child-card.add .plus { font-size: 40px; font-weight: 800; }

/* ── Avatar picker ── */
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.avatar-opt { font-size: 28px; padding: 6px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.avatar-opt.on { border-color: var(--violet); background: #F5F3FF; transform: scale(1.05); }

/* ── Level bar ── */
.level { margin-top: 14px; }
.level-top { display: flex; justify-content: space-between; font-weight: 700; }
.xp { color: var(--accent); }
.bar { height: 12px; background: #EEE9FB; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.bar.sm { height: 8px; margin-top: 8px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--pink)); border-radius: 999px; transition: width .5s ease; }
.level-next { font-size: 12px; color: var(--muted); }

/* ── Child hero ── */
.child-hero { margin-bottom: 18px; }
.child-hero-top { display: flex; align-items: center; gap: 16px; }
.hero-avatar { font-size: 54px; }
.hero-id { flex: 1; }
.hero-id h2 { margin: 0; }

/* ── Area filters ── */
.area-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chip {
  border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--chip, var(--violet)); color: #fff; border-color: transparent; }
.example-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.example-chips .chip { font-weight: 600; font-size: 13px; }

/* ── Topic grid ── */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.topic-card { border-top: 6px solid var(--accent); }
.topic-head { display: flex; align-items: center; gap: 12px; }
.topic-emoji { font-size: 34px; }
.topic-title { font-family: 'Baloo 2'; font-weight: 700; font-size: 19px; }
.topic-area { font-size: 12px; color: var(--muted); font-weight: 700; }
.topic-desc { color: #4B5563; font-size: 14px; margin: 10px 0; }
.technique { font-size: 12px; font-weight: 700; color: var(--violet); background: #F5F3FF; padding: 6px 10px; border-radius: 10px; display: inline-block; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px; }
.act-dot {
  min-width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font-size: 18px; cursor: pointer; display: grid; place-items: center; font-weight: 700; transition: transform .1s;
}
.act-dot:hover { transform: translateY(-2px); border-color: var(--violet-2); }
.act-dot.done { background: linear-gradient(135deg, #FDE68A, #FBBF24); border-color: #F59E0B; color: #7C2D12; letter-spacing: -1px; }
.topic-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 700; gap: 8px; }
.cref { font-weight: 600; font-size: 11px; text-align: right; }
.cref.block { display: block; background: #F5F3FF; padding: 8px 10px; border-radius: 10px; margin: 8px 0; text-align: left; }
.tag.ai { background: linear-gradient(135deg, var(--pink), var(--accent)); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 800; }
.badge-dot { margin-left: 2px; }

/* ── Play / games ── */
.play-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.play-emoji { font-size: 40px; }
.game-card { min-height: 320px; display: grid; }
.game-stage { display: grid; }
.game { display: grid; gap: 16px; place-items: center; text-align: center; width: 100%; }
.game-progress { font-weight: 800; color: var(--violet); background: #F5F3FF; padding: 4px 14px; border-radius: 999px; justify-self: center; }
.q-emoji { font-size: 60px; }
.q-prompt { font-family: 'Baloo 2'; font-size: 22px; font-weight: 700; }
.q-hint { color: var(--muted); font-weight: 700; }
.options { display: grid; gap: 12px; width: 100%; max-width: 420px; }
.options-inline { grid-auto-flow: column; justify-content: center; }
.opt {
  padding: 16px; border: 3px solid var(--line); border-radius: 16px; background: #fff; font: inherit;
  font-family: 'Baloo 2'; font-weight: 700; font-size: 20px; cursor: pointer; transition: transform .1s, border-color .1s;
}
.opt:hover:not(:disabled) { border-color: var(--violet-2); transform: translateY(-2px); }
.opt-num { min-width: 76px; font-size: 26px; }
.opt.right { background: #DCFCE7; border-color: var(--green); }
.opt.wrong { background: #FEE2E2; border-color: var(--red); }

.count-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 420px; }
.count-item { font-size: 40px; animation: pop .3s ease; }

.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; width: 100%; max-width: 480px; }
.match-col { display: grid; gap: 10px; }
.match-card { padding: 14px; border: 3px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; }
.match-card.sel { border-color: var(--violet); background: #F5F3FF; }
.match-card.solved { background: #DCFCE7; border-color: var(--green); opacity: .7; cursor: default; }
.match-card.shake { animation: shake .4s; border-color: var(--red); }

.seq-answer { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.seq-slot { min-width: 84px; padding: 12px; border: 3px dashed var(--line); border-radius: 14px; color: var(--muted); font-weight: 700; }
.seq-slot.filled { border-style: solid; color: var(--ink); background: #F5F3FF; }
.seq-slot.right { border-style: solid; background: #DCFCE7; border-color: var(--green); color: var(--ink); }
.seq-slot.wrong { border-style: solid; background: #FEE2E2; border-color: var(--red); color: var(--ink); }
.seq-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.seq-tile, .spell-tile { padding: 12px 16px; border: 3px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; }
.seq-tile:hover, .spell-tile:hover { border-color: var(--violet-2); transform: translateY(-2px); }

.spell-slots { display: flex; gap: 8px; justify-content: center; }
.spell-slot { width: 46px; height: 54px; border: 3px solid var(--line); border-radius: 12px; display: grid; place-items: center; font-family: 'Baloo 2'; font-weight: 800; font-size: 26px; background: #fff; }
.spell-slots.right .spell-slot { background: #DCFCE7; border-color: var(--green); }
.spell-slots.wrong .spell-slot { background: #FEE2E2; border-color: var(--red); }
.spell-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ── Result ── */
.result-card { text-align: center; }
.result-emoji { font-size: 72px; animation: pop .4s ease; }
.stars { letter-spacing: 4px; color: var(--accent); font-size: 22px; }
.stars.big { font-size: 40px; }
.levelup { background: linear-gradient(135deg, #FEF3C7, #FDE68A); padding: 12px; border-radius: 14px; font-weight: 800; color: #92400E; margin: 12px 0; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ── Request / AI ── */
.req-out { margin-top: 16px; }
.req-loading { display: flex; align-items: center; gap: 14px; padding: 20px; font-weight: 700; color: var(--violet); }
.spinner { width: 26px; height: 26px; border: 4px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: spin 1s linear infinite; }
.req-result .technique-card { background: #F5F3FF; border-radius: 14px; padding: 14px; margin: 12px 0; }
.req-result .technique-card p { margin: 6px 0 0; color: #4B5563; }
.note-warn { background: #FEF9C3; border-radius: 12px; padding: 12px; font-weight: 700; color: #854D0E; }
.req-actions { margin-top: 14px; }

/* ── Empty ── */
.empty { text-align: center; padding: 48px; }
.empty-emoji { font-size: 54px; }

/* ── Toast + confetti ── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 700; transition: transform .3s; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti span { position: absolute; top: -40px; animation: fall 2.2s ease-in forwards; }

/* Respect users who prefer less motion — calm the animations right down. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .confetti { display: none; }
}

@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: .9; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ── Extra controls ── */
.icon-btn { padding: 8px 12px; font-size: 18px; }
.hero-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.technique .flag { margin-right: 4px; }
.levelup.soft { background: #EDE9FE; color: var(--violet); }
.pw-field input { border-color: var(--violet-2); }
.field-label { display: block; margin: 6px 0; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.type-chips .chip { font-size: 13px; font-weight: 700; }

/* ── TRUE / FALSE ── */
.tf-btns { display: flex; gap: 14px; }
.tf { padding: 16px 26px; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-family: 'Baloo 2'; font-weight: 700; font-size: 20px; cursor: pointer; }
.tf-true:hover:not(:disabled) { border-color: var(--green); }
.tf-false:hover:not(:disabled) { border-color: var(--red); }
.tf.right { background: #DCFCE7; border-color: var(--green); }
.tf.wrong { background: #FEE2E2; border-color: var(--red); }

/* ── MEMORY ── */
.memory-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 420px; }
.mem-card { aspect-ratio: 1; border-radius: 14px; border: 3px solid var(--violet-2); background: linear-gradient(135deg, var(--violet), var(--blue)); cursor: pointer; font-size: 24px; display: grid; place-items: center; }
.mem-card .mem-face { opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.mem-card.open, .mem-card.done { background: #fff; }
.mem-card.open .mem-face, .mem-card.done .mem-face { opacity: 1; transform: scale(1); }
.mem-card.done { border-color: var(--green); background: #DCFCE7; cursor: default; }
@media (max-width: 420px) { .memory-board { grid-template-columns: repeat(3, 1fr); } }

/* ── SORT ── */
.sort-buckets { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sort-bucket { display: grid; place-items: center; gap: 4px; min-width: 100px; padding: 14px; border: 3px dashed var(--violet-2); border-radius: 16px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.sort-bucket .bkt-emoji { font-size: 28px; }
.sort-bucket:hover { background: #F5F3FF; }
.sort-hint { font-size: 13px; }
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sort-item { padding: 12px 14px; border: 3px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.sort-item.sel { border-color: var(--violet); background: #F5F3FF; transform: scale(1.05); }
.sort-item.gone { opacity: 0; pointer-events: none; transition: opacity .3s; }

/* ── TAP ALL ── */
.tap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 360px; }
.tap-item { aspect-ratio: 1; border-radius: 14px; border: 3px solid var(--line); background: #fff; font-size: 26px; font-weight: 800; cursor: pointer; font-family: 'Baloo 2'; }
.tap-item.on { border-color: var(--violet); background: #EDE9FE; transform: scale(1.05); }
.tap-item.was-good { background: #DCFCE7; border-color: var(--green); }
.tap-item.was-bad.on { background: #FEE2E2; border-color: var(--red); }

/* ── Mascot ── */
.mascot { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; }
.mascot-face { font-size: 46px; cursor: pointer; animation: bob 2.5s ease-in-out infinite; flex: 0 0 auto; }
.mascot-bubble { background: #fff; border: 2px solid var(--line); border-radius: 16px; border-bottom-left-radius: 4px; padding: 10px 16px; font-weight: 700; box-shadow: var(--shadow-sm); position: relative; }
.result-card .mascot { justify-content: center; margin-top: 12px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ── Stats (coins / streak / goal) ── */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; }
.stat { font-weight: 800; padding: 6px 12px; border-radius: 999px; background: #F5F3FF; color: var(--violet); }
.stat.coin { background: #FEF3C7; color: #92400E; }
.stat.fire { background: #FFE4E6; color: #BE123C; }
.stat.goal { background: #DCFCE7; color: #166534; }
.coins-won { font-family: 'Baloo 2'; font-weight: 800; font-size: 20px; color: #B45309; background: #FEF3C7; border-radius: 12px; padding: 8px; margin: 8px 0; }
.streak-line { font-weight: 700; color: #BE123C; }

/* child cards extra */
.child-card { position: relative; }
.report-btn { position: absolute; top: 8px; right: 8px; border: 0; background: #F5F3FF; border-radius: 10px; padding: 4px 8px; cursor: pointer; font-size: 15px; }
.report-btn:hover { background: #EDE9FE; }
.child-chips { display: flex; gap: 6px; justify-content: center; margin: 6px 0; flex-wrap: wrap; }
.mini-chip { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.mini-chip.fire { background: #FFE4E6; color: #BE123C; }
.mini-chip.coin { background: #FEF3C7; color: #92400E; }

/* ── Adventure trail ── */
.trail { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 8px; }
.trail::before { content: ''; position: absolute; left: 30px; top: 20px; bottom: 20px; width: 4px; background: repeating-linear-gradient(var(--violet-2) 0 10px, transparent 10px 20px); opacity: .4; }
.trail-item { display: grid; grid-template-columns: 64px 1fr; align-items: start; gap: 12px; position: relative; }
.trail-node { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: #fff; border: 4px solid var(--accent); box-shadow: var(--shadow-sm); z-index: 1; }
.trail-node.done { background: var(--accent); color: #fff; }
.trail-item .topic-card { border-top: 0; border-left: 6px solid var(--accent); }

/* ── Shop ── */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 12px; }
.shop-item { text-align: center; padding: 16px 12px; display: grid; gap: 6px; justify-items: center; }
.shop-item.owned { background: #F5F3FF; }
.shop-emoji { font-size: 40px; }
.shop-name { font-weight: 800; font-family: 'Baloo 2'; }
.shop-type { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.shop-item .btn { width: 100%; }
.owned-tag { color: var(--green); font-weight: 800; }

/* ── Report ── */
.report-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.report-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.rstat { background: #F5F3FF; border-radius: 14px; padding: 12px; text-align: center; }
.rstat-val { font-family: 'Baloo 2'; font-weight: 800; font-size: 18px; }
.rstat-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.area-prog { margin: 8px 0; }
.area-prog-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.recent { list-style: none; padding: 0; margin: 8px 0; }
.recent li { padding: 8px 10px; border-radius: 10px; background: #F9FAFB; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.link-btn.danger { color: var(--red); display: block; margin: 8px auto 0; }

/* ── Lesson ("Aprende primeiro") ── */
.lesson { gap: 16px; }
.lesson-scene { display: grid; gap: 12px; place-items: center; animation: slidein .45s ease; }
.lesson-pop { animation: floaty 3s ease-in-out infinite; }
.lesson-check-label { font-family: 'Baloo 2'; font-weight: 800; color: var(--violet); background: #F5F3FF; padding: 6px 14px; border-radius: 999px; }
.lesson-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
  padding: 14px 16px; border: 0; border-radius: 16px; cursor: pointer; font: inherit; font-family: 'Baloo 2'; font-weight: 700; font-size: 16px;
  color: #fff; background: linear-gradient(135deg, var(--violet), var(--blue)); box-shadow: var(--shadow-sm); }
.lesson-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lesson-btn.done { background: linear-gradient(135deg, #34D399, #10B981); }
.lesson-btn .lb-go, .lesson-btn .lb-done { font-size: 13px; background: rgba(255,255,255,.22); padding: 3px 10px; border-radius: 999px; }
@keyframes slidein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }

/* ── Story (read-along) ── */
.story { gap: 14px; }
.story-pic { animation: pop .4s ease; }
.story-text { font-family: 'Baloo 2'; font-size: 24px; line-height: 1.5; max-width: 520px; text-align: center; }
.story-text .word { cursor: pointer; border-radius: 6px; padding: 0 1px; }
.story-text .word:hover, .story-text .word:active { background: #FDE68A; }
.story-nav { display: flex; gap: 10px; justify-content: center; }
.story-btn { background: linear-gradient(135deg, #EC4899, #F59E0B) !important; }
.story-btn.done { background: linear-gradient(135deg, #34D399, #10B981) !important; }

/* ── Journey (POV around the world) ── */
.journey { gap: 14px; }
.journey-flag { font-family: 'Baloo 2'; font-weight: 800; font-size: 22px; color: var(--violet); }
.journey-intro { background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; }
.q-emoji.big { font-size: 76px; animation: pop .4s ease; }

/* ── Illustrations ── */
.illus { width: 100%; }
.illus svg { width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* ── Landing ── */
.landing { max-width: 1040px; margin: 0 auto; padding: 20px 18px 60px; display: grid; gap: 40px; }
.hero-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; padding-top: 12px; }
.hero-copy h1 { font-size: 40px; margin: 0 0 12px; color: var(--violet); }
.hero-copy .lead { font-size: 18px; color: #4B5563; line-height: 1.5; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-cta .btn-lg { width: auto; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.feature-emoji { font-size: 32px; }
.feature strong { display: block; margin: 6px 0 4px; font-family: 'Baloo 2'; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.steps { text-align: center; }
.steps h2 { margin-top: 0; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 18px 0; text-align: left; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; display: grid; place-items: center; font-family: 'Baloo 2'; font-weight: 800; }
.step p { margin: 2px 0 0; font-size: 14px; }
.landing-foot { text-align: center; font-size: 13px; }
.donate-sec { text-align: center; display: grid; gap: 8px; justify-items: center; }
.donate-btn { display: inline-flex; align-items: center; gap: 8px; background: #FFDD00; color: #111827; font-family: 'Baloo 2', sans-serif; font-weight: 800; border-radius: 999px; padding: 10px 20px; text-decoration: none; box-shadow: var(--shadow-sm); }
.donate-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* ── Recommended (spaced repetition) ── */
.reco { margin: 4px 0 14px; }
.reco-title { margin: 0 0 10px; font-size: 18px; }
.reco-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.reco-card { flex: 0 0 auto; width: 150px; background: #fff; border: 2px solid var(--line); border-left: 6px solid var(--accent); border-radius: 16px; padding: 14px; cursor: pointer; display: grid; gap: 6px; text-align: left; font: inherit; box-shadow: var(--shadow-sm); }
.reco-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.reco-emoji { font-size: 28px; }
.reco-name { font-weight: 700; font-size: 14px; }
.reco-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; justify-self: start; }
.reco-tag.review { background: #FEF3C7; color: #92400E; }
.reco-tag.reinforce { background: #FFE4E6; color: #BE123C; }
.reco-tag.new { background: #DCFCE7; color: #166534; }
.reco-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.reco-head .reco-title { margin: 0; }
.mastered { font-weight: 800; color: #B45309; }

/* ── Screen-time ── */
.stat.time { background: #E0F2FE; color: #075985; }
.stat.lvl { background: #EDE9FE; color: var(--violet); }
.rest-card { text-align: center; display: grid; gap: 12px; justify-items: center; }
.rest-card .illus { max-width: 220px; }

/* ── Admin form ── */
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; }
form h3 { margin: 20px 0 4px; }

/* ── Admin tabs + users + metrics ── */
.admin-tabs { display: flex; gap: 8px; margin: 10px 0 16px; flex-wrap: wrap; }
.tab { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.tab.on { background: var(--violet); color: #fff; border-color: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.sm.danger { color: var(--red); }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.user-row:last-child { border-bottom: 0; }
.user-main .small { font-size: 12px; margin-top: 2px; }
.user-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tagrole { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; }
.tagrole.admin { background: #FEF3C7; color: #92400E; }
.tagrole.parent { background: #EDE9FE; color: var(--violet); }
.metric-block h3 { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.log-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-head { display: flex; gap: 10px; align-items: center; font-weight: 700; flex-wrap: wrap; }
.log-status { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #F5F3FF; }
.log-status.s-ok { background: #DCFCE7; color: #166534; }
.log-status.s-partial { background: #FEF3C7; color: #92400E; }
.log-status.s-error { background: #FEE2E2; color: #B91C1C; }
.log-err { color: var(--red); }
.small { font-size: 12px; margin-top: 3px; }

/* ── Consent + policy + danger ── */
.check.consent { text-align: left; font-size: 14px; font-weight: 600; align-items: flex-start; margin: 4px 0 8px; }
.check.consent a { color: var(--violet); font-weight: 700; }
.policy h2 { margin-top: 0; }
.policy-sec { margin: 14px 0; }
.policy-sec h3 { margin: 0 0 4px; }
.policy-sec ul { margin: 6px 0; padding-left: 20px; }
.policy-sec li { margin: 4px 0; }
.btn.danger { color: var(--red); border-color: #FECACA; }
.btn.danger:hover { background: #FEF2F2; }
.metric-bar { margin: 8px 0; }
.metric-bar-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 2px; }

/* ── Duelo (2-player) ── */
.duel-p { font-weight: 800; }
.duel-p.p0 { color: #2563EB; }
.duel-p.p1 { color: #DC2626; }
.duel-turn { font-family: 'Baloo 2'; font-weight: 800; font-size: 20px; padding: 8px 18px; border-radius: 999px; color: #fff; }
.duel-turn.p0 { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.duel-turn.p1 { background: linear-gradient(135deg, #EF4444, #DC2626); }
.duel-score { font-weight: 700; color: var(--muted); }
.duel-final { font-family: 'Baloo 2'; font-weight: 800; font-size: 20px; margin: 10px 0; }
.opt.sel { border-color: var(--violet); background: #F5F3FF; }

/* ── Worksheet button on topic cards ── */
.topic-head-mid { flex: 1; }
.ws-btn { border: 0; background: #F5F3FF; border-radius: 10px; padding: 4px 8px; cursor: pointer; font-size: 15px; align-self: flex-start; }
.ws-btn:hover { background: #EDE9FE; }

/* ── Printables (worksheet + certificate) ── */
.printable { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.worksheet .ws-head { border-bottom: 3px solid var(--violet); padding-bottom: 10px; margin-bottom: 14px; }
.worksheet h1 { margin: 0 0 8px; font-size: 24px; }
.ws-meta { color: #374151; font-weight: 600; }
.ws-list { padding-left: 22px; }
.ws-list li { margin: 12px 0; }
.ws-q { font-weight: 700; font-family: 'Baloo 2'; }
.ws-opts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.ws-opt { color: #374151; }
.ws-key { margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--muted); }
.ws-foot { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; }
.certificate { text-align: center; }
.cert-inner { border: 6px double var(--violet); border-radius: 16px; padding: 32px 24px; background: linear-gradient(180deg, #FFFFFF, #F5F3FF); }
.cert-emoji { font-size: 60px; }
.cert-title { font-family: 'Baloo 2'; font-weight: 800; font-size: 30px; color: var(--violet); }
.cert-sub { color: var(--muted); margin: 12px 0 4px; }
.cert-name { font-family: 'Baloo 2'; font-weight: 800; font-size: 28px; margin: 6px 0; }
.cert-body { max-width: 460px; margin: 8px auto; color: #374151; }
.cert-foot { display: flex; justify-content: space-between; margin-top: 22px; font-weight: 700; color: var(--muted); }

@media print {
  .topbar, .no-print, .toast, .confetti, .mascot { display: none !important; }
  body { background: #fff; }
  .container, .container.narrow { max-width: 100%; padding: 0; }
  .printable { box-shadow: none; border: none; }
  .certificate .cert-inner { border-color: #6D28D9; }
}

/* ── Growth-mindset note ── */
.growth-note { background: #ECFDF5; color: #065F46; border-radius: 12px; padding: 10px 14px; font-weight: 700; margin: 8px 0; }

/* ── Draw (creative canvas) ── */
.draw { gap: 12px; width: 100%; }
.draw-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.draw-palette { display: flex; gap: 6px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--violet); transform: scale(1.1); }
.draw-sizes { display: flex; gap: 6px; }
.sizebtn { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 8px; cursor: pointer; font-size: 16px; }
.sizebtn.on { border-color: var(--violet); background: #F5F3FF; }
.draw-canvas { width: 100%; max-width: 640px; aspect-ratio: 640 / 440; border: 3px solid var(--line); border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }

/* ── Duel mode chips ── */
.chip.mode.on { background: var(--violet); color: #fff; border-color: transparent; }

/* ── SEL check-in ── */
.checkin { display: grid; gap: 12px; margin-bottom: 16px; border-left: 6px solid var(--pink); }
.checkin-top { display: flex; align-items: center; gap: 12px; }
.checkin-face { font-size: 40px; animation: bob 2.5s ease-in-out infinite; }
.checkin-q { font-family: 'Baloo 2'; font-weight: 700; font-size: 18px; }
.checkin-moods { display: flex; gap: 10px; flex-wrap: wrap; }
.mood { font-size: 34px; background: #F5F3FF; border: 2px solid var(--line); border-radius: 16px; padding: 6px 12px; cursor: pointer; }
.mood:hover { border-color: var(--pink); transform: translateY(-2px); }

/* ── Accessibility: easy-reading mode (UDL) ── */
.a11y-readable .q-prompt, .a11y-readable .story-text, .a11y-readable .topic-desc,
.a11y-readable .opt, .a11y-readable p, .a11y-readable li, .a11y-readable .field > span, .a11y-readable .lesson-scene .q-prompt {
  letter-spacing: .05em; word-spacing: .14em; line-height: 1.8;
}
.a11y-readable .story-text { font-size: 27px; }
.a11y-readable .opt { font-size: 21px; }
.a11y-readable .q-prompt { font-weight: 700; }

/* ── Narration affordance ── */
.speakable { cursor: pointer; }
.speakable:hover { color: var(--violet); }

@media (max-width: 720px) {
  .hero-sec { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .steps-row { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 32px; }
}
@media (max-width: 460px) {
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page-title { font-size: 23px; }
  .child-hero-top { flex-wrap: wrap; }
  .hero-btns { width: 100%; }
  .match-board { gap: 14px; }
  .brand-sub { display: none; }
  .tf-btns { flex-direction: column; width: 100%; }
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .trail::before { left: 26px; }
  .trail-item { grid-template-columns: 52px 1fr; }
}
