/* ============================================================
   v5.18.0 — Mobile chat modes (mini / default / full)
   ------------------------------------------------------------
   Three states the user can cycle through on mobile:
     • body.chat-mode-mini    → chat collapsed to a slim 36px
                                 bar at the bottom; pitch + page
                                 get the full screen. Tap the
                                 bar (or the mnav Chat button)
                                 to expand.
     • body.chat-mode-default → current behaviour: chat fills
                                 the lower ~half of the screen,
                                 pitch sits above.
     • body.chat-mode-full    → chat overlays everything below
                                 the scorebar, full screen, so
                                 you can read messages comfortably.

   Desktop ignores all of this — chat lives in the side rail.
   ============================================================ */

/* ----- Mode-cycle button in the chat header (mobile only) ----- */
.lf-mode-cycle {
  display: none;                /* hidden on desktop, shown via media query below */
  appearance: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e6f0ff;
  font: 800 11px/1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  padding: 6px 9px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 6px;
  min-height: 28px;
  align-items: center;
}
.lf-mode-cycle .lf-mode-icon {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  margin-right: 4px;
  vertical-align: -1px;
}
.lf-mode-cycle:hover { background: rgba(255,255,255,0.14); }
.lf-mode-cycle:active { transform: translateY(1px); }

/* ----- Mini-mode "tap to open" handle row ----- */
.lf-mini-handle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 12px;
  height: 100%;
  font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #cfe2ff;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.lf-mini-handle .lf-mini-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lf-mini-handle .lf-mini-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff3b3b;
  box-shadow: 0 0 6px rgba(255,59,59,0.7);
  animation: lfMiniPulse 1.6s ease-in-out infinite;
}
@keyframes lfMiniPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
.lf-mini-handle .lf-mini-watch {
  font-weight: 600;
  color: #8fa8c3;
  letter-spacing: 0.04em;
  font-size: 11px;
  text-transform: none;
}
.lf-mini-handle .lf-mini-up {
  font-size: 16px;
  color: #8fa8c3;
  font-weight: 700;
}

/* ============================================================
   Mobile only
   ============================================================ */
@media (max-width: 768px) {

  /* Show the cycle button */
  .lf-mode-cycle { display: inline-flex !important; align-items: center; }

  /* The header collapse "–" is now redundant on mobile — hide it. */
  #vflLiveFeel.live-feel .lf-collapse {
    display: none !important;
  }

  /* ------- DEFAULT MODE (unchanged behaviour) -------
     Already styled in v517-2.css. Nothing extra needed. */

  /* ------- MINI MODE -------
     Chat collapses to a slim 36px tap-bar pinned just above the
     mnav. The pitch + page below it scroll normally. */
  body.chat-mode-mini #vflLiveFeel.live-feel {
    top: auto !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 12px 12px 0 0 !important;
    background: linear-gradient(180deg, rgba(8,14,26,0.98), rgba(5,10,19,0.98)) !important;
    border-top: 1px solid rgba(0,200,255,0.25) !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.35) !important;
    overflow: hidden !important;
  }
  /* Hide every part of the chat except the mini handle */
  body.chat-mode-mini #vflLiveFeel.live-feel .lf-head,
  body.chat-mode-mini #vflLiveFeel.live-feel .lf-odds,
  body.chat-mode-mini #vflLiveFeel.live-feel .lf-feed,
  body.chat-mode-mini #vflLiveFeel.live-feel .lf-input {
    display: none !important;
  }
  /* Show the mini handle */
  body.chat-mode-mini #vflLiveFeel.live-feel .lf-mini-handle {
    display: flex !important;
  }
  /* Pitch breathing room — let the page scroll normally; nothing
     is pinned to a fixed top. The mini bar is only 36px so the
     pitch effectively gets the full above-mnav region. */

  /* ------- FULL MODE -------
     Chat overlays everything below the scorebar. Pitch is hidden
     behind the chat. */
  body.chat-mode-full #vflLiveFeel.live-feel {
    top: 64px !important;       /* just below scorebar */
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    background: rgba(5,10,19,0.985) !important;
    z-index: 80 !important;
  }
  /* Make sure the feed and input render */
  body.chat-mode-full #vflLiveFeel.live-feel .lf-head,
  body.chat-mode-full #vflLiveFeel.live-feel .lf-odds,
  body.chat-mode-full #vflLiveFeel.live-feel .lf-feed,
  body.chat-mode-full #vflLiveFeel.live-feel .lf-input {
    display: flex !important;
  }
  body.chat-mode-full #vflLiveFeel.live-feel .lf-mini-handle {
    display: none !important;
  }

  /* Make sure mini handle never shows in default/full */
  body.chat-mode-default #vflLiveFeel.live-feel .lf-mini-handle,
  body:not(.chat-mode-mini) #vflLiveFeel.live-feel .lf-mini-handle {
    display: none !important;
  }
}

/* ============================================================
   Desktop — keep mini handle hidden, mode-cycle hidden.
   ============================================================ */
@media (min-width: 769px) {
  .lf-mini-handle { display: none !important; }
  .lf-mode-cycle  { display: none !important; }
}
