:root {
  --bg-1: #0f0f13;
  --bg-2: #1a1a23;
  --text-main: #f5f6fa;
  --text-dim: #c0c2cb;
  --accent: #3ed37b;
  --accent-soft: rgba(62, 211, 123, 0.25);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 75% 35%, #272739 0%, #13131a 40%, #09090d 100%);
  color: var(--text-main);
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 22% 48%, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.06), transparent 35%);
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, rgba(255, 255, 255, 0.025) 1px, transparent 2px);
  opacity: 0.2;
  pointer-events: none;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 760px);
  gap: 2rem;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.word-storm {
  position: relative;
  height: min(70vh, 620px);
  transform: perspective(700px) rotateY(35deg) rotateX(8deg);
  transform-origin: left center;
  opacity: 0.85;
}

.word-storm span {
  position: absolute;
  left: 0;
  top: 50%;
  font-size: clamp(0.85rem, 1.3vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(245, 246, 250, 0.5);
  white-space: nowrap;
  animation: words 8s linear infinite;
}

.word-storm span:nth-child(1) { animation-delay: 0s; top: 8%; }
.word-storm span:nth-child(2) { animation-delay: -0.5s; top: 14%; }
.word-storm span:nth-child(3) { animation-delay: -1s; top: 19%; }
.word-storm span:nth-child(4) { animation-delay: -1.5s; top: 26%; }
.word-storm span:nth-child(5) { animation-delay: -2s; top: 31%; }
.word-storm span:nth-child(6) { animation-delay: -2.5s; top: 37%; }
.word-storm span:nth-child(7) { animation-delay: -3s; top: 42%; }
.word-storm span:nth-child(8) { animation-delay: -3.5s; top: 48%; }
.word-storm span:nth-child(9) { animation-delay: -4s; top: 53%; }
.word-storm span:nth-child(10) { animation-delay: -4.5s; top: 59%; }
.word-storm span:nth-child(11) { animation-delay: -5s; top: 65%; }
.word-storm span:nth-child(12) { animation-delay: -5.5s; top: 70%; }
.word-storm span:nth-child(13) { animation-delay: -6s; top: 77%; }
.word-storm span:nth-child(14) { animation-delay: -6.5s; top: 84%; }

@keyframes words {
  0% {
    transform: translateX(-8%) scale(1);
    opacity: 0;
  }
  20% {
    opacity: 0.7;
  }
  60% {
    opacity: 0.35;
  }
  100% {
    transform: translateX(78%) scale(0.15);
    opacity: 0;
  }
}

.panel {
  width: 100%;
  max-width: 760px;
}

.title {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.title span {
  color: var(--accent);
}

.spectrum {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 86px;
}

.station-mark {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem;
  border: 2px solid rgba(245, 246, 250, 0.75);
}

.wave {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-wrap: nowrap;
}

.wave span {
  width: 5px;
  border-radius: 999px;
  background: #f0f1f5;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
  height: 24px;
  animation: pulse 1.2s ease-in-out infinite;
}

.wave span:nth-child(odd) { animation-duration: 1s; }
.wave span:nth-child(2n) { animation-duration: 1.4s; }
.wave span:nth-child(3n) { animation-duration: 0.8s; }
.wave span:nth-child(1) { animation-delay: -0.2s; }
.wave span:nth-child(2) { animation-delay: -0.4s; }
.wave span:nth-child(3) { animation-delay: -0.1s; }
.wave span:nth-child(4) { animation-delay: -0.6s; }
.wave span:nth-child(5) { animation-delay: -0.3s; }
.wave span:nth-child(6) { animation-delay: -0.5s; }
.wave span:nth-child(7) { animation-delay: -0.15s; }
.wave span:nth-child(8) { animation-delay: -0.7s; }
.wave span:nth-child(9) { animation-delay: -0.25s; }
.wave span:nth-child(10) { animation-delay: -0.45s; }
.wave span:nth-child(11) { animation-delay: -0.35s; }
.wave span:nth-child(12) { animation-delay: -0.55s; }
.wave span:nth-child(13) { animation-delay: -0.12s; }
.wave span:nth-child(14) { animation-delay: -0.62s; }
.wave span:nth-child(15) { animation-delay: -0.32s; }
.wave span:nth-child(16) { animation-delay: -0.52s; }

@keyframes pulse {
  0%, 100% {
    height: 12px;
    opacity: 0.45;
  }
  50% {
    height: 68px;
    opacity: 1;
  }
}

.controls {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.play-btn {
  border: 1px solid var(--accent-soft);
  background: linear-gradient(180deg, rgba(62, 211, 123, 0.3), rgba(62, 211, 123, 0.12));
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(62, 211, 123, 0.42), rgba(62, 211, 123, 0.16));
}

.play-btn.is-playing {
  background: linear-gradient(180deg, rgba(238, 98, 98, 0.4), rgba(238, 98, 98, 0.18));
  border-color: rgba(238, 98, 98, 0.35);
}

.status-text {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.now-playing-card {
  margin-top: 1.4rem;
  width: min(95%, 520px);
  padding: 0.95rem 1rem;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  backdrop-filter: blur(3px);
  transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
}

.now-playing-card.is-changing {
  opacity: 0.3;
  transform: translateY(2px) scale(0.99);
  filter: blur(1px);
}

.cover-frame {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: radial-gradient(circle at 30% 30%, rgba(62, 211, 123, 0.28), rgba(18, 18, 26, 0.95));
  position: relative;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cover-image.is-visible {
  opacity: 1;
}

.cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(245, 246, 250, 0.95);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  transition: opacity 0.35s ease;
}

.cover-fallback.is-hidden {
  opacity: 0;
}

.track-label {
  margin: 0 0 0.2rem;
  color: var(--text-dim);
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.track-name {
  margin: 0;
  font-size: clamp(1.06rem, 2.2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  word-break: break-word;
}

.track-artist {
  margin: 0.22rem 0 0;
  font-size: 0.97rem;
  color: #d8dae4;
  line-height: 1.3;
}

.track-next-label {
  margin: 0.72rem 0 0.18rem;
  color: rgba(192, 194, 203, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.track-next {
  margin: 0;
  color: #e9eaf0;
  font-size: 0.95rem;
  line-height: 1.25;
  word-break: break-word;
}

.fm-line {
  margin-top: 1.4rem;
  margin-bottom: 0.2rem;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  color: #f7f8fb;
}

.fm-line strong {
  color: var(--accent);
}

.tg-link {
  display: inline-block;
  margin-top: 0.15rem;
  color: #d8dae4;
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 218, 228, 0.45);
  padding-bottom: 2px;
}

.tg-link:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .word-storm {
    height: 180px;
    transform: perspective(420px) rotateY(32deg) rotateX(6deg);
  }

  .now-playing-card {
    grid-template-columns: 80px minmax(0, 1fr);
    width: min(100%, 520px);
    padding: 0.85rem;
    gap: 0.8rem;
  }

  .cover-frame {
    width: 80px;
    height: 80px;
  }

  @keyframes words {
    0% {
      transform: translateX(-10%) scale(1);
      opacity: 0;
    }
    20% {
      opacity: 0.6;
    }
    100% {
      transform: translateX(64%) scale(0.33);
      opacity: 0;
    }
  }
}
