/* ============================================================
   Zero-Stage Music Money — GLOBAL PWA TAB BAR
   Injected by /assets/js/tabbar.js on every public page.
   Mobile only (<721px). Uses tokens from /assets/css/theme.css.

   Deliberately NO backdrop-filter: blur() here — on mid/low-end
   Android it re-rasterises the whole page behind the bar on every
   scroll frame, which is the main source of the "wobbly" feel.
   A near-opaque surface looks the same and stays at 60 fps.
   ============================================================ */

@media (max-width: 720px) {
  /* Reserve the bar's space up-front (higher specificity than the
     per-page `body { padding: 32px }`), so the bar never pushes
     content around after first paint. */
  html body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .tabbar {
    position: fixed;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: calc(12px + env(safe-area-inset-left));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 70;
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 7px 8px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(18, 18, 26, 0.97);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    /* Own compositor layer: the bar never repaints the page behind it. */
    transform: translateZ(0);
    isolation: isolate;
    overscroll-behavior: contain;
  }

  .tabbar a {
    flex: 1;
    min-width: 0;
    min-height: 46px;             /* comfortable tap target */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 15px;
    text-decoration: none;
    color: var(--tertiary);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
  }
  .tabbar a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tabbar a svg {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tabbar a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
  }
  .tabbar a.active svg {
    color: var(--cyan);
  }
  .tabbar a:active {
    transform: scale(0.94);
  }

  /* Prominent centre action */
  .tabbar a.join {
    color: #0a0a0f;
    background: var(--grad);
    font-weight: 800;
    box-shadow: 0 6px 18px rgba(168, 85, 247, 0.35);
  }
  .tabbar a.join svg {
    color: #0a0a0f;
  }

  /* Landscape phones: keep the bar, trim the height. */
  @media (max-height: 430px) {
    .tabbar a { min-height: 40px; padding: 3px 2px; }
    .tabbar a span { display: none; }
    html body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  }
}

@media (min-width: 721px) {
  .tabbar {
    display: none !important;
  }
}
