:root {
  color-scheme: dark;
  --bg: #101815;
  --panel: #17231f;
  --panel-soft: #20302a;
  --text: #f4f0e7;
  --muted: #b9c1b7;
  --line: rgba(244, 240, 231, 0.14);
  --leaf: #74a674;
  --moss: #9bb56c;
  --water: #6ab6b8;
  --clay: #bf7158;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(16, 24, 21, 0.72), #101815 48%),
    radial-gradient(circle at 15% 0%, rgba(116, 166, 116, 0.18), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(106, 182, 184, 0.16), transparent 28%),
    #101815;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 24, 21, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background:
    linear-gradient(140deg, transparent 48%, rgba(255, 255, 255, 0.36) 49%, transparent 52%),
    linear-gradient(135deg, var(--leaf), var(--water) 58%, var(--clay));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
}

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

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(14px, 3vw, 38px) 56px;
}

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

.player-area,
.playlist,
.curation {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 35, 31, 0.78);
  box-shadow: var(--shadow);
}

.player-area {
  overflow: hidden;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #060908;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px 18px;
}

.now-playing p,
.section-head p,
.eyebrow {
  margin: 0;
  color: var(--moss);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.now-playing h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.08;
}

.source-link {
  min-width: 66px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.source-link:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.13);
}

.playlist {
  padding: 14px;
  min-height: 100%;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.playlist-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 70px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.queue-item:hover,
.queue-item.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.queue-item img,
.video-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #24322d;
}

.queue-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 16 / 10;
}

.queue-copy strong,
.video-card strong {
  display: block;
  line-height: 1.25;
}

.queue-copy span,
.video-card span,
.curation p {
  color: var(--muted);
  font-size: 13px;
}

.library {
  margin-top: 22px;
}

.library-bar {
  display: grid;
  grid-template-columns: minmax(240px, 380px) 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.search-wrap {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--water);
  flex: 0 0 auto;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.search-wrap input::placeholder {
  color: rgba(244, 240, 231, 0.58);
}

.segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.segment {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.segment:hover,
.segment.is-active {
  color: #08100d;
  border-color: transparent;
  background: linear-gradient(135deg, var(--moss), var(--water));
}

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

.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 48, 42, 0.72);
  cursor: pointer;
}

.video-card:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.play-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #0e1512;
  background: rgba(244, 240, 231, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.play-badge svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.card-copy {
  padding: 13px;
}

.card-copy strong {
  margin-bottom: 6px;
  font-size: 16px;
}

.tagline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  color: #101815;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--leaf);
}

.curation {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: end;
  margin-top: 24px;
  padding: 24px;
}

.curation h2 {
  margin: 6px 0 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
}

.empty {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .watch-shell,
  .library-bar,
  .curation {
    grid-template-columns: 1fr;
  }

  .segments {
    justify-content: flex-start;
  }

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

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

  .nav {
    width: 100%;
  }

  .nav a {
    flex: 1;
    justify-content: center;
  }

  .now-playing {
    align-items: flex-start;
    flex-direction: column;
  }

  .playlist {
    padding: 10px;
  }

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