:root {
  --ink: #2b2d42;
  --cream: #fffaf0;
  --line: #e2d4f7;
  --purple: #7048e8;
  --green: #2f9e44;
  --orange: #f76707;
  --red: #e03131;
  --blue: #1c7ed6;
  --shadow: 0 6px 0 rgba(0,0,0,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Baloo 2', system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(ellipse at 20% 0%, #3b2d8f, #1a1446 55%, #0b0a24);
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
.stars-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .8;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 30% 70%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 50% 40%, #ffe066 50%, transparent 51%), radial-gradient(1.5px 1.5px at 70% 15%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 85% 60%, #a5d8ff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 20% 85%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 90%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 92% 88%, #fff 50%, transparent 51%);
  background-size: 400px 400px; animation: twinkle 6s ease-in-out infinite alternate;
}
#app { position: relative; z-index: 1; min-height: 100vh; padding-bottom: 30px; }
button { font-family: inherit; color: inherit; cursor: pointer; }
input { font-family: inherit; font-size: 18px; padding: 6px 12px; border: 3px solid var(--line); border-radius: 12px; color: var(--ink); }
h1, h2, h3 { margin: 6px 0; line-height: 1.15; }
.hidden { display: none !important; }
.muted { opacity: .75; }
.small { font-size: 14px; }
.big { font-size: 22px; }

.btn {
  display: inline-block; text-decoration: none; border: none; border-radius: 16px; padding: 9px 22px; font-size: 19px; font-weight: 800;
  background: var(--orange); color: #fff; box-shadow: var(--shadow); transition: transform .1s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.green { background: var(--green); } .btn.gray { background: #868e96; } .btn.purple { background: var(--purple); }
.btn.small { font-size: 15px; padding: 5px 14px; }
.btn.big { font-size: 26px; padding: 12px 34px; }
.btn:disabled { background: #adb5bd; box-shadow: none; }
.icon-btn { width: 44px; height: 44px; border: none; border-radius: 14px; background: #fff; font-size: 20px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.row-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.pill { background: #fff3bf; border-radius: 12px; padding: 0 10px; font-weight: 800; }
.pill.big { font-size: 24px; padding: 2px 16px; background: #fff; }
.pill.low { background: #ffc9c9; color: var(--red); animation: pulse .5s infinite; }

/* ---------- cartões / perfis ---------- */
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--cream); border-radius: 30px; padding: 24px; width: min(640px, 100%); text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.25); }
.card.wide { width: min(960px, 100%); text-align: left; }
.logo { font-size: 60px; animation: float 3s ease-in-out infinite; }
h1 { font-size: clamp(36px, 7vw, 58px); color: var(--purple); }
.sub { font-size: 19px; }
.profiles { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 10px 0; }
.profile { position: relative; width: 124px; background: #fff; border-radius: 20px; border: 4px solid transparent; padding: 8px 4px; box-shadow: var(--shadow); }
.profile:hover { border-color: var(--purple); }
.profile svg { width: 66px; height: 99px; }
.pname { font-weight: 800; font-size: 17px; }
.pmeta { font-size: 13px; opacity: .8; }
.pdel { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 13px; }
.name-row { display: flex; gap: 10px; align-items: center; font-weight: 800; font-size: 20px; margin: 10px 0; }
.import { background: #f3f0ff; border-radius: 16px; padding: 8px 12px; }
.import-list { display: flex; gap: 6px; flex-wrap: wrap; }
.import-list button { background: #fff; border: 3px solid transparent; border-radius: 14px; padding: 2px 8px; font-weight: 700; display: flex; flex-direction: column; align-items: center; }
.import-list button:hover { border-color: var(--purple); }
.import-list svg { width: 40px; height: 60px; }
/* editor de avatar compartilhado */
.ae { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.ae-preview { display: grid; place-items: center; background: linear-gradient(#d0bfff, #a5d8ff); border-radius: 20px; min-height: 260px; }
.ae-preview svg { width: 170px; height: 255px; }
.ae-row { margin-bottom: 8px; }
.ae-label { font-weight: 800; }
.ae-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ae-chip { border: 3px solid var(--line); background: #fff; border-radius: 12px; padding: 1px 9px; font-size: 14px; font-weight: 700; }
.ae-chip.sel { border-color: var(--purple); background: #f3f0ff; }
.ae-swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); padding: 0; }
.ae-swatch.sel { box-shadow: 0 0 0 4px var(--purple); }

/* ---------- barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255,250,240,.96); box-shadow: 0 4px 0 rgba(0,0,0,.2); position: sticky; top: 0; z-index: 5; }
.tb-title { flex: 1; font-size: 22px; font-weight: 800; }
.tb-me { display: flex; align-items: center; gap: 6px; }
.tb-me .face { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; position: relative; background: #d0bfff; }
.tb-me .face svg { width: 100%; height: 100%; display: block; }

/* ---------- central ---------- */
.hub { max-width: 980px; margin: 0 auto; padding: 16px; }
.hub-hero { display: flex; gap: 16px; align-items: center; background: var(--cream); border-radius: 26px; padding: 14px 20px; box-shadow: var(--shadow); }
.hero-avatar { position: relative; width: 90px; height: 135px; flex: none; }
.hero-avatar svg { width: 100%; height: 100%; }
.hero-rocket { position: absolute; right: -24px; top: 0; font-size: 38px; animation: float 2s ease-in-out infinite; }
.hub-hero p { margin: 4px 0; font-size: 17px; }
.bar { height: 14px; background: #e9ecef; border-radius: 7px; overflow: hidden; max-width: 380px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #40c057, #fab005); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.hub-card {
  border: none; border-radius: 24px; padding: 16px; text-align: left; color: #fff; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px; min-height: 140px; transition: transform .12s;
}
.hub-card:hover { transform: translateY(-4px) rotate(-1deg); }
.hub-card span { font-size: 44px; line-height: 1.1; }
.hub-card b { font-size: 21px; }
.hub-card small { font-size: 14px; opacity: .92; }
.c1 { background: linear-gradient(135deg, #7048e8, #4c6ef5); } .c2 { background: linear-gradient(135deg, #12b886, #2f9e44); }
.c3 { background: linear-gradient(135deg, #f76707, #f03e3e); } .c4 { background: linear-gradient(135deg, #e64980, #be4bdb); }
.c5 { background: linear-gradient(135deg, #1c7ed6, #15aabf); } .c6 { background: linear-gradient(135deg, #f59f00, #e8590c); }
.c7 { background: linear-gradient(135deg, #5c7cfa, #845ef7); }

/* ---------- planetas ---------- */
.planet {
  width: var(--s); height: var(--s); border-radius: 50%; position: relative; display: grid; place-items: center; margin: 0 auto;
  background: radial-gradient(circle at 32% 28%, #fff 0, var(--c1) 22%, var(--c2) 80%);
  box-shadow: inset -8px -10px 0 rgba(0,0,0,.18), 0 0 22px rgba(255,255,255,.25);
}
.planet span { font-size: calc(var(--s) * .45); font-weight: 800; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.3); position: relative; z-index: 2; }
.planet.ringed::before {
  content: ''; position: absolute; width: 150%; height: 34%; border-radius: 50%; border: calc(var(--s) * .06) solid rgba(255,255,255,.65);
  transform: rotate(-18deg); z-index: 1; box-sizing: border-box;
}
.planet.gold { box-shadow: inset -8px -10px 0 rgba(0,0,0,.18), 0 0 0 4px #ffd43b, 0 0 26px #ffd43b; }
.planet.spin { animation: float 3s ease-in-out infinite; }
.hint { text-align: center; color: #fff; font-size: 18px; margin: 12px; }
.space-map { position: relative; max-width: 1100px; margin: 0 auto; aspect-ratio: 16 / 8; min-height: 420px; }
.space-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-planet { position: absolute; transform: translate(-50%, -50%); background: none; border: none; text-align: center; color: #fff; transition: transform .15s; }
.map-planet:hover { transform: translate(-50%, -50%) scale(1.1); }
.mp-name { font-weight: 800; font-size: 14px; white-space: nowrap; text-shadow: 0 2px 0 #000; }
.mp-stars { color: #ffd43b; font-size: 18px; letter-spacing: 2px; text-shadow: 0 2px 0 #000; }

.intro { max-width: 700px; margin: 20px auto; background: var(--cream); border-radius: 30px; padding: 24px; text-align: center; box-shadow: var(--shadow); }
.tip { background: #fff3bf; border-radius: 16px; padding: 10px 14px; font-size: 18px; font-weight: 600; text-align: left; margin: 12px 0; }
.tip.small { font-size: 15px; margin: 4px 0; }

/* ---------- aprender ---------- */
.learn-menu { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.planet-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.planet-pick button { background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2); border-radius: 20px; padding: 12px 6px; color: #fff; font-weight: 800; }
.planet-pick button:hover { background: rgba(255,255,255,.2); }
.planet-pick span { display: block; margin-top: 6px; }
.learn { display: grid; grid-template-columns: 300px 1fr; gap: 16px; max-width: 1100px; margin: 16px auto; padding: 0 16px; }
.learn-side, .learn-main { background: var(--cream); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); }
.learn-head { display: flex; gap: 10px; align-items: center; }
.learn-head .planet { margin: 0; flex: none; }
.table-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.table-list button { display: flex; align-items: center; gap: 8px; border: 3px solid transparent; background: #fff; border-radius: 12px; padding: 3px 12px; font-size: 20px; font-weight: 700; }
.table-list button span { flex: 1; text-align: left; }
.table-list button i { font-style: normal; font-size: 14px; width: 20px; }
.table-list button.sel { border-color: var(--purple); background: #f3f0ff; }
.slider-row { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; margin: 12px 0; }
.slider-row input { flex: 1; accent-color: var(--purple); height: 30px; }

.explain { text-align: center; }
.ex-title { font-size: 24px; margin-bottom: 8px; }
.ex-sum { font-size: 22px; margin-top: 8px; font-weight: 600; }
.groups { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.group { background: #fff; border: 3px dashed #b197fc; border-radius: 14px; padding: 4px 6px; font-size: 22px; line-height: 1.1; max-width: 160px; word-break: break-all; }
.group.empty { font-size: 34px; border-color: #ced4da; }
.group .zero { font-size: 14px; opacity: .6; }

/* ---------- missão ---------- */
.mission, .race { max-width: 760px; margin: 0 auto; padding: 14px; }
.trip { position: relative; height: 60px; margin: 6px 10px 10px; }
.trip-line { position: absolute; left: 0; right: 30px; top: 50%; border-top: 4px dashed rgba(255,255,255,.4); }
.trip-rocket { position: absolute; top: 4px; font-size: 40px; transform: rotate(45deg); transition: left .6s ease-out; left: 0; }
.trip-planet { position: absolute; right: 0; top: 4px; }
.qcount { text-align: center; color: #fff; font-weight: 700; font-size: 17px; }
.qcard { background: var(--cream); border-radius: 26px; padding: 18px; text-align: center; box-shadow: var(--shadow); margin: 8px 0 14px; }
.q-help { font-size: 18px; font-weight: 700; opacity: .8; }
.q-big { font-size: clamp(42px, 10vw, 70px); font-weight: 800; line-height: 1.15; }
.q-slot { display: inline-block; min-width: 1.4em; padding: 0 .2em; border-radius: 16px; background: #f3f0ff; color: var(--purple); border: 4px dashed #b197fc; }
.q-slot.wrong { background: #ffe3e3; color: var(--red); border-color: var(--red); }
.flash-good { animation: flashGood .35s; }
.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.answers.two .opt { font-size: 30px; }
.answers.pad { display: block; }
.opt {
  font-size: clamp(30px, 7vw, 44px); font-weight: 800; border: none; border-radius: 22px; padding: 12px; background: #fff; box-shadow: 0 6px 0 #b197fc;
  transition: transform .08s;
}
.opt:active { transform: translateY(4px); box-shadow: 0 2px 0 #b197fc; }
.opt.yes { background: #d3f9d8; box-shadow: 0 6px 0 #69db7c; } .opt.no { background: #ffe3e3; box-shadow: 0 6px 0 #ff8787; }
.opt.picked { outline: 4px solid var(--purple); }
.opt.right { background: #b2f2bb !important; box-shadow: 0 6px 0 #40c057 !important; outline: 4px solid #2f9e44; }
.q-slot.shown { background: #d3f9d8; color: var(--green); border-color: var(--green); }
.opt:disabled { cursor: default; }
.feedback { margin-top: 14px; border-radius: 22px; padding: 14px; text-align: center; animation: pop .3s; }
.feedback.good { background: #d3f9d8; }
.feedback.bad { background: #fff9db; }
.fb-big { font-size: 26px; font-weight: 800; margin-bottom: 6px; }

/* teclado numérico */
.kp-display { display: none; }
.kp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.kp-grid button {
  font-size: 34px; font-weight: 800; border: none; border-radius: 18px; padding: 8px 0; background: #fff; box-shadow: 0 5px 0 #b197fc; touch-action: manipulation;
}
.kp-grid button.down { transform: translateY(3px); box-shadow: 0 2px 0 #b197fc; }
.kp-del { background: #ffe3e3 !important; box-shadow: 0 5px 0 #ff8787 !important; }
.kp-ok { background: var(--green) !important; color: #fff; box-shadow: 0 5px 0 #2b8a3e !important; }
.off .kp-grid { opacity: .5; pointer-events: none; }

/* ---------- resultado ---------- */
.result { max-width: 700px; margin: 20px auto; background: var(--cream); border-radius: 30px; padding: 24px; text-align: center; box-shadow: var(--shadow); }
.r-stars { font-size: 80px; letter-spacing: 8px; color: #dee2e6; }
.r-stars span { display: inline-block; animation: pop .5s backwards; }
.r-stars .on { color: #fcc419; text-shadow: 0 4px 0 #e67700; }
.sticker-new { display: inline-flex; align-items: center; gap: 10px; background: #e5dbff; border-radius: 18px; padding: 6px 16px; font-size: 20px; font-weight: 800; margin: 6px; animation: pop .5s; }
.sticker-new.gold { background: linear-gradient(90deg, #ffe066, #fab005); }
.sticker-new .stk { font-size: 44px; }
.review-box { background: #fff3bf; border-radius: 16px; padding: 10px 14px; font-size: 18px; margin: 10px 0; }

/* ---------- configuração (corrida/duelo) ---------- */
.setup { max-width: 760px; margin: 20px auto; background: var(--cream); border-radius: 30px; padding: 22px; text-align: center; box-shadow: var(--shadow); }
.setup-icon { font-size: 60px; }
.table-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.table-chips button { width: 54px; height: 54px; border-radius: 16px; border: 3px solid var(--line); background: #fff; font-size: 24px; font-weight: 800; }
.table-chips button.sel { background: var(--purple); color: #fff; border-color: var(--purple); }
.count-big { font-size: 140px; font-weight: 800; color: #ffd43b; text-shadow: 0 8px 0 #e67700; }
.count-big.pop { animation: pop .5s; }
.check { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 12px 0; font-weight: 600; }
.check input { width: 22px; height: 22px; }

.race-top { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.race-top .pill:not(.big) { background: #ffd8a8; font-size: 18px; }
.track {
  position: relative; height: 96px; margin: 12px 0; border-radius: 20px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #8ce99a 0 40px, #69db7c 40px 80px); border: 4px solid #fff;
}
.track-finish { position: absolute; right: 8px; top: 24px; font-size: 40px; }
.runner { position: absolute; left: 0; bottom: 2px; width: 56px; height: 84px; transition: left .4s ease-out; }
.runner svg { width: 100%; height: 100%; }

/* ---------- duelo ---------- */
.duel { height: 100vh; display: flex; flex-direction: column; }
.half { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; transition: background .2s; }
.half.blue { background: linear-gradient(#1c7ed6, #1864ab); } .half.red { background: linear-gradient(#e03131, #c92a2a); }
.half.flipped { transform: rotate(180deg); }
.half.win { background: linear-gradient(#40c057, #2b8a3e); }
.half.lock { filter: saturate(.4) brightness(.85); }
.h-head { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 20px; }
.h-face { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; position: relative; background: #fff; }
.h-face svg { width: 100%; height: 100%; display: block; }
.h-score { background: #fff; color: var(--ink); border-radius: 12px; padding: 0 12px; font-weight: 800; font-size: 26px; }
.h-q { font-size: clamp(36px, 8vw, 60px); font-weight: 800; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.h-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(560px, 100%); }
.h-opts button { font-size: clamp(26px, 6vw, 38px); font-weight: 800; border: none; border-radius: 18px; padding: 8px 0; background: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.25); touch-action: manipulation; }
.h-opts button.right { background: #b2f2bb; } .h-opts button.wrong { background: #ffc9c9; }
.h-msg { color: #fff; font-weight: 800; font-size: 20px; min-height: 30px; }
.duel-mid { height: 0; display: flex; justify-content: center; align-items: center; z-index: 3; }
.duel-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.people button { background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 2px 6px; display: flex; flex-direction: column; align-items: center; font-weight: 700; font-size: 13px; }
.people button.sel { border-color: var(--purple); background: #f3f0ff; }
.people svg { width: 36px; height: 54px; }
.winner { position: relative; width: 120px; height: 180px; margin: 0 auto; }
.winner svg { width: 100%; height: 100%; }
.crown { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 44px; animation: float 1.5s ease-in-out infinite; }

/* ---------- mapa da tabuada ---------- */
.factmap { display: grid; grid-template-columns: 330px 1fr; gap: 16px; max-width: 1150px; margin: 16px auto; padding: 0 16px; }
.fm-side { background: var(--cream); border-radius: 24px; padding: 16px; box-shadow: var(--shadow); align-self: start; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.legend span { border-radius: 8px; padding: 0 8px; font-size: 14px; font-weight: 700; }
.fm-detail .explain .ex-title { font-size: 20px; } .fm-detail .group { font-size: 16px; }
.fm-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; background: var(--cream); border-radius: 24px; padding: 12px; box-shadow: var(--shadow); align-self: start; }
.fm-cell { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: clamp(11px, 1.6vw, 18px); border: none; padding: 0; }
.fm-head, .fm-corner { background: var(--purple); color: #fff; }
.m0 { background: #e9ecef; color: #868e96; } .m1 { background: #ffc9c9; color: #c92a2a; } .m2 { background: #ffec99; color: #a87300; } .m3 { background: #b2f2bb; color: #2b8a3e; }
.fm-cell.sel { outline: 4px solid var(--purple); transform: scale(1.1); }

/* ---------- álbum ---------- */
.album { max-width: 960px; margin: 16px auto; padding: 16px 20px; background: var(--cream); border-radius: 28px; box-shadow: var(--shadow); }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.stk-card { background: #fff; border-radius: 18px; padding: 10px; text-align: center; border: 4px solid #d0bfff; }
.stk-card.off { opacity: .55; border-style: dashed; }
.stk-card.gold { border-color: #fab005; background: linear-gradient(135deg, #fff9db, #ffe066); box-shadow: 0 0 18px #ffd43b; }
.stk-card .stk { font-size: 54px; }
.stk-name { font-weight: 800; font-size: 14px; }
.stk-stars { color: #f59f00; }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ach { display: flex; gap: 10px; align-items: center; background: #f1f3f5; border-radius: 16px; padding: 8px 12px; opacity: .6; }
.ach.got { background: #fff3bf; opacity: 1; }
.ach-e { font-size: 34px; }

/* ---------- avisos e efeitos ---------- */
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(43,45,66,.95); color: #fff; padding: 8px 18px; border-radius: 16px; font-size: 18px; font-weight: 700; animation: pop .3s, fade .4s 2.7s forwards; }
.toast.gold { background: linear-gradient(90deg, #f59f00, #f76707); }
.confetti { position: fixed; top: -40px; font-size: 28px; z-index: 60; pointer-events: none; animation: fall linear forwards; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.15); } to { transform: scale(1); } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes fade { to { opacity: 0; } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes twinkle { from { opacity: .5; } to { opacity: 1; } }
@keyframes flashGood { 50% { color: var(--green); transform: scale(1.06); } }

@media (max-width: 760px) {
  .learn, .factmap { grid-template-columns: 1fr; }
  .ae { grid-template-columns: 1fr; }
  .ae-preview { min-height: 200px; } .ae-preview svg { width: 120px; height: 180px; }
  .space-map { aspect-ratio: auto; height: 560px; min-height: 0; }
  .duel-pick { grid-template-columns: 1fr; }
  .h-opts { grid-template-columns: repeat(2, 1fr); }
  .tb-title { font-size: 17px; }
  .tb-me b { display: none; }
}

/* =========================================================
   Parte lúdica: mascote, jornada, história, atividades
   ========================================================= */
.c8 { background: linear-gradient(135deg, #fd7e14, #fab005); }

/* Zuzu, o guia */
.guide { position: fixed; left: 12px; bottom: 12px; z-index: 40; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; max-width: min(460px, calc(100vw - 24px)); }
.guide-body { pointer-events: auto; width: 92px; height: 92px; border: none; background: none; padding: 0; flex: none; animation: float 2.6s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.guide-body svg { width: 100%; height: 100%; }
.guide.jump .guide-body { animation: hopBig .5s; }
.guide-bubble {
  order: 2; background: #fff; border-radius: 20px 20px 20px 4px; padding: 10px 14px; font-size: 18px; font-weight: 700; margin-bottom: 52px;
  box-shadow: 0 6px 0 rgba(0,0,0,.2); pointer-events: auto; line-height: 1.3;
}
.guide-bubble.pop { animation: pop .3s; }
.guide.quiet .guide-bubble { display: none; }
.zuzu .zz-eyes { animation: blink 4s infinite; transform-origin: 50% 47%; }
.zuzu .zz-ball { animation: glow 1.4s ease-in-out infinite alternate; }

/* jornada do planeta */
.journey { max-width: 1080px; margin: 0 auto; padding: 16px 16px 130px; }
.j-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, var(--c1), #fffaf0 70%); border-radius: 28px; padding: 16px 22px; box-shadow: var(--shadow); flex-wrap: wrap; }
.j-hero .planet { margin: 0; }
.j-who { font-size: 80px; animation: float 2s ease-in-out infinite; }
.j-text { flex: 1; min-width: 220px; }
.j-text p { font-size: 19px; margin: 4px 0; }
.j-stars { font-size: 30px; color: #fab005; letter-spacing: 3px; }
.j-steps { display: flex; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.j-arrow { color: rgba(255,255,255,.6); font-size: 26px; }
.j-step {
  position: relative; width: 165px; min-height: 160px; border: none; border-radius: 24px; background: var(--cream); padding: 14px 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; transition: transform .12s;
}
.j-step:hover:not(:disabled) { transform: translateY(-4px); }
.j-step b { font-size: 18px; line-height: 1.1; }
.j-step small { font-size: 14px; opacity: .8; }
.js-num { position: absolute; top: -10px; left: -6px; width: 36px; height: 36px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.js-icon { font-size: 46px; line-height: 1.2; }
.j-step.done { background: #d3f9d8; }
.j-step.done .js-num { background: #fff; }
.j-step.next { outline: 5px solid #ffd43b; animation: pulse 1.6s ease-in-out infinite; }
.j-step.locked { opacity: .5; cursor: default; }
.j-step.locked .js-num { background: #868e96; }

.activity { max-width: 900px; margin: 0 auto; padding: 14px 14px 130px; }
.step-done { background: var(--cream); border-radius: 30px; padding: 24px; text-align: center; box-shadow: var(--shadow); margin-top: 20px; }
.sd-who { font-size: 90px; animation: hopBig 1s ease-in-out infinite; }

/* história */
.story { background: var(--cream); border-radius: 30px; padding: 18px; box-shadow: var(--shadow); }
.story-cast { display: grid; grid-template-columns: 110px 1fr 110px; align-items: center; gap: 10px; min-height: 140px; }
.story-who { font-size: 90px; text-align: center; transition: transform .2s; }
.story-zuzu { width: 105px; height: 105px; transition: transform .2s; }
.story-zuzu svg { width: 100%; height: 100%; }
.story-who.talking, .story-zuzu.talking { transform: scale(1.12); animation: talk .4s ease-in-out infinite alternate; }
.story-bubble { background: #fff; border-radius: 22px; padding: 14px 18px; font-size: clamp(19px, 3vw, 24px); font-weight: 700; box-shadow: 0 4px 0 rgba(0,0,0,.1); position: relative; animation: pop .3s; }
.story-bubble.from-who { border: 4px solid #ffa94d; }
.story-bubble.from-zuzu { border: 4px solid #9775fa; }
.story-scene { min-height: 150px; margin-top: 10px; }

/* recipientes com itens */
.conts { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.cont { position: relative; width: 150px; min-height: 150px; background: #fff; border-radius: 22px; border: 4px dashed #d0bfff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px; transition: transform .15s, border-color .2s; }
.conts.big .cont { width: 170px; min-height: 175px; }
.cont.tap { cursor: pointer; }
.cont.tap:active { transform: scale(.96); }
.cont.full { border-style: solid; border-color: #51cf66; background: #ebfbee; }
.cont.counting-now { transform: scale(1.12); border-color: #fab005; box-shadow: 0 0 0 6px rgba(250,176,5,.35); }
.cont-items { font-size: 24px; line-height: 1.15; text-align: center; min-height: 30px; word-break: break-all; }
.cont-e { font-size: 44px; line-height: 1; }
.cont-count { font-weight: 800; color: #868e96; }
.cont .ctotal { position: absolute; top: -18px; right: -12px; background: #fab005; color: #fff; font-weight: 800; font-size: 24px; border-radius: 16px; padding: 0 12px; box-shadow: 0 3px 0 #e67700; animation: pop .3s; }
.pop-item { display: inline-block; animation: dropIn .35s; }
.build { background: var(--cream); border-radius: 30px; padding: 16px; box-shadow: var(--shadow); }
.build-top { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.build-q { margin-top: 16px; text-align: center; animation: pop .3s; }
.answers.three { grid-template-columns: repeat(3, 1fr); }

/* pulos na reta numérica */
.jumps { background: var(--cream); border-radius: 30px; padding: 18px; box-shadow: var(--shadow); text-align: center; }
.jline { position: relative; height: 150px; margin: 10px 4px 16px; }
.jtrack { position: absolute; left: 2%; right: 2%; bottom: 40px; height: 8px; background: #845ef7; border-radius: 4px; }
.jtick { position: absolute; bottom: 30px; width: 4px; height: 28px; background: #5f3dc4; transform: translateX(-50%); border-radius: 2px; }
.jtick span { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: clamp(14px, 2.4vw, 22px); color: #adb5bd; white-space: nowrap; }
.jtick.reached span { color: var(--purple); animation: pop .4s; }
.jtoken { position: absolute; bottom: 52px; font-size: 52px; transform: translateX(-50%); transition: left .6s ease-in-out; line-height: 1; }
.jtoken.hop { animation: jumpArc .6s ease-in-out; }
.jseq { margin-top: 12px; font-size: 22px; font-weight: 800; color: var(--purple); background: #f3f0ff; border-radius: 16px; padding: 6px 12px; }

/* chuva de meteoros */
.meteor-hud { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.sky { position: relative; height: min(58vh, 480px); border-radius: 26px; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #4c3fb8, #120d33 70%); border: 4px solid rgba(255,255,255,.25); touch-action: manipulation; }
.ship { position: absolute; bottom: 8px; left: 50%; font-size: 48px; transform: translateX(-50%) rotate(-45deg); transition: left .2s; }
.meteor {
  position: absolute; top: -12%; width: 92px; height: 92px; margin-left: -46px; border: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffc078, #e8590c 55%, #862e00); box-shadow: 0 -18px 24px -6px rgba(255,146,43,.7), inset -8px -8px 0 rgba(0,0,0,.25);
  color: #fff; font-size: 34px; font-weight: 800; text-shadow: 0 3px 0 rgba(0,0,0,.4); display: grid; place-items: center;
}
.meteor.miss { filter: grayscale(1) brightness(.7); animation: shake .4s; pointer-events: none; }
.meteor.boom { background: none; box-shadow: none; font-size: 70px; animation: boom .5s forwards; }
.laser { position: absolute; height: 5px; background: linear-gradient(90deg, #ffe066, #ff6b6b); transform-origin: left center; border-radius: 3px; box-shadow: 0 0 10px #ffe066; }
.mq { margin-top: 10px; background: var(--cream); border-radius: 24px; text-align: center; font-size: clamp(38px, 8vw, 60px); font-weight: 800; padding: 6px; box-shadow: var(--shadow); }

/* jogo da memória */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 640px; margin: 0 auto; }
.mem-card { aspect-ratio: 1.15; border: none; background: none; padding: 0; perspective: 600px; }
.mc-inner { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.mem-card.flip .mc-inner { transform: rotateY(180deg); }
.mc-face { position: absolute; inset: 0; border-radius: 18px; display: grid; place-items: center; backface-visibility: hidden; font-weight: 800; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.mc-back { background: repeating-linear-gradient(45deg, #7048e8 0 12px, #845ef7 12px 24px); font-size: 36px; }
.mc-front { transform: rotateY(180deg); background: #fff; font-size: clamp(22px, 4.5vw, 34px); }
.mc-front.r { background: #fff3bf; color: #e67700; }
.mem-card.ok .mc-front { background: #b2f2bb; color: #2b8a3e; }
.play-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }

/* explicação animada "contando junto" */
.cgroup { display: flex; flex-direction: column; align-items: center; gap: 2px; transition: opacity .3s, transform .3s; }
.cgroup .ctotal { font-weight: 800; color: #e67700; font-size: 20px; }
.counting.anim .cgroup:not(.show) { opacity: 0; transform: scale(.6); }
.counting.anim .cgroup.show { animation: pop .35s; }
.ex-sum.wait { opacity: 0; }
.ex-sum { transition: opacity .4s; }

@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes glow { to { fill: #fff3bf; } }
@keyframes hopBig { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-22px); } }
@keyframes talk { from { transform: scale(1.08) rotate(-2deg); } to { transform: scale(1.14) rotate(2deg); } }
@keyframes dropIn { from { transform: translateY(-40px) scale(.4); opacity: 0; } }
@keyframes jumpArc { 0% { margin-bottom: 0; } 45% { margin-bottom: 70px; } 100% { margin-bottom: 0; } }
@keyframes shake { 0%,100% { margin-left: -46px; } 25% { margin-left: -56px; } 75% { margin-left: -36px; } }
@keyframes boom { to { transform: scale(1.8); opacity: 0; } }

@media (max-width: 760px) {
  .guide-body { width: 64px; height: 64px; }
  .guide-bubble { font-size: 15px; margin-bottom: 36px; }
  .j-step { width: 140px; min-height: 140px; } .j-arrow { display: none; }
  .story-cast { grid-template-columns: 70px 1fr 70px; } .story-who { font-size: 56px; } .story-zuzu { width: 70px; height: 70px; }
  .cont, .conts.big .cont { width: 120px; min-height: 130px; } .cont-items { font-size: 18px; }
  .meteor { width: 70px; height: 70px; margin-left: -35px; font-size: 26px; }
  .mem-grid { grid-template-columns: repeat(3, 1fr); }
  .jtoken { font-size: 36px; }
}
.home-btn { background: #ffe39a; }
