/* Lull Radio panel — rinwave.space aesthetic in plain CSS. */

:root {
  --bg: #07070b;
  --ink: #f5f7ff;
  --plum: #2b123d;
  --violet: #5b2a86;
  --magenta: #a135ff;
  --crimson: #c1124a;
  --ok: #3fb950;
  --line: rgba(255, 255, 255, 0.08);
  --line-bright: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(91, 42, 134, 0.16), transparent 26%),
    linear-gradient(180deg, #09090d 0%, #07070b 100%);
  padding-bottom: 160px;
}

::selection { background: rgba(161, 53, 255, 0.28); color: #fff; }

a { color: inherit; text-decoration: none; }
.muted { color: rgba(245, 247, 255, 0.5); }

/* ─── Background layers ─── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.34;
}
.glow-a {
  width: 60vw; height: 60vw; top: -22vw; left: -12vw;
  background: radial-gradient(circle, rgba(161, 53, 255, 0.55), transparent 60%);
  animation: pulseGlow 9s ease-in-out infinite, drift 22s ease-in-out infinite alternate;
}
.glow-b {
  width: 50vw; height: 50vw; bottom: -18vw; right: -10vw;
  background: radial-gradient(circle, rgba(193, 18, 74, 0.4), transparent 60%);
  animation: pulseGlow 11s ease-in-out infinite 1.5s, drift 26s ease-in-out infinite alternate-reverse;
}
.grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at top, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000 10%, transparent 70%);
}
.grain {
  position: absolute; inset: -50%;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(8) infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.28; filter: blur(72px); }
  50% { opacity: 0.46; filter: blur(96px); }
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(28px, -18px, 0) scale(1.04); }
  100% { transform: translate3d(-22px, 20px, 0) scale(0.98); }
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(4%, -1%); }
  60% { transform: translate(-2%, 3%); }
  80% { transform: translate(3%, -2%); }
}

/* ─── Layout ─── */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}

/* ─── Hero ─── */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.mark {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(161,53,255,0.25), rgba(193,18,74,0.18));
  border: 1px solid var(--line-bright);
  box-shadow: 0 0 40px rgba(161, 53, 255, 0.18);
}
.mark-core {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 18px rgba(161, 53, 255, 0.8);
  animation: rinwave-breathe 6s ease-in-out infinite;
}
@keyframes rinwave-breathe { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

h1 {
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
  margin: 0; line-height: 1.1;
}
.brand-text p { margin: 4px 0 0; font-size: 13px; }

.status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(245,247,255,0.55);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.025);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7280; }
.dot.online { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* ─── Section ─── */
.section-label {
  text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.14em;
  color: rgba(245,247,255,0.4);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.count {
  font-size: 11px; letter-spacing: normal;
  padding: 1px 8px; border-radius: 999px;
  background: rgba(161,53,255,0.16);
  color: rgba(245,247,255,0.7);
}

/* ─── Channel cards ─── */
.channels { display: grid; gap: 12px; }

.channel {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  overflow: hidden;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.channel::before {
  content: "";
  position: absolute; inset-inline: 18px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.channel:hover {
  border-color: var(--line-bright);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}
.channel:hover::before { opacity: 1; }
.channel.active {
  border-color: rgba(161,53,255,0.55);
  box-shadow: 0 0 0 1px rgba(161,53,255,0.3), 0 24px 80px rgba(0,0,0,0.45);
}

.play {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(135deg, rgba(161,53,255,0.22), rgba(91,42,134,0.18));
  color: var(--ink);
  font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.15s, box-shadow 0.25s, border-color 0.25s;
}
.play:hover { border-color: var(--magenta); box-shadow: 0 0 24px rgba(161,53,255,0.35); }
.play:active { transform: scale(0.94); }

.ch-body { flex: 1; min-width: 0; }
.ch-head { display: flex; align-items: center; gap: 9px; }
.ch-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 12px rgba(161,53,255,0.6);
  opacity: 0.5;
}
.channel.active .ch-dot { opacity: 1; animation: rinwave-breathe 2.4s ease-in-out infinite; }
.ch-title {
  font-family: "Sora", sans-serif;
  font-size: 16px; font-weight: 600; margin: 0;
}
.ch-listeners {
  margin-left: auto;
  font-size: 12px; color: rgba(245,247,255,0.5);
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.ch-np {
  margin: 6px 0 0; font-size: 13px;
  color: rgba(245,247,255,0.62);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-tags { margin-top: 8px; font-size: 11px; color: rgba(245,247,255,0.35); }

.skip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: rgba(245,247,255,0.7);
  border-radius: 11px; padding: 9px 12px;
  font: inherit; font-size: 12px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.skip:hover { border-color: var(--line-bright); color: var(--ink); }

/* ─── Player dock ─── */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  border-top: 1px solid var(--line);
  background: rgba(9, 9, 14, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 14px 24px 18px;
  z-index: 10;
}
.dock-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
}
.dock-now { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.dock-meta { min-width: 0; }
.dock-title {
  font-family: "Sora", sans-serif; font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dock-meta .muted { font-size: 12px; }
audio { display: none; }

.dock-btn {
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 13px;
  border: 1px solid var(--line-bright);
  background: linear-gradient(135deg, rgba(161,53,255,0.25), rgba(91,42,134,0.2));
  color: var(--ink); font-size: 15px; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.15s, box-shadow 0.25s, border-color 0.25s;
}
.dock-btn:hover { border-color: var(--magenta); box-shadow: 0 0 22px rgba(161,53,255,0.35); }
.dock-btn:active { transform: scale(0.94); }

.dock-controls { display: flex; align-items: center; gap: 12px; }
.vol-ico { font-size: 13px; opacity: 0.6; }
.vol {
  -webkit-appearance: none; appearance: none;
  width: 84px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,0.14); cursor: pointer;
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 10px rgba(161,53,255,0.7);
}
.vol::-moz-range-thumb {
  width: 13px; height: 13px; border: none; border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 10px rgba(161,53,255,0.7);
}

.dock-queue { display: flex; gap: 8px; }
#request-uri {
  font: inherit; font-size: 13px; width: 200px; max-width: 42vw;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink); border-radius: 11px; padding: 9px 12px;
}
#request-uri:focus { outline: none; border-color: rgba(161,53,255,0.5); }
.btn-ghost {
  font: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line-bright);
  background: rgba(161,53,255,0.12);
  color: var(--ink); border-radius: 11px; padding: 9px 16px;
  transition: background 0.2s, border-color 0.2s;
}
.btn-ghost:hover { background: rgba(161,53,255,0.2); border-color: var(--magenta); }

.msg {
  max-width: 760px; margin: 8px auto 0;
  font-size: 12px; min-height: 1em; color: rgba(245,247,255,0.5);
}
.msg.error { color: #ff6b81; }
.msg.ok { color: var(--ok); }

/* ─── Equalizer (plays when a channel is active) ─── */
.eq { display: flex; align-items: flex-end; gap: 3px; height: 26px; width: 26px; flex-shrink: 0; }
.eq span {
  flex: 1; height: 30%;
  background: linear-gradient(180deg, var(--magenta), var(--crimson));
  border-radius: 2px; opacity: 0.4;
}
body.playing .eq span { animation: eq 0.9s ease-in-out infinite; opacity: 0.9; }
body.playing .eq span:nth-child(2) { animation-delay: 0.15s; }
body.playing .eq span:nth-child(3) { animation-delay: 0.3s; }
body.playing .eq span:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ─── Empty / loading ─── */
.empty {
  text-align: center; padding: 40px 20px;
  color: rgba(245,247,255,0.4); font-size: 14px;
  border: 1px dashed var(--line); border-radius: 20px;
}

@media (max-width: 560px) {
  .wrap { padding: 32px 16px 16px; }
  h1 { font-size: 24px; }
  .dock-inner { grid-template-columns: 1fr; grid-template-areas: "now" "player" "queue"; }
  #request-uri { max-width: none; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .glow, .grain, .mark-core, .ch-dot, .eq span { animation: none !important; }
}
