:root {
  --bg: #000000;
  --panel: rgba(9, 9, 9, 0.96);
  --panel-soft: rgba(18, 18, 18, 0.98);
  --panel-hover: rgba(28, 28, 28, 0.98);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f6f3ee;
  --muted: #9fa4af;
  --accent: #e50914;
  --accent-soft: rgba(229, 9, 20, 0.12);
  --gold: #d6b15f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.app-body {
  margin: 0;
  color: var(--text);
  font-family: "Red Hat Display", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(229, 9, 20, 0.08), transparent 18%),
    linear-gradient(180deg, #000 0%, #020202 45%, #000 100%);
  background-color: #000;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: 100%;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 2.5rem;
}

.brand-mark,
.display-title,
.section-title,
.detail-title,
.card-title,
.episode-title {
  font-family: "Playfair Display", serif;
}

.brand-mark {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  color: var(--text);
}

.hero-section,
.search-panel,
.category-row-section,
.detail-hero,
.info-panel,
.episodes-panel,
.watchlist-drawer {
  backdrop-filter: blur(16px);
}

.hero-section {
  padding-bottom: 1.2rem;
}

.hero-copy {
  max-width: 50%;
}

.hero-copy-compact {
  padding: 2.4rem 0 1.35rem;
}

.eyebrow-text,
.section-kicker,
.subtle-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold);
}

.display-title {
  font-size: clamp(2.65rem, 5.2vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0.65rem 0 0.85rem;
}

.compact-title {
  max-width: 100%;
}

.hero-text,
.detail-summary,
.episode-summary,
.info-copy {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.search-panel,
.category-row-section,
.info-panel,
.episodes-panel,
.detail-hero {
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.96), rgba(5, 5, 5, 0.96));
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 1rem 1.1rem;
  width: 50%;
}

.genre-hero-copy {
  width: 50%;
}

.control-dark {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.control-dark:focus {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: rgba(229, 9, 20, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(229, 9, 20, 0.14);
}

.control-dark::placeholder {
  color: #7e8490;
}

.btn-danger-soft {
  color: #ffd8da;
  background: var(--accent-soft);
  border: 1px solid rgba(229, 9, 20, 0.35);
}

.btn-danger-soft:hover,
.btn-danger-soft:focus {
  color: #fff;
  background: rgba(229, 9, 20, 0.24);
  border-color: rgba(229, 9, 20, 0.5);
}

.status-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(214, 177, 95, 0.12);
  border: 1px solid rgba(214, 177, 95, 0.18);
  color: #f3dfaf;
  font-size: 0.9rem;
}

.section-block {
  padding-top: 1rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head-row {
  align-items: center;
  margin-bottom: 1.1rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0.2rem 0 0;
}

.section-meta,
.muted-small {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-stack {
  display: grid;
  gap: 1.1rem;
}

.category-row-section {
  padding: 1.1rem;
}

.view-all-btn {
  color: #f3dfaf;
  font-size: 0.88rem;
  text-decoration: none;
}

.view-all-btn:hover {
  color: #fff2c9;
}

.row-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.9rem;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.95rem;
}

.load-more-sentinel {
  display: grid;
  place-items: center;
  min-height: 72px;
  color: var(--muted);
  font-size: 0.88rem;
}

.show-card {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(11, 11, 11, 0.98));
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.show-card:hover {
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.98), rgba(18, 18, 18, 0.98));
  border-color: rgba(255, 255, 255, 0.14);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #111;
}

.show-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-topline {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  right: 0.65rem;
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.save-toggle,
.image-rating,
.pill,
.stat-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.34rem 0.66rem;
  font-size: 0.7rem;
  line-height: 1;
}

.save-toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 7, 7, 0.86);
  color: var(--text);
  font-weight: 700;
}

.save-toggle.is-saved {
  background: rgba(229, 9, 20, 0.94);
}

.image-rating {
  background: rgba(214, 177, 95, 0.16);
  color: #f6df9d;
  font-weight: 700;
}

.show-card-body {
  padding: 0.85rem 0.85rem 0.95rem;
}

.meta-row,
.detail-meta-row,
.detail-actions,
.detail-stats {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.network-pill,
.stat-pill {
  background: rgba(255, 255, 255, 0.06);
  color: #eceef4;
}

.card-title-link {
  display: inline-block;
}

.card-title {
  margin: 0.55rem 0 0.35rem;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.card-title-link:hover .card-title {
  color: #fff2c9;
}

.genre-line {
  margin-bottom: 0.45rem;
}

.watchlist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  padding: 1.2rem;
  background: linear-gradient(180deg, rgba(9, 9, 9, 0.98), rgba(3, 3, 3, 0.98));
  border-left: 1px solid var(--card-border);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45);
  transform: translateX(102%);
  transition: transform 220ms ease;
  z-index: 1050;
  overflow-y: auto;
}

.watchlist-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1040;
}

.watchlist-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.drawer-title {
  font-size: 2rem;
}

.watchlist-items {
  display: grid;
  gap: 0.85rem;
}

.watchlist-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.watchlist-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
}

.watchlist-link {
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
}

.watchlist-link:hover {
  color: #fff2c9;
}

.genre-link {
  color: var(--muted);
  text-decoration: none;
}

.genre-link:hover {
  color: #fff2c9;
}

.compact-empty {
  min-height: 22vh;
}

.loading-stage,
.empty-state {
  min-height: 40vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1.2fr) minmax(300px, 0.85fr);
  gap: 1.5rem;
  padding: 1.5rem;
}

.detail-poster {
  border-radius: 22px;
  overflow: hidden;
  min-height: 420px;
  background: #101010;
}

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

.detail-title {
  font-size: clamp(2.6rem, 6vw, 5.2rem);
  line-height: 0.96;
  margin: 0.7rem 0 1rem;
}

.detail-shell {
  display: grid;
  gap: 1.25rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.detail-grid-secondary {
  align-items: start;
}

.info-panel,
.episodes-panel {
  padding: 1.25rem;
}

.episodes-panel .section-title,
.cast-panel .section-title {
  margin-bottom: 0.85rem;
}

.detail-info-panel {
  height: 100%;
}

.info-list,
.episodes-list {
  display: grid;
  gap: 0.85rem;
}

.info-item-label {
  display: block;
  color: var(--gold);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.35rem;
}

.episode-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.episode-title {
  font-size: 1.28rem;
  margin: 0 0 0.45rem;
}

.cast-list {
  display: grid;
  gap: 0.8rem;
}

.cast-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.8rem;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.cast-thumb {
  width: 72px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.cast-name {
  margin: 0 0 0.2rem;
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
  line-height: 1.05;
}

.cast-role {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.site-footer {
  padding: 2rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a {
  color: #fff;
}

@media (max-width: 1600px) {
  .row-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .genre-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  .row-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .genre-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .row-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .genre-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-grid,
  .detail-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-shell {
    padding-inline: 1rem;
  }

  .hero-copy,
  .search-panel,
  .genre-hero-copy {
    max-width: 100%;
    width: 100%;
  }

  .compact-title {
    max-width: 100%;
  }

  .row-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .genre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 576px) {
  .row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watchlist-item {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .remove-watchlist-btn {
    grid-column: 1 / -1;
  }
}
