/* DirtyPlayer radio: the site's look (near-black, dirty paper, red, HUD), sized for phones first.
   No inline styles: the site's CSP forbids them. */

:root {
  --ink: #0c0c0d;
  --ink-2: #141416;
  --paper: #e8e2d4;
  --text: #ece7db;
  --dim: #aba596;
  --red: #ff004e;
  --bad: #ff6b8e;
  --ok: #3ccf8e;
  --line: rgba(236, 231, 219, .16);
  --line-strong: rgba(236, 231, 219, .32);
  --grid: rgba(236, 231, 219, .045);
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
  --heavy: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Heavy", "sans-serif-condensed", "Arial Black", sans-serif;
  --tape: polygon(2% 0%, 2% 17%, 1% 33%, 4% 50%, 1% 67%, 0% 83%, 0% 100%, 96% 100%, 100% 83%, 97% 67%, 97% 50%, 96% 33%, 100% 17%, 96% 0%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(255, 0, 78, .14), transparent 55%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--ink);
  color: var(--text);
  font: 16px/1.45 var(--sans);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url(../assets/noise.svg) 0 0 / 240px 240px;
  opacity: .08;
}

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { max-width: 540px; margin: 0 auto; padding: 16px 16px 30px; }

.top { display: flex; align-items: center; gap: 10px; margin: 6px 0 26px; }
.brand { display: block; line-height: 0; }
.brand img { display: block; width: 150px; height: auto; }
.tag {
  padding: 5px 7px;
  background: var(--red);
  color: var(--ink);
  font: 800 .68rem/1 var(--mono);
  letter-spacing: .2em;
  transform: rotate(-4deg);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--dim);
  font: 700 .72rem/1.3 var(--mono);
  letter-spacing: .1em;
  text-align: right;
  text-transform: uppercase;
}
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #55524b; }
.dot.live { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s steps(1) infinite; }
.dot.bad { background: var(--red); box-shadow: 0 0 10px var(--red); }
@keyframes blink { 50% { opacity: .35; } }

.card {
  position: relative;
  padding: 22px 18px 18px;
  border: 1px solid var(--line-strong);
  background: #111113;
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .95), 0 0 0 6px rgba(236, 231, 219, .025);
}
.card::before {
  content: "";
  position: absolute;
  top: -15px;
  left: 50%;
  width: 124px;
  height: 28px;
  margin-left: -62px;
  background: rgba(236, 226, 196, .62);
  clip-path: var(--tape);
  transform: rotate(-3deg);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
}

.station {
  min-height: 1.3em;
  overflow: hidden;
  color: var(--red);
  font: 800 .82rem/1.3 var(--mono);
  letter-spacing: .14em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The show on the station: its name is the card's big title, the description under it. */
.show { margin-top: 8px; }
.show-name {
  color: var(--paper);
  font: 400 clamp(1.9rem, 8.4vw, 2.6rem)/1 var(--heavy);
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.show-desc { margin: 8px 0 0; color: var(--dim); font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.show-name[hidden], .show-desc[hidden], .show[hidden] { display: none; }
.has-show .now { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }

.now { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.eq {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 70px;
  height: 70px;
  padding: 12px 9px;
  border: 1px solid var(--line);
  background: #0a0a0b;
}
.eq i { flex: 1; height: 16%; background: #55524b; }
.playing .eq i { background: var(--red); animation: bar .9s ease-in-out infinite alternate; }
.playing .eq i:nth-child(2) { animation-duration: .7s; animation-delay: -.3s; }
.playing .eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.6s; }
.playing .eq i:nth-child(4) { animation-duration: .8s; animation-delay: -.15s; }
.playing .eq i:nth-child(5) { animation-duration: 1.2s; animation-delay: -.45s; }
@keyframes bar { from { height: 14%; } to { height: 100%; } }

/* The cover, when the station sends one: the bars go small over its bottom edge. */
.art { position: relative; flex: none; width: 70px; height: 70px; }
.cover { display: block; width: 70px; height: 70px; border: 1px solid var(--line); object-fit: cover; }
.cover[hidden] { display: none; }
.has-cover .eq {
  position: absolute;
  inset: auto 0 0 0;
  width: auto;
  height: 26px;
  padding: 4px 8px;
  border: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}

.titles { flex: 1; min-width: 0; }
.title { overflow: hidden; font: 800 1.3rem/1.25 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.artist { min-height: 1.45em; overflow: hidden; color: var(--dim); text-overflow: ellipsis; white-space: nowrap; }

button { font: inherit; border-radius: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .38; box-shadow: none !important; }
button:not(:disabled):active { transform: translate(1px, 1px); }

.row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-top: 20px; }
.row button {
  min-height: 60px;
  border: 2px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 800 1.12rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.row button.on { border-color: var(--red); background: var(--red); color: var(--ink); box-shadow: 4px 4px 0 var(--paper); }

/* The floating player: a quieter button under Listen and Stop. */
.pop {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 2px dashed var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 700 .82rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.pop:not(:disabled):hover { border-color: var(--red); }
/* Its video lives off the layout: only the floating window shows it. */
.screen { position: fixed; bottom: 0; left: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

.slider { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.slider label {
  min-width: 76px;
  color: var(--dim);
  font: 700 .7rem/1.2 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
input[type=range] { flex: 1; min-width: 0; height: 34px; accent-color: var(--red); }

.note { min-height: 1.45em; margin: 14px 0 0; color: var(--dim); font-size: .95rem; }
.note.bad { color: var(--bad); }

.code-label {
  display: block;
  margin: 28px 2px 9px;
  color: var(--dim);
  font: 700 .72rem/1.2 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
form { display: flex; gap: 10px; }
form input {
  flex: 1;
  min-width: 0;
  padding: 13px 12px;
  border: 2px solid var(--line-strong);
  border-radius: 0;
  background: var(--ink-2);
  color: var(--paper);
  font: 400 1.15rem/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
form input::placeholder { color: var(--dim); opacity: .6; }
form input:focus-visible { border-color: var(--red); outline-offset: 2px; }
form button {
  min-height: 52px;
  padding: 0 20px;
  border: 2px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  font: 800 .95rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* The public stations on the air: one row each, a tap tunes in. */
.onair[hidden], .list[hidden], .list-empty[hidden] { display: none; }
.onair .code-label { margin-top: 30px; }
.list { margin: 0; padding: 0; border: 1px solid var(--line-strong); list-style: none; background: rgba(0, 0, 0, .3); }
.list li + li { border-top: 1px solid var(--line); }
.st { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 9px 12px; color: var(--text); text-decoration: none; }
.st:hover { background: rgba(255, 0, 78, .08); }
.st[aria-current] { background: rgba(255, 0, 78, .1); box-shadow: inset 3px 0 0 var(--red); }
.st-art {
  flex: none;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle, var(--ink) 1.2px, transparent 1.7px) 0 0 / 5px 5px,
    linear-gradient(135deg, var(--paper), #8f8a7e);
}
.st-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-words { flex: 1; min-width: 0; }
.st-name, .st-now { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-name { font-weight: 800; }
.st-now { color: var(--dim); font-size: .86rem; }
.st-ears { flex: none; max-width: 30%; color: var(--dim); font: 700 .66rem/1.25 var(--mono); letter-spacing: .08em; text-align: right; text-transform: uppercase; }
.list-empty { margin: 0; padding: 12px 14px; border: 1px dashed var(--line-strong); color: var(--dim); font-size: .95rem; }

footer { margin-top: 40px; text-align: center; }
.slogan { margin: 0 0 8px; color: var(--paper); font: 400 1.3rem/1.15 var(--heavy); }
.links { margin: 0; font: 700 .72rem/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.links a { color: var(--dim); text-decoration-color: var(--red); text-underline-offset: 3px; }
.links a:hover { color: var(--text); }

.noscript { padding: 0 16px; color: var(--dim); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .playing .eq i { height: 70%; animation: none; }
  .dot.live { animation: none; }
}

/* The station's chat (chat.css draws it), under the card while listening: wider than the card,
   so who's here fits beside the conversation on a computer. */
.chat { position: relative; left: 50%; width: min(960px, calc(100vw - 32px)); margin-top: 24px; transform: translateX(-50%); }
.chat[hidden] { display: none; }
