/* ════════════════════════════════════════════════════════════════
   DXED ARENA: MISSION AUDIO (menu music player)

   Reads as shell instrumentation, not a media widget: dark compact
   surfaces, hairline technical borders, sharp 2px corners, restrained
   amber accent (the shell's selection color), cyan only for the live
   signal. Desktop: the dock sits inline in the footer line; the track
   list opens as a compact panel anchored above it. Mobile
   (body.dx-music-m): the dock re-docks as a slim strip above the
   bottom nav and the list becomes a bottom drawer.
   ════════════════════════════════════════════════════════════════ */

/* ── compact dock (desktop: floating bottom-right, .gs-dock) ── */
#mpDock {
  --mp-amb: var(--amb, #ffa54d);
  --mp-cyn: var(--cyn, #2fe3cb);
  --mp-line: var(--line2, rgba(255,255,255,.13));
  position: relative;
  display: flex; align-items: center; gap: 9px;
  height: 28px; padding: 0 10px 0 9px;
  background: color-mix(in srgb, var(--ink1, #101319) 72%, transparent);
  border: 1px solid var(--line, rgba(255,255,255,.07));
  border-radius: 2px;
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  flex: 0 1 auto; min-width: 0;
  overflow: hidden;
}
/* corner tick: the shell's blueprint framing, in miniature */
#mpDock::before {
  content: ''; position: absolute; left: 0; top: 0; width: 7px; height: 7px;
  border-left: 1px solid var(--mp-amb); border-top: 1px solid var(--mp-amb);
  opacity: .55; pointer-events: none;
}

/* hairline playback progress along the dock's bottom edge */
#mpDock .mp-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255,255,255,.05);
}
#mpDock .mp-progress i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mp-amb) 55%, transparent), var(--mp-amb));
  transition: width .3s linear;
}

/* ── signal indicator: four thin equalizer bars ── */
.mp-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.mp-eq i {
  width: 2px; height: 3px; background: var(--mp-cyn, #2fe3cb);
  opacity: .4; transform-origin: bottom;
}
#mpDock .mp-sig { display: flex; align-items: center; flex: none; }
#mpDock .mp-sig .mp-eq i { background: var(--mp-cyn); }
#mpDock.playing .mp-eq i { animation: mpEq 1.1s ease-in-out infinite; opacity: .95; }
#mpDock.playing .mp-eq i:nth-child(2) { animation-delay: .18s; animation-duration: .9s; }
#mpDock.playing .mp-eq i:nth-child(3) { animation-delay: .36s; animation-duration: 1.25s; }
#mpDock.playing .mp-eq i:nth-child(4) { animation-delay: .09s; animation-duration: .8s; }
#mpDock.muted.playing .mp-eq i { animation-play-state: paused; opacity: .35; }
@keyframes mpEq {
  0%, 100% { height: 3px; }
  35% { height: 12px; }
  60% { height: 6px; }
  80% { height: 10px; }
}

/* ── title block ── */
#mpDock .mp-meta { display: flex; flex-direction: column; justify-content: center; min-width: 0; width: 148px; }
#mpDock .mp-kicker {
  font-style: normal; font-size: 7.5px; font-weight: 700; letter-spacing: .22em;
  color: var(--tx3, #737a86); line-height: 1; transition: color .3s;
  white-space: nowrap;
}
#mpDock .mp-kicker.flash { color: var(--mp-amb); }
#mpDock.standby .mp-kicker { color: var(--tx3, #737a86); opacity: .8; }
#mpDock .mp-titlewrap { position: relative; overflow: hidden; height: 14px; margin-top: 1px; }
#mpDock .mp-title {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--tx, #edeae4);
  transition: transform .32s cubic-bezier(.22,.9,.34,1), opacity .32s;
}
#mpDock.standby .mp-title, #mpDock.paused .mp-title { color: var(--tx2, #a7adb7); }
#mpDock .mp-title.in { transform: translateY(110%); opacity: 0; }
#mpDock .mp-title.out { transform: translateY(-110%); opacity: 0; }
/* overflow glide for long names: clip window, never layout growth */
#mpDock .mp-title.mp-slide { animation: mpSlide var(--mp-slide-t, 6s) ease-in-out 1.2s infinite alternate; }
@keyframes mpSlide { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--mp-shift, 0)); } }

/* ── transport buttons ── */
.mp-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; padding: 0;
  background: none; border: none; border-radius: 2px;
  color: var(--tx2, #a7adb7); cursor: pointer;
  transition: color .14s, background .14s, transform .06s;
}
.mp-btn svg { width: 13px; height: 13px; }
.mp-btn:hover { color: var(--tx, #edeae4); background: rgba(255,255,255,.06); }
.mp-btn:active { transform: translateY(1px); }
.mp-btn.on { color: var(--mp-amb, #ffa54d); }
#mpDock .mp-ctrls { display: flex; align-items: center; gap: 2px; flex: none; }
#mpDock .mp-main {
  width: 24px; height: 24px;
  border: 1px solid var(--mp-line);
  color: var(--tx, #edeae4);
}
#mpDock .mp-main:hover { border-color: var(--mp-amb); color: var(--mp-amb); }
#mpDock.standby .mp-main { border-color: color-mix(in srgb, var(--mp-amb) 45%, transparent); animation: mpPulse 2.2s ease-in-out infinite; }
@keyframes mpPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,165,77,0); } 50% { box-shadow: 0 0 7px 0 rgba(255,165,77,.28); } }

/* ── volume ── */
#mpDock .mp-vol { display: flex; align-items: center; gap: 4px; flex: none; }
.mp-range {
  -webkit-appearance: none; appearance: none;
  width: 64px; height: 12px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
  --mp-fill: 70%;
}
.mp-range::-webkit-slider-runnable-track {
  height: 2px; border-radius: 0;
  background: linear-gradient(90deg, var(--mp-amb, #ffa54d) var(--mp-fill), rgba(255,255,255,.14) var(--mp-fill));
}
.mp-range::-moz-range-track { height: 2px; background: rgba(255,255,255,.14); }
.mp-range::-moz-range-progress { height: 2px; background: var(--mp-amb, #ffa54d); }
.mp-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 3px; height: 10px; border-radius: 1px; margin-top: -4px;
  background: var(--tx, #edeae4); border: none;
  transition: background .15s;
}
.mp-range::-moz-range-thumb {
  width: 3px; height: 10px; border-radius: 1px; border: none;
  background: var(--tx, #edeae4);
}
.mp-range:hover::-webkit-slider-thumb, .mp-range:focus-visible::-webkit-slider-thumb { background: var(--mp-amb, #ffa54d); }
.mp-range:focus-visible { outline: 1px solid var(--mp-amb, #ffa54d); outline-offset: 3px; }

/* footer breathing room when the player is docked (desktop) */
body.dx-music #scrMenu .gs-dock { gap: 10px; }
@media (max-width: 1180px) { body.dx-music #scrMenu .gs-build em { display: none; } }
@media (max-width: 980px) { body.dx-music #scrMenu .gs-keys { display: none; } }
@media (max-width: 700px) {
  body.dx-music:not(.dx-music-m) #mpDock .mp-vol .mp-range { display: none; }
  body.dx-music:not(.dx-music-m) #mpDock .mp-meta { width: 110px; }
}

/* ════════════ expanded panel (desktop: anchored above the footer) ════════════ */
#mpPanel { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
#mpPanel .mpp-scrim { display: none; }
#mpPanel .mpp-card {
  pointer-events: auto;
  position: absolute; right: 16px; bottom: calc(var(--foot-h, 36px) + 10px);
  width: 308px;
  background: color-mix(in srgb, var(--ink0, #0a0c0f) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line2, rgba(255,255,255,.13));
  border-radius: 2px;
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  color: var(--tx, #edeae4);
  box-shadow: 0 14px 40px -18px rgba(0,0,0,.85);
  animation: mppUp .18s cubic-bezier(.22,.9,.34,1);
}
@keyframes mppUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.mpp-tick { position: absolute; width: 9px; height: 9px; pointer-events: none; }
.mpp-tick.tl { left: -1px; top: -1px; border-left: 1px solid var(--amb, #ffa54d); border-top: 1px solid var(--amb, #ffa54d); }
.mpp-tick.br { right: -1px; bottom: -1px; border-right: 1px solid var(--amb, #ffa54d); border-bottom: 1px solid var(--amb, #ffa54d); }

.mpp-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 8px 12px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.07));
}
.mpp-id { display: flex; flex-direction: column; gap: 1px; flex: none; }
.mpp-id em { font-style: normal; font-size: 8px; font-weight: 700; letter-spacing: .24em; color: var(--amb, #ffa54d); }
.mpp-id b { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; color: var(--tx, #edeae4); }
.mpp-wave { flex: 1 1 auto; min-width: 0; height: 14px; opacity: .3; }
.mpp-wave path { fill: none; stroke: var(--cyn, #2fe3cb); stroke-width: 1; }

.mpp-list { display: flex; flex-direction: column; padding: 5px 5px; }
.mpp-row {
  position: relative;
  display: grid; grid-template-columns: 22px 1fr auto auto; align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid transparent; border-radius: 2px;
  background: none; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--tx2, #a7adb7);
  transition: background .13s, color .13s, border-color .13s;
}
.mpp-row + .mpp-row { margin-top: 1px; }
.mpp-row:hover { background: rgba(255,255,255,.045); color: var(--tx, #edeae4); }
.mpp-row:active { background: rgba(255,255,255,.07); }
.mpp-row:focus-visible { outline: none; border-color: var(--amb, #ffa54d); }
.mpp-row.act {
  color: var(--tx, #edeae4);
  background: color-mix(in srgb, var(--amb, #ffa54d) 8%, transparent);
  border-color: color-mix(in srgb, var(--amb, #ffa54d) 30%, transparent);
}
.mpp-row.act::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px;
  background: var(--amb, #ffa54d);
}
.mpp-row.err { opacity: .38; }
.mpp-row.err .mpp-dur { visibility: hidden; }
.mpp-row.err::after { content: 'UNAVAILABLE'; grid-column: 4; font-size: 8px; letter-spacing: .14em; color: var(--red, #ff5a5e); }
.mpp-num { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--tx3, #737a86); }
.mpp-row.act .mpp-num { color: var(--amb, #ffa54d); }
.mpp-name {
  font-size: 13.5px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.mpp-dur { font-size: 11px; font-weight: 600; color: var(--tx3, #737a86); font-variant-numeric: tabular-nums; }
.mpp-row .mp-eq { visibility: hidden; }
.mpp-row.act.playing .mp-eq { visibility: visible; }
.mpp-row.act.playing .mp-eq i { animation: mpEq 1.05s ease-in-out infinite; opacity: .9; background: var(--amb, #ffa54d); }
.mpp-row.act.playing .mp-eq i:nth-child(2) { animation-delay: .2s; animation-duration: .85s; }
.mpp-row.act.playing .mp-eq i:nth-child(3) { animation-delay: .4s; animation-duration: 1.3s; }

/* now-playing strip: scrub + modes */
.mpp-now { padding: 8px 12px 10px; border-top: 1px solid var(--line, rgba(255,255,255,.07)); }
.mpp-scrub { display: flex; align-items: center; gap: 8px; }
.mpp-seek { flex: 1 1 auto; width: auto; }
.mpp-time {
  font-size: 10.5px; font-weight: 600; color: var(--tx3, #737a86);
  font-variant-numeric: tabular-nums; min-width: 30px;
}
.mpp-time:last-child { text-align: right; }
.mpp-modes { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.mpp-mode {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  background: none; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 2px;
  color: var(--tx3, #737a86); cursor: pointer; font-family: inherit;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  transition: color .14s, border-color .14s, background .14s;
}
.mpp-mode svg { width: 11px; height: 11px; }
.mpp-mode:hover { color: var(--tx2, #a7adb7); border-color: var(--line2, rgba(255,255,255,.13)); }
.mpp-mode.on {
  color: var(--amb, #ffa54d);
  border-color: color-mix(in srgb, var(--amb, #ffa54d) 45%, transparent);
  background: color-mix(in srgb, var(--amb, #ffa54d) 7%, transparent);
}
.mpp-mode:focus-visible { outline: 1px solid var(--amb, #ffa54d); outline-offset: 2px; }
.mpp-vol { display: none; align-items: center; gap: 4px; margin-left: auto; }

/* ════════════ mobile treatment (body.dx-music-m / .mp-mobile) ════════════
   A slim fixed strip directly above the bottom nav: title · prev/play/next
   · mute · list. Volume fader moves into the drawer. Touch targets 40px+. */
#mpDock.mp-mobile {
  position: fixed; left: 0; right: 0;
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 88;
  height: 44px; border-radius: 0;
  border-left: none; border-right: none;
  background: rgba(10, 12, 16, .94);
  backdrop-filter: blur(8px);
  padding: 0 4px 0 10px; gap: 5px;
}
#mpDock.mp-mobile::before { display: none; }
#mpDock.mp-mobile .mp-sig { display: none; }   /* the row eq + play state carry the signal here */
#mpDock.mp-mobile .mp-meta { flex: 1 1 auto; width: auto; }
#mpDock.mp-mobile .mp-kicker { font-size: 8px; }
#mpDock.mp-mobile .mp-titlewrap { height: 16px; }
#mpDock.mp-mobile .mp-title { font-size: 13.5px; }
#mpDock.mp-mobile .mp-ctrls { gap: 0; }
#mpDock.mp-mobile .mp-btn { width: 38px; height: 40px; }
#mpDock.mp-mobile .mp-btn svg { width: 16px; height: 16px; }
#mpDock.mp-mobile .mp-main { width: 40px; height: 40px; border: none; }
#mpDock.mp-mobile .mp-vol .mp-range { display: none; }  /* fader lives in the drawer */
#mpDock.mp-mobile .mp-progress { top: 0; bottom: auto; }
/* the stage scroll area clears the strip (nav 76px + strip 44px) */
body.dx-music-m.dx-mnav .gs-stage { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
body.dx-music-m.dx-mnav .gs-drawer { bottom: calc(112px + env(safe-area-inset-bottom)); }

/* the PWA install banner docks above the bottom nav, with the music strip
   there too, it steps up one slot so neither covers the other */
@media (max-width: 720px), (pointer: coarse) {
  body.dx-music-m #dxInstallPill { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
}
/* while the track drawer/panel is open, floating chrome yields to it */
body.mp-panel-open #dxInstallPill { opacity: 0 !important; pointer-events: none !important; }

/* drawer panel */
#mpPanel.mp-mobile { position: fixed; z-index: 130; }  /* above nav + install pill */
#mpPanel.mp-mobile .mpp-scrim {
  display: block; pointer-events: auto;
  position: absolute; inset: 0; background: rgba(3, 5, 9, .6);
}
#mpPanel.mp-mobile .mpp-card {
  right: 0; left: 0; bottom: 0; width: auto;
  max-height: min(70vh, calc(var(--dxvh, 1vh) * 70));
  overflow-y: auto;
  border-left: none; border-right: none; border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom);
  animation: mppDrawer .22s cubic-bezier(.22,.9,.34,1);
}
@keyframes mppDrawer { from { transform: translateY(26px); opacity: .5; } to { transform: none; opacity: 1; } }
#mpPanel.mp-mobile .mpp-tick { display: none; }
#mpPanel.mp-mobile .mpp-row { padding: 12px 10px; }
#mpPanel.mp-mobile .mpp-name { font-size: 15px; }
#mpPanel.mp-mobile .mpp-mode { height: 34px; padding: 0 12px; font-size: 10px; }
#mpPanel.mp-mobile .mpp-vol { display: flex; }
#mpPanel.mp-mobile .mpp-vol .mp-range { width: 92px; }

/* motion accessibility */
@media (prefers-reduced-motion: reduce) {
  #mpDock .mp-eq i, .mpp-row .mp-eq i { animation: none !important; height: 7px; }
  #mpDock .mp-title.mp-slide { animation: none; }
  #mpDock.standby .mp-main { animation: none; }
}
