/* Tema espacial: sempre escuro, cada planeta troca o --accent */
:root {
  color-scheme: dark;
  --bg: #140c3f;
  --surface: rgba(36, 22, 92, .78);
  --surface-2: rgba(70, 48, 150, .6);
  --text: #f1f3ff;
  --muted: #b7acdf;
  --grid: rgba(190, 170, 255, .2);
  --accent: #38bdf8;
  --accent-2: #ff5fa2;
  --accent-deep: color-mix(in srgb, var(--accent) 45%, #050816);
  --accent-ink: #ffffff;
  --good: #34d399;
  --warn: #fb923c;
  --bad: #f43f5e;
  --gold: #fbbf24;
  --radius: 22px;
  --fun: "Fredoka", "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: #0b0828; }
body {
  background:
    radial-gradient(ellipse 90% 55% at 10% 5%, rgba(99, 102, 241, .35), transparent 60%),
    radial-gradient(ellipse 80% 55% at 95% 40%, rgba(217, 70, 239, .28), transparent 60%),
    radial-gradient(ellipse 90% 55% at 20% 100%, rgba(56, 189, 248, .18), transparent 60%),
    linear-gradient(180deg, #120a3a, #1d0f52 50%, #0b0828);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font: 600 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 540px; margin: 0 auto; padding: 0 16px; position: relative; }
/* Céu estrelado em duas camadas que piscam em tempos diferentes */
body::before, body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 120px, #cfe3ff, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff, transparent),
    radial-gradient(1px 1px at 230px 170px, #ffd9ec, transparent),
    radial-gradient(2px 2px at 300px 40px, #fff, transparent),
    radial-gradient(1px 1px at 50px 210px, #fff, transparent);
  background-size: 340px 240px;
  animation: twinkle 4s ease-in-out infinite alternate;
}
body::after { background-size: 270px 310px; background-position: 120px 80px; opacity: .6; animation-duration: 6.5s; animation-delay: -2s; }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }
h2 { margin: 0 0 8px; font-size: 1.25rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 540px; margin: 0 auto; padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.35rem; letter-spacing: -.5px; }
.brand img { border-radius: 8px; }
.stats { display: flex; gap: 12px; font-size: .9rem; color: var(--muted); }
.stat b { color: var(--text); }

.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--grid);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.banner { border: 2px solid var(--accent); }
.error { color: var(--bad); }

.btn {
  appearance: none; border: 1px solid var(--grid); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; padding: 13px 18px; border-radius: 14px; cursor: pointer;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, black);
}
.btn.ghost { border: none; background: none; padding: 8px 0; color: var(--muted); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.actions .btn { flex: 1 1 auto; }

/* Fases do planeta */
.path { display: flex; flex-wrap: wrap; gap: 10px 8px; padding: 16px 14px 18px; }
.node {
  width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; padding: 0; color: var(--text); font: inherit; cursor: pointer;
}
.node .dot {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: #0b1020; text-shadow: 0 1px 0 rgba(255,255,255,.3);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 55%, black);
}
.node.current .dot { animation: pulse 1.6s ease-in-out infinite; }
.node.done .dot { background: var(--good); box-shadow: 0 4px 0 color-mix(in srgb, var(--good) 55%, black); }
.node.locked .dot { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.node.cp .dot { border-radius: 16px; }
.node .lbl { font-size: .72rem; text-align: center; line-height: 1.15; color: var(--muted); }
.node .st { font-size: .75rem; color: var(--gold); letter-spacing: 1px; min-height: 1em; }
.node:disabled { cursor: default; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* Mascote */
.mascot-row { display: flex; align-items: flex-end; gap: 10px; margin: 6px 0 12px; }
.mascot-row:empty { display: none; }
.tom { width: 64px; height: 70px; flex: 0 0 auto; overflow: visible; }
.tom .pupil { fill: #1c1a2b; }
.tom .m-line { fill: none; stroke: #1c1a2b; stroke-width: 3.5; stroke-linecap: round; }
.tom .m-line.thin { stroke-width: 3; }
.tom .m-fill { fill: #1c1a2b; }
.tom-body { transform-origin: 60px 120px; animation: bob 2.4s ease-in-out infinite; }
.tom-top .tom-body, .tom-good .tom-body { animation: hop .6s ease-in-out 3; }
.tom-top .hl, .tom-top .hr { animation: clap .32s ease-in-out 8; }
.tom-top .hl { transform-origin: 16px 104px; }
.tom-top .hr { transform-origin: 104px 112px; }
.tom-retry .tom-body { animation: nod 1.2s ease-in-out 2; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes hop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-12px) rotate(-4deg); } }
@keyframes clap { 0%,100% { transform: translate(0,0); } 50% { transform: translate(var(--cx, 22px), -30px); } }
.tom-top .hr { --cx: -22px; }
@keyframes nod { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
.bubble {
  position: relative; background: var(--surface); border: 1px solid var(--grid); border-radius: 16px;
  padding: 10px 14px; font-size: .95rem; font-weight: 600; flex: 1;
}
.bubble::before {
  content: ""; position: absolute; left: -8px; bottom: 14px; width: 14px; height: 14px; background: var(--surface);
  border-left: 1px solid var(--grid); border-bottom: 1px solid var(--grid); transform: rotate(45deg);
}
.result .mascot-row { justify-content: center; }

/* Teste de extensão e afinador */
.live-note { text-align: center; margin: 16px 0 8px; }
.big-note { font-size: 3.2rem; font-weight: 800; text-align: center; }
.meter { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .1s linear; }
.skip { margin-top: 16px; }
.skip summary { color: var(--muted); cursor: pointer; }

.gauge { margin: 12px 0; }
.gauge-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.gauge-track { position: relative; height: 36px; border-radius: 8px; background: linear-gradient(90deg, var(--warn), var(--good) 40%, var(--good) 60%, var(--warn)); opacity: .9; }
.gauge-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.needle { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; left: 50%; background: var(--text); border-radius: 2px; transition: left .08s linear; }

/* Exercício */
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ex-world { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; flex: 1; text-align: center; }
.lives { color: var(--bad); font-size: 1.2rem; letter-spacing: 2px; }
.roll-wrap { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
#ex-canvas { display: block; width: 100%; height: 300px; }
.staff {
  position: absolute; top: 8px; right: 8px; width: 46%; max-width: 230px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--grid);
  border-radius: 12px; padding: 2px 4px;
}
.staff:empty { display: none; }
.staff-svg { display: block; width: 100%; height: auto; }
.st-line { stroke: var(--muted); stroke-width: 1; opacity: .7; }
.st-clef { font-size: 40px; fill: var(--text); font-family: "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; }
.st-clef.bass { font-size: 30px; }
.st-acc { font-size: 13px; fill: var(--text); }
.st-eight { font-size: 10px; font-weight: 700; fill: var(--text); }
.st-note { fill: var(--text); transition: fill .15s; }
.st-note.now { fill: var(--accent); }
.st-note.hit { fill: var(--good); }
.st-note.miss { fill: var(--warn); }
.status {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 1.15rem;
  background: var(--bg); padding: 5px 14px; border-radius: 12px; white-space: nowrap;
}
.status:empty { display: none; }
.ex-live { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.level { position: relative; display: inline-block; width: 70px; height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.level i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--good); transition: width .05s linear; }
.level.wide { display: block; width: 100%; height: 12px; margin: 8px 0; }
.level .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); left: 30%; }
.controls .btn { font-size: 1.05rem; }

.breath { text-align: center; }
.breath-center { position: relative; }
.breath-label { font-weight: 800; font-size: 1.3rem; }
.breath-secs { font-weight: 800; font-size: 2.2rem; font-variant-numeric: tabular-nums; min-height: 1.3em; }

.result { text-align: center; margin-top: 16px; }
.stars { font-size: 2rem; color: var(--gold); letter-spacing: 6px; }
.stars .off { color: var(--grid); }
.stars span { display: inline-block; animation: pop .4s ease-out both; }
.stars span:nth-child(2) { animation-delay: .15s; }
.stars span:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.score { font-size: 2.6rem; font-weight: 800; }
.score small { font-size: 1rem; color: var(--muted); }
.verdict { font-weight: 800; }
.verdict.pass { color: var(--good); }
.verdict.fail { color: var(--warn); }
.feedback { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; text-align: left; }
.feedback::before { content: "Dica: "; font-weight: 800; }
.metrics { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.metrics li { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; margin: 6px 0; font-size: .9rem; }
.bar { height: 8px; background: var(--grid); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.slider { display: block; margin: 12px 0; font-weight: 600; }
.slider input { display: block; width: 100%; margin-top: 6px; accent-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center; z-index: 10;
}

/* Navegação inferior */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; z-index: 5;
  background: rgba(10, 13, 34, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--grid);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 0 1 180px; background: none; border: none; font: inherit; font-weight: 700;
  color: var(--muted); padding: 16px 8px; cursor: pointer;
}
.tabs button.active { color: var(--accent); }

/* ---------- Planetas ---------- */
.planet { position: relative; width: var(--s); height: var(--s); flex: 0 0 auto; }
.planet-svg { position: absolute; left: 50%; top: 50%; width: 160%; height: 160%; translate: -50% -50%; overflow: visible; }
.planet-spin { animation: pspin 16s linear infinite; }
@keyframes pspin { from { transform: translateX(0); } to { transform: translateX(-100px); } }
.planet.hero { margin: 4px auto 14px; animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Galáxia ---------- */
.galaxy { position: relative; padding: 8px 0 24px; overflow-x: clip; }
.orbit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.orbit path { fill: none; stroke: rgba(180, 195, 255, .35); stroke-width: 2.5; stroke-dasharray: 2 10; stroke-linecap: round; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.gp {
  position: relative; display: flex; align-items: center; gap: 22px; width: 100%;
  background: none; border: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
  padding: 14px 22px; min-height: 150px;
}
.gp.right { flex-direction: row-reverse; text-align: right; }
.gp-art { position: relative; width: 140px; display: grid; place-items: center; flex: 0 0 auto; }
.gp-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.gp-text small { font-size: .72rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--glow); }
.gp-text b { font-size: 1.3rem; letter-spacing: -.3px; line-height: 1.15; }
.gp-text em { font-style: normal; font-size: .85rem; color: var(--muted); }
.gp.locked .planet, .gp.soon .planet { filter: grayscale(.55) brightness(.6); }
.gp.locked .gp-text b, .gp.soon .gp-text b { color: var(--muted); }
.gp.cleared .gp-text em { color: var(--good); }
.gp.current .gp-text em { color: var(--text); font-weight: 700; }
.gp:active .planet { transform: scale(.96); }
.gp-rocket { position: absolute; width: 34px; right: -6px; top: -10px; animation: hover 2s ease-in-out infinite; z-index: 3; }
.gp.right .gp-rocket { right: auto; left: -6px; }
.gp-rocket .rocket { width: 100%; height: auto; transform: rotate(35deg); filter: drop-shadow(0 0 8px rgba(255, 176, 46, .6)); }
@keyframes hover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.rocket .flame { transform-origin: 30px 86px; animation: flame .15s ease-in-out infinite alternate; }
@keyframes flame { from { transform: scaleY(.75); } to { transform: scaleY(1.15); } }

/* ---------- Tela do planeta ---------- */
.pill { font-weight: 800; font-size: .8rem; background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.w-hero { text-align: center; padding-top: 4px; }
.w-hero h2 { font-size: 1.6rem; letter-spacing: -.5px; margin-bottom: 2px; }
#w-path { justify-content: center; background: var(--surface); border: 1px solid var(--grid); border-radius: var(--radius); margin: 10px 0 16px; }
.boss-card { display: flex; gap: 14px; align-items: center; border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.boss-card.ready { border-color: var(--bad); box-shadow: 0 0 24px rgba(244, 63, 94, .25); }
.boss-card-art { width: 96px; flex: 0 0 auto; }
.boss-card-text { flex: 1; min-width: 0; }
.boss-card-text small { font-size: .72rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--bad); }
.boss-card.down .boss-card-text small { color: var(--good); }
.boss-card-text b { display: block; font-size: 1.25rem; }
.taunt { font-size: .9rem; color: var(--muted); font-style: italic; margin: 4px 0 0; }
.boss-card .actions { margin-top: 10px; }

/* ---------- Chefões ---------- */
.boss { width: 100%; height: auto; overflow: visible; display: block; }
.boss .b-line { fill: none; stroke: #0b1020; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.boss .b-line.thin { stroke-width: 2.5; }
.boss .b-pupil { fill: #0b1020; }
.boss .b-led { fill: #fde047; }
.boss-body { transform-origin: 60px 110px; }
.boss-img .boss-body { transform-origin: 50% 95%; }
.boss-img img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .45)) drop-shadow(0 0 14px color-mix(in srgb, var(--boss) 45%, transparent)); user-select: none; -webkit-user-drag: none; }
.boss-img .boss-vec { width: 100%; height: auto; display: block; overflow: visible; }
.boss-img .boss-vec .b-line { fill: none; stroke: #0b1020; stroke-width: 4; stroke-linecap: round; }
.boss-img .boss-vec .b-pupil { fill: #0b1020; } .boss-img .boss-vec .b-led { fill: #fde047; }
.boss.hit img { filter: drop-shadow(0 0 16px #fff) brightness(1.6); transition: filter .2s; }
.boss.idle .boss-body { animation: menace 2.2s ease-in-out infinite; }
.boss.hit .boss-body { animation: hit .5s ease-in-out 2; }
.boss.laugh .boss-body { animation: laugh .25s ease-in-out 6; }
.boss.ko .boss-body { animation: ko 1.2s ease-in forwards; }
.boss-card.down .boss.ko .boss-body { animation: none; transform: rotate(80deg) translateY(10px) scale(.85); opacity: .55; filter: grayscale(.8); }
@keyframes menace { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.05, .95) rotate(-3deg); } }
@keyframes hit { 0%,100% { transform: translateX(0); filter: none; } 25% { transform: translateX(-8px) rotate(-6deg); filter: brightness(2.2); } 75% { transform: translateX(8px) rotate(6deg); } }
@keyframes laugh { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px) scale(1.04); } }
@keyframes ko { 0% { transform: none; filter: brightness(2.5); } 30% { transform: rotate(-15deg) scale(1.1); } 100% { transform: rotate(80deg) translateY(10px) scale(.85); opacity: .55; filter: grayscale(.8); } }

.boss-panel {
  display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; padding: 10px 14px;
  background: linear-gradient(135deg, rgba(244, 63, 94, .16), var(--surface)); border: 1px solid rgba(244, 63, 94, .4); border-radius: var(--radius);
}
.boss-art { width: 70px; flex: 0 0 auto; }
.boss-info { flex: 1; min-width: 0; }
.boss-info b { font-size: 1.05rem; }
.hp { height: 12px; border-radius: 6px; background: rgba(0,0,0,.4); overflow: hidden; margin: 6px 0 4px; border: 1px solid rgba(255,255,255,.12); }
.hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f43f5e, #fb923c); transition: width .8s cubic-bezier(.3, 1.4, .5, 1); }
.boss-info small { display: block; font-size: .8rem; line-height: 1.3; }

/* Combo de notas certas seguidas */
.combo {
  position: absolute; top: 10px; left: 10px; font-weight: 900; font-size: 1.05rem; padding: 4px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #fb923c); color: #2a1600; box-shadow: 0 0 16px rgba(251, 191, 36, .5);
}
.combo.bump { animation: pop .35s ease-out; }

/* ---------- Bexiga do fôlego ---------- */
.balloon-stage { position: relative; height: 270px; margin: 4px auto 6px; width: 220px; }
.balloon {
  --fill: 0;
  position: absolute; left: 50%; bottom: 72px; width: 160px; margin-left: -80px;
  transform-origin: 50% 100%;
  transform: scale(calc(.28 + .62 * var(--fill)));
  transition: transform .18s ease-out;
  filter: drop-shadow(0 0 calc(var(--fill) * 26px) color-mix(in srgb, var(--accent) 70%, transparent));
}
.balloon svg { display: block; width: 100%; height: auto; }
.balloon.leak { transition-duration: .5s; }
.balloon.full { animation: wobble .4s ease-in-out infinite; }
.balloon.fly { animation: fly 1.3s ease-in forwards; }
.balloon.deflate { transition: transform .9s cubic-bezier(.5, -0.4, .7, 1); animation: shake .15s linear 6; }
@keyframes wobble { 0%,100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes shake { 0%,100% { translate: 0; } 50% { translate: 4px 0; } }
@keyframes fly { to { translate: 0 -260px; rotate: 10deg; opacity: 0; } }
.balloon-string { position: absolute; left: 50%; bottom: 0; width: 20px; height: 74px; margin-left: -10px; }
.balloon-string path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.balloon.fly ~ .balloon-string { opacity: 0; transition: opacity .3s .2s; }
.meter { position: relative; }
.meter-goal { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }

/* ---------- Viagem de foguete ---------- */
.travel { position: fixed; inset: 0; z-index: 50; background: #03050f; overflow: hidden; opacity: 0; transition: opacity .35s; }
.travel.go { opacity: 1; }
.travel.fade { opacity: 0; transition-duration: .45s; }
.warp {
  position: absolute; inset: -50%;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.0) 0deg 4deg, rgba(200,220,255,.5) 4deg 4.4deg, rgba(255,255,255,0) 4.4deg 9deg);
  -webkit-mask: radial-gradient(circle, transparent 6%, #000 40%); mask: radial-gradient(circle, transparent 6%, #000 40%);
  opacity: 0; transform: scale(.6);
}
.travel.go .warp { animation: warp 3.4s ease-in-out forwards; }
@keyframes warp { 15% { opacity: .2; } 45% { opacity: .9; transform: scale(1.4) rotate(8deg); } 80% { opacity: .5; } 100% { opacity: 0; transform: scale(2.2) rotate(14deg); } }
.travel-from, .travel-to { position: absolute; left: 50%; top: 50%; translate: -50% -50%; }
.travel-from { animation: leave 1.6s ease-in forwards; }
.travel-to { opacity: 0; scale: .05; }
.travel.arrive .travel-to { animation: arrive 1.4s cubic-bezier(.2, .9, .3, 1.1) forwards; }
@keyframes leave { 0% { transform: none; } 30% { transform: translateY(-20px); } 100% { transform: translate(-160%, 140%) scale(.2); opacity: 0; } }
@keyframes arrive { from { opacity: 0; scale: .05; } to { opacity: 1; scale: 1; } }
.travel-rocket { position: absolute; left: 50%; top: 50%; width: 64px; margin: -60px 0 0 -32px; z-index: 2; animation: blast 3.6s ease-in-out forwards; }
.travel-rocket .rocket { width: 100%; height: auto; filter: drop-shadow(0 0 18px rgba(255, 176, 46, .8)); }
@keyframes blast {
  0% { transform: translate(-90px, 160px) rotate(30deg) scale(.6); }
  20% { transform: translate(0, 40px) rotate(15deg) scale(1); }
  35%, 60% { transform: translate(0, 0) rotate(0) scale(1.05); }
  45% { transform: translate(-3px, 2px) rotate(-2deg) scale(1.05); }
  80% { transform: translate(0, -60px) rotate(0) scale(.8); }
  100% { transform: translate(0, -128px) rotate(0) scale(.5); }
}
.travel-text { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; color: #fff; animation: rise .6s .3s both; }
.travel-text small { display: block; font-size: .85rem; letter-spacing: 3px; text-transform: uppercase; color: #9ea6cc; }
.travel-text b { font-size: 1.8rem; letter-spacing: -.5px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  .planet-spin, .orbit path, body::before, body::after, .boss .boss-body, .gp-rocket { animation: none !important; }
}

.test-banner { text-align: center; font-size: .82rem; font-weight: 700; color: var(--gold); background: rgba(251, 191, 36, .1); border: 1px dashed rgba(251, 191, 36, .5); border-radius: 12px; padding: 6px 10px; }

/* Medidor de afinação: agulha em relação à nota-alvo do momento */
.tune { margin-top: 12px; }
.tune-track { position: relative; height: 22px; border-radius: 11px; background: linear-gradient(90deg, rgba(251,146,60,.45), rgba(251,146,60,.12) 35%, rgba(251,146,60,.12) 65%, rgba(251,146,60,.45)); border: 1px solid var(--grid); overflow: hidden; }
.tune-zone { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; transform: translateX(-50%); background: rgba(52, 211, 153, .3); border-left: 2px solid var(--good); border-right: 2px solid var(--good); }
.tune-needle { position: absolute; top: 2px; bottom: 2px; width: 6px; margin-left: -3px; left: 50%; border-radius: 3px; background: var(--muted); transition: left .08s linear, background .15s; opacity: .4; }
.tune.on .tune-needle { opacity: 1; background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.tune.in .tune-needle { background: var(--good); box-shadow: 0 0 12px var(--good); }
.tune-scale { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.tune-scale b { font-size: .95rem; color: var(--text); }
.tune.in .tune-scale b { color: var(--good); }
.tune.on:not(.in) .tune-scale b { color: var(--warn); }


/* ================= Visual lúdico (versão 3) ================= */
h1, h2, h3, .btn, .tabs button, .gp-text b, .gp-text small, .lvl-name, .score, .verdict, .big-note, .logo-text, .chip, .status, .breath-label, .breath-secs, .w-hero h2, .boss-info b, .boss-card-text b, .combo, .travel-text b {
  font-family: var(--fun);
}
h2 { font-weight: 700; letter-spacing: -.2px; }
.card { border-radius: 24px; border: 2px solid rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(52, 32, 128, .8), rgba(30, 18, 80, .82)); }

/* Botões gordinhos com sombra de "apertar" */
.btn {
  font-weight: 600; font-size: 1.05rem; letter-spacing: .2px; border-radius: 18px; padding: 13px 20px;
  border: none; color: #fff; background: linear-gradient(180deg, #8b6cff, #6a46f0);
  box-shadow: 0 5px 0 #3f22a8, inset 0 2px 0 rgba(255,255,255,.3); text-shadow: 0 1px 0 rgba(0,0,0,.2);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #3f22a8, inset 0 2px 0 rgba(255,255,255,.3); }
.btn.primary {
  background: linear-gradient(180deg, #ffd84d, #ff9d1c); color: #5a2a00; text-shadow: 0 1px 0 rgba(255,255,255,.4);
  box-shadow: 0 5px 0 #c2620a, inset 0 2px 0 rgba(255,255,255,.55), 0 8px 18px rgba(255, 157, 28, .3);
}
.btn.primary:active { box-shadow: 0 1px 0 #c2620a, inset 0 2px 0 rgba(255,255,255,.55); }
.btn.danger { background: linear-gradient(180deg, #ff6b8a, #e11d48); box-shadow: 0 5px 0 #9f1239; color: #fff; }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 1.7rem; line-height: 1; display: grid; place-items: center; flex: 0 0 auto; }
.btn.ghost { box-shadow: none; background: none; }
.file-btn { cursor: pointer; text-align: center; }

/* Topo: astronauta do aluno, marca e fichas de moedas/XP */
.top { gap: 10px; padding: 12px 16px; }
.me { width: 46px; height: 46px; border-radius: 50%; padding: 0; border: 3px solid #ffd84d; background: radial-gradient(circle at 40% 30%, #5b3fd6, #241063); overflow: hidden; cursor: pointer; flex: 0 0 auto; box-shadow: 0 3px 0 #c2620a; }
.me .astro.mini { width: 74px; height: auto; margin: -2px 0 0 -14px; }
.me .astro.mini .a-body { animation: none; }
.brand { flex: 1; min-width: 0; }
.logo-text { font-family: var(--fun); font-weight: 700; margin: 0; letter-spacing: -.5px; color: #fff; }
.logo-text span { background: linear-gradient(90deg, #ffd84d, #ff7ac6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text.small { font-size: 1.3rem; }
.stats { gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 5px; border-radius: 999px; background: rgba(10, 6, 40, .55); border: 2px solid rgba(255,255,255,.1); font-weight: 600; color: #fff; font-size: .95rem; }
.chip i { font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; font-size: .85rem; }
.coin-icon { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd84d 40%, #e8961a); box-shadow: inset 0 -2px 0 #b8650c, 0 0 8px rgba(255, 216, 77, .5); position: relative; }
.coin-icon::after { content: "♪"; position: absolute; inset: 0; display: grid; place-items: center; color: #a35a00; font-size: .8rem; font-weight: 900; }
.chip.reward { margin: 4px; font-size: 1.05rem; animation: pop .45s ease-out both; }
.chip.reward:nth-child(2) { animation-delay: .15s; }
.chip.reward:nth-child(3) { animation-delay: .3s; }
#res-xp { display: flex; justify-content: center; flex-wrap: wrap; }

/* Navegação de baixo com ícones */
.tabs { background: linear-gradient(180deg, rgba(40, 22, 110, .95), rgba(20, 10, 60, .98)); border-top: 2px solid rgba(255,255,255,.08); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; padding: 8px 8px 10px; font-size: .9rem; }
.tabs button i { font-style: normal; font-size: 1.35rem; transition: transform .2s; }
.tabs button.active { color: #ffd84d; }
.tabs button.active i { transform: translateY(-3px) scale(1.15); }

/* Astronauta */
.astro { width: 72px; height: auto; flex: 0 0 auto; overflow: visible; }
.astro .a-accent { fill: var(--accent-2, #ff7ac6); }
.astro .a-arm { fill: none; stroke: #e9e4ff; stroke-width: 12; stroke-linecap: round; }
.astro .a-eye { fill: #7df9ff; filter: drop-shadow(0 0 3px #7df9ff); }
.astro .a-face-line { fill: none; stroke: #7df9ff; stroke-width: 3.5; stroke-linecap: round; }
.astro .a-face-fill { fill: #7df9ff; }
.astro .a-note { fill: none; stroke: var(--accent-2, #ff7ac6); stroke-width: 2.5; stroke-linecap: round; }
.astro .a-eq rect { fill: #ffd84d; transform-box: fill-box; transform-origin: bottom; animation: eq .6s ease-in-out infinite alternate; }
.astro .a-eq rect:nth-child(2) { animation-delay: -.2s; fill: #7df9ff; }
.astro .a-eq rect:nth-child(3) { animation-delay: -.4s; fill: #ff7ac6; }
.astro .a-eq rect:nth-child(4) { animation-delay: -.1s; fill: #4ade80; }
@keyframes eq { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
.astro .a-body { transform-origin: 70px 165px; animation: bob 2.6s ease-in-out infinite; }
.astro .a-wave { transform-box: view-box; transform-origin: 96px 112px; }
.astro .a-mic { transform-box: view-box; transform-origin: 44px 112px; }
.astro .a-head { transform-box: view-box; transform-origin: 70px 100px; }
.astro .a-spark { fill: #ffd84d; opacity: 0; }
.astro-top .a-body, .astro-good .a-body { animation: hop .6s ease-in-out 3; }
.astro-top .a-wave { animation: wave .3s ease-in-out 8 alternate; }
.astro-good .a-wave { animation: wave .45s ease-in-out 4 alternate; }
.astro-top .a-spark { animation: spark 1.2s ease-out 2; }
.astro-retry .a-head { animation: tilt 1.4s ease-in-out 2; }
.astro-retry .a-wave { animation: wave .8s ease-in-out 2 alternate; }
.astro-breath .a-head { animation: breathe 2s ease-in-out infinite; }
@keyframes wave { from { transform: rotate(0); } to { transform: rotate(-35deg); } }
@keyframes tilt { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes spark { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) translateY(-10px); } }
.mascot-row .astro { width: 76px; }
.bubble { border-radius: 20px; border: 2px solid rgba(255,255,255,.12); background: rgba(52, 32, 128, .9); font-family: "Nunito", sans-serif; font-weight: 700; }
.bubble::before { background: rgba(52, 32, 128, .9); border-color: rgba(255,255,255,.12); border-width: 2px; }

/* Perfil */
.astro-card { text-align: center; }
.astro-big { display: grid; place-items: center; padding: 6px 0 4px; }
.astro-big .astro { width: 150px; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.me-stats div { background: rgba(10, 6, 40, .45); border-radius: 16px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; }
.me-stats i { font-style: normal; font-size: 1.3rem; }
.me-stats b { font-family: var(--fun); font-size: 1.3rem; }
.me-stats small { color: var(--muted); font-size: .78rem; }

/* Galáxia: bolha de vidro em volta do planeta, número e estrelas */
.gp-bubble { position: absolute; width: 150px; height: 150px; border-radius: 50%; left: 50%; top: 50%; translate: -50% -50%; border: 2px solid rgba(255,255,255,.14); background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.12), rgba(255,255,255,.02) 60%); }
.gp.current .gp-bubble { border-color: rgba(255, 216, 77, .55); box-shadow: 0 0 26px rgba(255, 216, 77, .25); }
.gp-num { position: absolute; top: -6px; left: 50%; translate: -50% 0; z-index: 4; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--fun); font-weight: 700; color: #5a2a00; background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd84d 45%, #e8961a); box-shadow: 0 3px 0 #b8650c; }
.gp.locked .gp-num, .gp.soon .gp-num { background: radial-gradient(circle at 35% 30%, #c9b8ff, #7c5cff 50%, #4c2fb8); color: #fff; box-shadow: 0 3px 0 #2e1680; }
.gp-text .gp-stars { justify-content: flex-start; }
.gp.right .gp-text .gp-stars { justify-content: flex-end; }

/* Estrelas das fases */
.lvl-stars { display: flex; justify-content: center; gap: 1px; }
.lvl-stars i { font-style: normal; font-size: 1.15rem; color: rgba(20, 12, 60, .9); -webkit-text-stroke: 1.5px rgba(255,255,255,.35); line-height: 1; }
.lvl-stars i.on { color: #ffd84d; -webkit-text-stroke: 1.5px #c2620a; filter: drop-shadow(0 0 4px rgba(255, 216, 77, .6)); }
.lvl-stars i:nth-child(2) { translate: 0 -5px; font-size: 1.35rem; }

/* Mapa de fases do planeta */
.level-map { position: relative; margin: 6px -16px 18px; overflow: hidden; }
.map-planet { position: absolute; right: -60px; top: 10px; opacity: .55; pointer-events: none; }
.map-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-trail path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.map-trail .glow { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 14; filter: blur(4px); }
.map-trail .dots { stroke: #fff; stroke-width: 4; stroke-dasharray: 0.1 12; animation: trail 1.4s linear infinite; }
@keyframes trail { to { stroke-dashoffset: -12.1; } }
.lvl { position: absolute; width: 112px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; background: none; border: none; padding: 0; color: #fff; cursor: pointer; font: inherit; z-index: 2; }
.lvl-coin {
  position: relative; z-index: 2; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--fun); font-weight: 700; font-size: 1.5rem; color: #5a2a00;
  background: radial-gradient(circle at 35% 28%, #fff6b0, #ffd84d 40%, #f0a020); border: 3px solid #fff3c4;
  box-shadow: 0 4px 0 #b8650c, 0 0 18px rgba(255, 216, 77, .45);
}
.lvl.locked .lvl-coin { background: radial-gradient(circle at 35% 28%, #e3d6ff, #9a7cff 40%, #5b3bd0); border-color: #cbb8ff; box-shadow: 0 4px 0 #2e1680; font-size: 1.2rem; }
.lvl.current .lvl-coin { animation: pulse 1.4s ease-in-out infinite; box-shadow: 0 4px 0 #b8650c, 0 0 0 6px rgba(255, 216, 77, .25), 0 0 28px rgba(255, 216, 77, .7); }
.lvl-plat { width: 96px; height: 30px; margin-top: -14px; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--accent) 60%, #fff) 0 30%, #3a2b6e 32% 58%, #241848 60%); box-shadow: 0 8px 0 #160d33, 0 12px 16px rgba(0,0,0,.4); }
.lvl.done .lvl-plat { background: radial-gradient(ellipse at 50% 35%, #7df9ff 0 30%, #3a2b6e 32% 58%, #241848 60%); }
.lvl-name { margin-top: 12px; font-size: .82rem; font-weight: 600; text-align: center; line-height: 1.1; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.lvl.locked .lvl-name { color: var(--muted); }
.boss-lvl .lvl-coin { width: 84px; height: 84px; background: radial-gradient(circle, rgba(244, 63, 94, .35), rgba(244, 63, 94, .05) 70%); border: 3px dashed rgba(244, 63, 94, .7); box-shadow: 0 0 24px rgba(244, 63, 94, .4); }
.boss-lvl .lvl-coin .boss { width: 64px; }
.boss-lvl .lvl-plat { width: 120px; }
.boss-lvl.locked .lvl-coin { filter: grayscale(.4) brightness(.75); }
.map-astro { position: absolute; width: 64px; z-index: 3; animation: hover 2.4s ease-in-out infinite; pointer-events: none; }
.map-astro.right { translate: 46px -20px; }
.map-astro.left { translate: -110px -20px; }
.map-astro .astro { width: 64px; }

/* Abertura */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, #4b2bb8, #1d0f52 55%, #0b0828); transition: opacity .55s, transform .55s; }
.splash.out { opacity: 0; transform: scale(1.08); pointer-events: none; }
.splash-astro { animation: float 3s ease-in-out infinite; }
.splash-astro .astro { width: 170px; }
.splash .logo-text { font-size: 2.8rem; margin-top: 6px; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.splash-sub { color: var(--muted); font-family: var(--fun); font-size: 1.05rem; margin: 0 0 22px; letter-spacing: 1px; }
.loadbar { position: relative; width: min(280px, 80vw); height: 18px; border-radius: 999px; background: rgba(10, 6, 40, .6); border: 2px solid rgba(255,255,255,.15); }
.loadbar-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ff7ac6, #ffd84d); box-shadow: 0 0 12px rgba(255, 216, 77, .6); }
.loadbar-rocket { position: absolute; top: 50%; left: 0; width: 26px; height: 26px; translate: -50% -50%; rotate: 90deg; background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 110'%3E%3Cpath d='M22 86 Q30 118 38 86 Z' fill='%23ffb02e'/%3E%3Cpath d='M30 4 C46 18 48 50 44 86 H16 C12 50 14 18 30 4 Z' fill='%23f4f2ff'/%3E%3Cpath d='M30 4 C38 11 43 22 45 34 H15 C17 22 22 11 30 4 Z' fill='%23ff5fa2'/%3E%3Ccircle cx='30' cy='50' r='8' fill='%233b82f6'/%3E%3Cpath d='M16 66 L4 88 L16 84 Z M44 66 L56 88 L44 84 Z' fill='%238f74ff'/%3E%3C/svg%3E"); }
.splash-tip { color: var(--muted); font-size: .9rem; margin-top: 12px; }

.ex-head .btn.round, .w-hero + .level-map { flex: 0 0 auto; }
.node .dot { font-family: var(--fun); }

/* Astronauta 3D (versão 3.1) */
.astro .a-limb { fill: none; stroke-width: 15; stroke-linecap: round; }
.astro .a-limb.thin { stroke-width: 13; }
.astro .a-antenna { fill: none; stroke: #e4dcff; stroke-width: 4; stroke-linecap: round; }
.astro .a-body { transform-origin: 80px 200px; }
.astro .a-wave { transform-origin: 108px 128px; }
.astro .a-mic { transform-origin: 52px 128px; }
.astro .a-head { transform-origin: 80px 128px; }
.astro .a-lamp { animation: lamp 1.6s ease-in-out infinite alternate; }
@keyframes lamp { from { opacity: .7; } to { opacity: 1; filter: drop-shadow(0 0 4px #4ef0c8); } }
.astro { filter: drop-shadow(0 6px 10px rgba(20, 0, 60, .45)); }
.me .astro.mini { width: 70px; margin: -6px 0 0 -12px; filter: none; }

/* Tela inicial */
.brand { display: flex; align-items: center; gap: 6px; background: none; border: none; padding: 0; cursor: pointer; color: inherit; }
.top .logo-text.small { font-size: 1.15rem; }
@media (max-width: 440px) { .top .logo-text.small { display: none; } }
body.on-menu .top, body.on-menu .tabs { display: none; }
.menu { min-height: calc(100vh - 20px); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 28px 0 24px; text-align: center; }
.menu-logo img { filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); animation: float 4s ease-in-out infinite; }
.menu-logo .logo-text { font-size: 3rem; line-height: 1; margin-top: 6px; text-shadow: 0 5px 0 rgba(0,0,0,.25); animation: logoIn .8s cubic-bezier(.3, 1.6, .5, 1) both; }
.menu-logo p { font-family: var(--fun); color: var(--muted); letter-spacing: 1.5px; margin: 4px 0 0; }
@keyframes logoIn { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
.menu-stage { position: relative; display: grid; place-items: center; margin: 10px 0; }
.menu-astro { position: relative; z-index: 2; animation: astroIn 1s .2s cubic-bezier(.3, 1.3, .5, 1) both, float 3.5s 1.2s ease-in-out infinite; }
.menu-astro .astro { width: 190px; }
@keyframes astroIn { from { transform: translateY(80vh) scale(.5) rotate(20deg); } }
.menu-plat { width: 220px; height: 54px; margin-top: -30px; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #7df9ff 0 22%, #4a3a90 24% 55%, #2a1c5c 57%); box-shadow: 0 12px 0 #160d33, 0 22px 28px rgba(0,0,0,.45), 0 0 40px rgba(125, 249, 255, .25); }
.menu-buttons { width: 100%; display: flex; flex-direction: column; gap: 14px; animation: rise .6s .6s both; }
.menu-row { display: flex; gap: 12px; }
.menu-row .btn { flex: 1; font-size: 1rem; padding: 14px 8px; }
.btn.huge { font-size: 1.6rem; padding: 18px; border-radius: 24px; letter-spacing: 1px; }
.splash .logo-text { animation: logoIn .8s .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.splash-astro { animation: astroIn 1s cubic-bezier(.3, 1.3, .5, 1) both, float 3s 1s ease-in-out infinite; }

/* Planetas animados: cada tipo se mexe de um jeito e tem ícones de voz em volta */
.planet .p-body { transform-origin: 50% 50%; }
.p-fx { position: absolute; inset: -18%; pointer-events: none; z-index: 3; }
.p-ico { position: absolute; width: 22%; height: 22%; color: var(--c3); filter: drop-shadow(0 0 6px var(--c1)); }
.p-ico.o0 { left: -2%; top: 10%; } .p-ico.o1 { right: -2%; top: 30%; } .p-ico.o2 { left: 40%; bottom: -4%; }
.gp.locked .p-fx, .gp.soon .p-fx { opacity: .35; }
.travel .p-ico { width: 18%; height: 18%; }

/* Tônica: lava pulsando e notas subindo como faíscas */
.fx-lava .p-body { animation: lavaPulse 2.4s ease-in-out infinite; }
@keyframes lavaPulse { 50% { transform: scale(1.04); filter: brightness(1.15) drop-shadow(0 0 10px #ffa62b); } }
.fx-lava .p-ico { animation: emberUp 3s ease-in infinite; }
.fx-lava .p-ico.o1 { animation-delay: -1s; } .fx-lava .p-ico.o2 { animation-delay: -2s; }
@keyframes emberUp { 0% { transform: translateY(20px) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-30px) scale(1.1) rotate(15deg); opacity: 0; } }

/* Escadaria: cristal balança e ondas sobem e descem como degraus */
.fx-crystal .p-body { animation: sway 4s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.fx-crystal .p-ico { animation: steps 2s steps(4) infinite; }
.fx-crystal .p-ico.o1 { animation-delay: -.5s; } .fx-crystal .p-ico.o2 { animation-delay: -1s; }
@keyframes steps { 0% { transform: translateY(14px); } 100% { transform: translateY(-14px); } }

/* Salto: planeta quica e notas pulam em arco */
.fx-nebula .p-body { animation: bounceP 1.8s cubic-bezier(.3, 0, .5, 1) infinite; }
@keyframes bounceP { 0%,100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-8px) scale(.97, 1.03); } 80% { transform: translateY(2px) scale(1.04, .96); } }
.fx-nebula .p-ico { animation: hopArc 1.8s ease-in-out infinite; }
.fx-nebula .p-ico.o1 { animation-delay: -.6s; } .fx-nebula .p-ico.o2 { animation-delay: -1.2s; }
@keyframes hopArc { 0%,100% { transform: translate(0, 0); } 50% { transform: translate(10px, -22px) rotate(20deg); } }

/* Solfejo: ícones orbitam o planeta como uma estação */
.fx-bubbles .p-fx { animation: orbit 9s linear infinite; }
.fx-bubbles .p-ico { animation: counter 9s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes counter { to { transform: rotate(-360deg); } }
.fx-bubbles .p-body { animation: wobble2 3s ease-in-out infinite; }
@keyframes wobble2 { 50% { transform: scale(1.03, .97); } }

/* Passagem: ondas de som saindo do planeta */
.fx-rocky .p-fx::before, .fx-rocky .p-fx::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 3px solid var(--c3); animation: ripple 2.4s ease-out infinite; }
.fx-rocky .p-fx::after { animation-delay: -1.2s; }
@keyframes ripple { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.45); opacity: 0; } }
.fx-rocky .p-body { animation: tiltP 5s ease-in-out infinite; }
@keyframes tiltP { 50% { transform: rotate(-10deg) translateY(-3px); } }
.fx-rocky .p-ico { animation: pulseI 1.2s ease-in-out infinite alternate; }

/* Cometa: gira rápido e solta raios */
.fx-comet .p-body { animation: shake2 .5s ease-in-out infinite; }
@keyframes shake2 { 25% { transform: translate(1px, -1px) rotate(1deg); } 75% { transform: translate(-1px, 1px) rotate(-1deg); } }
.fx-comet .planet-spin { animation-duration: 5s; }
.fx-comet .p-fx { animation: orbit 3s linear infinite; }

/* Lado escuro: some e aparece, ícones de ouvido piscando */
.fx-dark .p-body { animation: flicker 4s ease-in-out infinite; }
@keyframes flicker { 0%,100% { filter: brightness(1); } 45% { filter: brightness(.55); } 50% { filter: brightness(1.3) drop-shadow(0 0 12px #cbd5e1); } }
.fx-dark .p-ico { animation: pulseI 2s ease-in-out infinite alternate; }
.fx-dark .p-ico.o1 { animation-delay: -1s; }
@keyframes pulseI { from { opacity: .25; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }

/* Supernova: respira grande e estrelas giram */
.fx-swirl .p-body { animation: nova 3s ease-in-out infinite; }
@keyframes nova { 50% { transform: scale(1.07); filter: drop-shadow(0 0 16px #fb7185); } }
.fx-swirl .p-fx { animation: orbit 12s linear infinite reverse; }
.fx-swirl .p-ico { animation: twinkleI 1.4s ease-in-out infinite alternate; }
@keyframes twinkleI { from { transform: scale(.7) rotate(0); } to { transform: scale(1.2) rotate(45deg); } }

/* Base Lunar: flutua devagar e os ícones piscam como um radar */
.fx-moon .p-body { animation: floatMoon 4s ease-in-out infinite; }
@keyframes floatMoon { 50% { transform: translateY(-6px); filter: drop-shadow(0 0 12px #7dd3fc); } }
.fx-moon .p-fx::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; border: 2px dashed #7dd3fc; opacity: .5; animation: orbit 14s linear infinite; }
.fx-moon .p-ico { animation: pulseI 1.6s ease-in-out infinite alternate; }
.fx-moon .p-ico.o1 { animation-delay: -.5s; } .fx-moon .p-ico.o2 { animation-delay: -1s; }

@media (prefers-reduced-motion: reduce) { .planet .p-body, .p-fx, .p-ico, .p-fx::before, .p-fx::after { animation: none !important; } }

/* Planeta em canvas com anel por cima e por baixo */
.planet .pcan { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; z-index: 1;
  box-shadow: 0 0 calc(var(--s) * .25) color-mix(in srgb, var(--c1) 55%, transparent); }
.p-ring { position: absolute; left: 50%; top: 50%; width: 170%; height: 85%; translate: -50% -50%; overflow: visible; pointer-events: none; }
.p-ring.back { z-index: 0; }
.p-ring.front { z-index: 2; clip-path: inset(50% 0 0 0); }

/* Mascote 3D em imagem: poses trocam e cada uma tem sua animação */
.astro-img { position: relative; display: inline-block; filter: none; }
.astro-body { position: relative; transform-origin: 50% 90%; }
.astro-img img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 14px rgba(20, 0, 60, .5)); user-select: none; -webkit-user-drag: none; }
.astro-img .astro-fallback { display: none; }
.astro-img.noimg .astro-body { display: none; }
.astro-img.noimg .astro-fallback { display: block; }
/* Rosto do aluno dentro do visor: foto com vidro escuro por cima e reflexo */
.astro-face { position: absolute; left: var(--fx, 50%); top: var(--fy, 32%); width: var(--fw, 34%); height: var(--fh, 27%); transform: translate(-50%, -50%); border-radius: 50%; background: center 35% / cover no-repeat; box-shadow: inset 0 0 0 2px rgba(125, 249, 255, .25), inset 0 -10px 18px rgba(40, 0, 90, .65); pointer-events: none; }
.astro-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(ellipse 45% 25% at 32% 22%, rgba(255, 255, 255, .55), transparent 70%), linear-gradient(160deg, rgba(120, 60, 255, .25), rgba(30, 0, 70, .35)); }
.astro-img[data-pose="idle"] { --fx: 50%; --fy: 32.5%; --fw: 35%; --fh: 27%; }
.astro-img[data-pose="win"] { --fx: 51%; --fy: 34%; --fw: 34%; --fh: 26%; }
.astro-img[data-pose="miss"] { --fx: 50.5%; --fy: 34%; --fw: 33%; --fh: 25%; }
.astro-img[data-pose="sing"] { --fx: 38.5%; --fy: 32%; --fw: 34%; --fh: 27%; }
.astro-idle .astro-body { animation: bob 2.8s ease-in-out infinite; }
.astro-top .astro-body, .astro-good .astro-body { animation: winJump .7s cubic-bezier(.3, 1.5, .5, 1) 3; }
.astro-retry .astro-body { animation: missShake .5s ease-in-out 2, droop 2.4s .9s ease-in-out infinite; }
.astro-breath .astro-body, .astro-sing .astro-body { animation: singSway 1.6s ease-in-out infinite; }
@keyframes winJump { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-18%) scale(1.05) rotate(-4deg); } 60% { transform: translateY(0) scale(1.08, .92); } }
@keyframes missShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes droop { 50% { transform: translateY(3px) rotate(-2deg); } }
@keyframes singSway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-3px); } }
/* Reação a cada nota: pulo com brilho no acerto, tremida avermelhada no erro */
.astro-img.hit .astro-body { animation: winJump .55s cubic-bezier(.3, 1.5, .5, 1) 1; }
.astro-img.miss .astro-body { animation: missShake .45s ease-in-out 1; }
.astro-img.miss img { filter: drop-shadow(0 0 10px rgba(244, 63, 94, .7)); }
.astro-img .burst { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.astro-img .burst::before, .astro-img .burst::after { content: "✦"; position: absolute; color: #ffd84d; font-size: 1.4em; text-shadow: 0 0 8px #ffd84d; }
.astro-img .burst::before { left: 0; top: 10%; } .astro-img .burst::after { right: 0; top: 0; content: "♪"; color: #7df9ff; text-shadow: 0 0 8px #7df9ff; }
.astro-img.hit .burst, .astro-top .burst { animation: burst .7s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.3) translateY(-12px); } }
.buddy { width: 70px; flex: 0 0 auto; margin-right: auto; }
.buddy .astro { width: 70px; }
.ex-live { justify-content: flex-start; gap: 10px; }
.mascot-row .astro-img { width: 84px; }
.menu-astro .astro-img { width: 240px; }
.splash-astro .astro-img { width: 210px; }
.astro-big .astro-img { width: 190px; }
.map-astro .astro-img { width: 76px; }
.astro-big { position: relative; }

/* Liga/desliga dos efeitos sonoros */
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 4px 0 12px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent, #8f74ff); }

/* Base Lunar: aulas em cartões */
.lesson-card { text-align: center; padding: 22px 18px; }
.lesson-card.enter { animation: cardIn .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes cardIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
.lesson-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 4px 10px rgba(125, 211, 252, .45)); }
.lesson-card h3 { font-size: 1.35rem; margin: 4px 0 8px; }
.lesson-card p { line-height: 1.5; margin: 0 auto 12px; max-width: 34ch; }
.lesson-demos { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lesson-art { width: 100%; max-width: 280px; margin: 4px auto 10px; display: block; }
.la-bg { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .12); }
.la-voice { fill: none; stroke: var(--warn, #fbbf24); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 400; animation: draw 2.4s ease-in-out infinite; }
.la-voice.good { stroke: var(--good, #22c55e); }
@keyframes draw { from { stroke-dashoffset: 400; } 70%, to { stroke-dashoffset: 0; } }
.la-target { fill: color-mix(in srgb, var(--accent) 55%, transparent); stroke: var(--accent); }
.la-zone { fill: rgba(34, 197, 94, .45); }
.la-needle { fill: #fff; animation: needle 2.6s ease-in-out infinite; }
@keyframes needle { 0%, 100% { transform: translateX(0); } 60%, 90% { transform: translateX(36px); } }
.la-t { fill: var(--muted); font-size: 10px; font-weight: 700; }
.lesson-dots, .ear-dots { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.lesson-dots i, .ear-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .18); transition: .25s; }
.lesson-dots i.seen { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.lesson-dots i.on { background: var(--accent); width: 26px; border-radius: 6px; }

/* Grave ou agudo? */
.ear-q { text-align: center; font-weight: 800; font-size: 1.1rem; line-height: 1.4; margin: 10px 0 4px; }
.ear-dots i.ok { background: var(--good, #22c55e); }
.ear-dots i.bad { background: var(--bad, #f43f5e); }
.ear-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.ear-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px; font-size: 2rem; }
.ear-btn span { font-size: 1.1rem; font-weight: 800; } .ear-btn small { font-size: .78rem; opacity: .8; }
.ear-btn.up { background: linear-gradient(180deg, #38bdf8, #6366f1); }
.ear-btn.down { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.ear-feedback { text-align: center; min-height: 1.4em; font-weight: 700; }
.btn.small { padding: 8px 14px; font-size: .9rem; }

/* Raio-X da afinação */
.x-meter { position: relative; height: 16px; border-radius: 8px; margin: 6px 0 4px; background: linear-gradient(90deg, #f43f5e, #fbbf24 30%, #22c55e 45%, #22c55e 55%, #fbbf24 70%, #f43f5e); opacity: .9; }
.x-needle { position: absolute; top: -6px; width: 6px; height: 28px; margin-left: -3px; border-radius: 3px; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .8); transition: left .6s cubic-bezier(.3, 1.4, .5, 1); }
.x-scale { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 8px; }
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.x-chip { padding: 6px 10px; border-radius: 999px; font-size: .82rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.x-chip.bad { border-color: rgba(244, 63, 94, .6); } .x-chip.good { border-color: rgba(34, 197, 94, .6); }
.x-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.x-bars i { flex: 1; border-radius: 3px 3px 0 0; background: #fbbf24; }
.x-bars i.good { background: var(--good, #22c55e); }

/* Aquecimento vocal */
.menu-buttons > .btn:last-child { width: 100%; margin-top: 10px; }
.wu-choice { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; cursor: pointer; margin-bottom: 12px; color: inherit; font: inherit; }
.wu-choice span { grid-row: 1 / 3; font-size: 2.4rem; text-align: center; }
.wu-choice b { font-size: 1.15rem; } .wu-choice small { color: var(--muted); }
.wu-choice:active { transform: scale(.98); }
.wu-steps { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; flex-wrap: wrap; }
.wu-steps i { font-style: normal; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .07); opacity: .5; font-size: 1rem; }
.wu-steps i.done { opacity: .9; background: rgba(34, 197, 94, .25); }
.wu-steps i.on { opacity: 1; background: color-mix(in srgb, var(--accent) 45%, transparent); transform: scale(1.15); box-shadow: 0 0 12px var(--accent); }
.wu-card { text-align: center; }
.wu-icon { font-size: 2.8rem; line-height: 1; }
.wu-card h2 { margin: 6px 0; }
.wu-card p { line-height: 1.5; max-width: 36ch; margin: 0 auto 10px; }
.wu-ring { position: relative; width: 170px; height: 170px; margin: 6px auto 4px; display: grid; place-items: center; }
.wu-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.wu-track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 9; }
.wu-prog { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.wu-ring b { position: relative; font-size: 2.4rem; line-height: 1; margin-top: -14px; }
.wu-ring small { position: absolute; bottom: 42px; color: var(--muted); font-weight: 700; }
.wu-breath { position: absolute; inset: 22px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%); transform: scale(.55); }
.wu-breath.in { transform: scale(1); transition: transform 4s ease-in-out; }
.wu-breath.out { transform: scale(.55); transition: transform 6s ease-in-out; }

/* Formulários (meu professor, painel do professor) */
.field { display: block; font-weight: 700; margin: 6px 0 12px; }
.field input, .inline-form input { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .25); color: inherit; font: inherit; font-weight: 600; }
.field input:focus, .inline-form input:focus { outline: none; border-color: var(--accent); }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input { margin-top: 0; flex: 1; text-transform: uppercase; letter-spacing: 2px; }
a.link { color: var(--accent-2, #ffc15e); font-weight: 800; text-decoration: none; }

/* Conta do aluno e tela de assinatura */
#account .menu-logo { margin-top: 18px; text-align: center; }
#account .menu-logo .logo-text { font-size: 2.4rem; }
#account .btn.huge { font-size: 1.25rem; }
.acc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, .25); margin-bottom: 12px; }
.acc-tabs button { border: 0; padding: 10px; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 800; cursor: pointer; }
.acc-tabs button.on { background: var(--accent); color: #fff; }
.acc-err { color: #fb7185; font-weight: 700; min-height: 1.2em; margin: 0 0 8px; }
.center { text-align: center; }
.btn.wide { width: 100%; }
.pay-plan { display: grid; gap: 2px; text-decoration: none; color: inherit; position: relative; padding: 18px 20px; border: 2px solid rgba(255, 255, 255, .14); }
.pay-plan.best { border-color: rgba(253, 224, 71, .7); }
.pay-plan b { font-family: var(--fun); font-size: 1.3rem; }
.pay-val { font: 700 1.6rem var(--fun); color: #fde68a; }
.pay-plan small { color: var(--muted); }
.pay-tag { position: absolute; top: 14px; right: 14px; padding: 4px 10px; border-radius: 99px; background: linear-gradient(90deg, #fde047, #f59e0b); color: #3b1d00; font-weight: 900; font-size: .8rem; }
.lvl .paid-lock { position: absolute; top: -6px; right: -6px; font-size: .9rem; }

/* Planetas pintados: a esfera ocupa ~78% da imagem, então a imagem passa um pouco do tamanho do planeta */
.planet .p-img { position: absolute; left: 50%; top: 50%; width: 130%; height: 130%; translate: -50% -50%; object-fit: contain; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 0 calc(var(--s) * .12) color-mix(in srgb, var(--c1) 55%, transparent)); }
