/* ==========================================================================
 * MILLENOVA GLOBAL PLAYER — OVERFLOW MENUS CONTRACT
 *
 * OWNER:
 * This file owns the player, current-track and queue-row overflow menus: surface, opacity, anchoring, stacking and menu-specific responsive presentation.
 *
 * MUST NOT OWN:
 * Do not define queue rows or dialogs. Scrollbar chrome remains owned by
 * Styles/scrollbars.css. JavaScript state/queue/provider semantics stay
 * outside CSS.
 *
 * CASCADE CONTRACT:
 * Segment 2 of 2 for this owner. Phase 11A mechanical split: loaded at manifest position 23, after
 * 22-stage-desktop-layout--part-4-of-6.css. Rule order is unchanged from the former monolith (baseline
 * df93472, lines 3902–4004). New corrections go into the canonical owning
 * rule; never append dated Phase/fix blocks.
 *
 * DEPENDENCIES:
 * Depends on the ⋮ menu markup rendered by floating_playlist.php and Scripts/floating-playlist.js.
 * ========================================================================== */


/* ==========================================================================
 * Phase 8 refinement 14 — opaque mobile overflow menus
 *
 * Physical mobile compositing rendered queue/current-track overflow surfaces
 * as see-through despite the desktop rgba panel looking effectively opaque.
 * Compact Stage therefore uses a deliberately solid menu surface and lifts the
 * open row/details into an isolated stacking context.
 * ========================================================================== */

@media (max-width: 900px) and (pointer: coarse) {
  .floating-playlist:not(.is-minimized)
    .floating-playlist__track:has(.floating-playlist__track-menu[open]) {
    position: relative;
    z-index: 92;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu[open],
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu[open] {
    position: relative;
    isolation: isolate;
    opacity: 1;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu[open] {
    z-index: 94;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu[open] {
    z-index: 96;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu-list,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu-list {
    z-index: 120;
    opacity: 1 !important;
    background: #090a0e !important;
    background-color: #090a0e !important;
    border-color: rgba(255,255,255,.14);
    box-shadow:
      0 20px 48px rgba(0,0,0,.76),
      0 0 0 1px rgba(0,0,0,.28);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    mix-blend-mode: normal;
    isolation: isolate;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu-list button,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu-list a,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu-list button,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu-list a {
    background: #090a0e;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu-list button:active,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__track-menu-list a:active,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu-list button:active,
  .floating-playlist:not(.is-minimized)
    .floating-playlist__current-menu-list a:active {
    background: #15171d;
  }
}

/* ==========================================================================
 * Phase 8 refinement 16 — mobile current-menu stacking-context fix
 *
 * The menu panel itself was already opaque. The actual bug was its parent
 * stage-info-row being a z-index:1 stacking context, tied with the later queue
 * sibling. Because the queue paints later, it covered the menu even when the
 * menu had z-index:120. Lift the whole info-row while its current-menu is open.
 * ========================================================================== */

@media (max-width: 900px) and (pointer: coarse) {
  .floating-playlist:not(.is-minimized)
    .floating-playlist__stage-info-row:has(
      > .floating-playlist__current-menu[open]
    ) {
    /* Stay sticky (2026-10-03 compact NOW PLAYING): `relative` combined
       with the sticky `top` offset pushed the whole row ~one video height
       down, behind the queue, while the ⋮ menu was open. */
    position: sticky;
    z-index: 140;
    overflow: visible;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__stage-info-row:has(
      > .floating-playlist__current-menu[open]
    )
    > .floating-playlist__current-menu {
    z-index: 141;
  }

  .floating-playlist:not(.is-minimized)
    .floating-playlist__stage-info-row:has(
      > .floating-playlist__current-menu[open]
    )
    .floating-playlist__current-menu-list {
    z-index: 142;
    pointer-events: auto;
  }
}
