/* =========================================================
   TopBRS Android Fixes
   Arquivo isolado carregado depois do styles.css.
   Objetivo: scroll no Chrome/PWA Android + navbar + fonte limpa.
   Não afeta iPhone/iOS.
   ========================================================= */

html.is-android,
html.is-android body {
  width: 100% !important;
  height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  min-height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  max-height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  overflow: hidden !important;
  touch-action: pan-y !important;
  overscroll-behavior: none !important;
}

/* Cada menu vira o próprio container rolável no Android */
html.is-android .dashboard-phone,
html.is-android .settings-phone,
html.is-android .members-phone,
html.is-android .ranking-phone,
html.is-android .war-phone,
html.is-android .leadership-phone,
html.is-android .tournament-phone,
html.is-android .phone-shell,
html.is-android .phone-frame,
html.is-android .app-shell {
  position: relative !important;
  width: min(100%, 430px) !important;
  height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  min-height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  max-height: calc(var(--topbrs-android-vh, 1vh) * 100) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  padding-bottom: 132px !important;
  box-sizing: border-box !important;
}

/* Remove recorte interno que impede scroll */
html.is-android main,
html.is-android .screen,
html.is-android .page,
html.is-android .content,
html.is-android .dashboard-content,
html.is-android .settings-content,
html.is-android .members-content,
html.is-android .ranking-content,
html.is-android .war-content,
html.is-android .leadership-content,
html.is-android .tournament-content,
html.is-android .members-list,
html.is-android .ranking-list,
html.is-android .war-list,
html.is-android .leadership-list {
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  touch-action: pan-y !important;
}

/* Topo não fica cortado */
html.is-android .dashboard-phone,
html.is-android .settings-phone,
html.is-android .members-phone,
html.is-android .ranking-phone,
html.is-android .war-phone,
html.is-android .leadership-phone,
html.is-android .tournament-phone {
  padding-top: max(18px, env(safe-area-inset-top, 0px)) !important;
}

/* Navbar Android centralizado no viewport */
html.is-android .bottom-nav {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 0 !important;
  width: min(100vw, 430px) !important;
  max-width: 430px !important;
  height: 78px !important;
  transform: translateX(-50%) !important;
  z-index: 9999 !important;
  box-sizing: border-box !important;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px)) !important;
  pointer-events: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.is-android .bottom-nav .nav-home,
html.is-android .nav-btn.nav-home {
  transform: translateY(-12px) !important;
  filter: none !important;
  animation: none !important;
}

html.is-android .bottom-nav .nav-home svg,
html.is-android .nav-btn.nav-home svg {
  width: 30px !important;
  height: 30px !important;
  padding: 10px !important;
}

/* Corrige fonte premium/decorativa quebrada no Android */
html.is-android body,
html.is-android .dashboard-phone,
html.is-android .settings-phone,
html.is-android .members-phone,
html.is-android .ranking-phone,
html.is-android .war-phone,
html.is-android .leadership-phone,
html.is-android .tournament-phone {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: geometricPrecision !important;
}

html.is-android #settingsPlan,
html.is-android #settingsClan,
html.is-android #settingsClanName,
html.is-android .settings-plan-name,
html.is-android .settings-clan-name,
html.is-android .settings-mini-card strong,
html.is-android .settings-mini-card b,
html.is-android .dash-clan strong,
html.is-android .dashboard-clan-name,
html.is-android #dashboardClanName,
html.is-android #dashClanName,
html.is-android [data-clan-name],
html.is-android .clan-name {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-style: normal !important;
  font-weight: 900 !important;
  letter-spacing: .01em !important;
  text-shadow: none !important;
  filter: none !important;
  line-height: 1.08 !important;
}

/* Redução visual segura só no Android */
html.is-android .bottom-nav,
html.is-android [class*="overlay"],
html.is-android .dash-card,
html.is-android .dash-title-card,
html.is-android .settings-mini-card,
html.is-android .member-row,
html.is-android .podium-card,
html.is-android .war-summary,
html.is-android .leadership-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.is-android img,
html.is-android svg,
html.is-android [class*="glow"],
html.is-android [class*="shine"],
html.is-android [class*="pulse"] {
  animation: none !important;
}

/* Camadas decorativas não capturam toque */
html.is-android *::before,
html.is-android *::after {
  pointer-events: none;
}

/* Overlays reais continuam podendo travar scroll quando abertos */
html.is-android body.modal-open,
html.is-android body.settings-scroll-locked,
html.is-android body.tournament-modal-open,
html.is-android body.trial-inline-open,
html.is-android.leadership-calendar-open,
html.is-android body.leadership-calendar-open {
  overflow: hidden !important;
  touch-action: none !important;
}
