:root {
  --accent: #fc6676;
  --accent-strong: #fb5168;
  --bg: #0e1018;
  --bg-rail: #0a0c12;
  --surface: #161922;
  --surface-2: #1d2130;
  --border: #262b3a;
  --ink: #f4f5f8;
  --muted: #9aa1b2;
  --muted-2: #6b7283;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------- App shell ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar rail ---------- */
.sidebar {
  width: 76px;
  flex: 0 0 76px;
  background: var(--bg-rail);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar__logo {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.sidebar__logo:hover {
  opacity: 0.8;
}

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 28px;
  align-items: start;
}

/* ---------- Player ---------- */
.player__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.player__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player__info {
  padding: 22px 2px 0;
}

.player__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.player__headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.player__title {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 27px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.player__duration {
  flex: none;
  padding-top: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.player__description {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 64ch;
}

/* ---------- Speaker card ---------- */
.speaker {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.speaker__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex: none;
}

.speaker__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.speaker__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.speaker__role {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.speaker__info {
  width: 18px;
  height: 18px;
  color: var(--muted-2);
  flex: none;
}

/* ---------- Playlist ---------- */
.playlist {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 28px;
}

.playlist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.playlist__course {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.playlist__count {
  font-size: 12px;
  color: var(--muted-2);
}

.playlist__list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 72vh;
  overflow-y: auto;
}

.playlist__item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.playlist__item:hover {
  background: var(--surface-2);
}

.playlist__item.is-active {
  background: rgba(252, 102, 118, 0.12);
}

.playlist__thumb {
  position: relative;
  flex: 0 0 116px;
  width: 116px;
  height: 66px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}

.playlist__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playlist__index {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(8, 10, 16, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist__item.is-active .playlist__index {
  background: var(--accent);
}

.playlist__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

.playlist__item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.playlist__item.is-active .playlist__item-title {
  color: var(--accent);
}

.playlist__item-duration {
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------- Scrollbar ---------- */
.playlist__list::-webkit-scrollbar {
  width: 8px;
}

.playlist__list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .playlist {
    position: static;
  }
}

@media (max-width: 720px) {
  .layout {
    padding: 18px 16px 40px;
  }
}
