/* ==========================================================================
   Compras — design system
   ========================================================================== */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #e7e7e9;
  --accent: #0f8a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e7f4ee;
  --danger: #dc2626;
  --warn-soft: #fef6e7;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --shadow-float: 0 1px 2px rgba(24, 24, 27, .05), 0 8px 28px rgba(24, 24, 27, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .9, .3, 1);
  color-scheme: light;

  /* cores das categorias */
  --c-hortifruti: #22a05a;
  --c-acougue: #d9443a;
  --c-frios: #e2a72e;
  --c-padaria: #c97a3a;
  --c-mercearia: #8b6b4a;
  --c-bebidas: #3b82f6;
  --c-congelados: #22b5c9;
  --c-limpeza: #8b5cf6;
  --c-higiene: #e0569b;
  --c-farmacia: #4f5bd5;
  --c-pet: #14a38b;
  --c-outros: #a1a1aa;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0d;
    --surface: #161618;
    --surface-2: #1f1f22;
    --surface-3: #29292d;
    --ink: #f4f4f5;
    --ink-2: #a1a1aa;
    --ink-3: #66666e;
    --line: #26262a;
    --accent: #34c58a;
    --accent-ink: #04140d;
    --accent-soft: rgba(52, 197, 138, .13);
    --danger: #f2625a;
    --warn-soft: rgba(245, 158, 11, .12);
    --shadow-float: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex: 0 0 auto; }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity .25s; }
.splash img { width: 64px; height: 64px; border-radius: 16px; }
.splash.gone { opacity: 0; pointer-events: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 18px; border: 0; border-radius: 12px;
  background: var(--surface-2); color: var(--ink);
  font-size: 15.5px; font-weight: 600; letter-spacing: -.005em;
  transition: transform .1s, opacity .2s, background .2s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--ink-2);
  transition: background .15s;
}
.icon-btn:active { background: var(--surface-2); }

.avatar {
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; flex: 0 0 auto;
  overflow: hidden; background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .1s;
}
button.avatar:active { transform: scale(.94); }
.avatar svg { width: 100%; height: 100%; }
.avatar-lg { width: 46px; height: 46px; }
.avatar-sm { width: 32px; height: 32px; }

.avatar-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.avatar-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: border-color .15s, background .15s;
}
.avatar-pick button svg { width: 60px; height: 60px; }
.avatar-pick button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
#nameStep .pin-msg { margin: -6px 0 10px; min-height: 0; }

/* ---------- Acesso (PIN) ---------- */
.auth {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  padding: calc(28px + var(--safe-t)) 28px calc(28px + var(--safe-b));
}
.auth-inner { width: 100%; max-width: 320px; text-align: center; }
.auth-logo { border-radius: 14px; }
.auth-title { margin: 18px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 32px; color: var(--ink-2); font-size: 15px; }
.auth-step { animation: rise .25s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.field { display: block; text-align: left; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }
.field input, .field textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); outline: none; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.pin-label { display: none; }
.pin-dots { display: flex; justify-content: center; gap: 14px; height: 14px; }
.pin-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-3); transition: background .12s, border-color .12s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.pin-msg { min-height: 20px; margin: 14px 0 18px; font-size: 14px; color: var(--danger); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); justify-content: center; gap: 16px 24px; margin-bottom: 26px; }
.keypad button {
  width: 72px; height: 72px; border: 0; border-radius: 50%;
  background: var(--surface-2); font-size: 28px; font-weight: 400; display: grid; place-items: center;
  transition: background .1s;
}
.keypad button:active { background: var(--surface-3); }
.keypad .key-ghost { background: transparent; color: var(--ink-2); }
.keypad .key-ghost:active { background: var(--surface-2); }

/* ---------- Estrutura do app ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: calc(16px + var(--safe-t)) 16px 12px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-text { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.028em; line-height: 1.15; }
.summary { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.topbar .avatar { margin-left: 4px; }
.sync { width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; opacity: 0; transition: opacity .3s, background .3s; }
.sync.pending { opacity: 1; background: #e8a33d; animation: blink 1s infinite; }
.sync.offline { opacity: 1; background: var(--ink-3); }
@keyframes blink { 50% { opacity: .3; } }

.offline {
  margin: 0 16px 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--ink); font-size: 13.5px;
}

.list { flex: 1; padding: 6px 16px calc(112px + var(--safe-b)); }

/* ---------- Grupos ---------- */
.group { margin-bottom: 22px; }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 0 4px 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: -.003em;
}
.count { margin-left: auto; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--c-outros); }
.c-hortifruti { background: var(--c-hortifruti); } .c-acougue { background: var(--c-acougue); }
.c-frios { background: var(--c-frios); } .c-padaria { background: var(--c-padaria); }
.c-mercearia { background: var(--c-mercearia); } .c-bebidas { background: var(--c-bebidas); }
.c-congelados { background: var(--c-congelados); } .c-limpeza { background: var(--c-limpeza); }
.c-higiene { background: var(--c-higiene); } .c-pet { background: var(--c-pet); }
.c-farmacia { background: var(--c-farmacia); }

.cards {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}

/* ---------- Item ---------- */
.item { position: relative; overflow: hidden; transition: opacity .3s, transform .3s; }
.item-row {
  position: relative; z-index: 1; display: flex; align-items: center; min-height: 56px;
  background: var(--surface); touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.item + .item::before {
  content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); z-index: 2;
}
.item.swiping::before, .item.swiping + .item::before { opacity: 0; }

.check { flex: 0 0 auto; width: 52px; height: 56px; border: 0; background: transparent; display: grid; place-items: center; }
.check span {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink-3);
  display: grid; place-items: center; transition: background .15s, border-color .15s, transform .15s;
}
.check:active span { transform: scale(.9); }
.check svg { width: 13px; height: 13px; color: var(--accent-ink); opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.item.done .check span { background: var(--accent); border-color: var(--accent); }
.item.done .check svg { opacity: 1; transform: scale(1); }

.item-body { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 9px 16px 9px 0; }
.item-name { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; letter-spacing: -.008em; }
.item-name .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty {
  flex: 0 0 auto; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.item-meta { margin-top: 1px; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta .note { color: var(--ink-2); }
.item.done .item-name .txt { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.item.done .qty { opacity: .55; }
.item.leaving { opacity: 0; transform: translateX(20px); }
.item.flash .item-row { animation: flash 1.2s; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: var(--surface); } }

/* Arrastar para excluir */
.swipe-bg {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding-left: 20px;
  background: var(--ink-3); color: #fff; font-size: 14.5px; font-weight: 600; transition: background .15s;
}
.swipe-bg svg { transition: transform .18s var(--ease); }
.item:not(.swiping) .swipe-bg { visibility: hidden; }
.item.armed .swipe-bg { background: #dc2626; }
.item.armed .swipe-bg svg { transform: scale(1.15); }
.item.removing { transition: height .2s ease, opacity .2s; opacity: 0; }

/* Comprados recentemente */
.bought-toggle {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 4px 8px;
  border: 0; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.bought-toggle .count { margin-left: 2px; }
.bought-toggle .chev { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.bought-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* ---------- Estado vazio ---------- */
.empty { text-align: center; padding: 64px 24px 32px; }
.empty-ic {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.empty h2 { margin: 0 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.empty p { margin: 0 auto; max-width: 270px; color: var(--ink-2); font-size: 14.5px; }

/* ---------- Sugestões rápidas ---------- */
.quick { margin: 0 0 22px; }
.quick-title { padding: 0 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; transition: transform .08s, background .15s, border-color .15s;
}
.chip:active { transform: scale(.96); background: var(--surface-2); }
.chip .plus { color: var(--accent); font-weight: 600; font-size: 15px; line-height: 1; }
.chip.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* ---------- Barra de adicionar ---------- */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 62%, color-mix(in srgb, var(--bg) 0%, transparent));
}
.composer-bar {
  max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 8px;
  padding: 5px 5px 5px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-float); transition: border-color .15s;
}
.composer-bar:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16.5px; padding: 10px 0; }
.composer input::placeholder { color: var(--ink-3); }
.add-btn {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); transition: transform .1s;
}
.add-btn:active { transform: scale(.93); }

.suggest {
  max-width: 720px; max-height: 44vh; margin: 0 auto 8px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-float);
}
.suggest button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px;
  border: 0; background: transparent; text-align: left; font-size: 15.5px;
}
.suggest button + button { border-top: 1px solid var(--line); }
.suggest button.hl, .suggest button:active { background: var(--surface-2); }
.s-dot { width: 8px; display: grid; place-items: center; }
.s-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-new .s-name { font-weight: 600; }
.s-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.ai-tag {
  padding: 1px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
}

/* ---------- Bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(9, 9, 11, .42); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; max-height: 92vh; margin: 0 auto; overflow-y: auto;
  padding: 8px 20px calc(24px + var(--safe-b));
  background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  animation: up .28s var(--ease);
}
.sheet.closing { transform: translateY(100%); transition: transform .2s ease-in; }
@keyframes up { from { transform: translateY(100%); } }
.sheet-grip { width: 36px; height: 5px; margin: 0 auto 18px; border-radius: 3px; background: var(--surface-3); }
.sheet h2 { margin: 0 0 18px; font-size: 20px; font-weight: 700; letter-spacing: -.018em; }
.sheet h3 { margin: 24px 4px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sheet .btn + .btn { margin-top: 10px; }
.sheet form > .btn:first-of-type { margin-top: 6px; }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-grid .chip { justify-content: flex-start; border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; }

.list-rows { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.row {
  width: 100%; min-height: 54px; display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  border: 0; background: transparent; text-align: left;
}
button.row:active, label.row:active { background: var(--surface-2); }
.row + .row { border-top: 1px solid var(--line); }
.row .r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .r-title { font-size: 15.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.row .r-sub { font-size: 13px; color: var(--ink-3); }
.row .r-icon { width: 22px; display: grid; place-items: center; color: var(--ink-2); }
.row .r-danger { color: var(--danger); }
.row .r-action { border: 0; background: transparent; padding: 6px 2px; color: var(--danger); font-size: 14px; font-weight: 600; }
.row .qty { font-size: 11.5px; }
.badge { padding: 1px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.sheet .field input { background: var(--surface); }

.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

.hint { margin: 8px 4px 0; font-size: 13px; color: var(--ink-3); }
.hint b { color: var(--ink-2); font-weight: 600; }
.version { margin-top: 28px; text-align: center; font-size: 12px; color: var(--ink-3); }
.stamp {
  margin: -6px 0 18px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-soft); color: var(--ink); font-size: 14px;
}
.stamp b { font-weight: 650; }
#purchases section h3 { margin-top: 20px; }
#purchases section:first-child h3 { margin-top: 0; }
#purchases .dot { margin: 0 2px; }
#morePurchases { margin-top: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px); padding: 11px 12px 11px 16px;
  border-radius: 12px; background: #1c1c1f; color: #fafafa; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22); animation: toastIn .22s var(--ease); white-space: nowrap;
}
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast button { border: 0; background: transparent; padding: 4px 6px; color: #5fd3a2; font-weight: 650; }
@media (prefers-color-scheme: dark) {
  .toast { background: #f4f4f5; color: #18181b; }
  .toast button { color: #0f8a5f; }
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (min-width: 760px) {
  .list, .topbar { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Minicraque aliviado (lista vazia) ---------- */
.empty-relief { padding-top: 20px; }
.relief {
  display: block; width: 280px; height: 280px; margin: 0 auto 4px; padding: 0;
  border: 0; background: transparent; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.rv-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; width: 100%; height: 100%; }
.rv-fig { position: relative; width: 268px; height: 268px; transform-origin: 50% 96%; animation: rvBreathe 2.2s ease-in-out infinite; }
.rv-stage.duo .rv-fig { width: 168px; height: 168px; margin: 0 -26px 14px; }
.rv-stage.duo .rv-fig + .rv-fig { animation-delay: -1.1s; }
.rv-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.rv-f1 { animation: rvFrame1 4.4s ease-in-out infinite; }
.rv-f2 { opacity: 0; animation: rvFrame2 4.4s ease-in-out infinite; }
.rv-shadow {
  position: absolute; left: 50%; bottom: 6px; width: 46%; height: 12px; margin-left: -23%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .16), transparent); animation: rvShadow 2.2s ease-in-out infinite;
}
.rv-fx { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rv-fx * { transform-box: view-box; }
.rv-ufa { transform-origin: 172px 98px; animation: rvUfa 4.4s ease-out infinite; }
.rv-spark { opacity: 0; animation: rvTwinkle 4.4s ease-in-out infinite; }
.rv-s1 { transform-origin: 10px 61px; }
.rv-s2 { transform-origin: 194px 41px; animation-delay: .25s; }
.rv-s3 { transform-origin: 198px 150px; animation-delay: .5s; }
.rv-s4 { transform-origin: 4px 140px; animation-delay: .35s; }
.rv-hearts { opacity: 0; transform-origin: 100px 4px; }
.relief.jump .rv-fig { animation: rvJump .75s cubic-bezier(.3, 1.6, .5, 1); }
.relief.jump .rv-stage.duo .rv-fig + .rv-fig { animation-delay: .08s; }
.relief.jump .rv-f1 { animation: none; opacity: 0; }
.relief.jump .rv-f2 { animation: none; opacity: 1; }
.relief.jump .rv-shadow { animation: rvJumpShadow .75s ease-out; }
.relief.jump .rv-hearts { animation: rvHearts 1.1s ease-out; }

/* 0–45%: suspirando (quadro 1) · 50–92%: sorrindo aliviado (quadro 2) */
@keyframes rvFrame1 { 0%, 44% { opacity: 1; } 50%, 92% { opacity: 0; } 98%, 100% { opacity: 1; } }
@keyframes rvFrame2 { 0%, 44% { opacity: 0; } 50%, 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
@keyframes rvBreathe {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  40% { transform: translateY(-6px) scale(.985, 1.025); }
  70% { transform: translateY(1px) scale(1.02, .98); }
}
@keyframes rvShadow { 0%, 100% { transform: scale(1); opacity: 1; } 40% { transform: scale(.86); opacity: .7; } }
@keyframes rvUfa {
  0%, 6% { opacity: 0; transform: translate(-10px, 10px) scale(.3); }
  14% { opacity: 1; transform: translate(0, 0) scale(1.08); }
  20%, 38% { opacity: 1; transform: translate(0, -3px) scale(1); }
  46%, 100% { opacity: 0; transform: translate(6px, -16px) scale(.9); }
}
@keyframes rvTwinkle {
  0%, 48% { opacity: 0; transform: scale(.2) rotate(0); }
  58% { opacity: 1; transform: scale(1.15) rotate(20deg); }
  70% { opacity: .6; transform: scale(.8) rotate(35deg); }
  82% { opacity: 1; transform: scale(1.05) rotate(50deg); }
  94%, 100% { opacity: 0; transform: scale(.2) rotate(70deg); }
}
@keyframes rvJump {
  0% { transform: translateY(0) scale(1.08, .9); }
  35% { transform: translateY(-40px) scale(.95, 1.06) rotate(-5deg); }
  65% { transform: translateY(-40px) scale(.97, 1.03) rotate(5deg); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes rvJumpShadow { 0%, 100% { transform: scale(1); } 45% { transform: scale(.5); opacity: .4; } }
@keyframes rvHearts {
  0% { opacity: 0; transform: translateY(16px) scale(.4); }
  30% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-30px) scale(1); }
}
