:root {
  --bg: #0c0c10;
  --panel: #15151b;
  --panel-2: #1c1c24;
  --line: #26262f;
  --text: #f3f3f6;
  --muted: #8d8d9b;
  --faint: #5d5d6b;
  --accent: #ff4f9a;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.6s;
}

button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px 28px;
}

/* ── Header ─────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.onair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.onair i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--faint);
}
.onair.live { color: var(--text); border-color: color-mix(in srgb, #ff3b3b 45%, var(--line)); }
.onair.live i { background: #ff3b3b; box-shadow: 0 0 0 0 #ff3b3b88; animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 #ff3b3b88; }
  70% { box-shadow: 0 0 0 8px #ff3b3b00; }
  100% { box-shadow: 0 0 0 0 #ff3b3b00; }
}

.stations {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.station {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.station img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.station span { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.station:hover { border-color: #3a3a46; }
.station:hover span { color: var(--text); }
.station.active { border-color: var(--accent); background: var(--accent-soft); }
.station.active span { color: var(--text); }

.banner {
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #5a4316;
  background: #2a2112;
  color: #f5d48c;
  border-radius: var(--radius);
  font-size: 14px;
}
.banner code { background: #0004; padding: 1px 5px; border-radius: 4px; }

/* ── Layout ─────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

/* ── Stage ──────────────────────────────────────────── */

.deck-card {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: 28px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
}
@media (max-width: 640px) {
  .deck-card { grid-template-columns: 1fr; }
}

.art {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-2);
  box-shadow: 0 18px 50px #0008;
}
.art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.art img.active { opacity: 1; }

.info {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}
.info h2 {
  margin: 8px 0 0;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.info p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.np-meta { display: flex; gap: 6px; min-height: 22px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
}
.chip.band { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.progress {
  height: 3px;
  margin: 22px 0 18px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.progress div {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s linear;
}

.controls { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.icon-btn:hover { border-color: #3a3a46; }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
#btn-play { width: 56px; height: 56px; background: var(--accent); color: #0c0c10; border: 0; }
#btn-play:hover { transform: scale(1.04); }
#btn-play .i-pause, #btn-play .spin { display: none; }
#btn-play.playing .i-play { display: none; }
#btn-play.playing .i-pause { display: block; }
#btn-play.loading svg { display: none; }
#btn-play.loading .spin {
  display: block;
  width: 20px; height: 20px;
  border: 2.5px solid #0c0c1040;
  border-top-color: #0c0c10;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.volume { display: flex; align-items: center; gap: 8px; margin-left: 8px; color: var(--muted); }
.volume svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.volume svg path:first-child { fill: currentColor; stroke: none; }
input[type="range"] { width: 96px; accent-color: var(--accent); }

.upnext {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 16px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 14px;
}
.upnext .label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
#upnext { color: var(--text); opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 13.5px;
  color: var(--muted);
}
.status.error { color: #ff8f8f; }

/* The YouTube players: present (so they play), but invisible and unclickable. */
.players {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 200px;
  height: 200px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.players .layer, .players iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* ── Side ───────────────────────────────────────────── */

.side { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel h3 {
  margin: 0;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.hint { margin: 6px 0 12px; font-size: 13.5px; color: var(--muted); }

.msg-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.msg-form:focus-within { border-color: var(--accent); }
.msg-form textarea {
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  padding: 6px 0;
  max-height: 140px;
}
.msg-form textarea::placeholder { color: var(--faint); }
.msg-form button {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: var(--accent); color: #0c0c10;
}
.msg-form button:disabled { background: var(--panel-2); color: var(--faint); cursor: default; }
.msg-form button svg { width: 17px; height: 17px; fill: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips button {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.2s, border-color 0.2s;
}
.chips button:hover { color: var(--text); border-color: #3a3a46; }

.log-panel { display: flex; flex-direction: column; max-height: 560px; }
.log {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.log li { border-top: 1px solid var(--line); animation: rise 0.3s ease; }
.log li:first-child { border-top: 0; }
.log a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  margin: 0 -6px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.log a:hover { background: var(--panel-2); }
.log a:hover .title { color: var(--accent); }
.log .thumb {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 7px; object-fit: cover; background: var(--panel-2);
}
.log .body { min-width: 0; flex: 1; }
.log .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.log .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .time { font-size: 11.5px; color: var(--faint); flex-shrink: 0; }
.log-empty { margin: 10px 0 0; color: var(--faint); font-size: 13.5px; }
