:root {
  color-scheme: dark;
  --bg: #0d0b0c;
  --panel: #18141a;
  --text: #e8e2e4;
  --muted: #9b8f94;
  --accent: #c2263a;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
}

#playlist {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

#playlist li {
  background: var(--panel);
  border-left: 3px solid transparent;
  border-radius: 6px;
}

#playlist li[aria-current] {
  border-left-color: var(--accent);
}

.episode {
  display: grid;
  grid-template-columns: 192px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 1rem;
  padding: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.thumb {
  grid-row: span 2;
  position: relative;
  line-height: 0;
}

.thumb::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--progress, 0%);
  height: 4px;
  background: var(--accent);
  border-radius: 0 0 0 4px;
}

#playlist li[data-watched] .thumb img {
  opacity: 0.5;
}

#playlist li[data-watched] .part::after {
  content: " · Watched";
}

.episode img {
  width: 192px;
  height: 108px;
  object-fit: cover;
  border-radius: 4px;
}

.part {
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 0.25rem;
}

.title {
  line-height: 1.35;
}

a:hover .title {
  color: #fff;
}

dialog {
  max-width: 28rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.92);
}

dialog button {
  font: inherit;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .episode {
    grid-template-columns: 120px 1fr;
  }

  .episode img {
    width: 120px;
    height: 68px;
  }
}
