/* Global Navigation v63 — one shell, one footer, module tabs inside content. */
:root {
  --global-footer-height: 5.55rem;
  --global-footer-safe: env(safe-area-inset-bottom, 0px);
  --global-shell-gap: 0.75rem;
  --z-content: 1;
  --z-module-tabs: 30;
  --z-header: 50;
  --z-global-footer: 80;
  --z-global-more: 90;
  --z-overlay: 110;
  --z-modal: 130;
}

.phone-frame {
  --app-bottom-reserve: calc(var(--global-footer-height) + var(--global-footer-safe));
}

.phone-frame > .bottom-nav[data-global-footer] {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  min-height: var(--global-footer-height) !important;
  height: calc(var(--global-footer-height) + var(--global-footer-safe)) !important;
  padding: 0.45rem 0.4rem calc(0.45rem + var(--global-footer-safe)) !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  background: rgba(255, 255, 255, 0.985) !important;
  border-top: 1px solid rgba(112, 98, 76, 0.12) !important;
  box-shadow: 0 -12px 30px rgba(38, 31, 22, 0.08) !important;
  z-index: var(--z-global-footer) !important;
  transform: none !important;
  contain: layout paint;
}

.phone-frame > .bottom-nav[data-global-footer] button {
  min-width: 0;
  height: 100%;
  border: 0;
  border-radius: 1.05rem;
  background: transparent;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.18rem;
  color: #69645c;
  font: inherit;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.phone-frame > .bottom-nav[data-global-footer] button .nav-icon {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  font-size: 1.25rem;
  line-height: 1;
}

.phone-frame > .bottom-nav[data-global-footer] button > span:last-child {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.phone-frame > .bottom-nav[data-global-footer] button.is-active {
  color: #a96500;
  background: linear-gradient(180deg, #fff8e8 0%, #fff1d0 100%);
}

body[data-global-footer="visible"] .mobile-content {
  padding-bottom: var(--app-bottom-reserve) !important;
  scroll-padding-bottom: calc(var(--app-bottom-reserve) + 0.7rem) !important;
}

body[data-global-footer="hidden"] .phone-frame > .bottom-nav[data-global-footer] {
  display: none !important;
}

body[data-global-footer="hidden"] .mobile-content {
  padding-bottom: 0 !important;
  scroll-padding-bottom: 0 !important;
}

.phone-frame > .mobile-menu-fab[data-global-more] {
  position: absolute !important;
  right: 0.8rem !important;
  bottom: calc(var(--global-footer-height) + var(--global-footer-safe) + 0.55rem) !important;
  z-index: var(--z-global-more) !important;
  transform: none !important;
}

body[data-global-footer="hidden"] .phone-frame > .mobile-menu-fab[data-global-more] {
  display: none !important;
}

.phone-frame > .mobile-quick-menu[data-global-more-menu] {
  position: absolute !important;
  z-index: var(--z-overlay) !important;
}

/* The secondary navigation lives in content, never at the bottom of the shell. */
.module-tabs {
  position: relative;
  z-index: var(--z-module-tabs);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: calc(100% - 1.5rem);
  max-width: 100%;
  margin: 0.6rem auto 0.75rem;
  padding: 0.28rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(132,111,77,.12);
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(40,32,21,.05);
}

.module-tabs::-webkit-scrollbar { display: none; }

.module-tabs button {
  flex: 1 0 auto;
  min-width: max-content;
  min-height: 2.65rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 0.78rem;
  background: transparent;
  color: #6f6a61;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.module-tabs button > span {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
}
.module-tabs button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.module-tabs button small { font: inherit; }
.module-tabs button.is-active,
.module-tabs button[aria-current="page"] {
  color: #a96500;
  background: #fff1d2;
}

.module-tabs--community,
.module-tabs--draws,
.module-tabs--predictions {
  position: sticky;
  top: 0.35rem;
}

/* Old bottom navigators must not exist after the build migration. These selectors
   are intentionally only defensive for stale HTML restored by an old SW. */
.phone-frame > .community-fusion-v44-footer,
.phone-frame > .draws-v44-footer,
.phone-frame > .prediction-hub-nav,
#communityPersistentNav {
  display: none !important;
}

@media (max-width: 430px) {
  :root { --global-footer-height: 5.25rem; }
  .module-tabs { width: calc(100% - 1rem); margin-top: 0.45rem; }
  .module-tabs button { padding-inline: 0.72rem; }
}

@media (min-width: 760px) {
  .module-tabs { max-width: 46rem; }
}
