* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111827;
  color: #e5e7eb;
}

.topbar {
  background: #1f2937;
  border-bottom: 1px solid #374151;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar h1 a {
  color: inherit;
  text-decoration: none;
}

.topbar h1 a:visited,
.topbar h1 a:hover,
.topbar h1 a:active {
  color: #ffffff;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  overflow: hidden;
}

.right-panel {
  position: sticky;
  top: 12px;
}

.tabs {
  display: flex;
  border-bottom: 1px solid #374151;
}

.tab {
  flex: 1;
  border: 0;
  padding: 12px;
  color: #d1d5db;
  background: transparent;
  cursor: pointer;
}

.tab.active {
  background: #111827;
  color: #93c5fd;
}

.tab-content {
  display: none;
  padding: 16px;
}

.tab-content.active {
  display: block;
}

.player-title {
  padding: 12px 16px;
  border-bottom: 1px solid #374151;
  font-weight: 700;
  color: #93c5fd;
}

.player-content {
  display: block;
}

.current-playing {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #f9fafb;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

input,
button {
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
  padding: 10px 12px;
}

input {
  flex: 1;
}

button {
  cursor: pointer;
}

.status {
  color: #9ca3af;
  margin-bottom: 10px;
}

.season-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.season-old-wrap {
  margin-bottom: 10px;
  border: 1px solid #374151;
  border-radius: 8px;
  background: #182132;
  padding: 8px 10px;
}

.season-old-wrap summary {
  cursor: pointer;
  color: #9ca3af;
  user-select: none;
}

.season-choices.old {
  margin-top: 10px;
  margin-bottom: 0;
}

.season-chip {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
}

.season-chip.active {
  border-color: #f472b6;
  color: #f472b6;
}

.list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.timeline-table-wrap {
  overflow-x: auto;
  border: 1px solid #4b5563;
  border-radius: 8px;
  background: #1b2230;
}

.timeline-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.timeline-table-wrap th,
.timeline-table-wrap td {
  border: 1px solid #4b5563;
  padding: 10px 8px;
  vertical-align: top;
  font-size: 13px;
}

.timeline-table-wrap .today-col {
  background: rgba(244, 114, 182, 0.12);
}

.timeline-table-wrap th {
  background: #252b36;
  color: #e5e7eb;
  text-align: left;
}

.timeline-table-wrap a {
  color: #d1d5db;
  text-decoration: none;
}

.timeline-table-wrap a:hover {
  color: #f9a8d4;
}

.timeline-extra-seasons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-extra-seasons button {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid #4b5563;
  background: #111827;
  color: #e5e7eb;
}

.card {
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 12px;
  background: #111827;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card h3 {
  margin: 0;
  font-size: 15px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-meta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.meta {
  color: #9ca3af;
  font-size: 12px;
}

.open-btn {
  white-space: nowrap;
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.episode-btn {
  padding: 8px 10px;
  font-size: 13px;
}

.player {
  width: 100%;
  background: #000;
  border-radius: 8px;
  min-height: 260px;
}

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

  .right-panel {
    position: static;
    order: -1;
  }

  .card {
    gap: 10px;
  }

  .open-btn {
    align-self: auto;
  }

  .card-top h3 {
    font-size: 20px;
  }

  .card-meta-row {
    gap: 12px;
    flex-wrap: nowrap;
  }

  .card-meta-row .meta {
    font-size: 16px;
    color: #c7cfdb;
  }

  .player {
    min-height: 220px;
  }

  .player-title {
    font-size: 15px;
  }
}
