/* ============================================================
   v5.17 — Mobile bottom navigation
   Replaces the cramped floating .dock on mobile with a proper
   labelled bottom-tab bar. Desktop keeps the existing dock.
   ============================================================ */

.mnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 12, 22, 0.94);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.4);
}

.mnav-btn {
  flex: 1 1 0;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9fb6cd;
  cursor: pointer;
  position: relative;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mnav-btn:active { transform: scale(0.94); }
.mnav-btn:hover { color: #e7eef8; }

.mnav-ico {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.mnav-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: inherit;
  white-space: nowrap;
}

/* Active / on states — brand green */
.mnav-btn.on,
.mnav-btn[aria-pressed="true"] {
  color: #1edb8a;
}
.mnav-btn.on::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #1edb8a;
  box-shadow: 0 0 8px rgba(30, 219, 138, 0.5);
}

/* OFF state (sound muted, comms off, etc.) — alert red */
.mnav-btn.off {
  color: #ff3d57;
}

/* Speed label shows 1×/2×/4× — monospace for clarity */
.mnav-btn[data-act="speed"] .mnav-lbl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mnav-btn[data-act="speed"].turbo {
  color: #ffd23f;
}

/* Chat badge */
.mnav-badge {
  position: absolute;
  top: 4px;
  right: 22%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3d57;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(7, 12, 22, 0.94);
}
.mnav-badge.hidden { display: none; }

/* Give the page room so content doesn't hide behind the bar */
@media (max-width: 768px) {
  body.match-live .broadcast,
  body.match-live .pitch-wrap {
    padding-bottom: 72px;
  }
}

/* Show the mobile nav and hide the original dock + FAB on mobile */
@media (max-width: 768px) {
  /* the JS that shows the dock will flip inline style; override via class */
  body.match-live #dock {
    display: none !important;
  }
  /* Move the chat FAB OFF-screen on mobile — Chat is now a mnav tab */
  body.match-live #lfFab {
    display: none !important;
  }
  /* If the chat panel is open, give it room above the nav */
  #vflLiveFeel.open,
  .live-feel.open {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px) - 20px) !important;
  }
}

/* Desktop: nav stays hidden, existing dock remains */
@media (min-width: 769px) {
  .mnav { display: none !important; }
}
