/* Receiver web — palette from the app icon: #f46b45 → #7b2ff7, plum ink. */
:root {
  --bg: #fbf8f6;
  --card: #ffffff;
  --ink: #2a2138;
  --muted: #71667f;
  --line: #e7e0ee;
  --accent: #7b2ff7;
  --warm: #f46b45;
  --brand-gradient: linear-gradient(90deg, var(--warm), var(--accent));
  --tick: #cfc5dc;
  --tick-strip: repeating-linear-gradient(
    90deg,
    var(--tick) 0 2px,
    transparent 2px 14px
  );
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17121f;
    --card: #221b2e;
    --ink: #ede8f4;
    --muted: #a397b4;
    --line: #352b44;
    --tick: #4b3f5e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; font-weight: 800; }
h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2.2rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
/* Signature: section titles sit on a tuning-dial tick strip. */
h2::after {
  content: "";
  flex: 1;
  height: 10px;
  background: var(--tick-strip);
}
h2 .more { font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
small, .card-meta, .station-meta, .player-status {
  font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
}

main { max-width: 64rem; margin: 0 auto; padding: 0 1rem 3rem; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.7rem 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: var(--ink);
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.header-search { flex: 1; min-width: 10rem; }
.site-header nav { display: flex; gap: 1rem; font-weight: 500; }

input[type="search"] {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
input[type="search"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

/* Hero */
.hero { text-align: center; padding: 2.5rem 0 1rem; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 0 0 0.3rem;
  background: var(--brand-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); margin: 0 0 1.4rem; }
.hero input[type="search"] {
  max-width: 34rem;
  padding: 0.8rem 1.2rem;
  font-size: 1.05rem;
}
#results { text-align: left; margin-top: 1rem; }

/* Station cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}
.card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  min-width: 0;
}
.card:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.card-body { min-width: 0; display: block; }
.card-name {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta, .card-tags {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-tags { font-size: 0.78rem; color: var(--muted); }

.logo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}
.logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand-gradient);
}

.fav-btn {
  margin-left: auto;
  flex-shrink: 0;
  border: 0;
  background: none;
  color: var(--tick);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.3rem;
}
.fav-btn:hover, .fav-btn.fav-active { color: var(--warm); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9rem;
}
.chip small { margin-left: 0.25rem; }
.chip:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

/* Country list */
.country-list {
  columns: 14rem;
  padding: 0;
  list-style: none;
}
.country-list li { padding: 0.2rem 0; break-inside: avoid; }

/* Station page */
.station-head {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.station-head .logo { width: 128px; height: 128px; border-radius: 16px; }
.station-head .logo-fallback { font-size: 3rem; }
.station-head h1 { margin: 0 0 0.2rem; }
.station-meta { margin: 0 0 0.6rem; }
.station-actions { display: flex; gap: 0.6rem; align-items: center; margin: 0; }
.station-actions .fav-btn { margin-left: 0; font-size: 0.9rem; }
.station-actions button,
.station-actions a {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}

/* Player: the play button is the tuning knob. */
.player {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--brand-gradient) border-box;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s;
}
.play-btn:hover { transform: scale(1.06); }
.player-unavailable {
  display: block;
  border-left: 4px solid var(--warm);
}
.player-unavailable p { margin: 0.3rem 0; }

/* Persistent bottom player bar (survives navigation). */
#player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem max(1rem, calc(50vw - 32rem));
  background: var(--card);
  border-top: 1px solid var(--line);
}
body:has(#player-bar:not([hidden])) { padding-bottom: 4.5rem; }
#player-bar .logo { width: 48px; height: 48px; }
#player-bar .logo-fallback { font-size: 1.2rem; }
.pb-info { min-width: 0; display: flex; flex-direction: column; flex: 1; }
#pb-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-btn-small { width: 44px; height: 44px; font-size: 1rem; }

.more-link { font-weight: 600; }
.empty { color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .play-btn { transition: none; }
}
@media (max-width: 480px) {
  .site-header nav { order: 2; }
  .header-search { order: 3; flex-basis: 100%; }
}
