:root {
  color-scheme: dark;
  --bg: #0d1011;
  --surface: #171c20;
  --surface-2: #20272d;
  --surface-3: #11171b;
  --text: #f5f7f8;
  --muted: #a8b2b9;
  --line: #333d45;
  --accent: #2fd3ad;
  --accent-2: #f0b94f;
  --brand-red: #ef5350;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(47, 211, 173, 0.12), transparent 34%),
    linear-gradient(135deg, #0d1011 0%, #151516 48%, #101416 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 16, 17, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--brand-red));
  color: #08100e;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 6px;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.hero {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 34px 24px 28px;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 24px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 6px 0 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(38px, 6vw, 74px);
}

h2 {
  font-size: 28px;
}

.hero-text {
  max-width: 650px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.player-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 18px;
  align-items: stretch;
}

.player-pane,
.library-pane {
  background: rgba(23, 28, 32, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.player-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.library-pane {
  display: flex;
  flex-direction: column;
  min-height: 720px;
  padding: 14px;
}

.player-topbar,
.now-playing,
.url-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-topbar,
.now-playing {
  justify-content: space-between;
}

.status {
  min-width: 96px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #17382f;
  color: #bff3e5;
  text-align: center;
  font-size: 13px;
}

.status.error {
  background: #442025;
  color: #ffd1d1;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #050607;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #050607;
}

.video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.video-empty.hidden {
  display: none;
}

.now-playing,
.direct-form,
.source-panel {
  padding: 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

.now-playing strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--accent-2);
  font-size: 24px;
  cursor: pointer;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.url-row input {
  min-width: 0;
  flex: 1;
}

input,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  padding: 0 11px;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #071310;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

.file-row,
.xtreme-panel {
  margin-top: 10px;
}

.xtreme-grid,
.filters {
  display: grid;
  gap: 8px;
}

.filters {
  grid-template-columns: 1fr 150px 102px;
  margin: 12px 0;
}

.filters button {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line);
}

.filters button[aria-pressed="true"] {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.channel-count {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.channel-list {
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.channel {
  width: 100%;
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  text-align: left;
  background: #14191e;
  color: var(--text);
  border: 1px solid var(--line);
}

.channel.active {
  border-color: var(--accent);
  background: #17332d;
}

.channel-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #29313a;
  color: var(--muted);
  font-weight: 800;
}

.channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-meta {
  min-width: 0;
}

.channel-meta strong,
.channel-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.channel-star {
  color: var(--accent-2);
  font-size: 20px;
  text-align: center;
}

@media (max-width: 1020px) {
  .player-shell {
    grid-template-columns: 1fr;
  }

  .library-pane {
    min-height: 540px;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding: 24px 10px;
  }

  .player-topbar,
  .now-playing,
  .url-row {
    align-items: stretch;
    flex-direction: column;
  }

  .status,
  button {
    width: 100%;
  }

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