/* BANG BNG — universal device compatibility layer
   Android, iOS/iPadOS Safari, macOS Safari, Windows/Linux Chrome/Edge/Firefox.
   Loaded after the existing theme and Android compatibility sheets. */
:root {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
  scroll-behavior: smooth;
  --bng-content-max: 1480px;
  --bng-safe-x: env(safe-area-inset-left, 0px);
  --bng-safe-right: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { width: 100%; min-width: 320px; max-width: 100%; overflow-x: clip; }
body {
  width: 100%; min-width: 320px; max-width: 100%; margin-inline: auto;
  overflow-x: clip; -webkit-tap-highlight-color: transparent;
  padding-left: max(0px, var(--bng-safe-x));
  padding-right: max(0px, var(--bng-safe-right));
}
img, picture, video, canvas, svg, iframe { max-width: 100%; }
img, picture, video { height: auto; }
main, header, footer, section, article, aside, nav, form,
.wrap, .container, .page-shell, .page-card, .panel, .card, .grid,
.cards, .features, .stats, .two, .row { min-width: 0; }
main, .wrap, .container { width: min(96%, var(--bng-content-max)); margin-inline: auto; }
button, input, select, textarea { max-width: 100%; font: inherit; }
input, select, textarea { min-width: 0; font-size: 16px; }
button, a, [role="button"], input[type="button"], input[type="submit"] {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
button, .btn, [role="button"], input[type="button"], input[type="submit"] { min-height: 42px; }
button { cursor: pointer; }
.grid, .cards, .features, .stats, .two {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: clamp(10px, 1.5vw, 20px);
}
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { min-width: 0; }
nav { max-width: 100%; flex-wrap: wrap; }
nav a, .nav a, .navlinks a { white-space: normal; overflow-wrap: anywhere; }
table { width: 100%; max-width: 100%; border-collapse: collapse; }
.table-wrap, .table-responsive { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre, code, .mono, .asset-address, .wallet-address, .wallet-address-wrap {
  max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.card, .panel, .page-card, .stat, .box { min-width: 0; }
/* Wide desktop and laptop */
@media (min-width: 1200px) {
  main, .wrap, .container { width: min(94%, var(--bng-content-max)); }
  nav { gap: clamp(8px, 1vw, 18px); }
}
@media (min-width: 1700px) {
  :root { --bng-content-max: 1600px; }
  body { font-size: 17px; }
}
/* Tablets, including iPad portrait/landscape */
@media (min-width: 601px) and (max-width: 1024px) {
  main, .wrap, .container { width: 94%; }
  .grid, .cards, .features, .stats, .two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  nav { position: relative; top: auto; }
}
/* Phones */
@media (max-width: 600px) {
  html { scroll-padding-top: 64px; }
  body { font-size: 14px; }
  main, .wrap, .container { width: 94% !important; }
  nav { position: relative; height: auto; min-height: 48px; padding: 8px 3%; gap: 6px; align-items: stretch; }
  nav a, .nav a, .navlinks a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 8px 10px; }
  .hero { padding-top: 20px; }
  .hero h1 { font-size: clamp(27px, 8vw, 42px); line-height: 1.12; }
  .grid, .cards, .features, .two { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { align-items: stretch; }
  .row > * { min-width: 0; }
  .card, .panel, .page-card { padding: 14px; border-radius: 14px; }
  button, .btn, [role="button"] { min-height: 44px; }
  table { display: block; overflow-x: auto; white-space: nowrap; font-size: 13px; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px; }
  input, select, textarea { min-height: 44px; }
  dialog, .modal, .dropdown, .popover { max-width: calc(100vw - 20px); }
}
@media (max-width: 380px) {
  main, .wrap, .container { width: 92% !important; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  nav a, .nav a, .navlinks a { font-size: 12px; padding: 8px 7px; }
}
/* Touch-first controls, without changing mouse/trackpad behavior on computers. */
@media (hover: none) and (pointer: coarse) {
  button, .btn, a, [role="button"] { -webkit-user-select: none; user-select: none; }
}
/* Apple safe areas and landscape phones */
@supports (padding: max(0px)) {
  body { padding-left: max(0px, env(safe-area-inset-left)); padding-right: max(0px, env(safe-area-inset-right)); }
  footer, .bottom-nav, .chat-widget, .floating-chat { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 520px) and (max-width: 950px) {
  nav { position: relative !important; }
  .hero { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Graceful fallback for browsers without CSS Grid. */
@supports not (display: grid) {
  .grid, .cards, .features, .stats, .two { display: flex; flex-wrap: wrap; }
  .grid > *, .cards > *, .features > *, .stats > *, .two > * { flex: 1 1 230px; }
}
