/* Rifas PH: complemento do ph.css (fonte da verdade visual). Aqui só o que o site real precisa a mais. */

/* fontes hospedadas no próprio site (sem Google): Geist, Geist Mono e Archivo variável */
@font-face { font-family: 'Geist'; src: url('/fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo.woff') format('woff'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }

html { background: var(--night-950); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
/* janelas e avisos ficam fora do #app: herdam a mesma fonte */
.ov, .toast { font-family: var(--f-ui); }
#app { min-height: 100vh; min-height: 100dvh; }
.ph h1, .ph h2, .ph h3, .ph p { overflow-wrap: break-word; }
button:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn--buy:disabled.shine::after { display: none; }
a.btn { cursor: pointer; }

/* primeira carga: a tela de espera fica fixa e o conteúdo entra de uma vez (sem pulo de layout) */
.carregando { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; margin: 0; font-size: 0; background: linear-gradient(180deg, var(--night-900), var(--night-950)); }
.carregando::before { content: ''; width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.14); border-top-color: #fff; animation: giro .9s linear infinite; }
.carrega-local { display: grid; place-items: center; min-height: 140px; }
.carrega-local::before { content: ''; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--night-900); animation: giro .9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- janelas (checkout, menu, 16+) ---------- */
.ov { position: fixed; inset: 0; z-index: 60; }
.ov .bsheet { max-height: 94vh; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.ov .dlg-wrap { overflow-y: auto; }
.ov .dlg { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; }
.ov--menu .ph.top { position: absolute; inset: 0; min-height: 100%; overflow-y: auto; animation: phSlide .3s var(--ease) both; }
.ov--menu .drawer { position: absolute; }
body.travado { overflow: hidden; }
.ov .scrim { animation: fadeIn .25s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- arte da campanha: imagem real enviada no painel ---------- */
.art-img { background: var(--night-900); }
.art-img::before, .art-img::after { display: none; }
.art-img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
/* arte gerada (sem imagem): o PH 3D real no lugar da silhueta, com o corte escondido na borda de baixo */
.art-fig--ph { right: -3%; bottom: 0; width: 60%; height: 84%; }
.art--wide .art-fig--ph { right: 5%; bottom: 0; width: 40%; height: 92%; }
.art--thumb .art-fig--ph { right: -16%; bottom: 0; width: 76%; height: 88%; }
.art-fig--ph img { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-width: none; filter: drop-shadow(0 1.5cqw 3cqw rgba(0,0,0,.55)); }
.art--gray .art-fig--ph { display: none; }
/* a mão do PH não pode ficar atrás do valor do prêmio: o lado esquerdo da foto some aos poucos */
.art-fig--ph { -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.25) 22%, #000 46%); mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.25) 22%, #000 46%); }
.art--sq .art-fig--ph { right: -8%; width: 62%; }
.art--wide .art-fig--ph { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%); mask-image: linear-gradient(90deg, transparent 0, #000 30%); }
.art-copy .art-prize { filter: drop-shadow(0 .6cqw 1.6cqw rgba(0,0,0,.55)); }
.art-copy--sem-ph { max-width: 88%; }
.art-prize .a.txt { font-size: 15cqw; letter-spacing: .01em; }
.art--wide .art-prize .a.txt { font-size: 9cqw; }
.art--thumb .art-prize .a.txt { font-size: 22cqw; }

/* ---------- personagem PH na interface ---------- */
.ph-img { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom center; pointer-events: none; }
.ph-festa { position: relative; height: 230px; margin-top: 4px; }
.ph-festa .ph-img { filter: drop-shadow(0 22px 40px rgba(0,0,0,.5)); }
.empty-ph .ph-img { filter: drop-shadow(0 10px 22px rgba(10,16,38,.25)); }
.login .ph-login { position: absolute; right: 10px; top: 8px; width: 84px; height: 92px; overflow: hidden; }
.login .ph-login .ph-img { -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.safe .ph-safe { position: absolute; right: -6px; bottom: 0; width: 96px; height: 120px; }

/* ---------- topo das páginas simples ---------- */
.pg-head { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 44px; }
.pg-head h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.03em; line-height: 1.12; }
.pg-head p { margin: 0; font-size: 14.5px; color: var(--night-text); }
.pg-head .k { font-size: 13px; color: var(--night-muted); }
.pg-dhead { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 32px 0 80px; }
.pg-dhead h1 { margin: 0; font-size: 38px; font-weight: 750; letter-spacing: -.035em; line-height: 1.08; }
.pg-dhead p { margin: 0; font-size: 16px; color: var(--night-text); }
.pg-dhead .k { font-size: 15px; color: var(--night-muted); }
.dmain--narrow { max-width: 820px; }
.voltar-d { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--night-text); text-decoration: none; font-size: 14px; font-weight: 600; }

/* ---------- textos longos (termos, avisos, artigos) ---------- */
.prose { padding: 20px; font-size: 15.5px; line-height: 1.7; color: var(--ink-2); overflow-wrap: anywhere; }
.prose--pre { white-space: pre-line; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 14px; }
.prose h2 { margin: 24px 0 8px; font-size: 19px; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue-ink); font-weight: 600; }
@media (min-width: 768px) { .prose { padding: 28px 32px; font-size: 16px; } }
.post-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* listas de avisos e artigos */
.post-li { display: flex; flex-direction: column; gap: 6px; padding: 16px; text-decoration: none; color: inherit; }
.post-li b { font-size: 16px; letter-spacing: -.01em; line-height: 1.3; }
.post-li > span:not(.row) { font-size: 14px; color: var(--muted); line-height: 1.5; }
.post-li .link { min-height: 0; }

/* perguntas frequentes */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { overflow: hidden; }
.faq summary { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; cursor: pointer; font-weight: 650; font-size: 15px; }
.faq summary .chev { margin-left: auto; transition: transform .2s var(--ease); }
.faq details > div { padding: 0 16px 16px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

/* canais de suporte */
.canal { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; text-decoration: none; color: inherit; }
.canal .help-ic { flex: 0 0 46px; }
.canal--zap .help-ic { background: linear-gradient(180deg, var(--buy-1), var(--buy-2)); }

/* aviso fixado na página inicial */
.aviso-fixo { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; text-decoration: none; color: inherit; border-color: var(--line-2); }
.aviso-fixo .mv-ic { background: var(--blue-soft); color: var(--blue-ink); }

/* campanha pausada ou encerrada no lugar da compra */
.aviso-compra { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.panel .aviso-compra { background: rgba(255,255,255,.05); border-color: var(--night-line); color: var(--night-text); }

/* resultado do sorteio principal */
.resultado { display: flex; align-items: center; gap: 14px; padding: 16px; }

/* contagem quando o sorteio já passou */
.cd-fim { font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.cd--dark .cd-fim, .panel .cd-fim { color: var(--night-text); }

/* números: mostrar todos */
.nums--todos { max-height: 360px; overflow-y: auto; padding-right: 2px; }

/* pix: QR real */
.qr-box { padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.qr-box svg, .qr-box img { width: 168px; height: 168px; display: block; }
.pixbox .qr-box svg, .pixbox .qr-box img { width: 208px; height: 208px; }
.code .mono { display: block; }

/* modo demonstração (só no teste) */
.demo-box { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; border: 1.5px dashed var(--gold-3); background: var(--gold-soft); font-size: 13.5px; color: #5A4520; }

/* rodapé: links */
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.foot-links a { color: var(--night-text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: #fff; }
.logo-slot img { height: 48px; width: 100%; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px 10px; }
.logo-slot i.nome { font-family: var(--f-ui); font-size: 12.5px; color: var(--night-text); padding: 0 8px; text-align: center; }

/* bloqueio de idade */
.bloqueio { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; color: #fff; }
.bloqueio p { color: var(--night-text); }

/* aviso rápido */
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; background: var(--night-900); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--sh-3); animation: phUp .3s var(--ease) both; }
.toast--err { background: var(--err); }

/* conta */
.dados { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.dados dt { color: var(--muted); }
.dados dd { margin: 0; font-weight: 600; }

/* menu: item de instalar o app */
.menu-a--app { background: linear-gradient(90deg, rgba(74,116,255,.22), rgba(255,255,255,.04)); border-color: rgba(74,116,255,.4); }
.menu-a .sub { display: block; font-size: 12px; font-weight: 500; color: var(--night-text); }

/* ganhadores na página própria */
.wins-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.wins-grid .win { flex: none; }
@media (min-width: 640px) { .wins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .wins-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* tablets: o topo do computador com o conteúdo um pouco mais estreito */
@media (min-width: 768px) and (max-width: 980px) {
  .hero .media { max-width: 100%; }
}

/* ---------- troca de página sem recarregar ---------- */
/* o topo escuro fica parado; só o conteúdo entra suave */
#app.entra .sheet, #app.entra .dsheet, #app.entra .pg-head, #app.entra .pg-dhead, #app.entra .hero, #app.entra .crumbs,
#app.entra .top > [role="img"], #app.entra .top > .col, #app.entra .top > .wrap > .row { animation: phEntra .32s var(--ease) both; }
#app.entra .foot { animation: phEntraLeve .32s var(--ease) both; }
@keyframes phEntra { from { opacity: 0; transform: translateY(8px); } }
@keyframes phEntraLeve { from { opacity: 0; } }
/* barrinha de carregamento, só aparece se a troca demorar */
.nav-barra { position: fixed; z-index: 99; left: 0; top: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--blue), #9DB3FF); box-shadow: 0 0 10px rgba(74,116,255,.6); pointer-events: none; }
.nav-barra--vai { transition: transform 8s cubic-bezier(.1,.7,.1,1); transform: scaleX(.85); }
.nav-barra--fim { transition: transform .2s ease, opacity .25s ease .05s; transform: scaleX(1); opacity: 0; }
/* janelas saindo: o mesmo caminho da entrada, ao contrário */
.ov--sai .scrim { animation: phSaiFade .2s ease forwards; }
.ov--sai .bsheet { animation: phSaiBaixo .22s cubic-bezier(.4,0,1,1) forwards; }
.ov--sai .dlg { animation: phSaiPop .18s ease forwards; }
.ov--sai .drawer { animation: phSaiEsq .22s cubic-bezier(.4,0,1,1) forwards; }
.ov--menu.ov--sai > .ph.top { animation: phSaiFade .2s ease forwards; }
@keyframes phSaiFade { to { opacity: 0; } }
@keyframes phSaiBaixo { to { transform: translateY(100%); } }
@keyframes phSaiPop { to { opacity: 0; transform: scale(.97); } }
@keyframes phSaiEsq { to { transform: translateX(-100%); } }
/* primeira carga: o círculo só aparece se demorar (carga rápida não pisca) */
.carregando::before { animation: giro .9s linear infinite, phAparece .2s ease .35s both; }
@keyframes phAparece { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #app.entra * { animation: none !important; } .nav-barra { display: none; } }

/* vendas fechadas: aviso no lugar do botão de compra */
.em-breve { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-radius: 18px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, rgba(74,116,255,.35), transparent 60%), linear-gradient(180deg, var(--night-800, #121A3D), var(--night-950));
  border: 1px solid rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--sh-1); }
.em-breve-ic { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.em-breve-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.em-breve-t b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.em-breve-t small { font-size: 12.5px; color: var(--night-text); }
.em-breve--curto { min-height: 52px; border-radius: 14px; padding: 8px 14px; }
.em-breve--curto .em-breve-ic { flex-basis: 30px; height: 30px; }
.em-breve--curto .em-breve-t b { font-size: 14.5px; }
.panel .em-breve { min-height: 64px; background: rgba(255,255,255,.05); border-color: var(--night-line-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
[role="dialog"][tabindex="-1"]:focus { outline: none; }
