:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1c1c1c;
  --panel-soft: #242424;
  --text: #f6f2eb;
  --muted: #b8b0a5;
  --line: #3a3731;
  --accent: #ff4d00;
  --accent-2: #33b1a6;
  --warn: #f2b544;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: #151515;
}

.kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h1 {
  font-size: clamp(24px, 3.4vw, 44px);
}

h2 {
  font-size: 22px;
}

.actions,
.episodeActions,
.episodeTitleRow,
.listHead {
  display: flex;
  align-items: center;
}

.actions {
  gap: 10px;
}

.iconButton {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 22px;
}

.iconButton:hover,
.playButton:hover {
  border-color: var(--accent);
}

.state,
.badge {
  border-radius: 999px;
  padding: 6px 9px;
  background: #223c39;
  color: #d9fff8;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.state.offline {
  background: #45361c;
  color: #ffe1a4;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  min-height: calc(100vh - 87px);
}

.playerPane {
  padding: clamp(16px, 3vw, 38px);
  border-right: 1px solid var(--line);
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #050505;
  object-fit: contain;
}

.playerMeta {
  margin-top: 22px;
  max-width: 860px;
}

.playerMeta p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.listPane {
  min-width: 0;
  padding: clamp(16px, 3vw, 30px);
}

.listHead {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.muted,
.meta,
.subtitle {
  color: var(--muted);
}

.episodes {
  display: grid;
  gap: 12px;
}

.episode {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  align-self: start;
  border-radius: 6px;
  background: #080808;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playMark {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
}

.episodeBody {
  min-width: 0;
}

.episodeTitleRow {
  justify-content: space-between;
  gap: 8px;
}

.episode h3 {
  font-size: 16px;
}

.subtitle,
.meta {
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.episodeActions {
  gap: 8px;
  margin-top: 12px;
}

.playButton {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #120600;
  font-weight: 800;
}

.cacheButton.cached {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.removeButton {
  color: var(--muted);
}

.empty {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .playerPane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

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

  .state {
    display: none;
  }

  .episode {
    grid-template-columns: 116px minmax(0, 1fr);
  }

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

  .subtitle {
    display: none;
  }
}
