:root {
  --fundo: #120a10;
  --cartao: #1f1219;
  --cartao2: #2a1822;
  --linha: #3a2330;
  --texto: #f5e9ef;
  --fraco: #b59aa8;
  --cor: #ff3d7f;
  --cor2: #ff8a3d;
  --verde: #39d98a;
  --perigo: #ff5252;
  --raio: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fundo); color: var(--texto); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
body.sem-menu { padding-bottom: 0; }
a { color: var(--cor); text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
#app { max-width: 720px; margin: 0 auto; }

/* Topo */
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(18, 10, 16, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.topo h1 { font-size: 19px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { font-weight: 800; background: linear-gradient(90deg, var(--cor), var(--cor2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.voltar { font-size: 22px; color: var(--texto); padding: 0 6px 0 0; background: none; border: 0; cursor: pointer; }

.pag { padding: 16px; }

/* Botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 999px; padding: 12px 18px; min-height: 44px;
  font: inherit; font-weight: 700; cursor: pointer; color: #fff;
  background: linear-gradient(90deg, var(--cor), var(--cor2));
}
.btn.sec { background: var(--cartao2); color: var(--texto); border: 1px solid var(--linha); }
.btn.perigo { background: transparent; color: var(--perigo); border: 1px solid var(--perigo); }
.btn.peq { padding: 6px 12px; min-height: 34px; font-size: 13px; }
.btn.largo { width: 100%; }
.btn:disabled { opacity: .5; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--texto);
  background: var(--cartao); border: 1px solid var(--linha); border-radius: 10px;
  padding: 12px; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cor); border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; min-height: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--cor); }
.opcoes { display: flex; flex-wrap: wrap; gap: 8px; }
.opcoes input { display: none; }
.opcoes label { margin: 0; padding: 10px 14px; border-radius: 999px; background: var(--cartao); border: 1px solid var(--linha); font-weight: 600; cursor: pointer; }
.opcoes input:checked + label { background: var(--cor); border-color: var(--cor); color: #fff; }
.erro { color: var(--perigo); min-height: 20px; margin-top: 10px; font-size: 14px; }
.fraco { color: var(--fraco); font-size: 13px; }
.caixa { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; margin-bottom: 14px; }

/* Portão de idade */
.portao { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.portao .marca { font-size: 42px; margin-bottom: 4px; }
.portao .mais18 { display: inline-block; font-weight: 800; border: 2px solid var(--cor); color: var(--cor); border-radius: 999px; padding: 4px 14px; margin: 14px 0; }
.portao p { color: var(--fraco); max-width: 420px; margin: 8px auto; }
.portao .acoes { display: grid; gap: 10px; margin-top: 18px; max-width: 320px; margin-inline: auto; }

/* Filtros */
.filtros { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--cartao); border: 1px solid var(--linha); color: var(--texto); font: inherit; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--cor); border-color: var(--cor); color: #fff; }

/* Grade de perfis */
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 4px; }
@media (min-width: 560px) { .grade { grid-template-columns: repeat(4, 1fr); } }
.card { position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: var(--cartao2); color: var(--texto); display: block; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .sem-foto { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; opacity: .5; }
.card .info { position: absolute; inset: auto 0 0 0; padding: 18px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-size: 12px; }
.card .nome { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .dist { color: #ddd; }
.card .papel { position: absolute; top: 5px; left: 5px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 6px; }
.on-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); margin-right: 3px; vertical-align: 1px; }
.borrada { filter: blur(22px) saturate(.6); transform: scale(1.15); }
.selo-picante { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; pointer-events: none; }
.vazio { text-align: center; color: var(--fraco); padding: 40px 20px; }

/* Perfil */
.galeria { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 2px; background: #000; scrollbar-width: none; }
.galeria .foto { flex: none; width: 100%; aspect-ratio: 3/4; max-height: 70dvh; scroll-snap-align: center; position: relative; overflow: hidden; }
.galeria img { width: 100%; height: 100%; object-fit: contain; }
.galeria .foto.picante-escondida img { filter: blur(30px); }
.galeria .revelar { position: absolute; inset: 0; display: grid; place-items: center; background: none; border: 0; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { background: var(--cartao2); border: 1px solid var(--linha); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; }
.tag.forte { background: rgba(255, 61, 127, .15); border-color: var(--cor); color: #ffb3cc; }
.acoes-perfil { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 16px; }
.bio { white-space: pre-wrap; margin: 12px 0; }

/* Conversas */
.conversa { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--linha); color: var(--texto); }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--cartao2); flex: none; display: grid; place-items: center; font-size: 22px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.conversa .meio { flex: 1; min-width: 0; }
.conversa .ult { color: var(--fraco); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa .n { background: var(--cor); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; padding: 2px 8px; }

/* Chat */
body.no-chat { padding-bottom: 0; }
.chat { display: flex; flex-direction: column; height: 100dvh; }
.chat .msgs { flex: 1; overflow-y: auto; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 6px; }
.balao { max-width: 78%; padding: 8px 12px; border-radius: 16px; background: var(--cartao2); white-space: pre-wrap; word-wrap: break-word; }
.balao.minha { align-self: flex-end; background: linear-gradient(90deg, var(--cor), var(--cor2)); color: #fff; border-bottom-right-radius: 4px; }
.balao:not(.minha) { border-bottom-left-radius: 4px; }
.balao time { display: block; font-size: 10px; opacity: .7; text-align: right; margin-top: 2px; }
.enviar { display: flex; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linha); background: var(--fundo); }
.enviar textarea { min-height: 44px; height: 44px; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.enviar .btn { padding: 0 16px; }
.topo .avatar { width: 36px; height: 36px; font-size: 16px; }

/* Meu perfil */
.minhas-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.minha-foto { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--cartao2); }
.minha-foto img { width: 100%; height: 100%; object-fit: cover; }
.minha-foto .bts { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: 4px; background: rgba(0,0,0,.6); }
.minha-foto .bts button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 4px; }
.minha-foto .principal { position: absolute; top: 4px; left: 4px; font-size: 10px; font-weight: 700; background: var(--cor); padding: 2px 6px; border-radius: 6px; }
.add-foto { aspect-ratio: 3/4; border: 2px dashed var(--linha); border-radius: 10px; display: grid; place-items: center; text-align: center; color: var(--fraco); cursor: pointer; font-size: 13px; padding: 6px; }

/* Mapa */
#mapa { height: calc(100dvh - 160px - env(safe-area-inset-bottom)); background: #0d0d0d; }
.pino { display: grid; place-items: center; }
.pino span {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cor), var(--cor2)); color: #fff; font-weight: 800; font-size: 16px;
  border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.6);
}
.leaflet-container { font: inherit; }
.mapa-escuro { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.caixa.feito { opacity: .7; }
.caixa ol { padding-left: 20px; }
input[type=file] { padding: 10px; }
.docs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.docs img { width: 110px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid var(--linha); }

/* Tabela de contas */
.tabela-rolar { overflow: auto; border: 1px solid var(--linha); border-radius: 10px; max-height: 65dvh; }
.tabela { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.tabela th, .tabela td { padding: 8px 10px; border-bottom: 1px solid var(--linha); text-align: left; }
.tabela th { position: sticky; top: 0; background: var(--cartao2); z-index: 1; }
.tabela tbody tr { cursor: pointer; }
.tabela tbody tr:hover { background: var(--cartao2); }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--cartao); border: 1px solid var(--linha); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-size: 24px; }
.denuncia.urgente { border-color: var(--perigo); }
.mini-fotos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mini-fotos div { position: relative; width: 64px; height: 84px; border-radius: 6px; overflow: hidden; }
.mini-fotos img { width: 100%; height: 100%; object-fit: cover; }
.mini-fotos button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; }
.linha-bts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Janela (modal) */
.fundo-modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 20; display: grid; place-items: end center; }
.modal { background: var(--cartao); width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; }
@media (min-width: 560px) { .fundo-modal { place-items: center; } .modal { border-radius: 18px; } }

/* Menu de baixo */
#menu {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: flex; background: rgba(18, 10, 16, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--linha);
  padding-bottom: env(safe-area-inset-bottom);
}
#menu[hidden], #menu a[hidden], [hidden] { display: none !important; }
#menu a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; color: var(--fraco); font-size: 11px; font-weight: 600; position: relative; }
#menu a .ic { font-size: 21px; line-height: 1; }
#menu a.ativo { color: var(--texto); }
#menu a.ativo .ic { filter: drop-shadow(0 0 6px var(--cor)); }
#badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--cor); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; }

#aviso { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--texto); color: var(--fundo); padding: 10px 16px; border-radius: 999px; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
