/* ============================================================
   Guilliman's Radio — design system (2026)
   Airy dark UI · muted chartreuse accent · Inter
   Blocks are separated by surface tone and whitespace, not
   borders. The accent is reserved for the primary action and
   the playing state; active segments are light pills.
   ============================================================ */

:root {
  /* surfaces — three levels */
  --bg: #0b0b0d;
  --surface: #131316;
  --surface-2: #1b1b21;
  --surface-3: #24242b;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);

  /* text */
  --text: #edece8;
  --muted: #a2a2ab;
  --dim: #7c7c86;

  /* accent — muted chartreuse, used sparingly */
  --accent: #b5d168;
  --accent-ink: #161d06;
  --accent-soft: rgba(181, 209, 104, .09);
  --live: #6fce8b;
  --red: #e5675f;

  /* shape & motion */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 16px;
  --r-xl: 22px;
  --control-h: 36px;
  --dur: .18s;
  --dur-fast: .13s;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --content: 1180px;
}

/* ------------------------------------------------- base --- */

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ambient tint, kept quiet */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 90% -10%, rgba(181, 209, 104, .055), transparent 60%),
    radial-gradient(45% 35% at -5% 0%, rgba(96, 122, 255, .05), transparent 55%),
    var(--bg);
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------- topbar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(16px, calc((100vw - var(--content)) / 2 + 32px));
  background: rgba(11, 11, 13, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.brand__eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}
.brand__eq i {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  animation: eq 1.15s var(--ease) infinite;
}
.brand__eq i:nth-child(2) { animation-delay: .18s; }
.brand__eq i:nth-child(3) { animation-delay: .36s; }
.brand__eq i:nth-child(4) { animation-delay: .52s; }

@keyframes eq {
  0%, 100% { height: 5px; }
  35% { height: 14px; }
  60% { height: 8px; }
}

.brand__name { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.brand__name-acc { color: var(--accent); }

/* -------------------------------------------------- main --- */

main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 32px) 150px;
}
main, .topbar, .footer { position: relative; z-index: 1; }

/* ----------------------------------------------- pagehead --- */

.pagehead { margin-bottom: 20px; }

.pagehead h1 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.2;
}

.stats {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  transition: opacity var(--dur) var(--ease);
}
.stats b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats[aria-busy="true"] { opacity: .45; }

/* ------------------------------------------- sources --- */

.sources {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 16px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.source {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.source:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.source:has(input:checked) {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.source:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.source input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.source__name { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }

/* ------------------------------------------- generator --- */

.ctl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--r-l);
  background: var(--surface);
}

/* segmented quality switch */
.kinds {
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.kind {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.kind:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.kind:has(input:checked) {
  background: rgba(255, 255, 255, .1);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.kind input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.kind__key { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.kind__hint { font-size: 11.5px; font-weight: 500; color: var(--dim); }
.kind:has(input:checked) .kind__hint { color: var(--muted); }

.ctl__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
}

.ctl__field { display: flex; }

.ctl__end {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 14px;
  min-width: 0;
}

.ctl__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ctl__status { margin-left: 0; }

.panel__status {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}
.panel__status.is-busy::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
  animation: blink 1s var(--ease) infinite;
}
.panel__status.is-ok:empty { display: none; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ------------------------------------------------- form --- */

select {
  appearance: none;
  height: var(--control-h);
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2383838c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur), background-color var(--dur);
}
select:hover { border-color: var(--line-strong); }
select:focus-visible { border-color: var(--accent); outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), opacity var(--dur);
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover:not(:disabled) { background: #c4dd7e; border-color: transparent; }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .05); color: var(--text); }

/* search — borderless until focus */
.search {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  width: 15px;
  height: 15px;
  color: var(--dim);
  pointer-events: none;
  transition: color var(--dur);
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 37px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--dur), background var(--dur);
}
.search input::placeholder { color: var(--dim); }
.search:hover input { background: rgba(255, 255, 255, .04); }
.search input:focus {
  background: rgba(255, 255, 255, .05);
  border-color: var(--accent);
}
.search:focus-within svg { color: var(--muted); }

/* ----------------------------------------------- toolbar --- */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}

.count {
  margin-left: auto;
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rbonly {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rbonly select { min-width: 150px; }

/* ------------------------------------------ station table --- */

.stations { margin-top: 2px; }

.tablehead,
.card {
  display: grid;
  grid-template-columns: 36px minmax(190px, 1.25fr) 140px minmax(0, 1.05fr) 76px 56px;
  grid-template-areas: "num name genre now listeners actions";
  align-items: center;
  column-gap: 14px;
}

/* sticky column headers */
.tablehead {
  position: sticky;
  top: 40px;
  z-index: 10;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.th {
  color: var(--dim);
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
button.th {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
button.th:hover { color: var(--muted); }
button.th:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.th[aria-pressed="true"] { color: var(--text); }
.th--listeners { text-align: right; }
button.th--listeners { justify-content: flex-end; }
.th__arrow { display: none; font-size: 8px; line-height: 1; color: var(--muted); }
button.th[aria-pressed="true"] .th__arrow { display: inline-block; }
button.th[data-dir="asc"] .th__arrow::before { content: '▲'; }
button.th[data-dir="desc"] .th__arrow::before { content: '▼'; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

/* rows — no borders, separated by air and a soft hover */
.card {
  padding: 8px 16px;
  border-radius: var(--r-m);
  background: transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.card:hover { background: rgba(255, 255, 255, .035); }
.card.is-playing {
  background: linear-gradient(90deg, var(--accent-soft), rgba(181, 209, 104, .02) 70%);
}
.card__main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: var(--r-m);
}

.card__main { display: contents; }

/* cells */
.card__num {
  grid-area: num;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* equalizer replaces the number on the playing row */
.card__eq {
  grid-area: num;
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.card.is-live .card__eq { display: inline-flex; }
.card.is-live .card__num { display: none; }
.card__eq i {
  width: 2.5px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  animation: eqbar 1s var(--ease) infinite;
}
.card__eq i:nth-child(2) { animation-delay: .2s; }
.card__eq i:nth-child(3) { animation-delay: .4s; }

@keyframes eqbar {
  0%, 100% { height: 3px; }
  40% { height: 11px; }
}

.card__name {
  grid-area: name;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.card__actions {
  grid-area: actions;
  justify-self: center;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.card__info,
.card__fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast), transform .12s var(--ease);
}
.card__info:hover,
.card__fav:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.card__info:focus-visible,
.card__fav:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card__fav:active { transform: scale(.9); }
.card__info svg { width: 15px; height: 15px; }
.card__fav svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.card__fav[aria-pressed="true"] { color: var(--accent); }
.card__fav[aria-pressed="true"] svg { fill: currentColor; }

/* cover art — the hero element of a music service */
.card__thumb {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* play button floats over the cover on hover */
.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: rgba(10, 10, 12, .55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.card:hover .card__play,
.card:focus-within .card__play { opacity: 1; }
.card__play svg { width: 20px; height: 20px; fill: currentColor; }
.card__play .i-pause { display: none; }
.card.is-live .card__play .i-play { display: none; }
.card.is-live .card__play .i-pause { display: block; }

.card__initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(135deg, #1d1d24, #141417);
}

.card__title {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* genre — quiet tag on a translucent chip, no border */
.card__genre {
  grid-area: genre;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__now {
  grid-area: now;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
}
.card.is-playing .card__now { color: var(--text); }

.card__listeners {
  grid-area: listeners;
  justify-self: end;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* skeletons */
.skel {
  border-radius: 3px;
  background: linear-gradient(90deg, #17171c, #222229, #17171c);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.card--skeleton { pointer-events: none; }
.skel--num { width: 22px; height: 11px; }
.card__thumb.skel--thumb { width: 56px; height: 56px; border-radius: 10px; }
.skel--title { width: min(170px, 70%); height: 13px; }
.skel--genre { width: 70px; height: 11px; }
.skel--now { width: min(150px, 80%); height: 11px; }
.skel--listeners { width: 34px; height: 11px; justify-self: end; }

/* ------------------------------------------------- notice --- */

.notice {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--surface);
  font-size: 13.5px;
}
.notice b { font-weight: 600; }
.notice span { color: var(--muted); }
.notice--error { border-color: rgba(229, 103, 95, .35); }
.notice--error b { color: var(--red); }
.notice .btn { margin-top: 6px; }

/* empty state */
#emptyBox {
  justify-items: center;
  text-align: center;
  padding: 56px 18px;
  border-style: dashed;
  border-color: var(--line-strong);
}
#emptyBox b { font-size: 15px; }
#emptyBox span { max-width: 420px; line-height: 1.55; }
.emptybox__icon { width: 26px; height: 26px; color: var(--dim); margin-bottom: 10px; }

/* ------------------------------------------------- footer --- */

.footer {
  max-width: var(--content);
  margin: 0 auto;
  padding: 18px max(16px, calc((100vw - var(--content)) / 2 + 32px)) 150px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12.5px;
}
.footer p { margin: 0; line-height: 1.55; }
.footer p + p { margin-top: 6px; }
.footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer a:hover { color: #c4dd7e; }

/* ------------------------------------------------- player --- */

.player {
  position: fixed;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  max-width: min(860px, calc(100vw - 24px));
  padding: 12px 20px 12px 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-xl);
  background: rgba(19, 19, 23, .72);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .7);
}

.player__station {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#playerLogo {
  width: 48px;
  height: 48px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
}
body.is-playing #playerLogo {
  border-color: rgba(181, 209, 104, .45);
  animation: breath 2.8s ease-in-out infinite;
}

@keyframes breath {
  0%, 100% { box-shadow: 0 0 0 2px rgba(181, 209, 104, .14); }
  50% { box-shadow: 0 0 0 5px rgba(181, 209, 104, .04); }
}

.player__fallback {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #202027, #131317);
  color: var(--accent);
  font-size: 22px;
}

.player__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  width: 210px;
}
.player__text b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.player__text span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--muted);
  font-size: 12.5px;
}
body.is-playing .player__text span { color: var(--text); }

.player__controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iconbtn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: color var(--dur-fast), background var(--dur-fast), transform .15s var(--ease);
}
.iconbtn:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, .06); }
.iconbtn:active:not(:disabled) { transform: scale(.92); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn svg { width: 18px; height: 18px; fill: currentColor; }

.iconbtn--main {
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 22px -8px rgba(181, 209, 104, .5);
}
.iconbtn--main:hover:not(:disabled) { background: #c4dd7e; color: var(--accent-ink); }

.i-pause { display: none; }
body.is-playing .i-play { display: none; }
body.is-playing .i-pause { display: block; }

.i-mute { display: none; }
body.is-muted .i-vol { display: none; }
body.is-muted .i-mute { display: block; }
body.is-muted #mute { color: var(--text); }

/* star in the player — filled once the station is a favorite */
#playerFav svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
#playerFav[aria-pressed="true"] { color: var(--accent); }
#playerFav[aria-pressed="true"] svg { fill: currentColor; }

.player__side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player__format {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* equalizer — wakes up while playing */
.player__eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  flex: none;
  padding: 0 2px;
}
.player__eq i {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-strong);
  transition: background .35s var(--ease);
}
body.is-playing .player__eq i {
  background: var(--accent);
  animation: eqwave 1.05s var(--ease) infinite;
}
body.is-playing .player__eq i:nth-child(2) { animation-delay: .18s; }
body.is-playing .player__eq i:nth-child(3) { animation-delay: .36s; }
body.is-playing .player__eq i:nth-child(4) { animation-delay: .54s; }

@keyframes eqwave {
  0%, 100% { height: 4px; }
  35% { height: 16px; }
  60% { height: 9px; }
}

#volume {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
#volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55);
  transition: transform .15s var(--ease);
}
#volume:active::-webkit-slider-thumb { transform: scale(1.25); }
#volume::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
}
#volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}

/* -------------------------------------------------- toast --- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  translate: -50% 8px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(26, 26, 32, .94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .65);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), translate .25s var(--ease);
}
.toast.is-visible { opacity: 1; translate: -50% 0; }
.toast.is-error {
  border-color: rgba(229, 103, 95, .45);
  background: rgba(52, 19, 20, .94);
}

/* ------------------------------------------- station card --- */

.station-detail {
  width: min(520px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  padding: 24px;
  border: 0;
  border-radius: var(--r-l);
  background: var(--surface);
  color: var(--text);
  overflow: auto;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65);
}
.station-detail::backdrop {
  background: rgba(8, 8, 10, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.station-detail[open] { animation: dialog-pop .2s var(--ease); }
@keyframes dialog-pop {
  from { opacity: 0; translate: 0 8px; scale: .98; }
  to   { opacity: 1; translate: 0 0; scale: 1; }
}

.station-detail__head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.station-detail__logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.station-detail__logo img { width: 100%; height: 100%; object-fit: cover; }
.station-detail__logo span { color: var(--muted); font-size: 22px; }
.station-detail__titles { flex: 1; min-width: 0; }
.station-detail__titles h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.station-detail__titles p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.station-detail__close { margin-left: auto; }

.station-detail__rows {
  display: grid;
  margin: 16px 0 0;
}
.station-detail__row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.station-detail__row:last-child { border-bottom: 0; }
.station-detail__row dt {
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-top: 2px;
}
.station-detail__row dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.station-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.station-detail__actions .btn { border-radius: 10px; }
.station-detail__actions a.btn { text-decoration: none; }

/* ---------------------------------------------- responsive --- */

@media (max-width: 1099px) {
  .tablehead,
  .card {
    grid-template-columns: 36px minmax(170px, 1.4fr) 130px 76px 56px;
    grid-template-areas: "num name genre listeners actions";
  }
  .card__now,
  .skel--now { display: none; }
}

@media (max-width: 899px) {
  .tablehead,
  .card {
    grid-template-columns: 36px minmax(140px, 1fr) 110px 76px 56px;
    grid-template-areas: "num name genre listeners actions";
  }
  .card__now,
  .skel--now { display: none; }
  .ctl__end { justify-content: space-between; }
  .count { margin-left: 0; }
}

@media (max-width: 599px) {
  main { padding-bottom: 170px; }

  /* the table becomes a stack of station cards */
  .tablehead { display: none; }
  .card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb title actions"
      "thumb now   actions";
    row-gap: 1px;
    padding: 10px 12px;
  }
  .card__name { display: contents; }
  .card__thumb { grid-area: thumb; width: 52px; height: 52px; }
  .card__title { grid-area: title; }
  .card__now { grid-area: now; }
  .card__actions { grid-area: actions; }
  .card__num, .card__eq, .card__genre, .card__listeners,
  .skel--num, .skel--genre, .skel--now, .skel--listeners { display: none; }

  /* generator — compact single column */
  .ctl { gap: 10px 12px; padding: 14px 14px; }
  .kinds { width: 100%; }
  .kind { flex: 1; padding: 0 8px; }

  /* source picker + radio-browser filters go full width */
  .sources { display: flex; width: 100%; }
  .source { flex: 1; justify-content: center; padding: 7px 8px; }
  .rbonly { width: 100%; }
  .rbonly select { flex: 1 1 0; min-width: 0; }
  .ctl__field,
  .ctl__field select { width: 100%; }
  .ctl__end { flex-direction: column; align-items: stretch; gap: 10px; }
  .ctl__status { text-align: center; }
  .ctl__actions { width: 100%; }
  .ctl__actions .btn { flex: 1; }

  /* pagehead on phones — deterministic stack */
  .pagehead { margin-bottom: 16px; }

  /* player — docked bottom sheet */
  .player {
    left: 0;
    right: 0;
    bottom: 0;
    translate: none;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 'station side' 'controls controls';
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    width: 100%;
    max-width: none;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--line-strong);
    background: rgba(15, 15, 18, .92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: none;
  }
  .player__station { grid-area: station; min-width: 0; gap: 10px; }
  .player__text { flex: 1; width: auto; min-width: 0; }
  .player__text b { font-size: 14px; }
  .player__text span { font-size: 12px; }
  .player__eq { display: none; }
  .player__controls { grid-area: controls; justify-self: center; gap: 8px; }
  .player__side { grid-area: side; justify-self: end; gap: 6px; }
  #volume { width: 72px; }
  .player__format { display: none; }
  #playerLogo,
  .player__fallback { width: 40px; height: 40px; }
  .iconbtn--main { width: 46px; height: 46px; }
  .toast { bottom: 176px; }
  .footer { padding-bottom: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
