:root {
  --bg-start: #07152f;
  --bg-end: #0f315d;
  --panel: rgba(9, 24, 54, 0.6);
  --panel-border: rgba(255, 255, 255, 0.16);
  --text-main: #f7f4ec;
  --text-muted: #cfd7e8;
  --accent: #d4a84f;
  --accent-strong: #f0c468;
  --success: #70d4a4;
  --danger: #ff8b8b;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --max-width: 1180px;
  --font-display: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-display);
  color: var(--text-main);
  background:
    radial-gradient(
      circle at top left,
      rgba(212, 168, 79, 0.2),
      transparent 28%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(255, 255, 255, 0.08),
      transparent 26%
    ),
    linear-gradient(145deg, var(--bg-start), var(--bg-end));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  opacity: 0.12;
  z-index: 0;
}

body::before {
  top: 22px;
  right: 18px;
  width: 120px;
  height: 120px;
  background: radial-gradient(
    circle,
    rgba(240, 196, 104, 0.65),
    transparent 66%
  );
  filter: blur(8px);
}

body::after {
  bottom: 24px;
  left: 16px;
  width: 90px;
  height: 140px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 160'%3E%3Cpath fill='none' stroke='%23f7f4ec' stroke-width='6' d='M60 10v70M28 40h64'/%3E%3Cpath fill='none' stroke='%23d4a84f' stroke-width='5' stroke-linecap='round' d='M36 112c12-25 29-39 51-44-10 14-15 27-15 40 0 15 8 28 24 41-26-2-46-10-60-24z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 24px), var(--max-width));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: linear-gradient(
    180deg,
    rgba(14, 31, 66, 0.72),
    rgba(7, 21, 47, 0.62)
  );
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero,
.stream-card,
.controls-panel,
.dashboard-panel {
  border-radius: var(--radius-lg);
}

.hero {
  padding: 28px;
}

.eyebrow,
.label,
.meta-label {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-size: 0.72rem;
}

h1,
h2,
.current-source {
  margin: 0;
}

h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

h2 {
  font-size: 1.4rem;
}

.hero-copy,
.card-copy {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 64ch;
}

.hero-status-row,
.card-top,
.action-row,
.input-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-panel {
  grid-column: span 12;
  padding: 24px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.dashboard-button {
  min-width: 180px;
}

.dashboard-button.is-active {
  background: linear-gradient(135deg, var(--accent), #f5d48d);
  color: #091632;
  box-shadow: 0 10px 22px rgba(212, 168, 79, 0.32);
}

.program-board {
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
}

.program-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.program-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.program-now-label {
  margin: 12px 0 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
  font-size: 0.72rem;
}

.program-now {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.program-updated {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.program-history-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  display: grid;
  gap: 4px;
}

.program-history-list li {
  line-height: 1.45;
}

.stream-card,
.controls-panel {
  padding: 24px;
}

.stream-card {
  grid-column: span 12;
}

.controls-panel {
  grid-column: span 12;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.primary-button {
  color: #091632;
  background: linear-gradient(135deg, var(--accent), #f5d48d);
  box-shadow: 0 10px 22px rgba(212, 168, 79, 0.32);
}

.secondary-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.primary-button:hover,
.secondary-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

.hidden {
  display: none;
}

.status-chip,
.live-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.status-chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.live-pill {
  background: rgba(112, 212, 164, 0.18);
  color: var(--success);
}

.live-pill.alt {
  background: rgba(212, 168, 79, 0.18);
  color: var(--accent-strong);
}

.current-source {
  font-size: 1.2rem;
  font-weight: 700;
}

.input-label {
  display: block;
  margin: 10px 0 8px;
  color: var(--text-muted);
}

.input-row input {
  flex: 1 1 260px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.youtube-frame-shell {
  position: relative;
  margin-top: 18px;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.28);
  aspect-ratio: 16 / 9;
}

.youtube-frame,
.youtube-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-overlay {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(7, 21, 47, 0.72);
  color: var(--text-main);
  backdrop-filter: blur(10px);
}

.volume-block {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

#volumeSlider {
  width: 100%;
  accent-color: var(--accent);
}

.meta-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.meta-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.equalizer {
  display: inline-flex;
  gap: 6px;
  align-items: flex-end;
  height: 42px;
  margin-top: 14px;
}

.equalizer span {
  width: 8px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-strong), #fff3d3);
  animation: bounce 1.1s infinite ease-in-out;
  animation-play-state: paused;
}

.equalizer span:nth-child(2) {
  animation-delay: 0.12s;
}

.equalizer span:nth-child(3) {
  animation-delay: 0.24s;
}

.equalizer span:nth-child(4) {
  animation-delay: 0.36s;
}

.equalizer span:nth-child(5) {
  animation-delay: 0.48s;
}

body.is-playing .equalizer span {
  animation-play-state: running;
}

.noscript-banner {
  margin: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 139, 139, 0.18);
  color: #ffe3e3;
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.8);
    opacity: 0.72;
  }

  50% {
    transform: scaleY(1.8);
    opacity: 1;
  }
}

@media (min-width: 860px) {
  .stream-card {
    grid-column: span 6;
  }

  .controls-panel {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(calc(100% - 16px), var(--max-width));
    padding-top: 10px;
  }

  .hero,
  .stream-card,
  .controls-panel,
  .dashboard-panel {
    padding: 20px;
  }

  .dashboard-button {
    width: 100%;
  }

  .action-row-stacked-mobile {
    align-items: stretch;
  }

  .action-row-stacked-mobile > * {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
