:root {
  --green: #58cc02; --green-d: #46a302;
  --blue: #1cb0f6; --blue-d: #1899d6;
  --red: #ff4b4b; --red-d: #ea2b2b;
  --yellow: #ffc800; --yellow-d: #e0a800;
  --purple: #ce82ff; --purple-d: #a568cc;
  --orange: #ff9600;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f7f7;
  --text: #3c3c3c;
  --muted: #777777;
  --border: #e5e5e5;
  --border-d: #cfcfcf;
  --locked: #e5e5e5;
  --locked-d: #b7b7b7;
  --ok-bg: #d7ffb8; --ok-text: #58a700;
  --bad-bg: #ffdfe0; --bad-text: #ea2b2b;
  --sel-bg: #ddf4ff; --sel-border: #84d8ff;

  --radius: 16px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131f24; --surface: #131f24; --surface-2: #1d2b31;
    --text: #f1f7fb; --muted: #9fb2bc;
    --border: #37464f; --border-d: #2a373e;
    --locked: #37464f; --locked-d: #26333a;
    --ok-bg: #1f3a14; --ok-text: #79d634;
    --bad-bg: #3d1c1f; --bad-text: #ff7b7b;
    --sel-bg: #1a3a4c; --sel-border: #3f9ccc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131f24; --surface: #131f24; --surface-2: #1d2b31;
  --text: #f1f7fb; --muted: #9fb2bc;
  --border: #37464f; --border-d: #2a373e;
  --locked: #37464f; --locked-d: #26333a;
  --ok-bg: #1f3a14; --ok-text: #79d634;
  --bad-bg: #3d1c1f; --bad-text: #ff7b7b;
  --sel-bg: #1a3a4c; --sel-border: #3f9ccc;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
button { font-family: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#app {
  max-width: 480px; margin: 0 auto; height: 100%;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: var(--bg);
}

/* ---------- Barra superior ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  border-bottom: 2px solid var(--border);
  background: var(--bg); z-index: 5;
}
.chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  border-radius: 12px; font-size: 17px; font-weight: 900;
  background: none; border: none;
}
.chip-ico { font-size: 22px; line-height: 1; }
.chip-avatar { padding: 0; }
.chip-avatar span, .mini-avatar {
  display: block; width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); overflow: hidden;
}
.chip-avatar svg, .mini-avatar svg { width: 100%; height: 100%; display: block; }
#top-streak { color: var(--orange); }
#top-level { color: var(--yellow-d); }
#top-coins { color: var(--yellow-d); }
.coin-bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ---------- Telas ---------- */
#screens { flex: 1; position: relative; overflow: hidden; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: 16px 16px 24px; display: none;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Navegação inferior ---------- */
.bottomnav {
  display: flex; justify-content: space-around;
  border-top: 2px solid var(--border); background: var(--bg);
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 2px solid transparent; border-radius: 14px; padding: 6px 0;
}
.nav-btn span { font-size: 26px; line-height: 1; filter: grayscale(.6); opacity: .75; transition: transform .2s; }
.nav-btn small { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.nav-btn.active { background: var(--sel-bg); border-color: var(--sel-border); }
.nav-btn.active span { filter: none; opacity: 1; transform: scale(1.1); }
.nav-btn.active small { color: var(--blue); }

/* ---------- Botões 3D ---------- */
.btn {
  border: none; border-radius: var(--radius); padding: 14px 20px;
  font-size: 16px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase;
  background: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-d);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 transparent; }
.btn:disabled { background: var(--locked); color: var(--muted); box-shadow: 0 5px 0 var(--locked-d); cursor: default; }
.btn-block { width: 100%; }
.btn-blue { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.btn-red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn-yellow { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); color: #5b4300; }
.btn-ghost { background: var(--surface); color: var(--blue); border: 2px solid var(--border); box-shadow: 0 4px 0 var(--border); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.icon-btn { background: none; border: none; font-size: 26px; color: var(--muted); padding: 4px 8px; font-weight: 900; }

/* ---------- Trilha ---------- */
.unit {
  border-radius: var(--radius); padding: 16px 18px; color: #fff; margin: 8px 0 18px;
  box-shadow: 0 5px 0 rgba(0,0,0,.18); position: relative; overflow: hidden;
}
.unit::after {
  content: '🦴'; position: absolute; right: -6px; bottom: -14px; font-size: 76px; opacity: .18; transform: rotate(-20deg);
}
.unit small { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: .9; font-weight: 900; }
.unit h2 { margin: 2px 0 2px; font-size: 22px; font-weight: 900; }
.unit p { margin: 0; font-size: 14px; opacity: .95; }
.unit .unit-meta { display: flex; gap: 10px; margin-top: 10px; font-size: 13px; font-weight: 800; }
.unit .unit-meta span { background: rgba(255,255,255,.22); padding: 4px 10px; border-radius: 999px; }
.unit.locked { filter: grayscale(.85); opacity: .75; }

.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 54px 0 34px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node-wrap.has-bubble { margin-top: 34px; }
.path > .node-wrap.has-bubble:first-child { margin-top: 0; }
.node {
  width: 74px; height: 68px; border-radius: 50%; border: none;
  font-size: 32px; display: grid; place-items: center; position: relative;
  transition: transform .08s, box-shadow .08s;
}
.node:active { transform: translateY(6px); }
.node.done, .node.current { background: var(--c); box-shadow: 0 7px 0 var(--cd); }
.node.done:active, .node.current:active { box-shadow: 0 1px 0 var(--cd); }
.node.locked { background: var(--locked); box-shadow: 0 7px 0 var(--locked-d); filter: grayscale(1); }
.node.locked .node-ico { opacity: .45; }
.node.current::before {
  content: ''; position: absolute; inset: -11px; border-radius: 50%;
  border: 6px solid var(--c); opacity: .35; animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.08); opacity: .15; } }
.node-stars { margin-top: 10px; font-size: 14px; letter-spacing: 1px; height: 16px; }
.node-label { font-size: 12px; color: var(--muted); font-weight: 800; margin-top: 2px; text-align: center; max-width: 130px; }
.start-bubble {
  position: absolute; top: -46px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--c); border: 2px solid var(--border);
  font-weight: 900; padding: 6px 12px; border-radius: 12px; font-size: 14px; white-space: nowrap;
  animation: bob 1.2s ease-in-out infinite; z-index: 2;
}
.start-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: var(--surface); border-right: 2px solid var(--border); border-bottom: 2px solid var(--border);
}
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.trail-buddy { position: absolute; width: 86px; top: -10px; pointer-events: none; }
.trail-buddy svg { width: 100%; display: block; }
.trail-buddy .wave { animation: wave 1.4s ease-in-out infinite; transform-origin: 154px 142px; }

.trophy-end { text-align: center; padding: 10px 0 30px; color: var(--muted); }
.trophy-end div { font-size: 56px; }

/* ---------- Esqueleto ---------- */
.wave { animation: wave 1.8s ease-in-out infinite; transform-origin: 154px 142px; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg); } }
.pet { animation: petBounce 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; }
@keyframes petBounce { 50% { transform: translateY(-6px) rotate(-6deg); } }
.skeleton { overflow: visible; }

/* ---------- Quiz ---------- */
.overlay {
  position: absolute; inset: 0; background: var(--bg); z-index: 20;
  display: flex; flex-direction: column; animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } }
.quiz-head { display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 12px 4px; }
.progress { flex: 1; height: 16px; background: var(--locked); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .4s ease;
  position: relative;
}
.progress-fill::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 999px; background: rgba(255,255,255,.35);
}
.timer { width: 46px; height: 46px; position: relative; flex-shrink: 0; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--locked); stroke-width: 5; }
.timer-fg { fill: none; stroke: var(--blue); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 119.4; transition: stroke .3s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; }
.timer.warn .timer-fg { stroke: var(--orange); }
.timer.danger .timer-fg { stroke: var(--red); }
.timer.danger b { color: var(--red); animation: bump .5s infinite; }

.quiz-sub { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px 0; font-size: 13px; color: var(--muted); font-weight: 800; }
.quiz-gains { display: flex; align-items: center; gap: 6px; color: var(--yellow-d); font-size: 15px; }
.combo { background: var(--orange); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 12px; animation: bump .5s; }

.quiz-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 18px; }
.q-row { display: flex; align-items: flex-end; gap: 8px; }
.q-mascot { width: 84px; flex-shrink: 0; }
.q-mascot svg { width: 100%; display: block; }
.q-bubble {
  flex: 1; position: relative; border: 2px solid var(--border); border-radius: 18px;
  padding: 14px 16px; font-size: 19px; font-weight: 800; line-height: 1.3; margin-bottom: 20px;
  background: var(--surface);
}
.q-bubble::before {
  content: ''; position: absolute; left: -9px; bottom: 18px; width: 14px; height: 14px; background: var(--surface);
  border-left: 2px solid var(--border); border-bottom: 2px solid var(--border); transform: rotate(45deg);
}
.q-mascot.happy svg { animation: jump .5s ease; }
.q-mascot.sad svg { animation: shake .45s ease; }
@keyframes jump { 40% { transform: translateY(-14px) rotate(-4deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--border); padding: 13px 14px; font-size: 17px; font-weight: 800;
  transition: transform .08s, box-shadow .08s;
}
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.opt .key {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--border); border-radius: 9px; font-size: 14px; color: var(--muted);
}
.opt.sel { background: var(--sel-bg); border-color: var(--sel-border); box-shadow: 0 4px 0 var(--sel-border); color: var(--blue); }
.opt.sel .key { border-color: var(--sel-border); color: var(--blue); }
.opt.right { background: var(--ok-bg); border-color: var(--green); box-shadow: 0 4px 0 var(--green); color: var(--ok-text); }
.opt.right .key { border-color: var(--green); color: var(--ok-text); }
.opt.wrong { background: var(--bad-bg); border-color: var(--red); box-shadow: 0 4px 0 var(--red); color: var(--bad-text); animation: shake .4s; }
.opt.wrong .key { border-color: var(--red); color: var(--bad-text); }
.opt:disabled { cursor: default; }

.quiz-foot { padding: 14px 16px calc(env(safe-area-inset-bottom) + 18px); border-top: 2px solid var(--border); }
.feedback {
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); animation: slideUp .25s ease;
}
.feedback.ok { background: var(--ok-bg); color: var(--ok-text); }
.feedback.bad { background: var(--bad-bg); color: var(--bad-text); }
.feedback.ok .btn { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.feedback.bad .btn { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.fb-title { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; }
.fb-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 20px; }
.fb-gain { margin-left: auto; font-size: 15px; background: var(--surface); padding: 4px 10px; border-radius: 999px; color: var(--yellow-d); }
.fb-text { margin: 8px 0 16px; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--text); }
.fb-text b { color: inherit; }

/* ---------- Resultado ---------- */
.result { align-items: center; justify-content: center; text-align: center; padding: 24px 20px calc(env(safe-area-inset-bottom) + 20px); gap: 10px; overflow-y: auto; }
.result-avatar { width: 170px; height: 200px; border-radius: 28px; padding: 6px 10px 0; animation: dance 1s ease-in-out infinite; }
.result-avatar svg { width: 100%; height: 100%; }
.result.fail .result-avatar { animation: none; transform: rotate(-4deg); filter: saturate(.6); }
@keyframes dance { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-6px); } }
.result h1 { margin: 6px 0 0; font-size: 28px; font-weight: 900; color: var(--yellow-d); }
.result.fail h1 { color: var(--red); }
.result p { margin: 0; color: var(--muted); font-size: 15px; }
.stars { font-size: 46px; display: flex; gap: 6px; justify-content: center; margin: 4px 0; }
.stars span { display: inline-block; animation: starPop .5s backwards; }
.stars span.off { filter: grayscale(1); opacity: .3; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } }
.stat-row { display: flex; gap: 10px; width: 100%; margin: 12px 0 16px; }
.stat {
  flex: 1; border-radius: 16px; border: 2px solid var(--sc); overflow: hidden; background: var(--sc);
}
.stat small { display: block; color: #fff; font-size: 11px; font-weight: 900; text-transform: uppercase; padding: 4px 0; letter-spacing: .5px; }
.stat b { display: block; background: var(--surface); color: var(--sc); font-size: 17px; white-space: nowrap; font-weight: 900; padding: 10px 0; border-radius: 13px; }
.result .btn { margin-top: 6px; }

/* ---------- Sheet / modal ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 40; animation: fadeIn .2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(env(safe-area-inset-bottom) + 22px);
  animation: sheetUp .28s cubic-bezier(.2,.9,.3,1.2);
  max-height: 90%; overflow-y: auto;
}
.sheet.center { top: 50%; bottom: auto; left: 16px; right: 16px; transform: translateY(-50%); border-radius: 24px; animation: popIn .35s cubic-bezier(.2,.9,.3,1.3); }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes popIn { from { transform: translateY(-50%) scale(.6); opacity: 0; } }
.sheet h3 { margin: 0 0 4px; font-size: 22px; font-weight: 900; }
.sheet p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.sheet .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sheet .chips span { background: var(--surface-2); border: 2px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.sheet input {
  width: 100%; font: inherit; font-size: 18px; font-weight: 800; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface-2); color: var(--text); margin-bottom: 16px; outline: none;
}
.sheet input:focus { border-color: var(--blue); }
.sheet .row { display: flex; gap: 10px; }
.sheet .row .btn { flex: 1; }
.title-big { font-size: 74px; text-align: center; animation: starPop .6s; }
.sheet .center-text { text-align: center; }
.sheet .badge-title { display: inline-block; background: var(--yellow); color: #5b4300; padding: 8px 16px; border-radius: 999px; font-weight: 900; font-size: 18px; margin: 6px 0 14px; box-shadow: 0 4px 0 var(--yellow-d); }
.onb-avatar { width: 130px; margin: 0 auto 8px; }
.onb-avatar svg { width: 100%; display: block; }

/* ---------- Toast ---------- */
.toast {
  position: absolute; top: calc(env(safe-area-inset-top) + 70px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 14px; font-weight: 800;
  z-index: 60; font-size: 15px; animation: popToast .3s ease; white-space: nowrap; max-width: 92%;
}
@keyframes popToast { from { transform: translate(-50%, -14px); opacity: 0; } }
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 70; width: 100%; height: 100%; }

/* ---------- Seções gerais ---------- */
.page-title { font-size: 24px; font-weight: 900; margin: 4px 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.card { border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }

/* ---------- Ranking ---------- */
.league {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--lc1), var(--lc2)); color: #fff; margin-bottom: 18px; box-shadow: 0 5px 0 rgba(0,0,0,.15);
}
.league .lg-ico { font-size: 42px; }
.league b { font-size: 19px; display: block; }
.league small { opacity: .95; font-size: 13px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 8px 0 18px; }
.pod { flex: 1; text-align: center; max-width: 120px; }
.pod .pod-av { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 50%; overflow: hidden; border: 4px solid var(--pc); }
.pod .pod-av svg { width: 100%; height: 100%; }
.pod .pod-name { font-size: 13px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pod-xp { font-size: 12px; color: var(--muted); }
.pod .pod-base {
  margin-top: 6px; background: var(--pc); color: #fff; border-radius: 12px 12px 0 0; font-size: 28px; font-weight: 900;
  display: grid; place-items: center; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12);
}
.pod.p1 .pod-base { height: 96px; } .pod.p2 .pod-base { height: 70px; } .pod.p3 .pod-base { height: 54px; }
.pod.p1 .pod-av { width: 76px; height: 76px; }
.rank-list { display: flex; flex-direction: column; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 2px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank-row.me { background: var(--sel-bg); }
.rank-pos { width: 26px; text-align: center; font-weight: 900; color: var(--muted); font-size: 16px; }
.rank-row .mini-avatar { width: 46px; height: 46px; }
.rank-name { flex: 1; min-width: 0; }
.rank-name b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-name small { color: var(--muted); font-size: 12px; font-weight: 700; }
.rank-xp { font-weight: 900; color: var(--muted); font-size: 14px; }
.rank-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 12px; }
.zone { font-size: 12px; font-weight: 900; text-align: center; padding: 6px; letter-spacing: .5px; }
.zone.up { color: var(--green-d); background: var(--ok-bg); }

/* ---------- Loja ---------- */
.shop-stage {
  border-radius: 24px; height: 230px; display: flex; justify-content: center; align-items: flex-end;
  margin-bottom: 14px; position: relative; overflow: hidden; border: 2px solid var(--border);
  transition: background .3s;
}
.shop-stage svg { height: 96%; }
.shop-stage .try-tag { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; background: var(--surface); border: 2px solid var(--border); box-shadow: 0 3px 0 var(--border);
  border-radius: 14px; padding: 8px 14px; font-weight: 900; font-size: 14px; color: var(--muted);
}
.tab.active { background: var(--sel-bg); border-color: var(--sel-border); box-shadow: 0 3px 0 var(--sel-border); color: var(--blue); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.item {
  border: 2px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 0 var(--border);
  padding: 10px; text-align: center; background: var(--surface); display: flex; flex-direction: column; gap: 6px;
}
.item.equipped { border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
.item.previewing { border-color: var(--blue); box-shadow: 0 4px 0 var(--blue); }
.item .prev { height: 92px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.item .prev svg { height: 100%; max-width: 100%; }
.bg-swatch { width: 100%; height: 100%; }
.pet-swatch { font-size: 52px; line-height: 1; }
.item .name { font-size: 14px; font-weight: 900; }
.item .btn { padding: 8px 6px; font-size: 13px; border-radius: 12px; }
.price { color: var(--yellow-d); }

/* ---------- Perfil ---------- */
.hero {
  border-radius: 24px; height: 250px; display: flex; justify-content: center; align-items: flex-end;
  position: relative; overflow: hidden; border: 2px solid var(--border);
}
.hero svg { height: 96%; }
.profile-name { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 2px; }
.profile-name h2 { margin: 0; font-size: 24px; font-weight: 900; }
.title-badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--yellow); color: #5b4300;
  padding: 5px 12px; border-radius: 999px; font-weight: 900; font-size: 14px; box-shadow: 0 3px 0 var(--yellow-d);
}
.xpbar { margin: 16px 0 6px; }
.xpbar .lbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.xpbar .bar { height: 16px; background: var(--locked); border-radius: 999px; overflow: hidden; }
.xpbar .bar div { height: 100%; background: var(--yellow); border-radius: 999px; }
.section-h { font-size: 19px; font-weight: 900; margin: 22px 0 10px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; gap: 10px; align-items: center; }
.stat-card .ico { font-size: 26px; }
.stat-card b { font-size: 19px; display: block; line-height: 1.1; }
.stat-card small { color: var(--muted); font-size: 12px; font-weight: 800; }
.titles { display: flex; flex-direction: column; gap: 8px; }
.title-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--border); border-radius: 14px; }
.title-row .t-ico { font-size: 26px; width: 34px; text-align: center; }
.title-row b { font-size: 15px; display: block; }
.title-row small { color: var(--muted); font-size: 12px; }
.title-row.locked { opacity: .5; }
.title-row.locked .t-ico { filter: grayscale(1); }
.title-row.current { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.settings { display: flex; flex-direction: column; gap: 10px; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; }
.switch { width: 52px; height: 30px; border-radius: 999px; background: var(--locked); border: none; position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(22px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Instalar app ---------- */
.install-card, .install-banner, .info-banner {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 2px solid var(--sel-border); background: var(--sel-bg); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 4px 0 var(--sel-border); margin-top: 18px;
}
.install-banner, .info-banner { margin: 0 0 14px; box-shadow: none; padding: 10px 8px 10px 12px; }
.install-card .ic, .install-banner .ic, .info-banner .ic { font-size: 30px; }
.install-card span:nth-child(2), .install-banner span:nth-child(2), .info-banner span:nth-child(2) { flex: 1; min-width: 0; }
.install-card b, .install-banner b, .info-banner b { display: block; font-size: 16px; color: var(--blue); }
.install-card small, .install-banner small, .info-banner small { color: var(--muted); font-size: 13px; }
.install-card .go { font-size: 30px; color: var(--blue); font-weight: 900; }
.install-banner .icon-btn, .info-banner .icon-btn { font-size: 18px; padding: 4px; }
.steps { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; line-height: 1.4; }

/* ---------- Baú diário ---------- */
.chest-card {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin: 0 0 14px;
  border: 2px solid var(--yellow-d); background: color-mix(in srgb, var(--yellow) 18%, var(--surface));
  border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 4px 0 var(--yellow-d);
}
.chest-card:active { transform: translateY(4px); box-shadow: none; }
.chest-card .chest-ico { font-size: 34px; animation: wiggle 1.6s ease-in-out infinite; }
.chest-card span:nth-child(2) { flex: 1; min-width: 0; }
.chest-card b { display: block; font-size: 16px; color: var(--yellow-d); }
.chest-card small { color: var(--muted); font-size: 13px; }
.chest-card .go { font-size: 30px; color: var(--yellow-d); font-weight: 900; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-14deg); } 84% { transform: rotate(12deg); } 92% { transform: rotate(-6deg); } }
.chest-big { font-size: 90px; line-height: 1.1; animation: starPop .5s; }
.chest-big.shake { animation: shake .35s infinite; }

/* ---------- PRO ---------- */
.unit .pro-tag {
  position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.95); color: #8a4fd8;
  font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 999px; letter-spacing: .4px; z-index: 1;
}
.unit .pro-tag.free { color: var(--green-d); }
.unit-pro-btn { margin-top: 12px; background: #fff; color: #8a4fd8; box-shadow: 0 4px 0 rgba(0,0,0,.2); position: relative; z-index: 1; }
.unit.locked .unit-pro-btn { filter: none; }
.btn-pro { background: linear-gradient(135deg, #ce82ff, #8a4fd8); color: #fff; box-shadow: 0 5px 0 #6d36b8; }
.item { position: relative; }
.item-pro { position: absolute; top: 6px; right: 8px; font-size: 18px; z-index: 1; }
.pro-chip { font-size: 12px; vertical-align: middle; background: linear-gradient(135deg, #ce82ff, #8a4fd8); color: #fff; padding: 3px 8px; border-radius: 999px; }
.chip-avatar span.pro { border-color: #ce82ff; box-shadow: 0 0 0 2px color-mix(in srgb, #ce82ff 40%, transparent); }

.paywall .pw-head { text-align: center; }
.pw-crown { font-size: 64px; line-height: 1; animation: bob2 2s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-6px) rotate(-6deg); } }
.paywall h3 { font-size: 26px; background: linear-gradient(135deg, #ce82ff, #8a4fd8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pw-list { list-style: none; padding: 0; margin: 4px 0 18px; display: flex; flex-direction: column; gap: 10px; }
.pw-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 700; line-height: 1.35; }
.pw-list li span { font-size: 20px; width: 26px; text-align: center; flex-shrink: 0; }
.pw-plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.pw-plan {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; text-align: left;
  border: 2px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); box-shadow: 0 4px 0 var(--border);
}
.pw-plan:active { transform: translateY(4px); box-shadow: none; }
.pw-plan b { font-size: 18px; }
.pw-plan .pw-price { font-weight: 900; font-size: 17px; color: #8a4fd8; text-align: right; }
.pw-plan small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.pw-plan.best { border-color: #ce82ff; box-shadow: 0 4px 0 #ce82ff; background: color-mix(in srgb, #ce82ff 10%, var(--surface)); }
.pw-badge { position: absolute; top: -11px; left: 14px; background: #ce82ff; color: #fff; font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 999px; letter-spacing: .5px; }
.pw-small { color: var(--muted); font-size: 13px !important; text-align: center; margin: 10px 0 12px !important; }

/* ---------- Conta / login ---------- */
.account-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px;
  border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.account-card div { min-width: 0; }
.account-card b { display: block; font-size: 16px; }
.account-card small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.account-card.pro { border-color: #ce82ff; background: color-mix(in srgb, #ce82ff 10%, var(--surface)); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #3c3c3c; border: 2px solid var(--border); box-shadow: 0 4px 0 var(--border); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 2px; background: var(--border); }
.link-btn { display: block; margin: 14px auto 0; background: none; border: none; color: var(--blue); font-weight: 900; font-size: 15px; }
.warn-text { color: var(--red) !important; font-weight: 800; }

/* Verdadeiro ou falso: botões lado a lado */
.options.tf { flex-direction: row; }
.options.tf .opt { flex: 1; flex-direction: column; justify-content: center; padding: 18px 10px; text-align: center; }
.options.tf .opt .key { width: 40px; height: 40px; font-size: 20px; }

/* ---------- Reportar pergunta / admin ---------- */
.fb-report { display: block; margin: 12px auto 0; background: none; border: none; color: inherit; opacity: .75; font-weight: 800; font-size: 13px; text-decoration: underline; }
.report-q { background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.sheet textarea {
  width: 100%; font: inherit; font-size: 16px; font-weight: 700; padding: 12px 14px; border-radius: 14px; resize: vertical;
  border: 2px solid var(--border); background: var(--surface-2); color: var(--text); margin-bottom: 14px; outline: none;
}
.sheet textarea:focus { border-color: var(--blue); }
.admin-link { display: block; text-align: center; text-decoration: none; margin-top: 12px; }

.legal-links a, .pw-small a { color: var(--blue); font-weight: 800; }

/* ---------- Jornada por períodos ---------- */
.year-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 6px; color: var(--muted); font-size: 13px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; }
.year-h::before, .year-h::after { content: ''; flex: 1; height: 2px; background: var(--border); border-radius: 2px; }
.unit-toggle { margin-top: 12px; background: rgba(255,255,255,.22); color: #fff; border: none; border-radius: 12px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 900; letter-spacing: .5px; position: relative; z-index: 1; }
.unit-toggle:active { transform: translateY(2px); }
.unit.complete::after { content: '🎓'; }
.node.exam { width: 92px; height: 84px; border-radius: 28px; font-size: 38px; }
.node.exam.done, .node.exam.current { background: linear-gradient(160deg, var(--c), var(--cd)); box-shadow: 0 7px 0 var(--cd), 0 0 0 5px var(--yellow); }
.node.exam.current::before { border-radius: 34px; border-color: var(--yellow); opacity: .6; }
.exam-wrap .node-label { font-weight: 900; color: var(--text); font-size: 13px; }
.grad-card, .newclass-card { border: 2px dashed var(--border); border-radius: var(--radius); padding: 16px; margin: 18px 0 4px; display: flex; gap: 14px; align-items: center; }
.grad-card .gc-ico { font-size: 40px; }
.grad-card b { display: block; font-size: 18px; }
.grad-card small { color: var(--muted); font-size: 13px; }
.grad-card.done { border: 2px solid var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.newclass-card { flex-direction: column; text-align: center; border: 2px solid var(--yellow); background: color-mix(in srgb, var(--yellow) 12%, transparent); margin-bottom: 30px; }
.newclass-card .nc-ico { font-size: 56px; }
.newclass-card b { font-size: 19px; }
.newclass-card p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.turma-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.ceremony .cer-stage { height: 200px; border-radius: 20px; display: grid; place-items: end center; overflow: hidden; margin-bottom: 12px; }
.ceremony .cer-stage svg { height: 186px !important; width: auto !important; max-width: 100%; }
.diploma { border: 3px double #c99400; background: #fffaf0; color: #5b4300; border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; display: grid; gap: 2px; }
.diploma small { letter-spacing: 3px; font-weight: 900; font-size: 11px; }
.diploma b { font-size: 22px; }
.diploma span { font-size: 13px; }
.diploma em { font-size: 12px; font-style: normal; opacity: .8; }
#quiz.exam-mode .quiz-head { box-shadow: inset 0 -4px 0 var(--yellow); }

/* ---------- Fundo animado da trilha ---------- */
.path.themed { margin: 0 -6px; border-radius: 32px; background:
  radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%),
  linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, transparent), color-mix(in srgb, var(--c) 4%, transparent)); }
.path > .node-wrap { z-index: 1; }
.path-deco { position: absolute; inset: 0; overflow: hidden; border-radius: 32px; pointer-events: none; z-index: 0; }
.path-deco span { position: absolute; opacity: .32; animation: deco-float 9s ease-in-out infinite; will-change: transform; }
@keyframes deco-float {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  33% { transform: translate(8px, -16px) rotate(6deg); }
  66% { transform: translate(-6px, -6px) rotate(-2deg); }
}
.path-deco .bubble { position: absolute; border-radius: 50%; background: var(--c); opacity: .08; animation: deco-pulse 6s ease-in-out infinite; }
.path-deco .b1 { width: 180px; height: 180px; left: -60px; top: 18%; }
.path-deco .b2 { width: 140px; height: 140px; right: -50px; top: 52%; animation-delay: -2s; }
.path-deco .b3 { width: 120px; height: 120px; left: 30%; bottom: -50px; animation-delay: -4s; }
@keyframes deco-pulse { 50% { transform: scale(1.18); opacity: .13; } }

/* ---------- Energia ---------- */
.chip-energy { border: none; background: none; font: inherit; color: inherit; cursor: pointer; }
.chip-energy b { color: #ffb100; }
.chip-energy.low b { color: var(--red); }
.chip-energy.low .chip-ico { animation: pulse-e 1.2s ease-in-out infinite; }
@keyframes pulse-e { 50% { transform: scale(1.2); } }
.energy-big { font-size: 64px; filter: drop-shadow(0 6px 0 rgba(0,0,0,.12)); animation: bob-e 1.6s ease-in-out infinite; }
.energy-big.empty { filter: grayscale(1); opacity: .6; }
@keyframes bob-e { 50% { transform: translateY(-6px); } }
.energy-bar { position: relative; height: 26px; border-radius: 99px; background: var(--border); overflow: hidden; margin: 6px 0 10px; }
.energy-bar div { height: 100%; background: linear-gradient(90deg, #ffc800, #ff9600); border-radius: 99px; transition: width .4s; }
.energy-bar b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .path-deco span, .path-deco .bubble, .energy-big, .chip-energy.low .chip-ico { animation: none; } }
