/* =====================================================================
   Radio - station directory + now-playing bar
   ===================================================================== */
.app-radio { background: var(--surface); }
.rd-split { min-height: 0; }
.rd-side { width: 216px; }
.rd-side .rd-quick { gap: 9px; }
.rd-side .rd-quick .rd-logo { border-radius: 6px; }
.rd-credit { margin-top: auto; padding: 14px 10px 4px; font-size: 11.5px; line-height: 1.4; color: var(--text-3); }
.rd-credit a { color: var(--text-2); }

.rd-main { min-width: 0; }
.rd-toolbar { gap: 8px; padding: 0 12px 0 14px; }
.rd-title { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rd-back { flex: 0 0 auto; margin-left: -6px; }
.rd-search { flex: 0 1 260px; min-width: 120px; }
.rd-search .input { height: 34px; }
.rd-tabs { display: none; }

.rd-content { flex: 1; min-height: 0; padding: 14px 16px 20px; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rd-subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 10px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.rd-banner {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 9px 12px; border-radius: 12px;
  background: rgba(var(--accent-rgb), .1); color: var(--text-2); font-size: 12.5px; line-height: 1.35;
}
.rd-banner .ic { color: var(--accent); }

/* station card */
.rd-card {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 8px 10px 10px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: background .12s, box-shadow .12s, transform .1s;
}
.rd-card:hover { background: var(--tile-hover); }
.rd-card:active { transform: scale(.99); }
.rd-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-card.on { box-shadow: inset 0 0 0 2px var(--accent); background: rgba(var(--accent-rgb), .08); }
.rd-card.insecure .rd-card-art { opacity: .55; }
.rd-card-art { position: relative; flex: 0 0 auto; }
.rd-card-play {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; color: #fff;
  background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .12s;
}
.rd-card:hover .rd-card-play, .rd-card:focus-visible .rd-card-play { opacity: 1; }
.rd-card.live .rd-card-play { opacity: 0; }
.rd-card.live:hover .rd-card-play { opacity: 1; }
.rd-card-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-card-txt b { font-size: 13.5px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.rd-card-txt small { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-card-q { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.rd-card-q .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }
.rd-warn { background: rgba(229, 72, 77, .14) !important; color: #e5484d !important; }
.rd-card-fav { flex: 0 0 auto; align-self: flex-start; width: 30px; height: 30px; color: var(--text-3); opacity: 0; transition: opacity .12s, color .12s; }
.rd-card:hover .rd-card-fav, .rd-card-fav:focus-visible, .rd-card-fav.on { opacity: 1; }
.rd-card-fav.on { color: #ec4899; }
.rd-card-fav.on .ic, .rd-fav.on .ic { fill: currentColor; }
@media (hover: none) { .rd-card-fav { opacity: 1; } }

/* logo: favicon over initials */
.rd-logo {
  position: relative; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.rd-logo b { font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.rd-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; opacity: 0; transition: opacity .2s; }
.rd-logo.has-img img { opacity: 1; }
.rd-logo.has-img b { visibility: hidden; }

/* animated equaliser (shows while live) */
.rd-eq { position: absolute; right: -4px; bottom: -4px; display: none; align-items: flex-end; gap: 2px; height: 18px; padding: 3px 4px; border-radius: 7px; background: var(--accent); }
.rd-eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent-fg); transform-origin: bottom; animation: rd-eq .9s ease-in-out infinite; }
.rd-eq i:nth-child(2) { animation-delay: -.3s; }
.rd-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes rd-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.rd-card.live .rd-eq, .rd-np.live .rd-eq { display: flex; }
.reduce-motion .rd-eq i { animation: none; transform: scaleY(.7); }

/* skeleton */
.rd-loading { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rd-skel { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.rd-skel i { width: 52px; height: 52px; border-radius: 12px; background: var(--surface-3); }
.rd-skel span { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.rd-skel b, .rd-skel small { display: block; height: 10px; border-radius: 5px; background: var(--surface-3); }
.rd-skel b { width: 70%; }
.rd-skel small { width: 45%; }
.rd-skel { animation: rd-pulse 1.2s ease-in-out infinite; }
@keyframes rd-pulse { 50% { opacity: .55; } }
.rd-center { display: grid; place-items: center; padding: 60px 0; }

.rd-empty { min-height: 300px; }
.rd-empty-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.rd-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* countries */
.rd-filterbar { position: sticky; top: -14px; z-index: 1; margin: -14px -16px 12px; padding: 12px 16px 10px; background: var(--surface); }
.rd-filter { max-width: 320px; }
.rd-countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.rd-country {
  display: flex; align-items: center; gap: 10px; min-width: 0; height: 44px; padding: 0 12px 0 8px; border: 0; border-radius: 11px;
  background: var(--surface-2); color: var(--text); text-align: left; box-shadow: inset 0 0 0 1px var(--line);
}
.rd-country:hover { background: var(--tile-hover); }
.rd-cc { flex: 0 0 auto; width: 32px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(var(--accent-rgb), .14); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.rd-country-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-country small { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rd-none { padding: 20px 4px; }

/* genres */
.rd-tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rd-tag {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-height: 64px; padding: 10px 12px; border: 0; border-radius: 14px;
  color: #fff; text-align: left; overflow: hidden;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: transform .12s, filter .12s;
}
.rd-tag:hover { filter: brightness(1.08) saturate(1.1); }
.rd-tag:active { transform: scale(.98); }
.rd-tag.big { grid-column: span 2; min-height: 92px; }
.rd-tag b { font-size: 15px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.rd-tag.big b { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.rd-tag small { font-size: 11.5px; font-weight: 600; opacity: .88; }

/* search */
.rd-searchform { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rd-searchform .select { width: auto; min-width: 160px; max-width: 260px; }

/* now-playing bar */
.rd-bar {
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; height: 72px; padding: 0 16px 0 12px;
  background: var(--surface-2); border-top: 1px solid var(--line); position: relative; overflow: hidden;
}
.rd-bar::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background: radial-gradient(120% 160% at 0% 50%, var(--a, transparent), transparent 55%);
}
.rd-bar.empty::before { display: none; }
.rd-bar-empty { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; font-weight: 600; }
.rd-np { position: relative; min-width: 0; display: flex; align-items: center; gap: 12px; }
.rd-np-art { position: relative; flex: 0 0 auto; }
.rd-np-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-np-txt b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-np-txt small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
.rd-np-txt small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-np-txt small.rd-bad { color: #e5484d; white-space: normal; }
.rd-np-txt small.rd-bad span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rd-dot { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .22); flex: 0 0 auto; animation: rd-live 1.6s ease-in-out infinite; }
@keyframes rd-live { 50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, .08); } }
.rd-mini-spin { width: 12px; height: 12px; border-width: 2px; flex: 0 0 auto; }
.rd-ctl { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.rd-playbtn {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; margin: 0 4px;
  background: var(--text); color: var(--surface); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .5); transition: transform .1s;
}
.rd-playbtn:hover { transform: scale(1.05); }
.rd-playbtn:active { transform: scale(.96); }
.rd-playbtn .spinner { border-color: rgba(127, 127, 127, .35); border-top-color: var(--surface); }
.rd-fav.on { color: #ec4899; }
.rd-volwrap { position: relative; justify-self: end; width: 100%; max-width: 190px; min-width: 110px; display: flex; align-items: center; gap: 6px; }
.rd-bar.empty { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- narrow / phone ---------- */
.win .app-radio { container-type: inline-size; }
@container (max-width: 700px) {
  .rd-side { display: none; }
  .rd-tabs { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: var(--surface); flex: 0 0 auto; }
  .rd-tabs::-webkit-scrollbar { display: none; }
  .rd-search { flex-basis: 200px; }
  .rd-volwrap { display: none; }
  .rd-ctl .icon-btn:not(.rd-fav) { display: none; }
  .rd-bar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 10px; }
  .rd-grid, .rd-loading { grid-template-columns: 1fr; gap: 8px; }
  .rd-card-fav { opacity: 1; }
  .rd-tag.big { grid-column: span 1; }
  .rd-countries { grid-template-columns: 1fr 1fr; }
}
@container (max-width: 440px) {
  .rd-title { display: none; }
  .rd-search { flex: 1 1 auto; }
  .rd-countries { grid-template-columns: 1fr; }
  .rd-tags { grid-template-columns: 1fr 1fr; }
  .rd-searchform .select { flex: 1 1 140px; min-width: 0; }
}
[data-layout="mobile"] .app-radio .rd-bar { height: 76px; padding-bottom: 6px; }
