/* Barzel — design system v2.1
   Editorial escuro e quente. Display: ABC Arizona Flare (fallback Fraunces).
   UI: Aeonik (fallback Inter). Profundidade por sombra + hairline, não por borda. */

:root {
  --bg: #0e0d0b;
  --card-hi: #1a1815;
  --card-lo: #141210;
  --hairline: rgba(255, 255, 255, 0.06);
  --text: #f1efe9;
  --muted: #9b968a;
  --faint: #7a756b;
  --cream: #f3efe4;
  --ink: #16150f;
  --gold: #c9a45c;
  --gold-dim: rgba(201, 164, 92, 0.12);
  --green: #7dbd82;
  --red: #d97b6f;
  --font-ui: "Aeonik", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "ABC Arizona Flare", "Fraunces", Georgia, serif;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* concha de aplicativo: o documento é fixo e só o miolo rola */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  background: var(--bg);
  background-image: radial-gradient(1100px 640px at 50% -12%, #1a1713 0%, var(--bg) 62%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea { user-select: text; -webkit-user-select: text; }

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
}

button { font-family: var(--font-ui); }

/* ---------- primitivas tipográficas ---------- */
.kicker, .micro {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--faint);
  font-weight: 500;
}
.screen-head { margin: 8px 6px 22px; }
.screen-head h1 {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 7px;
}
.screen-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 7px; }

.sec { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.sec h3 { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -0.01em; }
.sec .count { font-family: var(--font-display); font-size: 16px; color: var(--gold); }
.sec.sec-tap { cursor: pointer; }
.sec .sec-arrow { color: var(--faint); font-size: 19px; margin-left: 10px; line-height: 1; align-self: center; }

/* ---------- topo ---------- */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 18px) 22px 14px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(14, 13, 11, 0.96) 70%, rgba(14, 13, 11, 0));
  z-index: 10;
}
#topbar .brand { height: 14px; width: auto; display: block; opacity: 0.95; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.help-btn {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline);
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.streak-pill {
  display: flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, #d9b268, #bd934c);
  border: none;
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
  color: #16150f;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(201, 164, 92, 0.4);
  animation: pillGlow 3s ease-in-out infinite;
}
.streak-pill .sp-fire { font-size: 17px; }
.streak-pill .sp-col { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.streak-pill .sp-col b { font-size: 14.5px; font-weight: 800; }
.streak-pill .sp-col small { font-size: 7.8px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
@keyframes pillGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 164, 92, 0); }
  50% { box-shadow: 0 0 16px 2px rgba(201, 164, 92, 0.45); }
}
.streak-pill svg { width: 13px; height: 13px; fill: var(--gold); }

/* ---------- conteúdo ---------- */
#view {
  flex: 1;
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 118px);
  animation: viewIn 0.3s ease;
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: linear-gradient(180deg, var(--card-hi), var(--card-lo));
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card > .kicker, .card > .micro { display: block; margin-bottom: 14px; }
.card .sec { margin-bottom: 10px; }

/* ---------- versículo (herói claro) ---------- */
.verse-hero {
  background:
    linear-gradient(180deg,
      rgba(249, 245, 235, 0.97) 0%,
      rgba(248, 243, 231, 0.86) 34%,
      rgba(246, 239, 224, 0.78) 56%,
      rgba(248, 243, 231, 0.95) 80%,
      rgba(249, 245, 235, 0.98) 100%),
    url("assets/silhueta.jpg") center 30% / cover no-repeat,
    #f6f2e9;
  color: var(--ink);
  border-radius: 26px;
  padding: 36px 26px 24px;
  margin-bottom: 14px;
  text-align: center;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.verse-hero .kicker { color: #99917d; }
.verse-date { font-family: var(--font-display); font-size: 14px; color: #6f6753; margin-top: 8px; }
.verse-hero .rule { width: 32px; height: 1px; background: rgba(22, 21, 15, 0.28); margin: 15px auto; }
.verse-quote {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -0.012em;
}
.verse-ref {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: #99917d;
  margin-top: 17px;
}
.verse-streak {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #8a6a2e;
  background: rgba(201, 164, 92, 0.16);
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 10px;
}

/* versículo trancado: segurar para desbloquear */
.lock-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 0 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.lock-scene { position: relative; width: 184px; height: 200px; animation: scenePulse 2.2s ease-in-out infinite; }
.lock-wrap.holding .lock-scene { animation: none; }
@keyframes scenePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pot-img {
  position: absolute;
  top: -6px; right: 0;
  width: 94px;
  transform-origin: 80% 45%;
  transition: transform 0.45s cubic-bezier(0.3, 0.8, 0.3, 1);
  z-index: 2;
}
.lock-wrap.holding .pot-img { transform: rotate(-22deg); }
.pour {
  position: absolute;
  top: 58px; left: 83px;
  width: 10px; height: 58px;
  background: linear-gradient(90deg, #8a5a33 0%, #5a351b 45%, #3c2210 100%);
  clip-path: polygon(12% 0, 88% 0, 68% 100%, 32% 100%);
  transform: scaleY(0);
  transform-origin: top;
  z-index: 1;
  overflow: hidden;
}
.pour::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 22%;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 242, 224, 0.55), rgba(255, 242, 224, 0.25));
}
.lock-wrap.holding .pour { animation: pourDown 0.25s ease-out 0.3s forwards; }
@keyframes pourDown { to { transform: scaleY(1); } }
.splash {
  position: absolute;
  top: 111px; left: 78px;
  width: 20px; height: 9px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(125, 78, 41, 0.85) 0%, rgba(125, 78, 41, 0) 70%);
  opacity: 0;
  z-index: 4;
}
.lock-wrap.holding .splash {
  animation: splashPulse 0.4s ease-in-out 0.55s infinite alternate;
}
@keyframes splashPulse {
  from { opacity: 0.5; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1.2); }
}
.cup-wrap { position: absolute; bottom: 0; left: 0; width: 136px; z-index: 3; }
.cup-img { width: 100%; display: block; }
.fill-surface {
  position: absolute;
  left: 10%; top: 4%;
  width: 57%; height: 21%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #7a4a26 0%, #53301a 75%);
  opacity: 0;
}
.lock-wrap.holding .fill-surface { animation: fillSurf 3s linear forwards; }
@keyframes fillSurf { to { opacity: 1; } }
.steam-svg { position: absolute; left: 18%; top: -34px; width: 60px; height: 34px; }
.steam { fill: none; stroke: rgba(22, 21, 15, 0.4); stroke-width: 3; stroke-linecap: round; opacity: 0; }
.lock-wrap.holding .steam { animation: steamUp 1.4s ease-in-out infinite; }
.lock-wrap.holding .steam.s2 { animation-delay: 0.45s; }
@keyframes steamUp {
  0% { opacity: 0; transform: translateY(5px); }
  40% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-7px); }
}
.lock-hint { color: #5f5945; font-size: 13.5px; font-weight: 500; max-width: 250px; line-height: 1.6; }

.share-row { display: flex; justify-content: center; gap: 26px; margin-top: 22px; }
.share-c {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.share-c .cir {
  width: 46px; height: 46px; border-radius: 999px;
  background: var(--ink); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.share-c:active .cir { transform: scale(0.92); }
.share-c.ghost .cir { background: none; border: 1px solid rgba(22, 21, 15, 0.3); color: var(--ink); }
.share-c .cir svg { width: 19px; height: 19px; fill: currentColor; }
.share-c span { font-size: 10px; color: #6b6350; font-weight: 600; letter-spacing: 0.02em; }
.verse-reflect {
  text-align: left;
  border-top: 1px solid rgba(22, 21, 15, 0.1);
  margin-top: 22px;
  padding-top: 17px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #38341f;
}
.verse-reflect .kicker { display: block; margin-bottom: 8px; color: #99917d; }

/* ---------- diário ---------- */
.journal textarea {
  width: 100%;
  min-height: 68px;
  background: rgba(255, 255, 255, 0.045);
  border: none;
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  padding: 14px;
  resize: vertical;
}
.journal textarea::placeholder { color: var(--faint); }
.journal textarea:focus { outline: 1px solid rgba(201, 164, 92, 0.4); }
.journal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.autosave { font-size: 11.5px; color: var(--faint); transition: color 0.2s; }
.autosave.ok { color: var(--green); }

/* ---------- botões ---------- */
.btn {
  display: block;
  width: 100%;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  border: none;
  border-radius: 999px;
  padding: 14px;
  cursor: pointer;
  margin-top: 16px;
  text-align: center;
  transition: transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn.secondary { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn.danger { background: none; color: var(--red); border: 1px solid rgba(217, 123, 111, 0.28); }
.btn-text {
  background: none; border: none;
  color: var(--gold);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  padding: 12px 4px 2px;
}
.btn-text.block { display: block; margin: 6px auto 0; }

/* ---------- hábitos ---------- */
.habit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s;
}
.habit-row:active { transform: scale(0.985); }
.habit-row:last-of-type { border-bottom: none; }
.habit-check {
  width: 27px; height: 27px; min-width: 27px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}
.habit-row.done .habit-check {
  background: var(--cream);
  border-color: var(--cream);
  animation: pop 0.28s ease;
}
@keyframes pop { 50% { transform: scale(1.18); } }
.habit-check svg { width: 14px; height: 14px; fill: var(--ink); opacity: 0; transition: opacity 0.15s; }
.habit-row.done .habit-check svg { opacity: 1; }
.habit-ic {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  display: flex; align-items: center; justify-content: center;
}
.habit-ic svg { width: 17px; height: 17px; fill: var(--muted); }
.habit-row.done .habit-ic svg { fill: var(--gold); }
.habit-name { flex: 1; font-weight: 500; font-size: 15px; letter-spacing: 0.01em; }
.habit-row.done .habit-name { color: var(--faint); }
.streak-badge { font-size: 12px; color: var(--faint); font-weight: 500; white-space: nowrap; }
.streak-badge b { color: var(--gold); font-family: var(--font-display); font-weight: 500; font-size: 15px; }

.photo-btn {
  background: rgba(255, 255, 255, 0.045);
  border: none;
  border-radius: 12px;
  width: 36px; height: 36px; min-width: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.photo-btn svg { width: 16px; height: 16px; fill: var(--muted); }
.photo-btn.need { background: var(--gold-dim); }
.photo-btn.need svg { fill: var(--gold); }
.photo-thumb { width: 36px; height: 36px; min-width: 36px; border-radius: 12px; object-fit: cover; }

.hint { color: var(--faint); font-size: 12px; margin-top: 13px; line-height: 1.5; }

/* ---------- números ---------- */
.big-stat { text-align: center; padding: 10px 0 4px; }
.big-stat .n { font-family: var(--font-display); font-size: 58px; font-weight: 500; line-height: 1; display: block; letter-spacing: -0.02em; }
.big-stat .n small { font-size: 19px; color: var(--muted); font-weight: 400; }
.big-stat .kicker { margin-top: 10px; display: block; }
.big-stat .n-fire { font-size: 36px; margin-right: 6px; vertical-align: 8px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 18px; }
.stat-box { background: rgba(255, 255, 255, 0.04); border-radius: 14px; padding: 13px 6px; text-align: center; }
.stat-box b { font-family: var(--font-display); font-size: 21px; font-weight: 500; display: block; }
.stat-box small { color: var(--faint); font-size: 10.5px; letter-spacing: 0.04em; }

.evo-row { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--hairline); }
.evo-row:last-child { border-bottom: none; }
.evo-info { flex: 1; }
.evo-info b { font-size: 15px; font-weight: 500; display: block; }
.evo-info small { color: var(--faint); font-size: 12px; }
.evo-streak { text-align: right; }
.evo-streak b { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--gold); display: block; line-height: 1.05; }
.evo-streak small { color: var(--faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- semana / calendário ---------- */
.week-bars { display: flex; gap: 8px; align-items: flex-end; height: 82px; margin-top: 10px; }
.week-bars .day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.week-bars .bar { width: 100%; max-width: 26px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); min-height: 4px; transition: height 0.3s; }
.week-bars .bar.some { background: rgba(201, 164, 92, 0.55); }
.week-bars .bar.full { background: var(--gold); }
.week-bars small { color: var(--faint); font-size: 10px; }
.week-bars .today small { color: var(--gold); font-weight: 700; }

.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-head b { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.cal-nav { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .dow { text-align: center; font-size: 9.5px; color: var(--faint); padding: 5px 0; font-weight: 500; letter-spacing: 0.12em; }
.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 12.5px;
}
.cal-day.other { color: #45413a; }
.cal-day.today { background: var(--gold-dim); color: var(--gold); font-weight: 700; }
.cal-day .dots { display: flex; gap: 2px; margin-top: 2px; height: 4px; }
.dot { width: 4px; height: 4px; border-radius: 999px; display: inline-block; }
.dot.active { background: var(--gold); }
.dot.perfect { background: var(--green); }
.legend { font-size: 11px; color: var(--faint); text-align: center; margin-top: 14px; }

/* ---------- comunidades ---------- */
.comm-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(180deg, var(--card-hi), var(--card-lo));
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 19px 18px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.comm-card:active { transform: scale(0.98); }
.comm-avatar {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: 16px;
  background: var(--cream);
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.comm-info { flex: 1; }
.comm-info b { font-family: var(--font-display); font-size: 17.5px; font-weight: 500; display: block; }
.comm-info small { color: var(--faint); font-size: 12.5px; }
.comm-tag {
  font-size: 9px;
  color: var(--gold);
  background: var(--gold-dim);
  border-radius: 6px;
  padding: 3px 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.comm-arrow { color: var(--faint); font-size: 20px; }

.back-btn {
  background: none; border: none;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  padding: 4px 6px 14px;
  display: flex; align-items: center; gap: 6px;
}

.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 14px; margin-bottom: 2px; }
.rank-row.me { background: var(--gold-dim); }
.rank-pos { width: 22px; text-align: center; font-family: var(--font-display); font-weight: 500; color: var(--faint); font-size: 15px; }
.rank-row.top .rank-pos { color: var(--gold); }
.rank-avatar {
  width: 33px; height: 33px; min-width: 33px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; color: var(--muted);
  overflow: hidden;
}
.rank-row.me .rank-avatar { background: var(--cream); color: var(--ink); }
.rank-name { flex: 1; font-weight: 500; font-size: 14.5px; line-height: 1.25; }
.rank-name small { color: var(--faint); font-weight: 400; font-size: 11.5px; display: block; }
.rank-pts { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.rank-pts small { color: var(--faint); font-size: 10px; font-family: var(--font-ui); }
.pending { opacity: 0.45; }
.pending-tag { font-size: 9.5px; color: var(--muted); background: rgba(255, 255, 255, 0.05); border-radius: 6px; padding: 3px 7px; text-transform: uppercase; letter-spacing: 0.08em; }

/* feed de atividade do grupo (estilo GymRats) */
.feed-item { padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.feed-item:last-child { border-bottom: none; }
.fi-head { display: flex; align-items: center; gap: 11px; }
.fi-meta { flex: 1; min-width: 0; }
.fi-meta b { font-size: 14px; font-weight: 600; display: block; line-height: 1.25; }
.fi-meta small { color: var(--faint); font-size: 11.5px; }
.fi-check {
  font-size: 10.5px;
  color: var(--gold);
  background: var(--gold-dim);
  border-radius: 7px;
  padding: 4px 9px;
  font-weight: 600;
  white-space: nowrap;
}
.fi-photo {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  margin-top: 11px;
  display: block;
}

/* progresso do desafio */
.chal { margin-bottom: 16px; }
.chal .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.chal .row b { color: var(--gold); font-weight: 600; }

/* seletor de duração */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip-opt {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  cursor: pointer;
}
.chip-opt.sel { background: var(--gold-dim); border-color: rgba(201, 164, 92, 0.5); color: var(--gold); }

/* botão flutuante de criar (padrão dos grandes apps) */
.fab {
  position: fixed;
  right: 22px;
  bottom: calc(env(safe-area-inset-bottom) + 100px);
  width: 58px; height: 58px;
  border-radius: 19px;
  background: var(--cream);
  color: var(--ink);
  border: none;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  z-index: 21;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.92); }

.mural-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mural-item { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1; }
.mural-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mural-item span {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 9px; padding: 4px 7px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.empty-note { color: var(--faint); font-size: 13px; text-align: center; padding: 16px 6px; line-height: 1.55; }

/* ---------- perfil ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 999px;
  background: var(--cream); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
}
.profile-avatar img, .rank-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}
.profile-head .p-name { font-family: var(--font-display); font-size: 22px; font-weight: 500; display: block; line-height: 1.15; }
.profile-head .p-handle { color: var(--gold); font-size: 13.5px; font-weight: 500; }
.profile-head .p-since { color: var(--faint); font-size: 12px; display: block; margin-top: 2px; }

.patente-bar { margin-top: 20px; }
.patente-bar .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.patente-bar .row b { color: var(--gold); font-weight: 600; }
.progress-bar { height: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.3s; }

.journal-entry { border-bottom: 1px solid var(--hairline); padding: 14px 0; }
.journal-entry:last-child { border-bottom: none; }
.journal-entry small { color: var(--gold); font-weight: 600; font-size: 11.5px; }
.journal-entry .je-verse { color: var(--faint); font-size: 11px; }
.journal-entry p { font-size: 14px; color: #cbc7bd; margin-top: 5px; line-height: 1.55; }

.about-verse { font-family: var(--font-display); font-size: 17.5px; font-weight: 400; color: #d8d4c9; line-height: 1.5; }
.about-ref { color: var(--faint); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin: 10px 0 14px; }

.manage-row { display: flex; align-items: center; gap: 13px; padding: 12px 2px; border-bottom: 1px solid var(--hairline); }
.manage-row:last-of-type { border-bottom: none; }
.icon-btn { background: none; border: none; cursor: pointer; padding: 6px; opacity: 0.6; }
.icon-btn svg { width: 16px; height: 16px; fill: var(--muted); }
.icon-btn:hover { opacity: 1; }
.icon-btn:hover svg { fill: var(--red); }

/* ---------- switch ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; }
.switch-row .sw-label b { font-size: 14.5px; font-weight: 500; display: block; }
.switch-row .sw-label small { color: var(--faint); font-size: 12px; }
.switch { position: relative; width: 46px; height: 27px; min-width: 46px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  transition: 0.2s;
}
.switch .track::after {
  content: "";
  position: absolute;
  width: 21px; height: 21px;
  border-radius: 999px;
  top: 3px; left: 3px;
  background: var(--muted);
  transition: 0.2s;
}
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(19px); background: var(--ink); }

/* ---------- dock (tab bar flutuante) ---------- */
#tabbar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 430px;
  display: flex;
  background: rgba(26, 24, 20, 0.85);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px;
  z-index: 20;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
#tabbar .tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s, background 0.2s;
}
#tabbar .tab svg { width: 20px; height: 20px; fill: currentColor; }
#tabbar .tab.active { color: var(--ink); background: var(--cream); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 7, 6, 0.75);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
.modal {
  background: linear-gradient(180deg, #1c1a16, #14120f);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 26px 26px 0 0;
  padding: 26px 22px calc(env(safe-area-inset-bottom) + 26px);
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(48px); opacity: 0; } }
.modal h3 { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.modal p { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; line-height: 1.55; }
.modal label.field { display: block; margin-bottom: 14px; }
.modal label.field .micro { display: block; margin-bottom: 8px; }
.modal input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 14px;
  color: var(--text);
  font: inherit;
  padding: 14px;
}
.modal input[type="text"]::placeholder { color: var(--faint); }
.modal input[type="text"]:focus { outline: 1px solid rgba(201, 164, 92, 0.45); }
.field-error { color: var(--red); font-size: 12.5px; margin-top: 7px; display: none; }

/* cadastro em tela cheia (onboarding) */
.modal-backdrop.full { align-items: stretch; background: var(--bg); backdrop-filter: none; }
.modal-backdrop.full .modal {
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(11, 10, 8, 0.93) 0%, rgba(11, 10, 8, 0.86) 50%, rgba(14, 13, 11, 0.96) 100%),
    url("assets/cruz.jpg") center 20% / cover no-repeat,
    var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 28px calc(env(safe-area-inset-bottom) + 44px);
  animation: obIn 0.35s ease;
}
.modal-backdrop.full h3 { font-size: 27px; text-align: center; }
.modal-backdrop.full > .modal > p { text-align: center; }

/* convite para o tutorial */
.tour-intro {
  position: fixed; inset: 0;
  z-index: 48;
  background: rgba(6, 5, 4, 0.9);
  transform: translateZ(0);
  display: flex; align-items: center; justify-content: center;
  animation: obIn 0.3s ease;
}
.ti-card {
  background: linear-gradient(180deg, var(--card-hi), var(--card-lo));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  padding: 30px 26px 24px;
  width: min(340px, calc(100vw - 40px));
  text-align: center;
  box-shadow: var(--shadow);
}
.ti-card .ob-icon { width: 74px; height: 74px; margin: 0 auto 20px; box-shadow: none; }
.ti-card .ob-icon svg { width: 30px; height: 30px; }
.ti-card h3 { font-family: var(--font-display); font-size: 23px; font-weight: 500; margin-bottom: 8px; }
.ti-card p { color: var(--muted); font-size: 14px; line-height: 1.65; }

.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 6px; }
.icon-grid button {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 12px 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-grid button svg { width: 19px; height: 19px; fill: var(--muted); }
.icon-grid button.sel { border-color: rgba(201, 164, 92, 0.5); background: var(--gold-dim); }
.icon-grid button.sel svg { fill: var(--gold); }

/* editor de enquadramento da foto */
.crop-view {
  width: 240px; height: 240px;
  margin: 0 auto 16px;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  background: #000;
  touch-action: none;
  cursor: grab;
  border: 2px solid rgba(201, 164, 92, 0.4);
}
.crop-view:active { cursor: grabbing; }
.crop-view img {
  position: absolute;
  left: 0; top: 0;
  max-width: none;
  transform-origin: 0 0;
  -webkit-user-drag: none;
  pointer-events: none;
}
.crop-zoom { width: 100%; margin: 2px 0 10px; accent-color: var(--gold); }

.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-edit .profile-avatar { width: 64px; height: 64px; min-width: 64px; }
.avatar-edit .avatar-actions { display: flex; flex-direction: column; align-items: flex-start; }
.avatar-edit .btn-text { padding: 4px 0; }
.avatar-edit .btn-text.remove { color: var(--red); }

.install-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.install-block.hl { border-color: rgba(201, 164, 92, 0.45); }
.install-block > b { font-size: 14px; display: block; margin-bottom: 6px; }
.install-block ol { padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.8; margin: 0; }
.install-block ol b { color: var(--text); }

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
}
.auth-tab.sel { background: var(--cream); color: var(--ink); }
.handle-status { font-size: 12px; margin-top: 6px; color: var(--faint); min-height: 15px; }
.handle-status.ok { color: var(--green); }
.handle-status.bad { color: var(--red); }

.onboard-logo { display: block; margin: 6px auto 22px; height: 72px; }
.onboard-verse { text-align: center; font-family: var(--font-display); color: #d8d4c9; font-size: 16.5px; line-height: 1.5; margin-bottom: 8px; }
.onboard-ref { text-align: center; color: var(--faint); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 22px; }

/* celebração do desbloqueio: Jesus + fogos de artifício */
.jesus-pop { position: fixed; inset: 0; z-index: 49; pointer-events: none; overflow: hidden; }
.jesus-img {
  position: absolute;
  left: 50%;
  bottom: -2vh;
  width: min(112vw, 560px);
  transform: translate3d(-50%, 115%, 0);
  will-change: transform;
  animation: jesusJump 1.9s cubic-bezier(0.3, 0.7, 0.35, 1) forwards;
}
@keyframes jesusJump {
  0% { transform: translate3d(-50%, 115%, 0); }
  18% { transform: translate3d(-50%, 0, 0); }
  78% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(-50%, 115%, 0); }
}
.fw { position: absolute; width: 0; height: 0; }
.fw-p {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--c);
  opacity: 0;
  transform: rotate(var(--a)) translateY(0);
  animation: fwBoom 1s ease-out forwards;
  animation-delay: var(--d);
}
@keyframes fwBoom {
  0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
  65% { opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(-86px) scale(0.35); opacity: 0; }
}

/* celebração de dia completo */
.celebrate { position: fixed; inset: 0; z-index: 49; pointer-events: none; overflow: hidden; }
.celebrate .rocket {
  position: absolute;
  left: 50%;
  bottom: -70px;
  font-size: 46px;
  transform: translate(-50%, 0) rotate(-45deg);
  animation: rocketUp 1.3s cubic-bezier(0.35, 0, 0.25, 1) forwards;
}
@keyframes rocketUp {
  0% { transform: translate(-50%, 0) rotate(-45deg); opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(-50%, -118vh) rotate(-45deg); opacity: 0; }
}
.celebrate .spark {
  position: absolute;
  left: 50%;
  bottom: 8vh;
  opacity: 0;
  animation: sparkFly 1.5s ease-out forwards;
  animation-delay: var(--d);
}
@keyframes sparkFly {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1.05); opacity: 0; }
}

.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  padding: 12px 22px;
  z-index: 60;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.22s ease-out;
}

/* ---------- onboarding (slides) ---------- */
#onboarding {
  position: fixed; inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  animation: obIn 0.4s ease;
}
@keyframes obIn { from { opacity: 0; } }
.ob-skip {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 18px);
  right: 20px;
  z-index: 42;
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.ob-slides {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}
.ob-slides::-webkit-scrollbar { display: none; }
.ob-slide {
  min-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 36px 40px;
}
.ob-slide h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.ob-slide p {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
  max-width: 310px;
}
.ob-cover {
  background:
    linear-gradient(180deg, rgba(11, 10, 8, 0.55) 0%, rgba(11, 10, 8, 0.82) 62%, var(--bg) 100%),
    url("assets/silhueta.jpg") center 24% / cover no-repeat;
}
.ob-cover h2 { font-size: 34px; }
.ob-cover p { color: #c4beb0; }
.ob-logo { height: 64px; margin-bottom: 18px; }
.ob-word { height: 17px; margin-bottom: 34px; opacity: 0.95; }
.ob-icon {
  width: 92px; height: 92px;
  border-radius: 999px;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 30px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
.ob-icon svg { width: 38px; height: 38px; fill: var(--ink); }
.ob-icon.ob-emoji { font-size: 42px; }
.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px calc(env(safe-area-inset-bottom) + 30px);
}
.ob-dots { display: flex; gap: 7px; }
.ob-dots span {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: all 0.25s;
}
.ob-dots span.on { background: var(--cream); width: 22px; }
.ob-next {
  background: var(--cream);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 0.15s;
}
.ob-next:active { transform: scale(0.96); }

/* ---------- tour guiado (primeiro uso) ---------- */
.tour-hole {
  position: fixed;
  z-index: 46;
  border-radius: 26px;
  box-shadow: 0 0 0 9999px rgba(6, 5, 4, 0.78);
  border: 1.5px solid rgba(201, 164, 92, 0.65);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.tour-tip {
  position: fixed;
  z-index: 47;
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 18px;
  width: min(300px, calc(100vw - 32px));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  animation: viewIn 0.3s ease;
}
.tour-tip h4 { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin-bottom: 5px; }
.tour-tip p { font-size: 13.5px; color: #4a4534; line-height: 1.55; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.tour-count { font-size: 11px; color: #99917d; font-weight: 500; }
.tour-actions { display: flex; gap: 6px; }
.tour-actions .t-skip {
  background: none; border: none;
  color: #99917d;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 9px 12px;
  cursor: pointer;
}
.tour-actions .t-next {
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}

/* com "reduzir movimento" ativo, só as transições decorativas saem;
   os efeitos funcionais (café enchendo, celebrações) continuam */
@media (prefers-reduced-motion: reduce) {
  #view { animation: none; }
  .habit-row, .comm-card, .btn, .fab, .share-c .cir { transition: none; }
  .habit-row.done .habit-check { animation: none; }
}
