/* ============================================================
   INSANE RADIO — COSMIC ICONOGRAPHY + SHARE + ACTIVE-STATION
   Additive, loaded LAST on insane-radio.html (after radio-glow.css)
   and on /music/index.html. Pure CSS overrides; every JS hook/ID/
   class preserved. Palette: cosmic teal (#2dd4bf/#00fff0) + amber
   (#fbbf24) + brand amber (#f59e0b) on near-black, with a single subtle
   teal accent only. No purple, indigo or violet.
   No external icon fonts, no hotlinks.
   ============================================================ */
:root{
  --psr-teal:#2dd4bf;
  --psr-teal-bright:#00fff0;
  --psr-amber:#fbbf24;
  --psr-coral:#f59e0b;
  --psr-teal-soft:rgba(0,255,240,.18); /* brand teal accent only */
  --psr-ink:#070a12;
  --psr-line:rgba(255,255,255,.1);
}

/* ---------- share buttons (injected by js/radio-share.js) ---------- */
.ps-share-wrap{display:inline-flex;align-items:center;margin-left:.4rem;flex:0 0 auto;}
.ps-share-btn{
  display:inline-flex;align-items:center;gap:.35rem;
  min-height:36px;min-width:36px;padding:.3rem .65rem;
  border-radius:999px;border:1px solid rgba(45,212,191,.4);
  background:rgba(13,27,42,.7);color:#99f6e4;
  font:inherit;font-size:.78rem;font-weight:700;letter-spacing:.02em;
  cursor:pointer;touch-action:manipulation;white-space:nowrap;
  transition:background .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease,transform .12s ease;
}
.ps-share-btn:hover{background:rgba(45,212,191,.18);border-color:var(--psr-teal);color:#fff;box-shadow:0 0 14px rgba(45,212,191,.35);transform:translateY(-1px);}
.ps-share-btn:active{transform:scale(.96);}
.ps-share-btn:focus-visible{outline:2px solid var(--psr-amber);outline-offset:2px;}
.ps-share-icon{display:inline-flex;width:15px;height:15px;flex:0 0 auto;color:var(--psr-teal-bright);}
.ps-share-icon svg{width:15px;height:15px;display:block;}
.ps-share-playlist{border-color:rgba(251,191,36,.45);color:#fde68a;background:rgba(251,191,36,.08);}
.ps-share-playlist:hover{background:rgba(251,191,36,.18);border-color:var(--psr-amber);box-shadow:0 0 14px rgba(251,191,36,.3);}
.ps-share-playlist .ps-share-icon{color:var(--psr-amber);}
.ps-share-on-card{margin-top:.5rem;align-self:flex-start;}
/* track rows: make play button + share button sit together */
.radio-upnext li, .radio-tracklist li{display:flex;align-items:center;gap:.35rem;}
.radio-upnext li > button, .radio-tracklist li > button{flex:1 1 auto;min-width:0;}
#playlist li{display:flex;align-items:center;gap:.4rem;}
#playlist li > button{flex:1 1 auto;min-width:0;}
.song-btn{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;}
.song-btn > button{flex:1 1 auto;min-width:0;}

/* ---------- toast ---------- */
.ps-share-toast{
  position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%) translateY(16px);
  max-width:min(420px,90vw);padding:.7rem 1.1rem;border-radius:999px;
  background:rgba(10,16,28,.95);border:1px solid rgba(45,212,191,.5);
  color:#e2e8f0;font-size:.88rem;font-weight:600;text-align:center;
  box-shadow:0 12px 32px rgba(0,0,0,.55),0 0 22px rgba(45,212,191,.25);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  opacity:0;pointer-events:none;z-index:999999;
  transition:opacity .25s ease,transform .25s ease;
}
.ps-share-toast.is-visible{opacity:1;transform:translateX(-50%) translateY(0);}

/* ---------- active station: pulsing ring + equalizer bars ---------- */
.station-play{position:relative;overflow:hidden;}
.station-play .ps-station-eq{
  position:absolute;top:.6rem;right:.6rem;width:26px;height:26px;
  color:var(--psr-amber);display:none;pointer-events:none;
  filter:drop-shadow(0 0 6px rgba(251,191,36,.6));
}
.station-play.is-active .ps-station-eq{display:block;}
.ps-eq-bars{width:100%;height:100%;display:block;}
.ps-eq-bar{transform-origin:center bottom;animation:ps-eq-dance 1s ease-in-out infinite;}
.ps-eq-b2{animation-delay:.18s;}
.ps-eq-b3{animation-delay:.36s;}
@keyframes ps-eq-dance{
  0%,100%{transform:scaleY(.55);}
  50%{transform:scaleY(1);}
}
@media (prefers-reduced-motion:reduce){.ps-eq-bar{animation:none;}}
/* pulsing ring around active station card */
.station-card:has(.station-play.is-active){position:relative;}
.station-card:has(.station-play.is-active)::after{
  content:"";position:absolute;inset:-2px;border-radius:24px;pointer-events:none;
  border:1.5px solid var(--psr-amber);opacity:.7;
  animation:ps-station-pulse 2.2s ease-out infinite;
}
@keyframes ps-station-pulse{
  0%{transform:scale(1);opacity:.7;}
  70%{transform:scale(1.025);opacity:0;}
  100%{transform:scale(1.025);opacity:0;}
}
@media (prefers-reduced-motion:reduce){.station-card:has(.station-play.is-active)::after{animation:none;opacity:.5;}}
/* "LIVE" badge on active station */
.station-play.is-active::before{
  content:"LIVE";position:absolute;top:.6rem;left:.6rem;z-index:2;
  font-size:.62rem;font-weight:800;letter-spacing:.14em;
  padding:.2rem .5rem;border-radius:999px;
  background:rgba(245,158,11,.18);border:1px solid rgba(245,158,11,.55);
  color:#f1f5f9;pointer-events:none;
}

/* ---------- radio transport controls: SVG icon + text ---------- */
.radio-controls{display:flex;align-items:center;justify-content:center;gap:.7rem;flex-wrap:wrap;}
#radio-play,#radio-prev,#radio-next{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;}
#radio-play .psr-ic,#radio-prev .psr-ic,#radio-next .psr-ic{width:18px;height:18px;display:inline-flex;flex:0 0 auto;}
#radio-play .psr-ic svg,#radio-prev .psr-ic svg,#radio-next .psr-ic svg{width:18px;height:18px;display:block;}
#radio-prev .psr-ic,#radio-next .psr-ic{color:var(--psr-teal-bright);}
#radio-play .psr-ic{color:#1a0e05;}

/* ---------- station volume control (injected) ---------- */
.ps-station-volume{
  display:flex;align-items:center;gap:.5rem;justify-content:center;
  margin-top:.6rem;padding:.5rem .8rem;border-radius:999px;
  background:rgba(13,27,42,.6);border:1px solid var(--psr-line);
  width:fit-content;margin-left:auto;margin-right:auto;
}
.ps-station-volume .psr-ic{width:18px;height:18px;color:var(--psr-teal);display:inline-flex;flex:0 0 auto;}
.ps-station-volume .psr-ic svg{width:18px;height:18px;display:block;}
.ps-station-volume input[type=range]{
  -webkit-appearance:none;appearance:none;width:120px;height:4px;border-radius:2px;
  background:rgba(148,163,184,.3);cursor:pointer;padding:0;margin:0;
}
.ps-station-volume input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:14px;height:14px;border-radius:50%;
  background:var(--psr-amber);border:2px solid #0f172a;box-shadow:0 0 6px rgba(251,191,36,.55);cursor:pointer;
}
.ps-station-volume input[type=range]::-moz-range-thumb{
  width:14px;height:14px;border-radius:50%;background:var(--psr-amber);
  border:2px solid #0f172a;box-shadow:0 0 6px rgba(251,191,36,.55);cursor:pointer;
}
.ps-station-volume input[type=range]:focus-visible{outline:2px solid var(--psr-teal);outline-offset:3px;border-radius:2px;}
.ps-station-volume .ps-station-vol-label{font-size:.72rem;color:#94a3b8;font-weight:700;min-width:32px;text-align:right;}

/* ---------- now-playing glow enhancement (subtle teal rim) ---------- */
.radio-card.is-playing{border-color:rgba(45,212,191,.5) !important;}
.radio-card.is-playing::after{
  content:"";position:absolute;inset:0;pointer-events:none;border-radius:28px;
  box-shadow:inset 0 0 0 1px var(--psr-teal-soft);
}

/* ---------- mobile polish ---------- */
@media (max-width:480px){
  .ps-share-label{display:none;} /* icon-only on narrow screens to save width */
  .ps-share-btn{padding:.35rem;min-width:38px;min-height:38px;justify-content:center;}
  .ps-share-on-card .ps-share-label{display:inline;} /* on cards keep label */
  .station-play .ps-station-eq{width:22px;height:22px;top:.5rem;right:.5rem;}
  .station-play.is-active::before{font-size:.58rem;padding:.15rem .4rem;}
}
@media (prefers-reduced-motion:reduce){
  .ps-share-btn,.station-play::before{transition:none;}
}
