:root {
  color-scheme: dark;
  --bg: #101313;
  --panel: #181d1e;
  --panel-2: #202829;
  --text: #f4f1e8;
  --muted: #a9b3ad;
  --line: #303b3c;
  --accent: #d7ff4f;
  --accent-2: #4fd6b0;
  --danger: #ff7a59;
  --accent-ink: #11140a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.svg-sprite {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
select {
  font: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
  padding-bottom: 128px;
}

.filters {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 24px 24px 148px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  margin-bottom: 28px;
}

.wordmark {
  margin: 0;
  font-family: "Orbitron", ui-sans-serif, sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.wordmark span {
  display: block;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-top: 7px;
  padding-left: 3px;
}

h2,
p {
  margin: 0;
}

.now span {
  color: var(--muted);
}

@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.episode-skeleton {
  height: 108px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 1200px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.search {
  position: relative;
  display: block;
  margin-bottom: 24px;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0c0f0f;
  color: var(--text);
  padding: 12px 38px 12px 12px;
  border-radius: 8px;
}

.search-icon {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.filter-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111617;
  overflow: hidden;
}

.filter-panel summary,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-panel summary {
  cursor: pointer;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  list-style: none;
}

.filter-panel summary::-webkit-details-marker {
  display: none;
}

.filter-panel summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.filter-panel[open] summary::after {
  content: "-";
}

.filter-panel summary span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: none;
}

.filter-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 14px 10px;
}

.filter-search {
  display: block;
  position: relative;
  padding: 0 14px 12px;
}

.filter-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0f0f;
  color: var(--text);
  padding: 9px 34px 9px 10px;
}

.filter-search .search-icon {
  right: 25px;
  top: calc(50% - 6px);
}

.subtle-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.subtle-button:hover {
  border-color: transparent;
  background: transparent;
  color: var(--accent-2);
}

.section-title h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

button:hover {
  border-color: #3a3a3a;
  background: #2f2f2f;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 999px;
}

.icon-button:hover {
  color: var(--accent);
}

.filter-actions {
  padding: 0 14px 12px;
}

.filter-actions button {
  width: 100%;
  padding: 7px 10px;
  color: var(--muted);
}

.checklist {
  display: grid;
  max-height: 380px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.checklist.compact {
  max-height: 280px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(48, 59, 60, 0.65);
  color: var(--muted);
  cursor: pointer;
}

.check-row:hover {
  background: var(--panel-2);
  color: var(--text);
}

.check-row.active {
  color: var(--text);
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.check-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-row small {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.content {
  padding: 28px;
}

.toolbar {
  margin-bottom: 24px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar h2 {
  font-size: 34px;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  transition: width 140ms ease, padding 140ms ease, gap 140ms ease;
}

.sort-button:hover,
.sort-button:focus-visible {
  width: auto;
  padding: 0 11px;
  gap: 8px;
}

.sort-button span {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 140ms ease, opacity 140ms ease;
}

.sort-button:hover span,
.sort-button:focus-visible span {
  max-width: 130px;
  opacity: 1;
}

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

.episode {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px;
  transition: background 120ms ease, border-color 120ms ease;
}

.episode:hover {
  background: #202020;
  border-color: #3a3a3a;
}

.episode img {
  width: 88px;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-2);
}

.episode h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.meta,
.terms {
  color: var(--muted);
  font-size: 14px;
}

.terms {
  margin-top: 10px;
}

.play {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  width: 42px;
  height: 42px;
}

.episode-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-right: 6px;
}

.queue-button {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  opacity: 0.62;
}

.queue-button:hover {
  color: var(--accent-2);
  background: var(--panel-2);
  border-color: var(--line);
  opacity: 1;
}

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 56px 290px minmax(200px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  background: #0b0d0d;
  border-top: 1px solid var(--line);
  min-height: 86px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.32);
}

.player img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.now {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.now strong,
.now span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player audio {
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color-scheme: dark;
  accent-color: var(--accent);
}

.player audio::-webkit-media-controls-panel {
  background-color: transparent;
  border-radius: 999px;
}

.player audio::-webkit-media-controls-current-time-display,
.player audio::-webkit-media-controls-time-remaining-display {
  color: var(--text);
  text-shadow: none;
}


.player-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-button,
.labeled-control,
.queue-panel summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
}

.player-button svg,
.queue-panel summary svg {
  flex: 0 0 auto;
}

.player-button:hover,
.labeled-control:hover,
.queue-panel summary:hover {
  border-color: #3a3a3a;
  background: #2f2f2f;
  color: var(--accent);
}

.queue-panel {
  position: relative;
}

.queue-panel summary {
  list-style: none;
}

.queue-panel summary::-webkit-details-marker {
  display: none;
}

.queue-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, 86vw);
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0d0d;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 12px;
}

.queue-menu-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.queue-menu-actions button {
  flex: 1;
  font-size: 13px;
}

.queue-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.queue-menu ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.queue-menu li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-skip {
  position: relative;
  cursor: pointer;
}

.auto-skip input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 2px;
  transition: background 120ms ease;
}

.switch-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 120ms ease, background 120ms ease;
}

.auto-skip input:checked + .switch-track {
  background: var(--accent);
}

.auto-skip input:checked + .switch-track span {
  background: var(--accent-ink);
  transform: translateX(18px);
}

.speed-control {
  cursor: default;
}

.speed-control select {
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: #0c0f0f;
  color: var(--text);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
}

/* Mobile header — hidden on desktop */
.mobile-header {
  display: none;
}

.mobile-wordmark {
  font-family: "Orbitron", ui-sans-serif, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 0;
  color: var(--text);
}

/* Mobile player controls — hidden on desktop */
.mobile-controls {
  display: none;
}

.filters-close {
  display: none;
}

.filters-backdrop {
  display: none;
}

@media (max-width: 860px) {
  /* Mobile header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  /* Layout */
  .app {
    grid-template-columns: 1fr;
    padding-bottom: 200px;
  }

  .content {
    padding: 16px;
  }

  /* Filters drawer */
  .filters-close {
    display: flex;
  }

  .filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 149;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
  }

  .app.filters-open .filters-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .filters {
    position: fixed;
    left: 0;
    top: 0;
    width: min(320px, 88vw);
    height: 100%;
    height: 100dvh;
    z-index: 150;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 40px;
  }

  .app.filters-open .filters {
    transform: translateX(0);
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  /* Toolbar */
  .toolbar {
    align-items: center;
    flex-direction: row;
    margin-bottom: 16px;
  }

  .toolbar h2 {
    font-size: 22px;
  }

  /* Episodes */
  .episode {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    padding: 8px;
  }

  .episode img {
    width: 76px;
    height: 76px;
  }

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

  .episode-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 2px;
  }

  /* Player */
  .player {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 10px 14px;
    min-height: auto;
  }

  .player img {
    width: 44px;
    height: 44px;
  }

  .now {
    align-self: center;
  }

  /* Hide native audio element; show custom controls instead */
  .player audio {
    display: none;
  }

  .mobile-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-column: 1 / -1;
  }

  .play-pause-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    border-radius: 50%;
    padding: 0;
  }

  .play-pause-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    opacity: 0.85;
  }

  .player-time {
    flex: 0 0 auto;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    min-width: 30px;
  }

  .player-time--right {
    text-align: right;
  }

  .player-scrubber {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--line) var(--pct, 0%));
    outline: none;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
  }

  .player-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -6px;
  }

  .player-scrubber::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
  }

  .player-scrubber::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
  }

  .player-scrubber::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: var(--line);
  }

  .player-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .player-button,
  .labeled-control,
  .queue-panel summary {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    min-width: 36px;
  }
}
