/* Installed GoalGrid app: use the product navigation only.
   The former custom back/share/reload strip duplicated browser controls and
   consumed a full row below the mobile navigation. */
#gg-pwa-chrome,
.gg-pwa-chrome {
  display: none !important;
}

html.gg-pwa-standalone,
body.gg-pwa-standalone {
  --gg-pwa-chrome-h: 0px !important;
  --gg-sab: env(safe-area-inset-bottom, 0px) !important;
}

/* Remove the delayed double-tap gesture and sticky hover behaviour from app
   controls. Navigation itself is backed by gg-pwa-one-tap.js. */
body.gg-layout-shell :where(a[href], button, [role="button"], summary) {
  touch-action: manipulation;
}

@media (hover: none) and (pointer: coarse) {
  body.gg-layout-shell .site-topbar :where(a[href], button, summary),
  body.gg-layout-shell .bottom-nav :where(a[href], button) {
    -webkit-tap-highlight-color: transparent;
  }

  body.gg-layout-shell .bottom-nav a:focus {
    outline: none !important;
  }

  body.gg-layout-shell .site-topbar :where(a[href], button, summary):active,
  body.gg-layout-shell .bottom-nav :where(a[href], button):active {
    opacity: 0.82;
  }
}

/* Keep the current tab selected until the destination has actually rendered.
   A thin progress line confirms the tap without showing the wrong tab. */
html.gg-navigation-pending::after {
  content: "";
  position: fixed;
  z-index: 2147483647;
  top: var(--topbar-h, 64px);
  left: 0;
  width: 38%;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, #35e0c2 30%, #60a5fa 100%);
  box-shadow: 0 0 10px rgba(53, 224, 194, 0.65);
  animation: gg-navigation-progress 0.65s ease-in-out infinite;
}

@keyframes gg-navigation-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(360%); }
}

@media (max-width: 959px) {
  body.gg-pwa-standalone.gg-layout-shell,
  html.gg-pwa-standalone body.gg-layout-shell {
    --gg-sat: env(safe-area-inset-top, 0px) !important;
    --topbar-h: calc(64px + env(safe-area-inset-top, 0px)) !important;
    --gg-bottom-nav-h: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.gg-pwa-standalone.gg-layout-shell .site-topbar,
  html.gg-pwa-standalone body.gg-layout-shell .site-topbar,
  body.gg-pwa-standalone.livesport-theme.gg-layout-shell .site-topbar,
  html.gg-pwa-standalone body.livesport-theme.gg-layout-shell .site-topbar {
    box-sizing: border-box !important;
    top: 0 !important;
    height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    background: #071923 !important;
    border-bottom-color: rgba(53, 224, 194, 0.22) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
  }

  body.gg-pwa-standalone.gg-layout-shell .site-shell.football-shell,
  html.gg-pwa-standalone body.gg-layout-shell .site-shell.football-shell {
    margin-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
  }

  body.gg-pwa-standalone.gg-layout-shell .bottom-nav,
  html.gg-pwa-standalone body.gg-layout-shell .bottom-nav,
  body.gg-pwa-standalone.livesport-theme.gg-layout-shell .bottom-nav,
  html.gg-pwa-standalone body.livesport-theme.gg-layout-shell .bottom-nav {
    bottom: 0 !important;
    height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0.38rem 0.45rem calc(0.38rem + env(safe-area-inset-bottom, 0px)) !important;
    background: #091521 !important;
    border-top-color: rgba(105, 137, 164, 0.28) !important;
    border-bottom: 0 !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.24) !important;
    transform: none !important;
  }

  body.gg-pwa-standalone.gg-landing-page,
  html.gg-pwa-standalone body.gg-landing-page {
    --gg-landing-bottom-inset: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (display-mode: standalone) and (max-width: 959px) {
  body.gg-layout-shell {
    --gg-sat: env(safe-area-inset-top, 0px) !important;
    --topbar-h: calc(64px + env(safe-area-inset-top, 0px)) !important;
  }

  body.gg-layout-shell .site-topbar {
    height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    min-height: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    background: #071923 !important;
  }

  body.gg-layout-shell .bottom-nav {
    bottom: 0 !important;
    height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: calc(0.38rem + env(safe-area-inset-bottom, 0px)) !important;
    background: #091521 !important;
  }
}
