/* 📻 Pet Detective Radio: a small player in the bottom-right corner of every page */
.radio { position: fixed; right: max(12px, var(--m)); bottom: 16px; z-index: 60; font-family: "Jost", system-ui, sans-serif; color: var(--ink); }
.radio-tab {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 14px; margin-left: auto;
  border: 2px solid var(--accent); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--step-small); cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.radio-tab:hover { background: var(--bg); }
.radio.is-open .radio-tab { display: none; }
.radio-eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.radio-eq i { width: 4px; height: 6px; border-radius: 2px; background: var(--accent); }
.radio.is-playing .radio-eq i { animation: radioeq .9s ease-in-out infinite alternate; }
.radio.is-playing .radio-eq i:nth-child(2) { animation-delay: .3s; }
.radio.is-playing .radio-eq i:nth-child(3) { animation-delay: .6s; }
@keyframes radioeq { to { height: 16px; } }

.radio-card {
  width: min(340px, calc(100vw - 24px)); padding: 14px; border-radius: 22px;
  background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px 14px; align-items: center;
}
.radio-card[hidden] { display: none; }
.radio-cover { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; }
.radio.is-playing .radio-cover { animation: radiobop 1.2s ease-in-out infinite alternate; }
@keyframes radiobop { to { transform: rotate(-3deg) scale(1.04); } }
.radio-station { font-size: var(--step-small); color: var(--accent); font-weight: 600; }
.radio-title { font-weight: 700; line-height: 1.2; }
.radio-count { font-size: var(--step-small); }
.radio-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: #ffffff22; overflow: hidden; }
.radio-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.radio-ctl { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 6px; }
.radio-ctl button {
  flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: #ffffff14; color: var(--ink);
  font-size: 18px; cursor: pointer;
}
.radio-ctl button:hover { background: #ffffff26; }
.radio-ctl .radio-play { background: var(--accent); color: var(--accent-ink); flex: 1.4; }
.radio-ctl [aria-pressed="true"] { background: var(--accent-2); color: var(--accent-ink); }
.radio :focus-visible { outline-offset: 2px; }
/* out of the way while a game is on (the music keeps playing) */
html.gm-open .radio { display: none; }
@media (prefers-reduced-motion: reduce) {
  .radio.is-playing .radio-eq i, .radio.is-playing .radio-cover { animation: none; }
}
@media print { .radio { display: none; } }
