/* 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: 200px; height: 200px; display: block; border: 0; }
.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; }
}
