:root {
  color-scheme: dark;
  --bg: #07130f;
  --surface: #10231d;
  --surface-2: #18352b;
  --text: #f4fff9;
  --muted: #a8bdb4;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #30d67b;
  --accent-2: #f0b84a;
  --danger: #ff6961;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

:root.light {
  color-scheme: light;
  --bg: #f5f7f1;
  --surface: #ffffff;
  --surface-2: #e9efe6;
  --text: #102019;
  --muted: #52675d;
  --line: rgba(16, 32, 25, 0.14);
  --shadow: 0 18px 45px rgba(34, 58, 46, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% 0%, rgba(48, 214, 123, 0.18), transparent 28rem),
    linear-gradient(145deg, rgba(240, 184, 74, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #06120d;
  font-size: 0.8rem;
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a,
.text-button {
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
}

.nav a:hover,
.text-button:hover {
  color: var(--text);
}

.icon-button,
.primary-button,
.secondary-button,
.chip {
  border: 1px solid var(--line);
  border-radius: 7px;
}

.icon-button {
  width: 2.35rem;
  height: 2.35rem;
  background: var(--surface);
  color: var(--text);
}

main {
  width: min(1420px, calc(100% - 2rem));
  margin: 0 auto;
}

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1rem;
  padding: 1.25rem 0;
  min-height: calc(100vh - 4.2rem);
  align-items: stretch;
}

.player-panel,
.queue-panel,
.schedule,
.content-grid {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.player-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-shell {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.live-ribbon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.55rem;
  border-radius: 5px;
  background: var(--danger);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.player-meta {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.1rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.65rem, 3vw, 3rem);
  line-height: 1.04;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

#nowPlayingDesc {
  max-width: 62rem;
  color: var(--muted);
  line-height: 1.55;
}

.signal-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.signal-row > span,
.signal-row label {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.signal-row select {
  min-height: 1.45rem;
  border: 0;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
}

.player-actions {
  display: flex;
  align-items: start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  min-height: 2.55rem;
  padding: 0 1rem;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #06120d;
  border-color: transparent;
}

.secondary-button,
.chip {
  background: var(--surface-2);
  color: var(--text);
}

.queue-panel {
  padding: 1rem;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.queue-list,
.compact-list {
  display: grid;
  gap: 0.65rem;
}

.queue-item,
.compact-item,
.schedule-item {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--text);
  text-align: left;
}

.queue-item:hover,
.compact-item:hover,
.card:hover {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.controls-band {
  display: flex;
  align-items: end;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
}

.search-box {
  display: grid;
  gap: 0.35rem;
  width: min(24rem, 100%);
  color: var(--muted);
  font-size: 0.85rem;
}

.search-box input {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 0 0.85rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  min-height: 2.35rem;
  padding: 0 0.8rem;
}

.chip.active {
  background: var(--accent);
  color: #06120d;
}

.content-grid,
.schedule {
  padding: 1rem;
  margin: 1rem 0;
}

.span-all {
  grid-column: 1 / -1;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 68%, transparent);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-position: center;
  background-size: cover;
}

.badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.card-body {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-actions button {
  flex: 1;
}

.schedule-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.schedule-item time {
  color: var(--accent);
  font-weight: 900;
}

.schedule-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.schedule-actions .primary-button,
.schedule-actions .secondary-button {
  min-height: 2.25rem;
  padding: 0 0.55rem;
  font-size: 0.85rem;
}

.library-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .watch {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .queue-panel {
    max-height: none;
  }

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

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

@media (max-width: 680px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    margin-left: 0;
  }

  .player-meta,
  .controls-band,
  .footer {
    flex-direction: column;
    align-items: stretch;
  }

  .cards,
  .schedule-list,
  .library-columns {
    grid-template-columns: 1fr;
  }
}
