:root {
  --yellow: #F4E423;
  --yellow-soft: #FFF6A8;
  --red: #D7261E;
  --red-dark: #A3140E;
  --ink: #111111;
  --ink-soft: #2A2A2A;
  --paper: #FFFDF2;
  --green: #17742F;
  --green-soft: #D8F5DF;
  --bad-soft: #FFE1DE;
  --grey: #5E5E5E;
  --shadow: 0 6px 0 var(--ink);
  --shadow-sm: 0 4px 0 var(--ink);
  --radius: 18px;
  --font-display: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
  --font-cover: 'Jost', 'Futura', 'Century Gothic', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --tabbar-h: 68px;
  --topbar-h: 60px;
  --app-w: 430px;
  --frame-h: 100dvh;
  --frame-gap: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-width: none; background: var(--ink); }

* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--ink); color: var(--yellow);
  padding: 12px 18px; border-radius: 12px; font-weight: 900;
}
.skip-link:focus { top: 12px; outline-color: var(--red); }

.noscript { padding: 24px; font-weight: 800; }

.app {
  position: relative;
  display: flex; flex-direction: column;
  width: 100%; max-width: var(--app-w); height: var(--frame-h);
  margin: 0 auto; overflow: hidden;
  background-color: var(--yellow);
  background-image:
    linear-gradient(rgba(215, 38, 30, .07) 3px, transparent 3px),
    linear-gradient(90deg, rgba(215, 38, 30, .07) 3px, transparent 3px);
  background-size: 64px 64px;
}

.main { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; animation: screen-in .35s ease-out; }
.has-chrome .main { padding-bottom: 24px; }
.is-immersive .main { padding-bottom: 0; overflow: hidden; }

@media (min-width: 480px) {
  :root { --frame-h: min(calc(100dvh - 32px), 932px); --frame-gap: calc((100dvh - var(--frame-h)) / 2); }
  body { display: grid; place-items: center; }
  .app { border-radius: 36px; box-shadow: 0 0 0 10px #000, 0 30px 80px rgba(0, 0, 0, .6); }
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  font-size: .8rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
}

/* Botões 3D */
.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 3px solid var(--ink); border-radius: 16px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 900; font-size: 1rem; letter-spacing: .02em; text-decoration: none; text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { --btn-bg: #D9D4B8; --btn-fg: #4A4A4A; box-shadow: 0 4px 0 #8C8770; border-color: #8C8770; }
.btn--xl { min-height: 58px; width: 100%; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .06em; }
.btn--red { --btn-bg: var(--red); --btn-fg: #fff; }
.btn--ink { --btn-bg: var(--ink); --btn-fg: var(--yellow); }
.btn--ghost { --btn-bg: #fff; }
.btn--danger { --btn-bg: #fff; --btn-fg: var(--red-dark); border-color: var(--red-dark); box-shadow: 0 4px 0 var(--red-dark); }
.btn--ink:focus-visible { outline-color: var(--red); }

.icon-btn {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px;
  border: 3px solid var(--ink); border-radius: 14px;
  background: #fff; box-shadow: var(--shadow-sm);
  font-size: 1.2rem;
}
.icon-btn:active { transform: translateY(4px); box-shadow: none; }

.panel {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.panel + .panel { margin-top: 20px; }
.panel__title { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; letter-spacing: .01em; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.panel__count { font-family: var(--font-body); font-size: .9rem; font-weight: 900; background: var(--yellow); border: 2px solid var(--ink); border-radius: 99px; padding: 0 10px; }
.panel__hint { color: var(--ink-soft); font-size: .95rem; margin-bottom: 12px; }

.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.field__label { display: block; font-weight: 900; margin-bottom: 8px; padding: 0; }
.field__input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper);
  font-size: 1.05rem; font-weight: 700;
}
.field__input::placeholder { color: #6B6B6B; font-weight: 600; }
.field__input:focus-visible { outline-offset: 2px; background: #fff; }
textarea.field__input { resize: vertical; }
.field__error { color: var(--red-dark); font-weight: 900; margin-top: 6px; }
[aria-invalid="true"] { border-color: var(--red-dark); background: var(--bad-soft); }

/* Topbar */
.topbar {
  position: relative; z-index: 20; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: var(--topbar-h); padding: 8px 12px;
  background: var(--yellow); border-bottom: 3px solid var(--ink);
}
.stat {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 4px 8px;
  border: 0; background: transparent; border-radius: 12px;
  font-weight: 900; font-size: 1.05rem;
}
.stat:hover { background: rgba(0, 0, 0, .06); }
.stat--streak:not(.is-lit) span { filter: grayscale(1); opacity: .6; }
.stat--streak.is-lit span { animation: flicker 1.6s ease-in-out infinite; display: inline-block; }
.stat--level { flex-direction: column; gap: 0; line-height: 1.05; font-size: .85rem; align-items: flex-start; }
.stat__lvl { font-family: var(--font-display); font-size: .95rem; letter-spacing: .06em; background: var(--ink); color: var(--yellow); padding: 0 6px; border-radius: 6px; }
.mute-btn { min-width: 44px; }

@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50% { transform: scale(1.15) rotate(3deg); }
}

/* Tabbar */
.tabbar {
  position: relative; z-index: 30; flex: none;
  width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--ink); border-top: 3px solid var(--ink);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border-radius: 14px;
  color: var(--yellow); text-decoration: none; font-weight: 800; font-size: .78rem;
  transition: background .2s, transform .15s;
}
.tab__icon { font-size: 1.35rem; line-height: 1; transition: transform .2s; }
.tab[aria-current="page"] { background: var(--red); color: #fff; }
.tab[aria-current="page"] .tab__icon { transform: translateY(-2px) scale(1.15); }
.tab:focus-visible { outline-color: var(--yellow); outline-offset: -3px; }

/* Toast e diálogo */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--tabbar-h) + 22px); z-index: 60;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px;
  background: var(--ink); color: var(--yellow); border: 3px solid var(--yellow); border-radius: 16px;
  font-weight: 800; text-align: center; box-shadow: 0 6px 0 rgba(0, 0, 0, .35);
  transition: transform .25s cubic-bezier(.2, 1.4, .4, 1), opacity .2s;
}
.is-immersive .toast { bottom: auto; top: 56px; transform: translate(-50%, -30px); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.dialog {
  border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0; max-width: min(92vw, 420px); background: #fff;
}
.dialog::backdrop { background: rgba(17, 17, 17, .6); }
.dialog__body { padding: 22px; }
.dialog__text { font-weight: 800; font-size: 1.1rem; margin-bottom: 18px; }
.dialog__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }

/* Bonequinhos */
.walker .w-leg-a, .walker .w-leg-b, .cover-walker .w-leg-a, .cover-walker .w-leg-b, .v-climb .w-leg-a, .v-climb .w-leg-b, .escapee .w-leg-a, .escapee .w-leg-b { transform-origin: 18px 36px; }
.walker .w-arm-a, .walker .w-arm-b, .cover-walker .w-arm-a, .cover-walker .w-arm-b, .v-climb .w-arm-a, .v-climb .w-arm-b, .escapee .w-arm-a, .escapee .w-arm-b { transform-origin: 21px 20px; }
.w-leg-a, .w-arm-b { animation: swing .45s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.w-leg-b, .w-arm-a { animation: swing .45s ease-in-out infinite alternate-reverse; animation-delay: var(--d, 0s); }
@keyframes swing { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }

.cover-walker { animation: stroll 2.4s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes stroll { from { transform: translateX(-5px); } to { transform: translateX(5px); } }

.escapee { animation: escape 7s ease-in-out infinite; }
@keyframes escape {
  0%, 12% { transform: translate(var(--sx), var(--sy)); }
  45% { transform: translate(calc(var(--sx) + 16px), calc(var(--sy) + 78px)); }
  70% { transform: translate(calc(var(--sx) + 22px), calc(var(--sy) + 80px)); }
  88% { transform: translate(calc(var(--sx) + 22px), calc(var(--sy) + 80px)); opacity: 1; }
  94% { transform: translate(calc(var(--sx) + 22px), calc(var(--sy) + 80px)); opacity: 0; }
  95% { transform: translate(var(--sx), var(--sy)); opacity: 0; }
  100% { transform: translate(var(--sx), var(--sy)); opacity: 1; }
}

.mascot { width: 100%; height: 100%; overflow: visible; }
.mascot .m-leg-a, .mascot .m-leg-b { transform-origin: 27px 50px; }
.mascot .m-arm-a, .mascot .m-arm-b { transform-origin: 31px 30px; }
.mascot--walk .m-leg-a, .mascot--walk .m-arm-b { animation: swing .5s ease-in-out infinite alternate; }
.mascot--walk .m-leg-b, .mascot--walk .m-arm-a { animation: swing .5s ease-in-out infinite alternate-reverse; }
.mascot--walk .m-body { animation: bob .5s ease-in-out infinite alternate; }
.mascot--happy .m-body { animation: jump .7s cubic-bezier(.3, 1.6, .5, 1) infinite; transform-origin: 30px 76px; }
.mascot--happy .m-arm-a { transform: rotate(-120deg); animation: wave-a .35s ease-in-out infinite alternate; }
.mascot--happy .m-arm-b { transform: rotate(130deg); animation: wave-b .35s ease-in-out infinite alternate; }
.mascot--happy .m-mouth { d: path('M29 16 q4.5 5 9 0'); }
.mascot--sad .m-head { transform: rotate(18deg) translateY(3px); transform-origin: 30px 26px; }
.mascot--sad .m-mouth { d: path('M30 19 q3.5 -3 7 0'); }
.mascot--sad .m-arm-a { transform: rotate(35deg); }
.mascot--sad .m-arm-b { transform: rotate(-10deg); }
.mascot--sad .m-body { animation: sigh 2.2s ease-in-out infinite; transform-origin: 30px 76px; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes jump { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(0) scaleY(.9); } 50% { transform: translateY(-14px) scaleY(1.04); } }
@keyframes wave-a { from { transform: rotate(-80deg); } to { transform: rotate(-110deg); } }
@keyframes wave-b { from { transform: rotate(85deg); } to { transform: rotate(115deg); } }
@keyframes sigh { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.95); } }

/* Loop do hábito */
.habit-loop { width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.loop-track { animation: dash 12s linear infinite; }
.loop-orbit { transform-origin: 150px 150px; animation: orbit 4s linear infinite; }
.loop-heart { transform-origin: 150px 155px; animation: heartbeat 1.1s ease-in-out infinite; }
.loop-node.is-active circle { animation: node-pulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.loop-core.is-active circle { fill: var(--red); }
.loop-core.is-active .loop-heart { fill: var(--yellow); }
@keyframes dash { to { stroke-dashoffset: -240; } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(.96); } 45% { transform: scale(1.1); } }
@keyframes node-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Login e capa */
.login { position: relative; height: 100%; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; background: var(--yellow); }
.book { position: relative; flex: 1 1 0; min-height: 150px; perspective: 1800px; container-type: size; }
.book__page {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqh;
  padding: 4cqh 24px; text-align: center; background: var(--paper);
}
.book__page img { height: 62cqh; width: auto; border: 3px solid var(--ink); box-shadow: var(--shadow); }
.book__page-text { font-size: min(4.4cqw, 4.6cqh); font-weight: 700; }
.book__page-text strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: min(7cqw, 7cqh); line-height: 1.05; margin-top: 4px; }
.book__cover {
  position: absolute; inset: 0; transform-origin: left center; backface-visibility: hidden;
  transition: transform 1.2s cubic-bezier(.6, .05, .3, 1), box-shadow 1.2s;
}
.book.is-opening .book__cover { transform: rotateY(-165deg); box-shadow: -20px 10px 30px rgba(0, 0, 0, .3); }
.cover {
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 1.6cqh;
  padding: 3cqh 5cqw 1cqh; text-align: center; background: var(--yellow);
}
.cover__title { font-family: var(--font-cover); font-weight: 500; text-transform: uppercase; line-height: .92; }
.cover__line1 { display: block; white-space: nowrap; font-size: min(10.5cqw, 9cqh); letter-spacing: .06em; animation: drop-in .7s .2s cubic-bezier(.2, 1.5, .4, 1) both; }
.cover__line2 { display: block; white-space: nowrap; font-size: min(22cqw, 18cqh); color: var(--red); margin-top: .14em; animation: slam .6s .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.cover-grid { width: min(84cqw, 58cqh); height: auto; overflow: visible; animation: grid-in .7s .9s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes grid-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.cover__subtitle { width: min(84cqw, 58cqh); padding-right: 24%; font-family: var(--font-cover); font-size: min(4.4cqw, 4cqh); font-weight: 500; line-height: 1.2; text-align: left; animation: fade-in .6s 1.3s both; }
.cover__author { font-family: var(--font-cover); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red-dark); font-size: min(4.8cqw, 4.6cqh); animation: fade-in .6s 1.5s both; }
@container (max-height: 470px) {
  .cover__subtitle { display: none; }
  .cover__author { margin-top: 6cqh; }
}
@container (max-height: 150px) {
  .cover-grid, .cover__author { display: none; }
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-60px); } to { opacity: 1; transform: none; } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.6) rotate(-6deg); } 60% { opacity: 1; transform: scale(.94) rotate(1deg); } 80% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

.login__form {
  flex: none; display: grid; gap: 10px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: #fff; border-top: 3px solid var(--ink); border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 0 rgba(17, 17, 17, .12);
  transform-origin: bottom center; animation: form-in .5s 1.2s cubic-bezier(.2, 1.3, .4, 1) both; transition: opacity .3s;
}
@keyframes form-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.login__form.is-leaving { opacity: 0; }
.login__field { border: 0; margin: 0; padding: 0; min-width: 0; }
.login__label { display: block; padding: 0; margin-bottom: 4px; font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.login__input { min-height: 46px; padding: 8px 12px; }
.login__continue { width: 100%; min-height: 44px; }
.login__submit { min-height: 52px; font-size: min(1rem, 4.1vw); letter-spacing: .03em; white-space: nowrap; }
@media (max-height: 620px) {
  .login__form { gap: 6px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .login__label { margin-bottom: 2px; font-size: .78rem; }
  .login__input { min-height: 44px; }
  .login__submit { min-height: 48px; }
}

.avatar-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: -4px -2px -4px; scroll-snap-type: x proximity; }
.avatar-opt, .goal-opt { position: relative; }
.avatar-opt { flex: 0 0 auto; scroll-snap-align: start; }
.avatar-opt input, .goal-opt input, .yn__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.avatar-opt__face {
  display: grid; place-items: center; width: 46px; height: 46px; font-size: 1.45rem;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: 0 3px 0 var(--ink);
  transition: transform .15s, background .15s;
}
.avatar-opt input:checked + .avatar-opt__face { background: var(--yellow); transform: translateY(-2px) rotate(-4deg); box-shadow: 0 4px 0 var(--red); }
.avatar-opt input:focus-visible + .avatar-opt__face, .goal-opt input:focus-visible + .goal-opt__box, .yn__opt input:focus-visible + span { outline: 4px solid var(--ink); outline-offset: 2px; }
.goal-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.goal-opt__box {
  display: grid; place-items: center; min-height: 44px; padding: 0 4px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); box-shadow: 0 3px 0 var(--ink);
  font-size: .95rem; font-weight: 900; white-space: nowrap;
}
.goal-opt input:checked + .goal-opt__box { background: var(--ink); color: var(--yellow); box-shadow: 0 3px 0 var(--red); }

/* Onboarding */
.onboarding { height: 100%; display: flex; flex-direction: column; }
.onboarding__track {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.onboarding__track::-webkit-scrollbar { display: none; }
.onboarding__track:focus-visible { outline-offset: -6px; }
.onb-slide {
  flex: 0 0 100%; scroll-snap-align: center; padding: 28px 24px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px;
}
.onb-slide__art { width: min(78vw, 320px); }
.onb-slide__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.02; text-transform: uppercase; }
.onb-slide__text { font-size: 1.1rem; font-weight: 700; max-width: 34ch; }
.onboarding__footer { position: relative; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); }
.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.dot { width: 12px; height: 12px; border-radius: 99px; border: 2px solid var(--ink); background: transparent; transition: width .25s, background .25s; }
.dot.is-on { width: 34px; background: var(--red); }
.onboarding__mascot { position: absolute; right: 18px; top: -70px; width: 50px; height: 66px; }
.onboarding__actions { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }

/* Trilha */
.trail { padding: 16px 16px 0; }
.trail-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-bottom: 20px; }
.goal-card, .league-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.goal-card__ring { position: relative; width: 70px; flex: 0 0 70px; }
.ring__bar { transition: stroke-dashoffset 1s ease-out; }
.goal-card__pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: .95rem; }
.goal-card__label, .league-card__label { display: block; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.goal-card__value { font-size: 1.05rem; }
.goal-card__value strong { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; }
.goal-card__hint { font-size: .82rem; color: var(--ink-soft); line-height: 1.3; }
.league-card { text-decoration: none; background: var(--ink); color: var(--yellow); flex-direction: column; justify-content: center; text-align: center; gap: 2px; transition: transform .1s; }
.league-card:active { transform: translateY(4px); box-shadow: none; }
.league-card:focus-visible { outline-color: var(--red); }
.league-card__icon { font-size: 1.7rem; }
.league-card strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: #fff; }
.league-card__xp { display: block; font-size: .78rem; font-weight: 700; }

.unit { margin: 0 -16px 8px; padding: 0 16px 16px; }
.unit__head {
  position: sticky; top: 6px; z-index: 5;
  padding: 14px 18px; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
}
.unit--red .unit__head { background: var(--red); color: #fff; }
.unit--ink .unit__head { background: var(--ink); color: var(--yellow); }
.unit--yellow .unit__head { background: #fff; color: var(--ink); }
.unit__label { font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.unit__title { font-family: var(--font-display); font-weight: 400; font-size: 1.55rem; line-height: 1.08; text-transform: uppercase; }
.unit__sub { font-size: .9rem; font-weight: 700; opacity: .92; }

.path { list-style: none; padding: 64px 0 10px; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.path__item { position: relative; transform: translateX(var(--x)); }
.node {
  --node-bg: #CFCAB0; --node-edge: #8C8770;
  position: relative; width: 78px; height: 72px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--node-bg); box-shadow: 0 8px 0 var(--node-edge), 0 8px 0 3px var(--ink);
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 900; color: #fff;
  transition: transform .08s, box-shadow .08s;
}
.node:not(:disabled) { --node-bg: var(--red); --node-edge: var(--red-dark); }
.node.is-done { --node-bg: var(--yellow); --node-edge: #B3A40E; color: var(--ink); }
.node:disabled { color: #5E5A48; }
.node:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 0 0 var(--node-edge), 0 0 0 3px var(--ink); }
.node--chest, .node--boss { width: 92px; height: 84px; border-radius: 26px; }
.node--boss:not(:disabled):not(.is-done) { --node-bg: var(--ink); --node-edge: #000; }
.node.is-current { animation: node-glow 1.6s ease-in-out infinite; }
.node.is-current::after {
  content: ''; position: absolute; inset: -12px; border-radius: inherit; border: 4px solid var(--red); opacity: .6;
  animation: ripple 1.6s ease-out infinite;
}
.node.is-opening { animation: chest-open .9s cubic-bezier(.3, 1.6, .5, 1); }
.node__icon { line-height: 1; }
.path__bubble {
  position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%);
  background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 4px 12px;
  font-weight: 900; font-size: .85rem; text-transform: uppercase; white-space: nowrap; letter-spacing: .06em;
  animation: float 1.4s ease-in-out infinite alternate;
}
.path__bubble::after { content: ''; position: absolute; left: 50%; top: 100%; width: 12px; height: 12px; background: #fff; border: 3px solid var(--ink); border-top: 0; border-left: 0; transform: translate(-50%, -6px) rotate(45deg); }
.path__mascot { position: absolute; top: 4px; left: calc(50% + var(--side) * 76px - 22px); width: 44px; height: 58px; pointer-events: none; }
.trail__end { text-align: center; font-weight: 900; padding: 16px 12px 8px; }
@keyframes node-glow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ripple { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.25); opacity: 0; } }
@keyframes float { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -6px); } }
@keyframes chest-open { 0% { transform: scale(1); } 30% { transform: scale(1.3) rotate(-10deg); } 60% { transform: scale(.9) rotate(8deg); } 100% { transform: scale(1); } }

/* Lição */
.lesson { min-height: 100%; display: flex; flex-direction: column; background: var(--paper); }
.lesson--boss { background: #FFF1EF; }
.lesson__top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; }
.progress { height: 20px; border: 3px solid var(--ink); border-radius: 99px; background: #E9E4C8; overflow: hidden; }
.progress__bar { display: block; height: 100%; width: var(--p, 0%); background: var(--red); border-radius: 99px; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18), inset 0 4px 0 rgba(255, 255, 255, .35); transition: width .5s cubic-bezier(.3, 1.4, .5, 1); }
.lesson__hearts { font-weight: 900; font-size: 1.15rem; min-width: 52px; text-align: right; }
.lesson__hearts.is-hit { animation: hit .5s; }
.combo { text-align: center; font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .08em; color: var(--red-dark); min-height: 1.6rem; }
.combo.is-pop { animation: pop .5s cubic-bezier(.3, 1.8, .5, 1); }
.lesson__stage { flex: 1; padding: 8px 18px 20px; }
.lesson__stage.is-shake { animation: shake .45s; }
.lesson__footer { position: sticky; bottom: 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 3px solid var(--ink); }
.lesson--boss .lesson__footer { background: #FFF1EF; }
@keyframes hit { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-10deg); color: var(--red); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

.lesson-intro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 12px; }
.lesson-intro__kicker { font-weight: 900; text-transform: uppercase; letter-spacing: .14em; font-size: .85rem; background: var(--ink); color: var(--yellow); padding: 4px 12px; border-radius: 8px; }
.lesson-intro__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 10vw, 3.2rem); line-height: 1; text-transform: uppercase; }
.lesson-intro__mascot { width: 90px; height: 120px; }
.lesson-intro__text { font-size: 1.2rem; font-weight: 700; max-width: 32ch; background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.lesson-intro__meta { font-weight: 800; color: var(--ink-soft); }

.question { animation: q-in .35s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes q-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.q-retry { display: inline-block; font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; background: var(--red); color: #fff; padding: 2px 10px; border-radius: 8px; margin-bottom: 8px; }
.q-kind { font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--red-dark); margin-bottom: 6px; }
.q-title { font-size: clamp(1.3rem, 5.6vw, 1.6rem); font-weight: 900; line-height: 1.25; margin-bottom: 18px; outline: none; }
.gap-slot { display: inline-block; min-width: 4ch; border-bottom: 4px solid var(--ink); color: transparent; line-height: 1.1; transition: all .2s; }
.gap-slot.is-filled { color: var(--red-dark); border-bottom-color: var(--red); animation: pop .35s; }

.choices, .tf { display: grid; gap: 12px; }
.tf { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 12px 14px;
  text-align: left; font-weight: 800; font-size: 1.05rem;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.choice--tf { justify-content: center; min-height: 90px; font-size: 1.15rem; flex-direction: column; gap: 4px; }
.choice__key { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 8px; font-size: .85rem; font-weight: 900; }
.choice:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.choice[aria-pressed="true"] { background: var(--yellow); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.choice[aria-pressed="true"] .choice__key { background: var(--ink); color: var(--yellow); }
.choice.is-right { background: var(--green-soft); border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
.choice.is-right .choice__key { background: var(--green); color: #fff; border-color: var(--green); }
.choice.is-wrong { background: var(--bad-soft); border-color: var(--red-dark); box-shadow: 0 4px 0 var(--red-dark); }
.choice:disabled { color: var(--ink); cursor: default; }

.order-answer {
  list-style: none; margin: 0 0 18px; padding: 12px; min-height: 76px;
  display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
  border: 3px dashed var(--ink); border-radius: 16px; background: #fff;
  counter-reset: ord;
}
.order-slot { flex: 1 1 100px; min-height: 48px; border-radius: 12px; background: #EFEAD0; }
.order-slot.is-hidden { display: none; }
.order-bank { display: flex; flex-wrap: wrap; gap: 10px; min-height: 60px; }
.chip {
  position: relative; min-height: 48px; padding: 10px 14px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: 1rem; text-align: left; touch-action: none; user-select: none;
  animation: pop .25s;
}
.order-answer .chip { counter-increment: ord; background: var(--yellow); padding-left: 38px; }
.order-answer .chip::before { content: counter(ord); position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: .8rem; display: grid; place-items: center; }
.chip.is-dragging { z-index: 10; box-shadow: 0 12px 0 var(--ink); transition: none; animation: none; cursor: grabbing; }
.chip.is-right { background: var(--green-soft); border-color: var(--green); }
.chip.is-wrong { background: var(--bad-soft); border-color: var(--red-dark); }
.chip:disabled { color: var(--ink); }

.classify { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.classify__row { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 12px; box-shadow: var(--shadow-sm); }
.classify__row.is-right { background: var(--green-soft); border-color: var(--green); }
.classify__row.is-wrong { background: var(--bad-soft); border-color: var(--red-dark); }
.classify__text { display: block; font-weight: 900; margin-bottom: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg__btn { min-height: 44px; padding: 6px 4px; border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); font-weight: 800; font-size: .88rem; }
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.seg__btn.is-answer { outline: 3px solid var(--green); outline-offset: 1px; }
.seg__btn:disabled { color: var(--ink); cursor: default; }
.seg__btn[aria-pressed="true"]:disabled { color: var(--yellow); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match__col { display: grid; gap: 10px; align-content: start; }
.match__item {
  min-height: 64px; padding: 8px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-sm); font-weight: 800; font-size: .92rem; line-height: 1.25;
  transition: transform .08s, background .2s, opacity .3s;
}
.match__item[aria-pressed="true"] { background: var(--yellow); transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.match__item.is-matched { background: var(--green-soft); border-color: var(--green); box-shadow: none; color: #0E4D1F; }
.match__item.is-shake { animation: shake .45s; background: var(--bad-soft); border-color: var(--red-dark); }

.feedback {
  display: flex; gap: 12px; align-items: flex-start; margin: -14px -16px 14px; padding: 16px 16px 4px;
  animation: slide-up .3s cubic-bezier(.2, 1.3, .4, 1);
}
.feedback--ok { background: var(--green-soft); color: #0E4D1F; }
.feedback--bad { background: var(--bad-soft); color: #6E0D08; }
.feedback__mascot { width: 44px; height: 60px; flex: 0 0 44px; }
.feedback__title { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.1; text-transform: uppercase; }
.feedback__answer { font-weight: 800; }
.feedback__explain { font-weight: 700; font-size: .98rem; margin-bottom: 8px; }
.feedback--ok + .lesson__primary { --btn-bg: var(--green); }
@keyframes slide-up { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }

.finish { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.finish__mascot { width: 110px; height: 146px; }
.finish__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 12vw, 3.6rem); line-height: 1; text-transform: uppercase; color: var(--red-dark); outline: none; animation: slam .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.finish__sub { font-weight: 800; max-width: 30ch; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 6px; }
.tile { border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; animation: rise .5s both; }
.tile:nth-child(2) { animation-delay: .12s; }
.tile:nth-child(3) { animation-delay: .24s; }
.tile__label { font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 4px; }
.tile--xp .tile__label { background: var(--yellow); }
.tile--acc .tile__label { background: var(--green); color: #fff; }
.tile--combo .tile__label { background: var(--red); color: #fff; }
.tile__value { font-family: var(--font-display); font-size: 2rem; padding: 6px 4px 8px; }
.finish__bonus { font-weight: 900; font-size: 1.1rem; background: var(--ink); color: var(--yellow); border-radius: 12px; padding: 6px 14px; animation: pop .4s .4s both; }

.no-hearts { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: var(--paper); }
.no-hearts__mascot { width: 100px; height: 134px; }
.no-hearts__title { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; line-height: 1; text-transform: uppercase; outline: none; }
.no-hearts__text { font-weight: 700; max-width: 32ch; }
.no-hearts__actions { display: grid; gap: 12px; width: 100%; max-width: 380px; }
.no-hearts__hint { font-weight: 700; color: var(--ink-soft); }

/* Feed */
.feed { position: relative; height: 100%; overflow: hidden; background: var(--ink); }
.stories { position: absolute; top: 0; left: 0; right: 0; z-index: 4; padding: 10px 12px 18px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); pointer-events: none; }
.stories__bars { display: flex; gap: 4px; }
.stories__bar { flex: 1; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, .4); overflow: hidden; }
.stories__bar span { display: block; height: 100%; width: 0; background: #fff; }
.stories__bar.is-seen span { width: 100%; }
.stories__bar.is-now span { animation: story 6s linear forwards; }
.stories__label { color: #fff; font-weight: 900; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; text-shadow: 0 1px 3px #000; }
@keyframes story { to { width: 100%; } }
.feed__scroller { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed__scroller::-webkit-scrollbar { display: none; }
.feed__hint { position: absolute; bottom: 10px; left: 0; right: 76px; text-align: center; color: #fff; font-size: .8rem; font-weight: 800; opacity: .85; pointer-events: none; text-shadow: 0 1px 3px #000; }

.reel {
  position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 54px 84px 44px 20px; overflow: hidden; user-select: none;
}
.reel--yellow { background: var(--yellow); color: var(--ink); }
.reel--red { background: var(--red); color: #fff; }
.reel--ink { background: var(--ink); color: #fff; }
.reel--red :focus-visible, .reel--ink :focus-visible { outline-color: #fff; }
.reel__visual { flex: 1; display: grid; place-items: center; min-height: 0; padding: 8px 0 16px; }
.reel__visual > svg { width: min(64vw, 280px); max-height: 100%; filter: drop-shadow(6px 6px 0 rgba(0, 0, 0, .25)); }
.reel--ink .reel__visual > svg { filter: drop-shadow(6px 6px 0 rgba(215, 38, 30, .6)); }
.reel__kicker { display: inline-block; align-self: flex-start; font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; padding: 3px 10px; border-radius: 8px; background: var(--ink); color: var(--yellow); }
.reel--ink .reel__kicker { background: var(--yellow); color: var(--ink); }
.reel__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 9.5vw, 2.9rem); line-height: 1.02; text-transform: uppercase; margin: 10px 0; }
.reel--ink .reel__title { color: var(--yellow); }
.reel__text { font-size: 1.1rem; font-weight: 700; line-height: 1.45; }
.reel__chapter { margin-top: 12px; font-size: .85rem; font-weight: 800; opacity: .95; }
.reel.is-active .reel__copy > * { animation: rise .5s both; }
.reel.is-active .reel__title { animation-delay: .08s; }
.reel.is-active .reel__text { animation-delay: .16s; }
.reel.is-active .reel__chapter { animation-delay: .24s; }
.reel__actions { position: absolute; right: 10px; bottom: 44px; display: flex; flex-direction: column; gap: 12px; }
.reel-act {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 60px; min-height: 60px; padding: 6px 4px;
  background: rgba(255, 255, 255, .95); color: var(--ink); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-sm);
  font-weight: 900; font-size: .72rem;
}
.reel-act:active { transform: translateY(4px); box-shadow: none; }
.reel-act__icon { font-size: 1.45rem; line-height: 1.1; }
.reel-act.is-pop .reel-act__icon { animation: like-pop .5s cubic-bezier(.3, 1.8, .5, 1); }
.reel-act[aria-pressed="true"] { background: var(--yellow); }
.reel--yellow .reel-act[aria-pressed="true"] { background: #fff; box-shadow: 0 4px 0 var(--red); }
.heart-burst { position: absolute; z-index: 5; font-size: 6rem; pointer-events: none; transform: translate(-50%, -50%); animation: burst .9s ease-out forwards; }
@keyframes like-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-15deg); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.3) rotate(8deg); opacity: 1; } 60% { transform: translate(-50%, -60%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -140%) scale(.8); opacity: 0; } }

/* Visuais animados dos cards */
.visual { overflow: visible; }
.v-pulse { transform-box: fill-box; transform-origin: center; animation: heartbeat 1.2s ease-in-out infinite; }
.v-ring { transform-box: fill-box; transform-origin: center; animation: ring-out 1.6s ease-out infinite; }
@keyframes ring-out { from { transform: scale(1); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.v-rat { animation: rat-run 4s ease-in-out infinite; }
@keyframes rat-run { 0% { transform: translate(100px, 172px) rotate(-90deg); } 45% { transform: translate(100px, 72px) rotate(-90deg); } 55% { transform: translate(104px, 70px) rotate(0deg); } 85%, 100% { transform: translate(140px, 70px) rotate(0deg); } }
.v-chunk { animation: 2.4s ease-in-out infinite alternate; }
.v-chunk-a { animation-name: chunk-a; }
.v-chunk-c { animation-name: chunk-c; }
.v-chunk-b { animation-name: chunk-b; transform-box: fill-box; transform-origin: center; }
@keyframes chunk-a { 0%, 30% { transform: translateX(0); } 100% { transform: translateX(40px); } }
@keyframes chunk-c { 0%, 30% { transform: translateX(0); } 100% { transform: translateX(-40px); } }
@keyframes chunk-b { 0%, 70% { transform: scale(1); } 100% { transform: scale(1.25); } }
.v-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 1.4s ease-in-out infinite; }
.v-spark-2 { animation-delay: .7s; }
@keyframes twinkle { 0%, 100% { transform: scale(.5) rotate(0); opacity: .4; } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } }
.v-mist { transform-box: fill-box; transform-origin: center; animation: mist 1.8s ease-out infinite; }
.v-mist-2 { animation-delay: .3s; }
.v-mist-3 { animation-delay: .6s; }
@keyframes mist { from { transform: translate(-20px, 4px) scale(.3); opacity: 0; } 30% { opacity: 1; } to { transform: translate(12px, -8px) scale(1.4); opacity: 0; } }
.v-pull { animation: pull 1.6s ease-in infinite; }
@keyframes pull { from { transform: translateY(20px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }
.v-swap-out { animation: swap-out 3s ease-in-out infinite; }
.v-swap-in { animation: swap-in 3s ease-in-out infinite; }
@keyframes swap-out { 0%, 30% { transform: translateY(0); opacity: 1; } 50%, 100% { transform: translateY(-70px); opacity: 0; } }
@keyframes swap-in { 0%, 45% { transform: translateY(70px); opacity: 0; } 65%, 100% { transform: translateY(0); opacity: 1; } }
.v-spin { transform-origin: 100px 100px; animation: orbit 10s linear infinite; }
.visual--music .v-spin { transform-origin: 90px 110px; animation-duration: 3s; }
.v-domino { transform-box: fill-box; transform-origin: right bottom; animation: topple 3.2s ease-in infinite; animation-delay: calc(var(--i) * .2s); }
@keyframes topple { 0%, 10% { transform: rotate(0); } 30%, 80% { transform: rotate(62deg); } 95%, 100% { transform: rotate(0); } }
.v-check { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 2s ease-out infinite; }
@keyframes draw { 40%, 100% { stroke-dashoffset: 0; } }
.v-waves { animation: waves 2s linear infinite; }
@keyframes waves { to { transform: translateX(-80px); } }
.v-swimmer { animation: bob-y 1s ease-in-out infinite alternate; }
@keyframes bob-y { to { transform: translateY(8px); } }
.v-charge { transform-box: fill-box; transform-origin: left center; animation: charge 3s ease-in-out infinite alternate; }
@keyframes charge { from { transform: scaleX(1); fill: var(--red); } to { transform: scaleX(.15); fill: var(--ink); } }
.v-bounce { animation: bob-y .6s ease-in-out infinite alternate; }
.v-steam { animation: steam 2s ease-in-out infinite; }
.v-steam-2 { animation-delay: .8s; }
@keyframes steam { from { transform: translateY(8px); opacity: 0; } 40% { opacity: 1; } to { transform: translateY(-14px); opacity: 0; } }
.v-flame { transform-box: fill-box; transform-origin: center bottom; animation: flame .5s ease-in-out infinite alternate; }
.v-flame-2 { animation-duration: .35s; }
@keyframes flame { from { transform: scale(1, 1) skewX(0); } to { transform: scale(.94, 1.08) skewX(3deg); } }
.v-gear-a { transform-origin: 78px 100px; animation: orbit 6s linear infinite; }
.v-gear-b { transform-origin: 142px 62px; animation: orbit 4s linear infinite reverse; }
.v-bar { transform-box: fill-box; transform-origin: center bottom; animation: bars 1.8s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .25s); }
@keyframes bars { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
.v-note { animation: float-note 2.4s ease-in-out infinite; }
@keyframes float-note { 0% { transform: translate(0, 10px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-10px, -30px); opacity: 0; } }
.v-drive { animation: drive 1.2s ease-in-out infinite alternate; }
@keyframes drive { to { transform: translate(6px, -2px); } }
.v-wheel { animation: orbit 1s linear infinite; }
.v-weak { animation: dash 3s linear infinite; }
.v-tumble { animation: tumble 2.4s cubic-bezier(.3, 1.5, .5, 1) infinite; }
.v-tumble-2 { animation-delay: .3s; }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 30% { transform: rotate(200deg) translateY(-20px); } 50%, 100% { transform: rotate(360deg) translateY(0); } }
.v-zzz { animation: float-note 2.2s ease-in-out infinite; }
.v-climb { animation: climb 4s steps(1, end) infinite; }
@keyframes climb { 0% { transform: translate(0, 0); } 25% { transform: translate(40px, -34px); } 50% { transform: translate(80px, -68px); } 75% { transform: translate(120px, -102px); } }
.v-hand-m { transform-origin: 100px 100px; animation: orbit 3s linear infinite; }
.v-hand-h { transform-origin: 100px 100px; animation: orbit 36s linear infinite; }

/* Laboratório */
.lab { padding: 16px; }
.lab--intro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lab__title { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.4rem, 11vw, 3.4rem); line-height: 1; text-transform: uppercase; }
.lab__loop { width: min(70vw, 280px); }
.lab__lead { font-weight: 700; font-size: 1.1rem; max-width: 36ch; }
.lab__preview { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.lab__preview li { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 8px; font-weight: 800; box-shadow: var(--shadow-sm); }
.lab__preview strong { color: var(--red-dark); font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }

.stepper ol { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 6px; overflow-x: auto; }
.stepper li { flex: 1; min-width: 64px; }
.stepper__btn {
  width: 100%; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-sm);
  font-weight: 800; font-size: .66rem; overflow-wrap: anywhere; line-height: 1.15; padding: 4px 2px;
}
.stepper__n { font-family: var(--font-display); font-size: 1.2rem; line-height: 1; }
.stepper__btn.is-done { background: var(--yellow); }
.stepper__btn.is-on { background: var(--red); color: #fff; transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.stepper__btn:disabled { background: #E3DEC4; color: #4A4A4A; border-color: #8C8770; box-shadow: 0 4px 0 #8C8770; }

.lab-step__head { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; margin-bottom: 18px; }
.lab-step__title { font-family: var(--font-display); font-weight: 400; font-size: 2rem; line-height: 1.02; text-transform: uppercase; outline: none; margin: 2px 0 6px; }
.lab-step__text { font-weight: 700; font-size: .98rem; }
.lab-form { margin-bottom: 20px; }
.idea-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.idea-chip { min-height: 44px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 99px; background: var(--yellow-soft); font-weight: 800; font-size: .9rem; }
.idea-chip:active { transform: scale(.95); }
.timer { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.timer__clock { font-family: var(--font-display); font-size: 2rem; letter-spacing: .04em; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn__opt { position: relative; }
.yn__opt span { display: grid; place-items: center; min-height: 52px; padding: 8px; text-align: center; border: 3px solid var(--ink); border-radius: 14px; background: var(--paper); font-weight: 800; box-shadow: var(--shadow-sm); }
.yn__opt input:checked + span { background: var(--ink); color: var(--yellow); }
.lab-list__title { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; text-transform: uppercase; margin: 8px 0 10px; }
.lab-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.lab-entry { background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 12px 14px; animation: rise .35s both; }
.lab-entry.is-hit { border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
.lab-entry__main { font-weight: 900; }
.lab-entry__meta { font-size: .85rem; font-weight: 700; color: var(--ink-soft); }
.lab-entry__tag { font-size: .85rem; font-weight: 900; margin-top: 4px; }
.lab-entry.is-hit .lab-entry__tag { color: var(--green); }
.cue-tag { display: inline-block; background: var(--yellow-soft); border: 2px solid var(--ink); border-radius: 8px; padding: 0 8px; margin: 2px 2px 0 0; font-size: .9rem; }
.pattern { background: var(--ink); color: var(--yellow); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: 0 6px 0 var(--red); }
.pattern__title { font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; }
.pattern ul { margin: 6px 0 0; padding-left: 18px; }
.pattern strong { color: #fff; }
.lab-note { font-weight: 800; margin-bottom: 16px; }
.plan-preview { font-size: 1.25rem; font-weight: 800; line-height: 1.5; background: var(--yellow-soft); border: 3px dashed var(--ink); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
mark { background: var(--yellow); color: var(--ink); padding: 0 4px; border-radius: 4px; box-shadow: inset 0 -4px 0 var(--red); }

.tracker { display: grid; gap: 20px; }
.plan-card { background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.plan-card__text { font-size: 1.3rem; font-weight: 800; line-height: 1.45; margin-top: 6px; }
.lab-streak { display: flex; align-items: center; gap: 14px; }
.lab-streak__mascot { width: 64px; height: 86px; flex: 0 0 64px; }
.lab-streak__num { font-weight: 800; }
.lab-streak__num strong { font-family: var(--font-display); font-weight: 400; font-size: 3rem; line-height: 1; color: var(--red-dark); margin-right: 4px; }
.lab-streak__msg { font-weight: 700; }
.checkin__title { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; text-transform: uppercase; outline: none; }
.checkin__status { font-weight: 700; margin: 4px 0 14px; }
.checkin__actions { display: grid; gap: 10px; }
.checkin__actions .btn[aria-pressed="true"] { outline: 4px solid var(--green); outline-offset: 2px; }
.heat__weekdays, .heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat__weekdays { font-size: .75rem; font-weight: 900; text-align: center; margin-bottom: 4px; }
.heat { list-style: none; margin: 0; padding: 0; }
.heat__cell { display: inline-block; aspect-ratio: 1; min-height: 14px; border-radius: 8px; border: 2px solid var(--ink); background: #F1EDD6; }
.heat .heat__cell { display: block; }
.heat__cell--ok { background: var(--red); }
.heat__cell--slip { background: repeating-linear-gradient(45deg, #fff, #fff 4px, var(--ink) 4px, var(--ink) 6px); }
.heat__cell.is-today { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--ink); }
.heat__legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .85rem; font-weight: 700; margin-top: 12px; }
.heat__legend .heat__cell { width: 16px; min-height: 16px; border-radius: 4px; }
.heat__stats { margin-top: 8px; font-weight: 700; }
.tracker__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tracker__actions .btn--ghost { grid-column: 1 / -1; }

/* Perfil */
.profile { padding: 16px; display: grid; gap: 20px; }
.profile .panel + .panel { margin-top: 0; }
.profile__hero { text-align: center; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 18px; box-shadow: 0 6px 0 var(--red); }
.profile__avatar { width: 96px; height: 96px; margin: 0 auto 8px; display: grid; place-items: center; font-size: 3.2rem; background: var(--yellow); border: 4px solid #fff; border-radius: 50%; animation: pop .5s cubic-bezier(.3, 1.8, .5, 1); }
.profile__name { font-family: var(--font-display); font-weight: 400; font-size: 2.4rem; line-height: 1.05; color: var(--yellow); text-transform: uppercase; overflow-wrap: anywhere; }
.profile__since { font-weight: 700; font-size: .92rem; }
.level { margin-top: 14px; text-align: left; }
.level__label { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 6px; }
.level__bar { height: 18px; border: 3px solid #fff; border-radius: 99px; overflow: hidden; background: #333; }
.level__bar span { display: block; height: 100%; width: var(--p); background: var(--yellow); animation: grow 1s ease-out; }
@keyframes grow { from { width: 0; } }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-box__value { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; }
.stat-box__label { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.league { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.league__row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 12px; font-weight: 800; }
.league__row.is-top .league__pos { background: var(--yellow); }
.league__row.is-me { background: var(--red); color: #fff; border-width: 3px; transform: scale(1.02); }
.league__pos { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 50%; font-weight: 900; background: #fff; color: var(--ink); }
.league__xp { font-weight: 900; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border: 3px solid #8C8770; border-radius: 16px; background: #F1EDD6; color: #4A4A4A; }
.badge.is-got { border-color: var(--ink); background: var(--yellow); color: var(--ink); box-shadow: var(--shadow-sm); }
.badge__icon { font-size: 2rem; }
.badge.is-got .badge__icon { animation: pop .5s both; }
.badge__title { font-weight: 900; }
.badge__desc { font-size: .82rem; font-weight: 700; }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.saved__item { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; padding: 8px; border: 3px solid var(--ink); border-radius: 14px; text-decoration: none; background: var(--paper); min-height: 72px; }
.saved__art { width: 56px; height: 56px; background: var(--yellow); border-radius: 10px; display: grid; place-items: center; padding: 4px; }
.saved__kicker { display: block; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.saved__title { display: block; font-weight: 900; }
.settings { display: grid; gap: 12px; }
.settings .field__label { margin-bottom: -4px; }

@media (max-width: 360px) {
  .trail-hero { grid-template-columns: 1fr; }
  .stat--level strong { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .escapee { transform: translate(calc(var(--sx) + 22px), calc(var(--sy) + 80px)); }
}
