/* Site-wide player bar (radio.js). Uses tokens.css; no literal colours
   beyond the shadows the tokens don't carry. */
#adnb-radio { --radio-h: 60px; --radio-bottom: 0px; }
@media (max-width: 900px) {
  /* Above the mobile tab bar on scene pages; the landing page has none. */
  .tabbar ~ #adnb-radio { --radio-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* Idle: one small pill, so a visitor who never presses play gets nothing in the way. */
.radio-pill {
  position: fixed; right: 16px; bottom: calc(var(--radio-bottom) + 16px); z-index: 30;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: var(--glass-border); box-shadow: var(--shadow-1);
  color: var(--text); font: 600 var(--fs-sm, 14px)/1 inherit; cursor: pointer;
}
.radio-pill:hover { color: var(--accent); }
.radio-pill .radio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
#adnb-radio[data-state="idle"] .radio-bar,
#adnb-radio:not([data-state="idle"]) .radio-pill { display: none; }

.radio-bar {
  position: fixed; left: 0; right: 0; bottom: var(--radio-bottom); z-index: 30;
  height: var(--radio-h); padding: 0 12px;
  display: flex; align-items: center; gap: 12px;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
}
.radio-art { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); flex: none; }
.radio-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.radio-title { color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-artist { color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-artist:hover { color: var(--accent); }
.radio-ctl { display: flex; align-items: center; gap: 4px; flex: none; }
.radio-ctl button, .radio-tile-hide, .radio-close {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text); font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.radio-ctl button:hover, .radio-close:hover { background: var(--surface-2); }
.radio-ctl .radio-play { background: var(--accent); color: var(--accent-ink); }
.radio-ctl .radio-play:hover { background: var(--accent); filter: brightness(1.1); }
.radio-close { width: 32px; height: 32px; font-size: 16px; color: var(--muted); }
.radio-ctl button:focus-visible, .radio-pill:focus-visible, .radio-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* YouTube's terms: the player stays visible, at least 200x200, while it plays.
   For a YouTube Music art track that is simply the cover. */
.radio-tile {
  position: fixed; right: 12px; bottom: calc(var(--radio-bottom) + var(--radio-h) + 10px); z-index: 30;
  width: 200px; height: 200px; border-radius: var(--radius-lg); overflow: hidden;
  background: #000; box-shadow: var(--shadow-2); border: var(--glass-border);
}
.radio-tile[hidden] { display: none; }
.radio-tile iframe { width: 100%; height: 100%; display: block; border: 0; }
/* On the page's stage: sits exactly over the slot (radio.js sets the box). */
.radio-tile.on-stage { right: auto; bottom: auto; z-index: 20; border-radius: var(--radius-lg); box-shadow: none; }
.radio-tile.on-stage .radio-tile-hide { display: none; }
/* Only while moving between stage and corner; following a scroll is instant. */
@media (prefers-reduced-motion: no-preference) {
  .radio-tile.gliding { transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, border-radius .35s ease; }
}
.radio-tile-hide {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; font-size: 14px;
  background: rgba(0,0,0,.6); color: #fff;
}

/* Keep page content clear of the bar while it is up. */
body.radio-on { padding-bottom: var(--radio-h, 60px); }
body.radio-on .content { padding-bottom: calc(60px + var(--space-5, 24px)); }
@media (max-width: 900px) {
  body.radio-on .content { padding-bottom: calc(var(--tabbar-h) + 60px + var(--space-5, 24px)); }
}

@media (max-width: 520px) {
  .radio-bar { gap: 8px; padding: 0 8px; }
  .radio-prev { display: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .radio-bar, .radio-pill { transition: transform .2s ease; }
}

/* A page's stage slot ([data-radio-stage]) before anything plays on it:
   a poster with a play button. The player covers it once playing. */
.radio-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-lg);
  overflow: hidden; background: #000 center / cover no-repeat; display: block;
  border: 0; padding: 0; cursor: pointer; color: inherit; text-decoration: none;
}
.radio-stage::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,.05) 55%);
}
.radio-stage-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1;
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 28px; box-shadow: var(--shadow-2);
}
.radio-stage:hover .radio-stage-play { filter: brightness(1.1); }
.radio-stage-label {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1;
  color: #fff; font-weight: 700; font-size: 15px; text-align: left;
}
