/* SAFE-AREA-V1 (20/10/2026) | SORTE.ESP.BR | areas seguras do iPhone (notch / Dynamic Island / barra home)
   e Android com recorte. Incluido em TODAS as paginas, depois do CSS da propria pagina.
   Por que: o app da Tela de Inicio usa apple-mobile-web-app-status-bar-style=black-translucent, entao a pagina
   desenha POR BAIXO do relogio/bateria; as barras fixas precisam de padding = env(safe-area-inset-*).
   So layout: nao altera valores, saldo, regras nem chamadas de API.
   Variaveis: --sat/--sab/--sal/--sar (topo/baixo/esquerda/direita). Em teste e possivel sobrescrever no :root.
   Seletores com "html body" de proposito: vencem os <style> injetados por JS (ex.: cassino-barra.js) sem !important. */
:root{
  --sat:env(safe-area-inset-top,0px);
  --sab:env(safe-area-inset-bottom,0px);
  --sal:env(safe-area-inset-left,0px);
  --sar:env(safe-area-inset-right,0px);
  /* app.css usa --safe-top/--safe-bottom em --header-h e --tab-h: aponta para as mesmas variaveis */
  --safe-top:var(--sat);
  --safe-bottom:var(--sab);
}

/* ===== 1) SITE (app.css): cabecalho fixo e menu inferior ja somam --safe-top/--safe-bottom; aqui so as laterais ===== */
html body .app-header{padding-left:calc(16px + var(--sal));padding-right:calc(16px + var(--sar))}
html body .tab-bar{padding-left:var(--sal);padding-right:var(--sar)}
html body .cupom-wrapper{padding-left:var(--sal);padding-right:var(--sar)}
html body .search-overlay{padding-left:var(--sal);padding-right:var(--sar)}
html body .search-header{height:calc(56px + var(--sat));padding-top:var(--sat)}
html body .toast{top:calc(var(--header-h,56px) + 14px)}
html body .sheet-footer{padding-left:calc(16px + var(--sal));padding-right:calc(16px + var(--sar))}
/* paginas legais / limites (cabecalho proprio de 60px com .back-btn + .bottom-nav no <style> da pagina) */
html body .app-header:has(.back-btn){height:calc(60px + var(--sat));padding-top:var(--sat);padding-left:calc(16px + var(--sal));padding-right:calc(16px + var(--sar))}
html body .legal-content{padding-top:calc(72px + var(--sat));padding-bottom:calc(80px + var(--sab))}
html body .lim-wrap{padding-top:calc(72px + var(--sat));padding-bottom:calc(90px + var(--sab))}
html body .bottom-nav{height:calc(60px + var(--sab));padding-left:var(--sal);padding-right:var(--sar)}
/* paginas antigas com style.css (deposito/saque/perfil/historico) */
html body .main-header{padding-top:var(--sat);padding-left:var(--sal);padding-right:var(--sar)}
html body .betslip-sidebar.mobile-open{padding-top:var(--sat);padding-bottom:var(--sab);height:100vh !important;height:100dvh !important}

/* ===== 2) CASSINO: barra do topo (js/cassino-barra.js: voltar, saldo, depositar, som, ajuda, historico) ===== */
html body .cxb{height:calc(48px + var(--sat));padding-top:calc(4px + var(--sat));padding-left:calc(8px + var(--sal));padding-right:calc(8px + var(--sar))}
@media (max-width:400px){html body .cxb{padding-left:calc(6px + var(--sal));padding-right:calc(6px + var(--sar))}}
html body .cxb-toast{top:calc(54px + var(--sat))}
html body .cxb-sh{max-height:calc(86vh - var(--sat));max-height:calc(86dvh - var(--sat));padding-left:calc(16px + var(--sal));padding-right:calc(16px + var(--sar))}
/* slots (slots-lay.css: barra fina de 44px dentro da tela 100dvh) */
html body.slay .cxb{height:calc(44px + var(--sat));flex:0 0 calc(44px + var(--sat));padding-top:calc(2px + var(--sat));padding-left:calc(8px + var(--sal));padding-right:calc(8px + var(--sar))}
/* slots v2 (Mico/Touro/Jacare/Lobo: sem .cxb): a cena do topo (.hd.v2-cena) cresce a area do topo e o logo/18+ descem */
html body.v2.slay .hd{flex-basis:calc(clamp(108px,17vh,160px) + var(--sat))!important;padding-top:var(--sat)}
@media (max-height:700px){html body.v2.slay .hd{flex-basis:calc(clamp(84px,13vh,110px) + var(--sat))!important}}
html body.v2 .hd .v2-logo{top:calc(7px + var(--sat))}
html body.v2.slay .hd .hd-jk{top:calc(7px + var(--sat));right:calc(8px + var(--sar))}
html body.v2.slay #app .hd.v2-cena::after{top:calc(6px + var(--sat))!important;right:calc(6px + var(--sar))!important}
html body.slay #app.stage{padding-bottom:calc(6px + var(--sab));padding-left:calc(12px + var(--sal));padding-right:calc(12px + var(--sar))}
html body .sfx-ash .sh{padding-bottom:calc(16px + var(--sab))}
html body .v2-mb{padding-bottom:calc(14px + var(--sab))}
html body .sfx-big .h,html body .mw-fh{bottom:calc(30px + var(--sab))}
/* jogos instantaneos (cassino-jogos.css CJ6: Minas, Foguetinho, Plinko, Double) */
html body .cj-top{padding-top:calc(8px + var(--sat));padding-left:calc(12px + var(--sal));padding-right:calc(12px + var(--sar))}
html body.cj6>.cj-wrap{padding-bottom:calc(8px + var(--sab));padding-left:calc(10px + var(--sal));padding-right:calc(10px + var(--sar))}
html body .cj-confete,html body .cj-fxc{height:100%}
/* Feira da Sorte (feira.html): #app = tela menos a barra (48px + area do topo) */
html body.fe #app{height:calc(100vh - 48px - var(--sat));height:calc(100dvh - 48px - var(--sat))}
html body.fe > .top{height:calc(48px + var(--sat));padding-top:var(--sat)}
html body.fe #ctrl{padding-bottom:calc(8px + var(--sab));padding-left:calc(10px + var(--sal));padding-right:calc(10px + var(--sar))}
html body.fe .sh .cont{max-height:calc(86vh - var(--sat));max-height:calc(86dvh - var(--sat));padding-bottom:calc(16px + var(--sab))}
/* Plinko: folha de opcoes */
html body .pk-sh-in{margin-bottom:calc(8px + var(--sab))}
/* sobreposicoes de tela cheia com texto/botao (jackpot, manutencao, avisos): conteudo fora do relogio e da barra home */
html body .cjk-ov,html body .av-conf{padding-top:calc(20px + var(--sat));padding-bottom:calc(20px + var(--sab))}
html body #cxOff{padding-top:calc(24px + var(--sat));padding-bottom:calc(24px + var(--sab))}
html body .cupom-overlay,html body .ti-pop,html body .acb-bg{padding-top:calc(16px + var(--sat));padding-bottom:calc(16px + var(--sab))}
html body .av-sheet{padding-bottom:calc(14px + var(--sab));padding-left:calc(14px + var(--sal));padding-right:calc(14px + var(--sar))}

/* ===== 3) home: faixa fixa HOMETOP-V1 (ja usa top:var(--header-h), que inclui --sat); laterais em paisagem ===== */
html body .ht-sticky{padding-left:var(--sal);padding-right:var(--sar)}

@media (max-width: 767px) {
  html body .app-header {
    padding-left: calc(8px + var(--sal)) !important;
    padding-right: calc(8px + var(--sar)) !important;
  }
}
