:root {
  --bg-base: #07141e;
  --bg-strong: rgba(8, 18, 29, 0.84);
  --bg-soft: rgba(15, 34, 54, 0.68);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-main: #f5f7fb;
  --text-soft: #b7c5d6;
  --brand: #f5742a;
  --brand-soft: #ffb168;
  --mint: #6ee7d2;
  --danger: #ff7d7d;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-ui: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(245, 116, 42, 0.2), transparent 32%),
    radial-gradient(circle at bottom right, rgba(110, 231, 210, 0.18), transparent 30%),
    linear-gradient(160deg, #051019 0%, #0b1d2d 48%, #0c2234 100%);
  color: var(--text-main);
  font-family: var(--font-ui);
}

body {
  position: relative;
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.65;
  pointer-events: none;
}

.backdrop-a {
  top: -110px;
  left: -90px;
  width: 320px;
  height: 320px;
  background: rgba(245, 116, 42, 0.22);
}

.backdrop-b {
  right: -120px;
  bottom: 8vh;
  width: 360px;
  height: 360px;
  background: rgba(110, 231, 210, 0.2);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero-card,
.panel {
  background: linear-gradient(180deg, rgba(17, 31, 47, 0.92), rgba(10, 23, 37, 0.82));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 28px;
}

.eyebrow,
.panel-kicker,
.status-label {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-soft);
  font-size: 0.72rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 12ch;
  margin-top: 10px;
  font-size: clamp(2.2rem, 5vw, 4.9rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 68ch;
  margin-top: 18px;
  color: var(--text-soft);
  line-height: 1.55;
}

.connect-form,
.manual-form,
.panel-grid {
  margin-top: 24px;
}

.stack-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-row {
  margin-top: 16px;
}

.label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.field {
  flex: 1 1 260px;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font: inherit;
}

.field::placeholder {
  color: rgba(230, 240, 255, 0.45);
}

.button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--brand), #ff9552);
  color: #0b1420;
}

.button-accent {
  background: linear-gradient(135deg, var(--mint), #a9f3d9);
  color: #092031;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.status-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.toast {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--brand);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 14px 14px 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-player {
  min-height: 100%;
}

.panel-title-wrap h2 {
  margin-top: 6px;
  font-size: 1.5rem;
}

.panel-note {
  margin-top: 16px;
  color: var(--text-soft);
  line-height: 1.5;
}

.current-track {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(245, 116, 42, 0.16), rgba(110, 231, 210, 0.08)),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.current-track.empty {
  color: var(--text-soft);
}

.track-meta {
  display: flex;
  gap: 14px;
  align-items: center;
}

.track-thumb {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.track-copy {
  display: grid;
  gap: 6px;
}

.track-copy strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.track-copy span,
.track-copy a {
  color: var(--text-soft);
}

audio {
  width: 100%;
  margin-top: 18px;
  border-radius: 16px;
}

.hidden-player {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: 0;
  opacity: 0;
  pointer-events: none;
}

.youtube-embed-host {
  margin-top: 18px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
}

.youtube-embed-host.yt-hidden {
  display: none;
}

.youtube-embed-host iframe,
#youtube-player {
  width: 100%;
  height: 100%;
  display: block;
}

.list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.list li {
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.list-events li {
  display: grid;
  gap: 6px;
}

.event-time {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.queue-empty,
.events-empty {
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .hero-card,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  h1 {
    max-width: none;
    font-size: 2.45rem;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .track-meta {
    align-items: flex-start;
  }
}
