:root {
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --muted: #8a8a8a;
  --line: #262626;
  --live: #ff3b30;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
}
[hidden] { display: none !important; }
a { color: inherit; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.station { font-weight: 700; font-size: 16px; }
.links { display: flex; gap: 20px; margin-left: auto; margin-right: 24px; }
.links a { text-decoration: none; color: var(--muted); }
.links a:hover { color: var(--fg); }
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); }

.badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.badge i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.badge[data-live="true"] { color: var(--fg); }
.badge[data-live="true"] i { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.layout {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 380px);
  height: min(78vh, 720px);
  min-height: 460px;
  border-bottom: 1px solid var(--line);
}

.player {
  padding: clamp(24px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.label { margin: 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.title {
  margin: 0;
  font-size: clamp(36px, 7vw, 96px);
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.meta { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.now { display: flex; gap: clamp(16px, 3vw, 36px); align-items: flex-end; }
.now-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.art { position: relative; width: clamp(96px, 16vw, 200px); aspect-ratio: 1; flex: none; background: #1a1a1a center/cover no-repeat; }
.description { margin: 0; max-width: 60ch; color: #cfcfcf; line-height: 1.5; white-space: pre-line; }

.controls { display: flex; align-items: center; gap: 24px; margin-top: 28px; }
.play {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 2px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
}
.play:hover:not(:disabled) { transform: scale(1.05); }
.play:disabled { opacity: .2; cursor: not-allowed; }
.play svg { width: 34px; height: 34px; fill: currentColor; }
.play .icon-stop, .play.playing .icon-play { display: none; }
.play.playing .icon-stop { display: block; }

.volume { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.volume input { accent-color: var(--fg); width: 120px; }

.chat {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-head {
  display: flex; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
}
.muted { color: var(--muted); }
.messages {
  list-style: none; margin: 0; padding: 14px 18px;
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; line-height: 1.4;
}
.messages .nick { font-weight: 700; margin-right: 6px; }
.messages .time { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-right: 6px; }
.messages .text { overflow-wrap: anywhere; }

.chat-form { display: flex; border-top: 1px solid var(--line); }
.chat-form input, .chat-form button {
  font: inherit; font-size: 14px;
  background: transparent; color: var(--fg);
  border: 0; padding: 14px 12px; outline: none;
}
.chat-form #nick { width: 84px; border-right: 1px solid var(--line); }
.chat-form #text { flex: 1; min-width: 0; }
.chat-form button { font-family: var(--mono); text-transform: uppercase; font-size: 12px; cursor: pointer; border-left: 1px solid var(--line); }
.chat-form button:hover { background: var(--fg); color: var(--bg); }
.chat-form input::placeholder { color: var(--muted); }

.section { padding: 48px clamp(16px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.section h2 { margin: 0 0 20px; font-family: var(--mono); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.list .when { font-family: var(--mono); font-size: 13px; color: var(--muted); width: 210px; flex: none; }
.list .what { flex: 1; min-width: 0; }
.list .what b { display: block; font-size: 18px; }
.list .what small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.list .thumb { position: relative; width: 56px; height: 56px; flex: none; background: #1a1a1a center/cover; }
.list .empty { color: var(--muted); }
.list .listen {
  flex: none; background: none; border: 1px solid var(--line); color: var(--fg); padding: 8px 14px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer;
}
.list .listen:hover, .list .listen.active { background: var(--fg); color: var(--bg); }

.dock {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 24px); background: var(--fg); color: var(--bg);
}
.dock-play, .dock-close { flex: none; background: none; border: 0; color: inherit; cursor: pointer; }
.dock-play { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); color: var(--fg); display: grid; place-items: center; }
.dock-play svg { width: 18px; height: 18px; fill: currentColor; }
.dock-play .icon-play, .dock.paused .dock-play .icon-pause { display: none; }
.dock.paused .dock-play .icon-play { display: block; }
.dock-close { font-size: 26px; line-height: 1; padding: 0 4px; }
.dock-main { flex: 1; min-width: 0; }
.dock-title { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-seek { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; }
.dock-seek input { flex: 1; accent-color: var(--bg); }

@media (max-width: 760px) {
  .bar { padding: 12px 16px; }
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .links { display: none; }
  .now { flex-direction: column; align-items: flex-start; }
  .list li { flex-wrap: wrap; gap: 12px; }
  .list .when { width: 100%; }
  .player { padding: 32px 16px; }
  .chat { border-left: 0; border-top: 1px solid var(--line); min-height: 360px; }
  .messages { padding: 12px 16px; }
}
.messages .host { font-family: var(--mono); font-size: 9px; background: var(--fg); color: var(--bg); padding: 1px 4px; margin-right: 6px; vertical-align: 2px; }

/* The station's mark (optional; the server sets --mark and .has-mark). Drawn as a mask, so it takes the text colour. */
.mark { display: none; }
.has-mark .mark { display: block; flex: none; width: 22px; height: 22px; background: currentColor; }
.has-mark .mark, .has-mark .blank::after {
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
/* Shows without artwork, and the idle player, wear the mark instead. */
.has-mark .blank::after { content: ''; position: absolute; inset: 27%; background: #3d3d3d; }
