/* ============================================================================
   Atlas Radio v4 - glass music popover (#music-pop, mx-*)  -  css/radio.css
   Fixed chrome OUTSIDE #app: the one place real backdrop-filter is allowed.
   Pairs with js/radio.js v6 (free-spin dial, station icons, scale-meter vol).
   v4: back on the site's blue/white glass language. The rectangular card and
   circular wheel stay; only the skin changed (green Spotify accent retired).
============================================================================ */
#music-pop{position:fixed;inset:0;z-index:9000;pointer-events:none}
#music-pop.show{pointer-events:auto}
.mx-catch{position:absolute;inset:0;background:transparent}

/* v4: RECTANGULAR glass card (round dial kept). --sp = site blue accent,
   scoped tokens so a future re-skin only touches these three lines. Skin
   mirrors the .lg-surface header/menu glass so the popover reads as one
   family with the rest of the fixed chrome. */
.mx-pop{--sp:var(--blue,#1a2ffb);--sp-lit:#9db1ff;--sp-soft:rgba(58,86,255,.55);
  position:fixed;width:320px;max-width:92vw;padding:16px 16px 13px;border-radius:18px;
  /* base stays predominantly dark + fairly opaque so the white station icons
     read on ANY page section behind the glass (the light goal/featured/reel
     bands used to show white through and wash the icons out); the blur + the
     inset white rim below keep the glass sheen. */
  background:linear-gradient(180deg,rgba(26,31,48,.82),rgba(17,21,33,.85) 40%,rgba(10,13,20,.88));
  -webkit-backdrop-filter:blur(20px) saturate(150%) brightness(1.05);
  backdrop-filter:blur(20px) saturate(150%) brightness(1.05);
  border:1px solid rgba(255,255,255,.14);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.26),inset 0 -1px 0 rgba(255,255,255,.06),
    inset -8px -12px 24px -18px rgba(111,183,255,.26),
    0 30px 80px rgba(2,6,14,.6),0 2px 10px rgba(2,6,14,.35);
  transform-origin:top right;transform:translateY(-12px) scale(.93);opacity:0;
  transition:transform .42s var(--ease),opacity .32s var(--ease)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .mx-pop{background:linear-gradient(180deg,#1c2032 0%,#12141f 46%,#0b0d14 100%)}}
/* site-blue accent swaps, scoped to the popover */
.mx-pop .mx-eyebrow{color:var(--sp)}
.mx-pointer{border-top-color:var(--sp)!important;filter:drop-shadow(0 0 6px var(--sp-soft))!important}
.mxp-fill{stroke:var(--sp)!important;filter:drop-shadow(0 0 4px var(--sp-soft))!important}
.mx-play{background:var(--sp)!important}
.mx-play:hover{box-shadow:0 0 18px var(--sp-soft)!important}
.mx-cico{color:var(--sp-lit)!important}
#music-pop.show .mx-pop{transform:none;opacity:1}

.mx-pop button{font-family:inherit}
.mx-pop button:focus-visible,.mx-vol-bar:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:10px}
.mx-item:focus-visible{outline:2px solid var(--blue);outline-offset:3px;border-radius:50%}
.mx-play:focus-visible{outline:2px solid #fff;outline-offset:3px;border-radius:50%}
.mx-mute:focus-visible{border-radius:8px}
.mx-close:focus-visible{border-radius:9px}
.mx-ring:focus-visible{outline:none;box-shadow:inset 0 0 0 1px rgba(26,47,251,.4);border-radius:50%}

/* head */
.mx-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.mx-eyebrow{font-family:var(--mono);font-size:10px;letter-spacing:.26em;text-transform:uppercase;color:var(--blue)}
.mx-close{background:none;border:0;color:rgba(255,255,255,.55);font-size:20px;line-height:1;cursor:pointer;
  padding:2px 7px;border-radius:9px;
  transition:color .25s var(--ease),background .25s var(--ease),transform .34s var(--ease)}
.mx-close:hover{color:#fff;background:rgba(255,255,255,.08);transform:rotate(90deg)}
.mx-close:active{transform:rotate(90deg) scale(.88)}

/* dial */
.mx-dial{position:relative;width:250px;max-width:100%;aspect-ratio:1;margin:2px auto 0}
.mx-dial::before{content:"";position:absolute;inset:16px;border-radius:50%;border:1px solid rgba(255,255,255,.09)}
.mx-pointer{position:absolute;left:50%;top:6px;width:0;height:0;transform:translateX(-50%);z-index:5;
  border-left:6px solid transparent;border-right:6px solid transparent;border-top:9px solid var(--blue);
  filter:drop-shadow(0 0 6px rgba(26,47,251,.7));transition:filter .4s var(--ease)}
#music-pop.is-playing .mx-pointer{animation:mx-notch 2.6s ease-in-out infinite}
@keyframes mx-notch{
  0%,100%{filter:drop-shadow(0 0 6px rgba(26,47,251,.75))}
  50%{filter:drop-shadow(0 0 13px rgba(26,47,251,1))}}
.mx-ring{position:absolute;inset:0;touch-action:none;cursor:grab}
.mx-ring:active{cursor:grabbing}

/* station icons on the wheel (monoline, currentColor) */
.mx-item{position:absolute;left:0;top:0;width:30px;height:30px;padding:0;display:grid;place-items:center;
  background:none;border:0;cursor:pointer;color:rgba(255,255,255,.72);will-change:transform,opacity;
  line-height:0;transition:color .25s var(--ease)}
/* every glyph shares one fixed, centred 16x16 box so all six line up exactly
   on their ring node regardless of how full each 0..24 viewBox is */
.mx-ico{width:16px;height:16px;display:grid;place-items:center;transform-origin:50% 50%}
.mx-item svg{width:16px;height:16px;display:block;overflow:visible}
#music-pop.show .mx-ico{animation:mx-ico-in .5s var(--ease) backwards;animation-delay:calc(var(--i,0)*36ms)}
@keyframes mx-ico-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}
.mx-item:hover{color:#fff}
/* tuned station: bright white. active (playing) station: lit ice blue. */
.mx-item.is-sel{color:#fff}
.mx-item.is-sel svg{filter:drop-shadow(0 0 6px rgba(150,180,255,.9)) drop-shadow(0 0 2px rgba(255,255,255,.95))}
.mx-item.is-cur{color:var(--sp-lit,#9db1ff)!important;opacity:1!important}
.mx-item.is-cur svg{filter:drop-shadow(0 0 7px rgba(93,116,255,.9))}
#music-pop.is-playing .mx-item.is-cur svg{animation:mx-glow 2.6s ease-in-out infinite}
@keyframes mx-glow{
  0%,100%{filter:drop-shadow(0 0 5px rgba(93,116,255,.6))}
  50%{filter:drop-shadow(0 0 12px rgba(93,116,255,1))}}

/* centre disc: tuned station + progress ring + tabular time */
.mx-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:3;
  width:61%;height:61%;border-radius:50%;
  background:radial-gradient(120% 120% at 50% 28%,rgba(36,42,64,.94),rgba(11,13,20,.98));
  border:1px solid rgba(255,255,255,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 12px 30px rgba(0,0,0,.4);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:0 16px;text-align:center}
.mx-progress{position:absolute;left:-6px;top:-6px;width:calc(100% + 12px);height:calc(100% + 12px);
  transform:rotate(-90deg);pointer-events:none}
.mx-progress circle{fill:none;stroke-width:1.6}
.mxp-track{stroke:rgba(255,255,255,.08)}
.mxp-fill{stroke:var(--blue);stroke-linecap:round;stroke-dasharray:358.14;stroke-dashoffset:358.14;
  transition:stroke-dashoffset .4s linear;filter:drop-shadow(0 0 4px rgba(26,47,251,.55))}
.mx-now{display:flex;align-items:center;justify-content:center;gap:6px;max-width:100%}
.mx-cico{color:#8f9aff;flex:0 0 auto;width:13px;height:13px;line-height:0;display:grid;place-items:center}
.mx-cico svg{width:13px;height:13px;display:block;overflow:visible}
.mx-title{font-size:13px;font-weight:500;letter-spacing:-.01em;line-height:1.25;text-wrap:balance;color:#fff}
.mx-mood{font-family:var(--mono);font-size:8.5px;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.48)}
.mx-play{margin-top:4px;width:36px;height:36px;border-radius:50%;border:0;cursor:pointer;background:var(--blue);color:#fff;
  display:grid;place-items:center;
  transition:transform .28s var(--ease),box-shadow .28s var(--ease),background .28s var(--ease)}
.mx-play:hover{transform:scale(1.1);box-shadow:0 0 18px rgba(26,47,251,.55)}
.mx-play:active{transform:scale(.92)}
.mx-play svg{width:14px;height:14px;grid-area:1/1}
.mx-play .mp-pause{display:none}
.mx-play .mp-play{margin-left:2px}
#music-pop.is-playing .mx-play .mp-play{display:none}
#music-pop.is-playing .mx-play .mp-pause{display:block}
.mx-time{font-family:var(--mono);font-size:9.5px;letter-spacing:.08em;color:rgba(255,255,255,.55);
  font-variant-numeric:tabular-nums;min-height:12px}

/* volume bar */
.mx-vol{display:flex;align-items:center;gap:10px;margin-top:10px;padding:8px 12px;border-radius:14px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.07);
  transition:background .3s var(--ease),border-color .3s var(--ease)}
.mx-vol:hover{background:rgba(255,255,255,.07);border-color:rgba(255,255,255,.11)}
.mx-mute{width:26px;height:26px;flex:0 0 auto;border:0;background:none;color:rgba(255,255,255,.6);cursor:pointer;
  display:grid;place-items:center;border-radius:8px;
  transition:color .25s var(--ease),transform .25s var(--ease)}
.mx-mute:hover{color:#fff;transform:scale(1.12)}
.mx-mute:active{transform:scale(.94)}
.mx-mute svg{width:16px;height:16px}
.mx-mute .mv-off{display:none}
.mx-vol.is-muted .mv-on{display:none}
.mx-vol.is-muted .mv-off{display:block}
.mx-vol.is-muted .mx-mute{color:var(--sp,#1a2ffb)}
/* item 2: a scale-meter volume — scroll (or drag) over a ticked ruler. */
.mx-vol-bar{position:relative;flex:1;height:26px;display:flex;align-items:center;cursor:ns-resize;
  touch-action:none;border-radius:6px}
.mx-vol-track{position:relative;width:100%;height:15px;border-radius:4px;overflow:hidden;
  background:rgba(255,255,255,.08);
  /* the scale: a tick every 10% */
  background-image:repeating-linear-gradient(90deg,
    rgba(255,255,255,.22) 0 1px,transparent 1px 10%)}
.mx-vol-fill{position:absolute;left:0;top:0;height:100%;border-radius:4px 0 0 4px;
  background:linear-gradient(90deg,var(--sp,#1a2ffb),var(--sp-lit,#9db1ff));
  /* segmented LED read across the meter */
  -webkit-mask:repeating-linear-gradient(90deg,#000 0 calc(10% - 2px),transparent calc(10% - 2px) 10%);
  mask:repeating-linear-gradient(90deg,#000 0 calc(10% - 2px),transparent calc(10% - 2px) 10%);
  transition:width .14s var(--ease),opacity .3s var(--ease)}
.mx-vol-knob{position:absolute;top:50%;left:0;width:3px;height:22px;border-radius:2px;background:#fff;
  transform:translate(-50%,-50%);box-shadow:0 0 8px rgba(93,116,255,.7),0 1px 4px rgba(0,0,0,.6);
  transition:left .14s var(--ease),transform .22s var(--ease),box-shadow .22s var(--ease)}
.mx-vol-bar:hover .mx-vol-knob,.mx-vol-bar.dragging .mx-vol-knob{
  transform:translate(-50%,-50%) scaleY(1.14);
  box-shadow:0 0 12px rgba(93,116,255,.9),0 1px 4px rgba(0,0,0,.6)}
.mx-vol-bar.dragging .mx-vol-fill{transition:opacity .3s var(--ease)}
.mx-vol.is-muted .mx-vol-fill{opacity:.3}
.mx-vol-val{font-family:var(--mono);font-size:9.5px;letter-spacing:.06em;color:rgba(255,255,255,.55);
  min-width:4ch;text-align:right;font-variant-numeric:tabular-nums;flex:0 0 auto}

/* foot: hint line + license line */
.mx-foot{display:flex;flex-direction:column;align-items:center;gap:3px;margin-top:10px;
  font-family:var(--mono);text-transform:uppercase}
.mx-hint{font-size:8.5px;letter-spacing:.08em;color:rgba(255,255,255,.42);white-space:nowrap}
.mx-lic{font-size:8.5px;letter-spacing:.1em;color:rgba(255,255,255,.3)}

@media (prefers-reduced-motion:reduce){
  #music-pop .mx-ico{animation:none!important}
  #music-pop.is-playing .mx-item.is-sel svg{animation:none!important;filter:drop-shadow(0 0 5px rgba(26,47,251,.8))}
  #music-pop.is-playing .mx-pointer{animation:none!important;filter:drop-shadow(0 0 9px rgba(26,47,251,.9))}
  .mx-pop{transform:none!important;transition:opacity .15s linear!important}
  .mx-item{transition:none!important}
  .mxp-fill{transition:none!important}
  .mx-close:hover,.mx-close:active{transform:none}
  .mx-vol-fill,.mx-vol-knob{transition:none!important}
}
