:root {
  --bg: #070707;
  --ink: #f7f7f7;
  --panel: rgba(0, 0, 0, 0.58);
  --line: rgba(255, 255, 255, 0.24);
  --accent: #ff4d36;
  --accent-dark: #cf2f1d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% 50%, #202020 0%, var(--bg) 70%);
  color: var(--ink);
}

.stream-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.stream-player {
  width: 100%;
  height: 100%;
  border: 0;
  transition: opacity 220ms ease;
}

.stream-player.hidden {
  opacity: 0;
}

.stream-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0));
}

.overlay-left {
  display: grid;
  gap: 0.5rem;
  pointer-events: auto;
}

.overlay-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
}

.brand::before {
  content: "";
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255, 77, 54, 0.9);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.34rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.56);
  font-size: 0.76rem;
  color: rgba(247, 247, 247, 0.9);
}

.spinner {
  width: 0.76rem;
  height: 0.76rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: spin 760ms linear infinite;
}

.status-text {
  font-weight: 700;
}

.last-checked {
  color: rgba(247, 247, 247, 0.74);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.refresh-btn,
.fullscreen-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.refresh-btn:hover,
.fullscreen-btn:hover {
  transform: translateY(-1px);
  background: rgba(28, 28, 28, 0.82);
}

.refresh-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.9rem;
  transition: background 160ms ease, transform 160ms ease;
}

.subscribe-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.fallback {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(clamp(180px, 26vh, 280px) + 5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(12, 12, 12, 0.92), rgba(28, 14, 12, 0.84));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}

.fallback-kicker {
  margin: 0;
  color: #ffb0a7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 7rem;
}

.fallback-copy {
  display: grid;
  gap: 0.28rem;
}

.fallback h1 {
  margin: 0;
  font-size: clamp(1rem, 2.3vw, 1.35rem);
}

.fallback p {
  margin: 0;
  color: rgba(247, 247, 247, 0.78);
  font-size: 0.92rem;
  max-width: 54rem;
}

.playlist-dock {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 8, 8, 0.82);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}

.playlist-head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.playlist-head a {
  color: #ffb0a7;
  font-size: 0.82rem;
  text-decoration: none;
}

.playlist-head a:hover {
  color: #ffd7d2;
}

.playlist-player {
  width: 100%;
  height: clamp(180px, 26vh, 280px);
  border: 0;
  border-radius: 10px;
}

.hidden {
  display: none;
}

@media (max-width: 680px) {
  .stream-overlay {
    padding: 0.7rem;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .overlay-left {
    width: 100%;
  }

  .status-pill {
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .brand {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }

  .refresh-btn,
  .fullscreen-btn,
  .subscribe-btn {
    padding: 0.4rem 0.72rem;
    font-size: 0.8rem;
  }

  .playlist-dock {
    left: 0.45rem;
    right: 0.45rem;
    bottom: 0.45rem;
    padding: 0.6rem;
  }

  .fallback {
    left: 0.45rem;
    right: 0.45rem;
    bottom: calc(min(35vh, 220px) + 5.35rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.72rem 0.85rem;
  }

  .fallback-kicker {
    min-width: 0;
  }

  .fallback h1 {
    font-size: 1rem;
  }

  .fallback p {
    font-size: 0.85rem;
  }

  .playlist-head {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.5rem;
  }

  .playlist-player {
    height: min(35vh, 220px);
  }
}
