/* OBPC Mandaqui — Atalhos
   Visual mantido do app original (fundo preto, blocos coloridos, destaques em azul). */

:root {
  --bg: #000;
  --surface: #0f1115;
  --surface-2: #171a21;
  --border: #262a33;
  --text: #fff;
  --muted: #a3a3a3;
  --muted-2: #737373;
  --accent: #38bdf8;          /* azul do app original (sky-400) */
  --accent-strong: #0ea5e9;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 68px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding-left: 18px; padding-right: 18px; }

.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* ---------- Barra superior (botões flutuantes, como no original) ---------- */
.topbar { /* rola junto com o topo, para não cobrir o conteúdo */
  position: absolute; z-index: 40; max-width: 480px; margin: 0 auto;
  top: calc(12px + var(--safe-top)); left: 0; right: 0;
  display: flex; gap: 10px; align-items: center;
  padding: 0 12px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.fab {
  width: 44px; height: 44px; border-radius: 999px; border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  cursor: pointer; transition: background .2s;
}
.fab:active { background: rgba(255, 255, 255, .24); }
.fab .ic { width: 19px; height: 19px; }
.fab-music[aria-pressed="true"] { background: rgba(56, 189, 248, .28); }
.fab-music[aria-pressed="true"] .ic { animation: pulse 1.6s ease-in-out infinite; }
.install-pill {
  margin-left: auto; height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #00131f; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 24px rgba(56, 189, 248, .35); cursor: pointer;
}
.install-pill .ic { width: 18px; height: 18px; }
.install-pill:active { transform: scale(.97); }

/* ---------- Topo: fachada + logo ---------- */
.hero {
  position: relative; overflow: hidden;
  max-width: 480px; margin: 0 auto;
  min-height: 220px; padding: calc(64px + var(--safe-top)) 24px 18px;
  display: flex; align-items: flex-end; justify-content: center;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(34, 197, 94, .22), transparent 60%),
    radial-gradient(90% 70% at 85% 20%, rgba(14, 165, 233, .22), transparent 60%),
    #000;
}
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
}
.hero.has-photo { min-height: 300px; }
.hero.has-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.25) 40%, rgba(0,0,0,.92) 85%, #000 100%);
}
.anchor-top { position: absolute; top: 0; left: 0; }
section[id], .cultos, .contribua { scroll-margin-top: 16px; }
.hero-logo { position: relative; z-index: 1; width: 82%; max-width: 330px; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); }

/* ---------- Aviso offline ---------- */
.offline-banner {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 10px 16px calc(10px) ; padding-top: calc(10px + var(--safe-top));
  background: #3b2f04; color: #fde68a; font-size: 14px; font-weight: 600; text-align: left;
}
.offline-banner .ic { width: 18px; height: 18px; }

/* ---------- Conteúdo ---------- */
main.wrap { padding-top: 8px; padding-bottom: calc(var(--nav-h) + 28px + var(--safe-bottom)); }

.crumb {
  display: flex; align-items: center; gap: 8px;
  margin: 30px 0 12px; font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.crumb .home { color: #d4d4d4; }
.crumb .sep { color: var(--muted-2); font-weight: 400; }
.crumb .here { color: var(--accent); text-transform: uppercase; }

/* Blocos (tiles) */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 108px; padding: 14px; border-radius: var(--radius);
  text-decoration: none; color: #fff; background: #333;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 20px rgba(0,0,0,.35);
  transition: transform .18s ease, filter .18s ease;
  overflow: hidden;
}
.tile::before { /* brilho suave no canto, dá profundidade sem mudar a cor */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,255,255,.16), transparent 55%);
}
.tile:active { transform: scale(.96); filter: brightness(1.08); }
.tile .ic { width: 30px; height: 30px; position: relative; }
.tile .label { position: relative; font-size: 16px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tile-wide { grid-column: 1 / -1; min-height: 72px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; }
.tile-wide .sub { display: block; font-size: 13px; font-weight: 500; opacity: .85; margin-top: 2px; }
.tile-play { background: linear-gradient(135deg, #2a1458, #6928b0); border: 0; cursor: pointer; text-align: left; width: 100%; }
.tile-play .ic { width: 34px; height: 34px; padding: 7px; border-radius: 999px; background: rgba(255,255,255,.18); }

/* ---------- Cartões de pessoas e instituições ---------- */
.pcards { display: grid; gap: 12px; }
.grid-after { margin-top: 12px; }
.pcard {
  padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--border);
}
.pcard-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 52px; height: 52px; flex: none; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.avatar .ic { width: 26px; height: 26px; }
.pname { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2; }
.prole { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.pcard-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 12px; border-radius: 12px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  transition: transform .15s ease, filter .15s ease;
}
.pcard-links .chip:last-child:nth-child(odd) { grid-column: 1 / -1; } /* número ímpar: o último ocupa a linha toda */
.chip:active { transform: scale(.96); filter: brightness(1.1); }
.chip .ic { width: 19px; height: 19px; }

/* ---------- Cultos ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.cultos .card { margin-top: 0; }
.next { display: flex; gap: 14px; align-items: center; }
.next .badge {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(56, 189, 248, .14); color: var(--accent);
}
.next .badge .ic { width: 26px; height: 26px; }
.next-label { font-size: 13px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.next-when { font-size: 24px; font-weight: 800; line-height: 1.15; }
.next-when.live { color: #4ade80; }
.schedule { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.schedule li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.schedule .d { color: #e5e5e5; font-weight: 600; }
.schedule .t { color: var(--muted); text-align: right; }
.address { margin: 14px 0 0; color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.address .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--muted-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .15s ease, background .2s;
}
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { background: var(--accent); color: #00131f; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; }
.btn-block { width: 100%; margin-top: 14px; }

/* ---------- Contribua ---------- */
.contribua-intro { margin: 0 0 14px; color: #d4d4d4; font-size: 15px; }
.conta {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 16px; border-radius: var(--radius); margin-bottom: 10px;
  background: linear-gradient(135deg, #0b1a33, #0d2a57); border: 1px solid #1d3b6e;
}
.conta .bank { grid-column: 1; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.conta .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.conta .tipo { grid-column: 1; font-size: 13px; color: #9fb6d9; }
.conta .copy { grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 0 14px; background: rgba(255,255,255,.12); color: #fff; }
.conta .copy.ok { background: #15803d; }
.conta .chave {
  grid-column: 1 / -1; margin-top: 10px; white-space: nowrap;
  font-size: clamp(18px, 6vw, 23px); font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums;
}
.aviso {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 6px 0 0; padding: 12px 14px; border-radius: 14px;
  background: rgba(250, 204, 21, .08); border: 1px solid rgba(250, 204, 21, .25);
  color: #fde68a; font-size: 14px;
}
.aviso .ic { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Rodapé ---------- */
.footer { padding-bottom: calc(var(--nav-h) + 24px + var(--safe-bottom)); margin-top: -8px; text-align: center; color: var(--muted-2); font-size: 13px; }
.footer p { margin: 4px 0; }
.footer strong { color: #a3a3a3; font-weight: 600; }

/* ---------- Barra inferior (ferramentas) ---------- */
.tools {
  position: fixed; z-index: 35; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .9); border-top: 1px solid #262626;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding-bottom: var(--safe-bottom);
}
.tools-inner { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--nav-h); padding: 8px 4px; text-decoration: none;
  color: var(--accent); font-size: 11px; line-height: 1.15; text-align: center;
  animation: glow 3s ease-in-out infinite;
}
.tool .ic { width: 24px; height: 24px; }
.tool:active { color: #7dd3fc; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  width: min(440px, calc(100% - 28px));
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 16px;
  background: #f5f5f5; color: #0a0a0a; font-size: 15px; font-weight: 600;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: rise .25s ease-out;
}
.toast .msg { flex: 1; }
.toast .act { border: 0; border-radius: 10px; padding: 9px 14px; background: #0a0a0a; color: #fff; font-weight: 700; cursor: pointer; }

/* ---------- Folha de instalação ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.7);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease-out;
}
.sheet {
  position: relative; width: 100%; max-width: 480px;
  background: #121418; border: 1px solid var(--border); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 26px 22px calc(26px + var(--safe-bottom));
  animation: rise .25s ease-out;
}
.sheet-icon { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 12px; }
.sheet h2 { margin: 0 0 12px; font-size: 21px; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.08); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-close .ic { width: 20px; height: 20px; }
.sheet-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.sheet-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; font-size: 16px; color: #e5e5e5; }
.sheet-steps li::before {
  content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(56,189,248,.16); color: var(--accent); font-weight: 800;
}
.sheet-steps .ic { width: 20px; height: 20px; vertical-align: -4px; color: var(--accent); }
.sheet-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; }

.noscript { padding: 24px 0; color: #e5e5e5; }

/* Esqueleto enquanto carrega */
.skeleton { height: 108px; border-radius: var(--radius); background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

@keyframes glow { 0%, 100% { text-shadow: 0 0 0 rgba(56,189,248,0); } 50% { text-shadow: 0 0 12px rgba(56,189,248,.75); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes rise { from { transform: translate(var(--tx, 0), 16px); opacity: 0; } to { transform: translate(var(--tx, 0), 0); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { --tx: -50%; }

@media (min-width: 420px) { .tile .label { font-size: 17px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
