/* Comunidade DIRETEX: mesmo bronze e dourado do site, em formato de app de celular. */
:root {
  --ground: #17110a; --ground-2: #21180e; --metal: #2e2214;
  --gold: #e3b95e; --gold-soft: #b98f3f; --text: #f3e9d6; --muted: #b9a88c; --line: #4a3820;
  --like: #ff5d7a;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --topo: 52px; --barra: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--text); font: 16px/1.45 var(--body); overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg .cheio { fill: currentColor; stroke: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.app { height: 100%; height: 100dvh; display: grid; grid-template-rows: var(--topo) minmax(0, 1fr) calc(var(--barra) + env(safe-area-inset-bottom, 0px)); max-width: 600px; margin: 0 auto; border-inline: 1px solid var(--line); }
@media (max-width: 600px) { .app { border-inline: 0; } }

.topo { display: flex; align-items: center; gap: 10px; padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--ground-2), var(--ground)); }
.marca { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--gold); }
.marca img { border-radius: 50%; }
.marca span { font: 800 1.55rem/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.site { font-size: .8rem; color: var(--muted); text-decoration: none; margin-left: 2px; }
.conta { margin-left: auto; display: flex; align-items: center; }

main { overflow-y: auto; overscroll-behavior: contain; min-height: 0; position: relative; }
main:focus { outline: none; }

.barra { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; border-top: 1px solid var(--line); background: var(--ground); padding-bottom: env(safe-area-inset-bottom, 0px); }
.barra a { display: grid; justify-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .72rem; padding: 6px 0; }
.barra a.ativo { color: var(--gold); }
.barra a.mais { justify-self: center; width: 52px; height: 38px; border-radius: 12px; background: var(--gold); color: var(--ground); place-items: center; padding: 0; }
.barra a.mais svg { stroke-width: 2.6; }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--gold); color: var(--gold); font-weight: 700; text-decoration: none; border-radius: 10px; }
.btn.cheio { background: var(--gold); color: var(--ground); }
.btn.peq { min-height: 34px; padding: 6px 12px; font-size: .9rem; }
.btn.fraco { border-color: var(--line); color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-entrar { min-height: 34px; padding: 6px 12px; font-size: .9rem; }

/* avatar */
.av { border-radius: 50%; flex: none; object-fit: cover; display: inline-grid; place-items: center; font: 800 .9em/1 var(--display); color: var(--ground); text-transform: uppercase; overflow: hidden; background: var(--metal); }

/* abas do feed */
.abas { display: flex; gap: 22px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--ground); z-index: 2; }
.abas button { padding: 8px 0 10px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; }
.abas button[aria-selected="true"] { color: var(--gold); border-color: var(--gold); }

/* post */
.post { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.post-topo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.quem { display: grid; min-width: 0; text-decoration: none; color: var(--text); }
.quem b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quem small { color: var(--muted); font-size: .78rem; }
.selo { font-family: var(--mono); font-size: .72rem; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.mais-acoes { margin-left: auto; color: var(--muted); padding: 6px; }
.midia { position: relative; background: #000; display: block; width: 100%; }
.midia img, .midia video { display: block; width: 100%; max-height: 75vh; object-fit: contain; background: #000; }
.midia .coracao { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; color: var(--like); opacity: 0; transform: scale(.6); pointer-events: none; transition: opacity .2s, transform .25s; }
.midia .coracao.ver { opacity: .95; transform: scale(1); }
.midia .som { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.55); border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; color: #fff; }
.midia .som svg { width: 18px; height: 18px; }
.acoes { display: flex; align-items: center; gap: 16px; padding: 8px 12px 2px; }
.acoes button { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.acoes button.curti { color: var(--like); }
.acoes button.curti svg path { fill: currentColor; }
.legenda { padding: 4px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.legenda b { margin-right: 6px; }
.ver-com { padding: 2px 12px; color: var(--muted); font-size: .92rem; }
.quando { padding: 2px 12px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }

.vazio { padding: 48px 24px; text-align: center; color: var(--muted); display: grid; gap: 16px; justify-items: center; }
.vazio h2 { font: 800 2rem/1 var(--display); color: var(--gold); margin: 0; }
.carregando { padding: 24px; text-align: center; color: var(--muted); }

/* vídeos estilo tela cheia */
.reels { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; background: #000; overscroll-behavior: contain; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative; overflow: hidden; }
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel .sombra { position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none; }
.reel .info { position: absolute; left: 14px; right: 84px; bottom: 16px; display: grid; gap: 6px; text-shadow: 0 1px 3px #000; }
.reel .info a { color: #fff; font-weight: 700; text-decoration: none; display: flex; gap: 8px; align-items: center; }
.reel .info p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow: hidden; }
.reel .lado { position: absolute; right: 8px; bottom: 18px; display: grid; gap: 16px; justify-items: center; }
.reel .lado button, .reel .lado a { display: grid; justify-items: center; gap: 2px; color: #fff; font-size: .8rem; text-shadow: 0 1px 3px #000; text-decoration: none; }
.reel .lado svg { width: 32px; height: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.reel .lado .curti { color: var(--like); }
.reel .lado .curti svg path { fill: currentColor; }
.reel .seguir-mini { position: relative; }
.reel .seguir-mini i { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: var(--ground); font: 800 16px/20px var(--body); font-style: normal; text-align: center; }
.reel .pausa { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; color: rgba(255,255,255,.85); pointer-events: none; display: none; }
.reel.pausado .pausa { display: block; }
.reel .topo-reel { position: absolute; top: 10px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; color: #fff; font: 800 1.3rem/1 var(--display); letter-spacing: .03em; text-shadow: 0 1px 3px #000; pointer-events: none; }
.reel .topo-reel button { pointer-events: auto; color: #fff; background: rgba(0,0,0,.45); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; }
.reel .topo-reel svg { width: 20px; height: 20px; }

/* perfil */
.perfil { padding: 18px 16px 10px; display: grid; gap: 14px; }
.perfil-topo { display: flex; gap: 16px; align-items: center; }
.perfil h1 { font: 800 1.9rem/1 var(--display); margin: 0; letter-spacing: .01em; overflow-wrap: anywhere; }
.endereco { font-family: var(--mono); font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.endereco button { color: var(--gold); font-size: .78rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.saldo { border: 1px solid var(--gold-soft); border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, #3a2a12, var(--ground-2)); display: grid; gap: 2px; }
.saldo small { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.saldo b { font: 900 2.4rem/1 var(--display); color: var(--gold); }
.saldo b span { font-size: 1.1rem; margin-left: 6px; letter-spacing: .06em; }
.contas { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.contas b { display: block; font: 800 1.5rem/1.1 var(--display); }
.contas span { color: var(--muted); font-size: .82rem; }
.perfil-botoes { display: flex; gap: 8px; flex-wrap: wrap; }
.perfil-botoes .btn { flex: 1; }
.grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-top: 1px solid var(--line); padding-top: 2px; }
.grade > a { aspect-ratio: 1; position: relative; background: #000; overflow: hidden; display: block; }
.grade > a img, .grade > a video { width: 100%; height: 100%; object-fit: cover; display: block; }
.grade svg { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; color: #fff; filter: drop-shadow(0 1px 2px #000); }

/* ranking */
.cab { padding: 18px 16px 8px; display: grid; gap: 6px; }
.cab h1 { font: 800 2.2rem/1 var(--display); color: var(--gold); margin: 0; }
.cab p { margin: 0; color: var(--muted); font-size: .92rem; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li a { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.rank .pos { font: 900 1.5rem/1 var(--display); color: var(--muted); text-align: center; }
.rank li:nth-child(-n+3) .pos { color: var(--gold); }
.rank .nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .val { font-family: var(--mono); color: var(--gold); font-size: .9rem; }

/* formulários */
.form { padding: 16px; display: grid; gap: 14px; }
.form h1 { font: 800 2rem/1 var(--display); color: var(--gold); margin: 0; }
.campo { display: grid; gap: 6px; }
.campo span { font-size: .85rem; color: var(--muted); }
.campo input, .campo textarea { width: 100%; background: var(--ground-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.campo textarea { min-height: 96px; resize: vertical; }
.escolher { border: 1.5px dashed var(--gold-soft); border-radius: 14px; min-height: 220px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 18px; cursor: pointer; position: relative; overflow: hidden; }
.escolher b { color: var(--gold); display: block; font-size: 1.05rem; }
.escolher img, .escolher video { max-width: 100%; max-height: 60vh; display: block; border-radius: 8px; }
.escolher input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dica { color: var(--muted); font-size: .85rem; margin: 0; }
.barra-prog { height: 6px; background: var(--metal); border-radius: 3px; overflow: hidden; }
.barra-prog i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.foto-perfil { display: flex; gap: 14px; align-items: center; }

/* folhas (comentários, menus) */
#camada:empty { display: none; }
.fundo { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.folha { background: var(--ground-2); width: 100%; max-width: 600px; border-radius: 16px 16px 0 0; border-top: 1px solid var(--line); max-height: 82dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sobe .2s ease-out; }
@keyframes sobe { from { transform: translateY(30%); opacity: .4; } }
.folha header { padding: 10px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; font-weight: 700; }
.folha header button { margin-left: auto; color: var(--muted); }
.folha .lista { overflow-y: auto; padding: 6px 0; }
.coment { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 8px 16px; }
.coment p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.coment a { color: var(--text); font-weight: 700; text-decoration: none; margin-right: 6px; }
.coment small { color: var(--muted); display: block; font-size: .75rem; }
.coment button { color: var(--muted); align-self: start; }
.escrever { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.escrever input { flex: 1; min-width: 0; background: var(--ground); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.menu { display: grid; padding: 6px 0 10px; }
.menu button { text-align: left; padding: 14px 18px; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu button.perigo { color: var(--like); }
.menu button:last-child { border-bottom: 0; color: var(--muted); }
.menu textarea { margin: 10px 16px; width: calc(100% - 32px); background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 80px; }

#aviso { position: fixed; left: 50%; bottom: calc(var(--barra) + 20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: var(--ground); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 40; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .2s; text-align: center; }
#aviso.ver { opacity: 1; }

.entrar-cartao { margin: 18px 16px; padding: 18px; border: 1px solid var(--gold-soft); border-radius: 14px; background: linear-gradient(135deg, #3a2a12, var(--ground-2)); display: grid; gap: 10px; }
.entrar-cartao h2 { font: 800 1.7rem/1 var(--display); color: var(--gold); margin: 0; }
.entrar-cartao p { margin: 0; color: var(--muted); }
