:root {
  --paper: #F4EFE6;
  --paper-2: #EAE3D6;
  --card: #FFFDF9;
  --ink: #15172B;
  --ink-2: #565972;
  --ink-3: #8C8EA3;
  --volt: #D5F53F;
  --volt-2: #C3E62A;
  --coral: #FF5A36;
  --coral-soft: #FFE1D8;
  --ok: #1F9D57;
  --ok-soft: #DDF3E5;
  --sun: #FFD449;
  --dusk: #FF9A6B;
  --night: #3A3D9A;
  --night-ink: #F4EFE6;
  --line: 2px solid var(--ink);
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --lift: 0 4px 0 var(--ink);
  --lift-sm: 0 3px 0 var(--ink);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.4 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.ic { width: 24px; height: 24px; flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px calc(112px + var(--safe-b));
}
.wrap.no-nav { padding-bottom: calc(32px + var(--safe-b)); }

/* ---------- topo ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.eyebrow { font: 700 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 4px 0 8px; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.02em; }
h1 { font-size: 34px; line-height: 1; font-weight: 800; }
h2 { font-size: 22px; line-height: 1.1; font-weight: 800; }
h3 { font-size: 17px; line-height: 1.2; font-weight: 600; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: var(--line); border-radius: 999px;
  background: var(--card); box-shadow: var(--lift);
  font: 700 16px/1 var(--body);
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
  text-decoration: none; color: var(--ink);
  user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-volt { background: var(--volt); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:active { transform: none; box-shadow: none; opacity: .6; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; box-shadow: var(--lift-sm); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; box-shadow: var(--lift-sm); }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

/* ---------- placar ---------- */
.score {
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-lg); padding: 18px 18px 16px;
  margin-bottom: 26px;
}
.score-main { display: flex; align-items: center; gap: 12px; }
.score-num { font: 800 54px/0.9 var(--display); letter-spacing: -.03em; }
.score-unit { font-size: 14px; color: #C9CADB; line-height: 1.2; }
.score-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat {
  border: 1.5px solid #3A3D57; border-radius: var(--r-sm); padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.stat b { font: 800 22px/1 var(--display); display: block; }
.stat span { font-size: 12px; color: #C9CADB; }
.stat .ic { color: var(--volt); }
.goal { margin-top: 12px; border: 1.5px solid #3A3D57; border-radius: var(--r-sm); padding: 10px 12px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #C9CADB; margin-bottom: 8px; }
.goal-top b { color: var(--paper); font-weight: 700; }
.bar { height: 10px; border-radius: 99px; background: #2A2D45; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--volt); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }

.coin {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--volt); color: var(--ink);
  border: 2.5px solid var(--ink); box-shadow: inset 0 -4px 0 var(--volt-2);
  display: inline-grid; place-items: center;
  font: 800 20px/1 var(--display); flex: none;
}
.score .coin { border-color: var(--volt); }
.coin-sm { width: 22px; height: 22px; font-size: 11px; border-width: 2px; box-shadow: inset 0 -2px 0 var(--volt-2); }
.pts { display: inline-flex; align-items: center; gap: 5px; font: 700 14px/1 var(--body); white-space: nowrap; }

/* ---------- listas de missão ---------- */
.period { margin: 0 0 22px; }
.period-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.period-h .chip { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: var(--line); }
.period-h .chip .ic { width: 18px; height: 18px; }
.p-manha { background: var(--sun); }
.p-tarde { background: var(--dusk); }
.p-noite { background: var(--night); color: var(--night-ink); }

.list { display: grid; gap: 10px; }
.task {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: var(--line); border-radius: var(--r-md);
  padding: 10px 10px 10px 10px; min-height: 72px;
  transition: background .2s, opacity .2s;
}
.tile {
  width: 48px; height: 48px; border-radius: 14px; border: var(--line);
  display: grid; place-items: center; flex: none;
}
.tile .ic { width: 26px; height: 26px; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.task-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.task.is-sent { background: #FFF7D6; }
.task.is-done { background: var(--paper-2); border-color: #B9B5AA; }
.task.is-done .task-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-2); }
.task.is-done .tile { filter: grayscale(.8); opacity: .6; border-color: #B9B5AA; }
.task.is-back { background: var(--coral-soft); }
.flag { font-weight: 700; color: var(--coral); }
.done-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
.wait-btn { background: #FFE98A; }

.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.92); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }

.empty {
  text-align: center; padding: 34px 18px;
  border: 2px dashed #C9C2B3; border-radius: var(--r-lg);
}
.empty .big { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--volt); border: var(--line); display: grid; place-items: center; }
.empty .big .ic { width: 32px; height: 32px; }
.empty p { margin: 6px 0 0; color: var(--ink-2); }
.allset {
  background: var(--volt); border: var(--line); border-radius: var(--r-lg);
  padding: 18px; display: flex; gap: 14px; align-items: center; margin-bottom: 22px;
}
.allset .ic { width: 36px; height: 36px; }

/* ---------- loja ---------- */
.reward { display: flex; align-items: center; gap: 12px; background: var(--card); border: var(--line); border-radius: var(--r-md); padding: 10px; }
.reward .tile { background: var(--paper); }
.reward.is-goal { background: #F3FBD0; }
.goal-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid transparent; background: transparent; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.goal-btn[aria-pressed="true"] { color: var(--ink); background: var(--volt); border-color: var(--ink); }
.goal-btn .ic { width: 22px; height: 22px; }
.missing { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.block { margin-top: 28px; }
.block-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card); border: 1.5px solid #D8D1C3; font-size: 14px; }
.note .ic { width: 20px; height: 20px; color: var(--ink-2); }
.status { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.s-pendente { background: #FFE98A; }
.s-aprovada { background: var(--ok-soft); color: var(--ok); }
.s-recusada { background: var(--coral-soft); color: var(--coral); }

/* ---------- campos ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > span, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: var(--line); border-radius: var(--r-sm); background: var(--card);
  font-size: 17px; font-weight: 600;
}
textarea.input { min-height: 84px; resize: vertical; font-weight: 500; }
.input:focus { outline: none; box-shadow: 0 0 0 3px var(--volt); }
.seg { display: flex; border: var(--line); border-radius: 999px; padding: 3px; background: var(--card); gap: 3px; }
.seg button {
  flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg .ic { width: 18px; height: 18px; }
.days { display: flex; gap: 6px; margin-top: 10px; }
.days button { flex: 1; aspect-ratio: 1; max-width: 46px; border: var(--line); border-radius: 50%; background: var(--card); font-weight: 800; font-size: 14px; }
.days button[aria-pressed="true"] { background: var(--volt); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper output { font: 800 30px/1 var(--display); min-width: 74px; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-grid button {
  aspect-ratio: 1; border: 2px solid transparent; border-radius: 12px; background: var(--card);
  display: grid; place-items: center; padding: 0;
}
.icon-grid button[aria-pressed="true"] { border-color: var(--ink); background: var(--volt); }
.icon-grid .ic { width: 22px; height: 22px; }
.err { color: var(--coral); font-weight: 700; font-size: 14px; min-height: 20px; margin: 4px 0 0; }

/* ---------- barra de abas ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-b));
  width: min(448px, calc(100% - 24px));
  display: flex; gap: 4px; padding: 6px;
  background: var(--ink); border-radius: 999px;
  z-index: 10;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; border-radius: 999px; color: #A9ABC2; text-decoration: none;
  font-size: 11px; font-weight: 700; position: relative;
}
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { background: var(--volt); color: var(--ink); }
.badge {
  position: absolute; top: 5px; left: calc(50% + 6px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--ink);
}

/* ---------- cartões do adulto ---------- */
.card { background: var(--card); border: var(--line); border-radius: var(--r-md); padding: 14px; }
.review-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kind { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.k-tarefa { background: var(--volt); }
.k-resgate { background: var(--sun); }
.k-pedido { background: var(--dusk); }
.when { font-size: 12px; color: var(--ink-2); margin-left: auto; white-space: nowrap; }
.wish-text { font: 600 18px/1.3 var(--display); margin: 2px 0 12px; overflow-wrap: anywhere; }
.row-link {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: var(--line); border-radius: var(--r-md); padding: 10px;
}
.row-link .seta { margin-left: auto; color: var(--ink-3); }
.settings { display: grid; gap: 10px; }
.code-big { font: 800 52px/1 var(--display); letter-spacing: .12em; text-align: center; margin: 10px 0; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 16px;
  background: var(--ink); color: var(--paper); border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
}
.banner button { margin-left: auto; background: var(--volt); color: var(--ink); border: 0; border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 13px; }

/* semana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; padding: 14px 12px 10px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.wk-bar { width: 100%; max-width: 30px; background: var(--paper-2); border-radius: 8px; position: relative; flex: 1; overflow: hidden; border: 1.5px solid #D8D1C3; }
.wk-bar > i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--volt); border-top: 2px solid var(--ink); }
.wk-bar.full > i { background: var(--ok); }
.wk small { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.wk.today small { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.kpi { background: var(--card); border: var(--line); border-radius: var(--r-sm); padding: 10px; }
.kpi b { font: 800 24px/1 var(--display); display: block; }
.kpi span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.hist { display: grid; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1.5px solid #E0D9CB; font-size: 15px; }
.hist-row:last-child { border-bottom: 0; }
.hist-row .amt { margin-left: auto; font-weight: 800; white-space: nowrap; }
.amt.plus { color: var(--ok); }
.amt.minus { color: var(--coral); }
.hist-row .d { font-size: 12px; color: var(--ink-2); }

/* ---------- folha (dialog) ---------- */
dialog#sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 480px;
  background: var(--paper); color: var(--ink);
  border-radius: 26px 26px 0 0; border-top: var(--line);
  max-height: 92vh; overflow: auto;
}
dialog#sheet::backdrop { background: rgba(21, 23, 43, .55); }
dialog#sheet[open] { animation: up .28s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-in { padding: 20px 16px calc(24px + var(--safe-b)); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
@media (min-width: 560px) {
  dialog#sheet { margin: auto; border-radius: 26px; border: var(--line); }
}

/* PIN */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: var(--line); }
.pin-dots i.on { background: var(--ink); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pad button { min-height: 62px; border: var(--line); border-radius: 18px; background: var(--card); font: 800 26px/1 var(--display); box-shadow: var(--lift-sm); }
.pad button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.pad .ghost { border-color: transparent; background: transparent; box-shadow: none; font-size: 15px; font-family: var(--body); font-weight: 700; }
.pad .ghost .ic { margin: auto; }

/* celebração */
.party {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: rgba(21, 23, 43, .72);
}
.party-card {
  width: min(380px, 100%); background: var(--volt); border: var(--line); border-radius: 28px;
  padding: 26px 22px 20px; text-align: center; box-shadow: 0 8px 0 var(--ink);
  animation: partyIn .5s cubic-bezier(.2,1.5,.4,1);
}
@keyframes partyIn { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
.party-num { font: 800 76px/0.9 var(--display); letter-spacing: -.04em; }
.party-card .coin { width: 70px; height: 70px; font-size: 32px; margin: 0 auto 10px; animation: spin 1.1s cubic-bezier(.3,1.4,.5,1); }
@keyframes spin { from { transform: rotateY(0) translateY(20px); } to { transform: rotateY(720deg); } }
.party-list { list-style: none; padding: 0; margin: 14px 0 18px; text-align: left; display: grid; gap: 6px; }
.party-list li { display: flex; gap: 8px; justify-content: space-between; font-weight: 600; font-size: 15px; background: rgba(255,255,255,.55); border-radius: 10px; padding: 8px 10px; }
.confetti { position: fixed; top: -10px; width: 10px; height: 16px; z-index: 51; border: 1.5px solid var(--ink); animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60;
  max-width: calc(100% - 32px); text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%); }

/* boas-vindas e assistente */
.hero { padding-top: 6vh; }
.mark {
  width: 86px; height: 86px; border-radius: 26px; background: var(--volt); border: var(--line); box-shadow: var(--lift);
  display: grid; place-items: center; margin-bottom: 26px;
}
.mark svg { width: 52px; height: 52px; }
.hero h1 { font-size: 46px; }
.hero p.lead { font-size: 19px; color: var(--ink-2); margin: 14px 0 34px; max-width: 30ch; }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps i { flex: 1; height: 6px; border-radius: 99px; background: var(--paper-2); }
.steps i.on { background: var(--ink); }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: var(--line); border-radius: var(--r-md); padding: 10px; }
.pick .box { width: 28px; height: 28px; border-radius: 8px; border: var(--line); margin-left: auto; display: grid; place-items: center; flex: none; }
.pick[aria-pressed="true"] { background: #F3FBD0; }
.pick[aria-pressed="true"] .box { background: var(--ink); color: var(--volt); }
.pick .box .ic { width: 18px; height: 18px; }
.sticky-cta { position: sticky; bottom: 0; padding: 14px 0 calc(8px + var(--safe-b)); background: linear-gradient(to bottom, transparent, var(--paper) 30%); margin-top: 10px; }

.skel { background: linear-gradient(90deg, var(--paper-2) 0%, #F1EBDF 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r-md); }
@keyframes sk { to { background-position: -200% 0; } }

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