@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;1,600&family=Inter:wght@400;500;600;700&display=swap");
:root {
  --bg: #060607;
  --panel: #111114;
  --line: #28282f;
  --red: #ff2448;
  --muted: #9996a0;
  --white: #f8f5f6;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font:
    14px Inter,
    sans-serif;
  min-height: 100vh;
}
.catalog-loading .watch-hero,
.catalog-loading #provider-section,
.catalog-loading #discover {
  visibility: hidden;
}
button,
input {
  font: inherit;
}
.watch-nav {
  height: 80px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: #070708eb;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid #201c1e;
}
.watch-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.15em;
  line-height: 1.05;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  white-space: nowrap;
}
.watch-brand img {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(255, 45, 67, 0.65);
  filter: drop-shadow(0 0 10px #ff183f88);
}
.watch-brand small {
  font: 8px Inter;
  letter-spacing: 0.38em;
  color: #aaa;
}
#categories {
  display: flex;
  gap: 4px;
  overflow: auto;
  scrollbar-width: none;
}
#categories button {
  background: none;
  border: 0;
  color: #999;
  padding: 10px 11px;
  cursor: pointer;
}
#categories button:hover,
#categories button.active {
  color: #fff;
}
#categories button.active:after {
  content: "";
  display: block;
  height: 2px;
  background: var(--red);
  margin-top: 7px;
  box-shadow: 0 0 8px var(--red);
}
#search-form {
  margin-left: auto;
  display: flex;
  background: #121216;
  border: 1px solid #292932;
  border-radius: 99px;
  min-width: 260px;
}
#search-form input {
  background: none;
  border: 0;
  outline: 0;
  color: #fff;
  padding: 11px 16px;
  width: 100%;
}
#search-form button {
  border: 0;
  background: none;
  color: #fff;
  padding: 0 14px;
  font-size: 22px;
}
.account {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.account a,
.account button {
  color: #bbb;
  background: none;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.account form {
  margin: 0;
}
.account .join {
  color: #fff;
  border: 1px solid #5c1d2c;
  padding: 9px 14px;
  border-radius: 99px;
}
.watch-hero {
  min-height: 520px;
  padding: 90px max(6vw, 40px);
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 70% 45%, #3b0714 0, transparent 42%),
    linear-gradient(90deg, #070708 15%, #0b0809bb),
    url("/static/anime-gate-city.png") center/cover;
  position: relative;
}
.watch-hero:after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 160px;
  background: linear-gradient(transparent, var(--bg));
}
.watch-hero > div {
  position: relative;
  z-index: 1;
  max-width: 650px;
}
.eyebrow {
  color: var(--red);
  letter-spacing: 0.28em;
  font-size: 11px;
  font-weight: 700;
}
.watch-hero h1 {
  font:
    600 clamp(48px, 6vw, 84px)/0.94 "Cormorant Garamond",
    serif;
  margin: 18px 0;
}
.watch-hero h1 em {
  color: var(--red);
}
.watch-hero p:not(.eyebrow) {
  font-size: 17px;
  line-height: 1.7;
  color: #bbb;
  max-width: 600px;
}
.primary {
  background: linear-gradient(135deg, #ff2046, #a70c27);
  border: 0;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 13px 21px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 0 28px #ff173b22;
}
.shelf {
  padding: 30px max(4vw, 28px);
}
.shelf header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}
.shelf h2 {
  font:
    600 34px "Cormorant Garamond",
    serif;
  margin: 4px 0;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 14px;
}
.media-row, .media-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 12px;
}
.media-row .media-card:not(.continue-card), .media-rail .media-card:not(.continue-card) {
  flex: 0 0 140px;
  width: 140px;
  max-width: 140px;
  min-width: 140px;
  scroll-snap-align: start;
}
.media-card {
  background: #0d0c10;
  border: 1px solid #221e26;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.media-card:hover {
  transform: translateY(-4px);
  border-color: #e50914;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.media-card .poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  position: relative;
  background: #16141c;
}
.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.media-card:hover img {
  transform: scale(1.05);
}
.media-card .meta {
  padding: 8px 10px;
  background: #0d0c10;
}
.media-card b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eee;
}
.media-card small {
  display: block;
  font-size: 10px;
  color: #777;
  margin-top: 2px;
  text-transform: capitalize;
}
.progress {
  height: 3px;
  background: #29252a;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--red);
}
.empty {
  grid-column: 1/-1;
  border: 1px dashed #302b2e;
  border-radius: 12px;
  padding: 60px;
  text-align: center;
  color: #777;
}
.hidden {
  display: none !important;
}
.chat-toggle {
  position: fixed;
  right: 25px;
  bottom: 24px;
  z-index: 25;
  border: 1px solid #6a1e30;
  background: #190b0f;
  color: #fff;
  border-radius: 99px;
  padding: 13px 20px;
  box-shadow: 0 0 25px #ff183f33;
}
.chat-toggle i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35da7f;
  margin-left: 7px;
}
.chat {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(390px, 100%);
  z-index: 40;
  background: #0d0d10;
  border-left: 1px solid #332128;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: 0.25s;
}
.chat.open {
  transform: none;
}
.chat header {
  display: flex;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #262229;
}
.chat header small {
  display: block;
  color: #888;
  margin-top: 4px;
}
.chat header button,
.dialog-close {
  background: none;
  color: #fff;
  border: 0;
  font-size: 26px;
}
.chat #messages {
  flex: 1;
  overflow: auto;
  padding: 18px;
}
.message {
  padding: 10px 0;
}
.message b {
  font-size: 12px;
  color: #ff607a;
}
.message p {
  margin: 5px 0;
  color: #ddd;
  line-height: 1.45;
}
.message small {
  color: #666;
}
.chat form {
  display: flex;
  padding: 15px;
  border-top: 1px solid #28242a;
}
.chat input {
  flex: 1;
  background: #18171b;
  border: 1px solid #302d33;
  border-radius: 8px;
  color: #fff;
  padding: 12px;
}
.chat form button {
  width: 44px;
  background: var(--red);
  border: 0;
  border-radius: 8px;
  margin-left: 8px;
}
dialog {
  width: min(900px, calc(100% - 30px));
  border: 1px solid #4b202a;
  border-radius: 16px;
  padding: 0;
  background: #101013;
  color: #fff;
  box-shadow: 0 30px 100px #000;
}
dialog::backdrop {
  background: #000c;
  backdrop-filter: blur(8px);
}
.dialog-close {
  position: absolute;
  right: 12px;
  top: 8px;
  z-index: 2;
}
.detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  position: relative;
  background-image:
    linear-gradient(180deg, rgba(16, 16, 19, 0.45) 0%, #101013 280px),
    linear-gradient(90deg, rgba(16, 16, 19, 0.92) 0%, #101013 100%),
    var(--detail-backdrop);
  background-size: cover;
  background-position: center top;
  border-radius: 16px;
  min-height: 480px;
}
.detail-poster {
  padding: 40px 0 40px 40px;
  position: sticky;
  top: 0;
  align-self: start;
}
.detail-poster img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 0, 0, 0.5);
  display: block;
}
.poster-placeholder {
  width: 220px;
  aspect-ratio: 2 / 3;
  background: #191622;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.detail-copy {
  padding: 40px;
}
@media (max-width: 768px) {
  .detail {
    grid-template-columns: 1fr;
  }
  .detail-poster {
    padding: 24px 24px 0 24px;
    display: flex;
    justify-content: center;
  }
  .detail-poster img, .poster-placeholder {
    max-width: 160px;
  }
  .detail-copy {
    padding: 24px;
  }
}
.detail h2 {
  font:
    600 45px "Cormorant Garamond",
    serif;
  margin: 8px 0;
}
.detail p {
  color: #aaa;
  line-height: 1.65;
}
.detail-facts {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 7px 0 14px;
}
.detail-facts span {
  padding: 5px 8px;
  border: 1px solid #3a3136;
  border-radius: 99px;
  color: #c9c3c7;
  font-size: 10px;
  background: #0a090ba8;
}
.detail blockquote {
  margin: 6px 0 12px;
  color: #f1bdc8;
  font:
    italic 600 18px "Cormorant Garamond",
    serif;
}
.detail-extra {
  margin-top: 27px;
}
.detail-extra h3 {
  font:
    600 25px "Cormorant Garamond",
    serif;
  margin: 0 0 11px;
}
.cast-row,
.related-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 7px;
}
.cast-row article {
  flex: 0 0 82px;
  text-align: center;
}
.cast-row img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #693040;
}
.cast-row b,
.cast-row small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cast-row b {
  font-size: 10px;
  margin-top: 6px;
}
.cast-row small {
  color: #888;
  font-size: 9px;
  margin-top: 2px;
}
.related-row .media-card {
  flex: 0 0 105px;
}
.related-row .media-card .meta {
  padding: 10px;
}
.related-row .media-card small {
  display: none;
}
.related-row .media-card:after {
  width: 34px;
  height: 34px;
}
.detail-copy {
  position: relative;
  z-index: 1;
}
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.secondary {
  border: 1px solid #3a353c;
  color: #fff;
  background: #19181c;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  text-decoration: none;
}
.streams {
  margin-top: 20px;
}
.stream {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #28252a;
  padding: 13px 0;
  gap: 20px;
}
.stream span {
  overflow: hidden;
}
.stream small {
  display: block;
  color: #777;
  margin-top: 4px;
}
.player-dialog {
  width: min(1440px, calc(100% - 30px));
  background: #050506;
  overflow: hidden;
}
.player-dialog video,
.player-dialog iframe,
.reader-image {
  display: block;
  width: 100%;
  height: min(75vh, 760px);
  border: 0;
  object-fit: contain;
  background: #000;
}
.player-dialog .reader-image {
  height: auto;
  max-height: 80vh;
}
.theatre-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: min(82vh, 850px);
  background: #030304;
}
.player-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.player-heading {
  min-height: 72px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #252126;
  background: #0b0a0c;
}
.player-heading span,
.source-drawer header span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.player-heading small,
.source-drawer small {
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--red);
}
.player-heading b {
  font:
    600 24px "Cormorant Garamond",
    serif;
}
.player-heading button,
.source-drawer header button,
.player-tools button {
  border: 1px solid #363139;
  background: #151419;
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}
.theatre-player video {
  height: min(66vh, 700px);
  flex: 1;
}
.player-tools {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #0b0a0c;
  border-top: 1px solid #252126;
}
.player-tools span {
  margin-left: auto;
  color: #89858d;
  font-size: 11px;
}
.source-drawer {
  min-width: 0;
  background: #0d0c0f;
  border-left: 1px solid #2d2429;
  display: flex;
  flex-direction: column;
}
.source-drawer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #29242a;
}
.source-drawer header b {
  font-size: 15px;
}
.source-drawer header button {
  display: none;
  font-size: 20px;
  padding: 4px 10px;
}
#player-sources {
  overflow: auto;
  padding: 10px;
  max-height: calc(82vh - 75px);
}
.player-source {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #ddd;
  border-radius: 9px;
  padding: 12px;
  cursor: pointer;
}
.player-source:hover {
  background: #18151a;
}
.player-source.active {
  border-color: #792238;
  background: #250d14;
  box-shadow: inset 3px 0 var(--red);
}
.player-source > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  flex: 0 0 auto;
}
.player-source.active > i {
  background: #35db80;
  box-shadow: 0 0 10px #35db80;
}
.player-source span {
  min-width: 0;
}
.player-source b,
.player-source small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-source small {
  color: #827d86;
  margin-top: 4px;
  font-size: 10px;
}
.player-message {
  padding: 70px;
  text-align: center;
}
.auth-page {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, #350713, #060607 55%);
  padding: 25px;
}
.auth-card {
  width: min(460px, 100%);
  background: #101014;
  border: 1px solid #392129;
  border-radius: 18px;
  padding: 35px;
  box-shadow: 0 30px 90px #000;
}
.auth-card h1 {
  font:
    600 46px "Cormorant Garamond",
    serif;
  margin: 8px 0;
}
.auth-card p {
  color: #aaa;
  line-height: 1.6;
}
.auth-card label {
  display: block;
  color: #aaa;
  margin: 18px 0 7px;
}
.auth-card input {
  display: block;
  width: 100%;
  background: #18171b;
  border: 1px solid #353039;
  border-radius: 8px;
  color: #fff;
  padding: 13px;
  margin-top: 7px;
}
.auth-card button {
  width: 100%;
  margin-top: 15px;
}
.auth-error {
  background: #42101d;
  color: #ff9caf;
  padding: 12px;
  border-radius: 8px;
}
.auth-links {
  text-align: center;
}
a {
  color: #ff5b76;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #eee;
  color: #111;
  padding: 11px 17px;
  border-radius: 99px;
  transition: 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.catalog-credit {
  padding: 30px max(4vw, 28px) 50px;
  color: #656169;
  font-size: 11px;
}
.catalog-credit a {
  color: #918b94;
}
@media (max-width: 1000px) {
  .watch-nav {
    padding: 0 15px;
  }
  .watch-brand span,
  #categories {
    display: none;
  }
  #search-form {
    min-width: 0;
  }
  .account span {
    display: none;
  }
  .watch-hero {
    min-height: 440px;
  }
  .detail {
    grid-template-columns: 220px 1fr;
  }
}
@media (max-width: 620px) {
  .watch-nav {
    gap: 9px;
  }
  .watch-brand img {
    width: 38px;
    height: 38px;
  }
  #search-form input {
    width: 110px;
  }
  .account .join {
    display: none;
  }
  .watch-hero {
    padding: 65px 24px;
  }
  .watch-hero h1 {
    font-size: 50px;
  }
  .shelf {
    padding: 24px 16px;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .detail {
    display: block;
  }
  .detail > img {
    height: 260px;
    min-height: 0;
  }
  .detail-copy {
    padding: 25px;
  }
  .detail h2 {
    font-size: 35px;
  }
  .empty {
    padding: 35px 12px;
  }
}
@media (max-width: 850px) {
  .theatre-player {
    display: block;
    min-height: 0;
  }
  .source-drawer {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(340px, 88%);
    z-index: 6;
    transform: translateX(102%);
    transition: 0.25s;
    box-shadow: -20px 0 60px #000;
  }
  .theatre-player.drawer-open .source-drawer {
    transform: none;
  }
  .source-drawer header button {
    display: block;
  }
  .theatre-player video {
    height: 60vh;
  }
  .player-heading b {
    font-size: 19px;
  }
  .player-tools span {
    display: none;
  }
}

/* After Dark Theatre */
.watch-nav {
  height: 72px;
  background: linear-gradient(180deg, #050506 0%, #050506e8 76%, transparent);
  border-bottom: 0;
}
.watch-hero {
  --hero-image: url("/static/anime-gate-city.png");
  min-height: min(72vh, 760px);
  padding: 120px max(5vw, 34px) 100px;
  background-image:
    linear-gradient(90deg, #050506 4%, #070708e8 30%, #0707083b 65%, #05050626),
    linear-gradient(0deg, var(--bg), transparent 42%), var(--hero-image);
  background-position: center;
  background-size: cover;
  transition: background-image 0.7s ease;
}
.watch-hero:after {
  height: 90px;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 75% 35%,
    transparent 0 20%,
    #0505061c 60%
  );
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.watch-hero h1 {
  font-size: clamp(55px, 7vw, 96px);
  max-width: 800px;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  gap: 11px;
  margin-top: 27px;
}
.hero-actions .secondary {
  background: #151519c9;
  backdrop-filter: blur(12px);
}
.hero-dots {
  position: absolute;
  z-index: 3;
  left: max(5vw, 34px);
  bottom: 62px;
  display: flex;
  gap: 7px;
}
.hero-dots button {
  width: 25px;
  height: 3px;
  border: 0;
  border-radius: 8px;
  background: #ffffff45;
  padding: 0;
  cursor: pointer;
  transition: 0.25s;
}
.hero-dots button.active {
  width: 50px;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}
.discover {
  position: relative;
  z-index: 3;
  margin-top: -34px;
  padding-bottom: 30px;
}
.rail-section {
  padding: 22px max(4vw, 28px);
}
.rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 15px;
}
.rail-head h2 {
  font:
    600 clamp(27px, 3vw, 38px) "Cormorant Garamond",
    serif;
  margin: 4px 0 0;
}
.rail-head > span {
  color: var(--muted);
}
.rail-controls {
  display: flex;
  gap: 7px;
}
.rail-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid #343038;
  border-radius: 50%;
  color: #fff;
  background: #111115c9;
  font-size: 25px;
  cursor: pointer;
  transition: 0.2s;
}
.rail-controls button:hover {
  background: #311019;
  border-color: #8d273b;
}
.media-rail {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 5px 2px 25px;
}
.media-rail::-webkit-scrollbar {
  display: none;
}
.media-rail .media-card, .media-row .media-card {
  flex: 0 0 135px !important;
  width: 135px !important;
  max-width: 135px !important;
  min-width: 135px !important;
  scroll-snap-align: start;
}
.media-card {
  position: relative;
  background: #0c0c0f;
  border-color: #211e23;
  border-radius: 10px;
}
.media-card:after {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e50914;
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.6);
  transform: translate(-50%, -30%) scale(0.7);
  opacity: 0;
  transition: 0.25s;
}
.media-card:hover:after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.media-card .meta {
  background: linear-gradient(0deg, #0b0b0e 65%, transparent);
  margin-top: -15px;
  position: relative;
  padding-top: 18px;
}
.media-grid {
  padding: 8px 0 30px;
}
.season-choice,
.episode-choice {
  margin: 0 7px 8px 0;
}
.auto-source {
  width: 100%;
  margin-bottom: 12px;
}
@media (max-width: 1000px) {
  .watch-nav {
    background: #070708f2;
  }
  .watch-hero {
    min-height: 580px;
  }
  .discover {
    margin-top: -20px;
  }
  .media-rail .media-card, .media-row .media-card {
    flex: 0 0 125px !important;
    width: 125px !important;
    max-width: 125px !important;
    min-width: 125px !important;
  }
}
@media (max-width: 620px) {
  .watch-hero {
    min-height: 520px;
    padding-top: 90px;
    background-position: 63% center;
  }
  .watch-hero h1 {
    font-size: 48px;
  }
  .watch-hero p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.5;
  }
  .hero-actions {
    flex-wrap: wrap;
  }
  .hero-dots {
    bottom: 43px;
  }
  .rail-section {
    padding: 18px 16px;
  }
  .rail-controls {
    display: none;
  }
  .media-rail {
    gap: 10px;
  }
  .media-rail .media-card, .media-row .media-card {
    flex: 0 0 115px !important;
    width: 115px !important;
    max-width: 115px !important;
    min-width: 115px !important;
  }
  .discover {
    margin-top: 0;
  }
}

/* --- Ultra-Compact Stream Selector & Netflix/Cinejoy Modal Styling --- */
dialog#details {
  width: min(860px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(14, 14, 18, 0.96);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9);
}
.detail {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  position: relative;
  background-image:
    linear-gradient(90deg, #0e0e12 28%, #0e0e12ee 65%, #0e0e12cc),
    var(--detail-backdrop);
  background-size: cover;
  background-position: center;
}
.detail > img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}
.detail-copy {
  padding: 24px 28px;
  min-width: 0;
}
.detail h2 {
  font: 700 28px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.5px;
  margin: 4px 0 8px;
  color: #fff;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #e50914;
}
.detail p {
  color: #999;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.detail-facts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
}
.detail-facts span {
  padding: 3px 8px;
  border: 1px solid #332f38;
  border-radius: 4px;
  color: #ccc;
  font-size: 10px;
  font-weight: 600;
  background: rgba(10, 9, 12, 0.7);
}
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0 16px;
}
.detail-actions .primary, .detail-actions .secondary {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 600;
}
.source-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 10px;
  border-bottom: 1px solid #232029;
  padding-bottom: 8px;
}
.tab-btn {
  background: #16141a;
  border: 1px solid #2d2836;
  color: #aaa;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn.active, .tab-btn:hover {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
  font-weight: 600;
}
.streams-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 6px;
}
.streams-kicker {
  font-size: 10px;
  letter-spacing: 1px;
  color: #777;
  font-weight: 700;
}
.auto-play-link {
  background: none;
  border: none;
  color: #ff4d5a;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
}
.streams-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stream-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #232029;
  background: #121016;
  border-radius: 8px;
  padding: 10px 14px;
  gap: 12px;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.stream-card:hover {
  border-color: #4a3e52;
  background: #17151d;
}
.stream-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.stream-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}
.stream-title {
  font-size: 12px;
  font-weight: 600;
  color: #f0f0f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.badge-provider {
  background: #2a2233;
  color: #d1b3ff;
  border: 1px solid #4a3860;
}
.badge-res {
  background: #1e3a29;
  color: #5cf09e;
  border: 1px solid #2d6643;
}
.badge-codec {
  background: #1f2b3e;
  color: #72b5ff;
  border: 1px solid #334d73;
}
.badge-hdr {
  background: #3d2b1f;
  color: #ffaa5c;
  border: 1px solid #664633;
}
.badge-dv {
  background: #3d1f39;
  color: #ff5ce8;
  border: 1px solid #663360;
}
.badge-seeds {
  background: #2b391e;
  color: #a4ff5c;
  border: 1px solid #476633;
}
.stream-meta {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stream-play-btn {
  background: #e50914 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  padding: 6px 14px !important;
  border-radius: 5px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35) !important;
  transition: transform 0.15s ease, background 0.15s ease !important;
}
.stream-play-btn:hover {
  background: #f40612 !important;
  transform: scale(1.03) !important;
}
.stream-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.btn-subtle {
  background: #1c1922;
  border: 1px solid #383142;
  color: #ccc;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.torrent-notice, .empty-tab-notice {
  background: #141218;
  border: 1px solid #2d2836;
  border-radius: 6px;
  padding: 10px 14px;
  color: #aaa;
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 10px;
}

/* --- Cinejoy TV Season Dropdown & Episode Rail --- */
.tv-season-selector {
  margin-top: 10px;
}
.episodes-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #232029;
}
.episodes-header-title h3 {
  font: 600 24px "Cormorant Garamond", serif;
  margin: 0;
  color: #fff;
  letter-spacing: 0.02em;
}
.season-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.season-select-pill {
  appearance: none;
  -webkit-appearance: none;
  background: #191722;
  border: 1px solid #363044;
  color: #ffffff;
  padding: 7px 32px 7px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.season-select-pill:hover, .season-select-pill:focus {
  border-color: #ff2448;
  background: #221c2d;
}
.select-chevron {
  position: absolute;
  right: 12px;
  pointer-events: none;
  color: #aaa;
  font-size: 10px;
}
.episode-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 14px;
  margin-bottom: 16px;
}
.episode-rail::-webkit-scrollbar {
  display: none;
}
.episode-rail .episode-card {
  flex: 0 0 175px;
  width: 175px;
  max-width: 175px;
  min-width: 175px;
  background: #111016;
  border: 1px solid #26222e;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}
.episode-rail .episode-card:hover {
  transform: translateY(-3px);
  border-color: #ff2448;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.episode-rail .episode-card.active {
  border-color: #ff2448;
  background: #1c1418;
  box-shadow: 0 0 16px rgba(255, 36, 72, 0.35);
}
.ep-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1c1824;
  overflow: hidden;
}
.ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-num-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  line-height: 1;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.ep-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.episode-card:hover .ep-play-overlay, .episode-card.active .ep-play-overlay {
  opacity: 1;
}
.ep-body {
  padding: 8px 10px;
}
.ep-title {
  font-size: 11px;
  font-weight: 600;
  color: #f0f0f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.ep-overview {
  display: none;
}

/* Continue Watching 16:9 Landscape Card */
.media-row .continue-card {
  flex: 0 0 240px;
  width: 240px;
  max-width: 240px;
  min-width: 240px;
  scroll-snap-align: start;
}
@media (max-width: 768px) {
  .media-row .continue-card {
    flex: 0 0 185px;
    width: 185px;
    max-width: 185px;
    min-width: 185px;
  }
}
.continue-card .poster.landscape {
  aspect-ratio: 16 / 9 !important;
  position: relative;
  overflow: hidden;
  background: #14121a;
}
.continue-card .poster.landscape img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.continue-card:hover .poster.landscape img {
  transform: scale(1.06);
}
.continue-card .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(8, 7, 10, 0.82);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  letter-spacing: 0.05em;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.continue-card .badge.ep-badge {
  background: rgba(229, 9, 20, 0.88);
  border-color: rgba(255, 255, 255, 0.3);
}
.continue-card .poster.landscape .progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
}
.continue-card { position: relative; }
.card-remove {
  position: absolute;
  z-index: 5;
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border: 1px solid #ffffff38;
  border-radius: 50%;
  background: #09090bd9;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.continue-card:hover .card-remove, .card-remove:focus { opacity: 1; }
.card-remove:hover { background: var(--red); }
#simkl-control { display: inline-flex; gap: 6px; align-items: center; }
#simkl-control button, #simkl-control a {
  border: 1px solid #343039;
  border-radius: 7px;
  background: #151419;
  color: #ddd;
  padding: 7px 9px;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}
#simkl-control .simkl-connected { color: #67e39c; border-color: #245f3d; }
.watched-badge { background: #071d12e8 !important; color: #69e49e !important; border-color: #2a7a4c !important; }

/* Immersive cinema navigation and title pages */
@media (min-width: 1050px) {
  .watch-nav {
    top: 18px;
    left: 22px;
    right: 22px;
    width: auto;
    height: 58px;
    padding: 7px 12px;
    transform: none;
    border: 1px solid #ffffff1f;
    border-radius: 999px;
    background: #0d0d10b8;
    box-shadow: 0 14px 42px #0008;
    backdrop-filter: blur(22px) saturate(1.25);
  }
  .watch-brand {
    position: static;
    width: auto;
    justify-content: flex-start;
  }
  #categories { margin-left: auto; flex-shrink: 0; }
  #categories button {
    min-height: 42px;
    padding: 0 15px;
    border-radius: 999px;
  }
  #categories button.active {
    color: #111;
    background: #fff;
    box-shadow: none;
  }
  #categories button.active::after { display: none; }
  #search-form { margin-left: 0; min-width: 190px; max-width: 230px; }
  .watch-nav .account { flex-shrink: 0; }
}

dialog#details {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #08080a;
  overflow-y: auto;
  box-shadow: none;
}
dialog#details::backdrop { background: #000; }
dialog#details .dialog-close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff33;
  border-radius: 50%;
  background: #09090bd9;
  color: #fff;
  font-size: 28px;
  z-index: 50;
  backdrop-filter: blur(15px);
}
dialog#details .detail {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
  align-items: end;
  min-height: 100dvh;
  padding: clamp(150px, 28vh, 310px) max(5vw, 28px) 70px;
  border-radius: 0;
  background-image:
    linear-gradient(0deg, #08080a 0%, #08080ae8 28%, #08080a3d 68%, #08080a26),
    linear-gradient(90deg, #08080ad9 0%, #08080a38 58%, #08080a5c 100%),
    var(--detail-backdrop);
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}
dialog#details .detail-poster {
  display: none;
}
dialog#details .detail-poster img,
dialog#details .poster-placeholder {
  width: 100%;
  max-width: 260px;
  border-radius: 15px;
  box-shadow: 0 25px 70px #000d;
}
dialog#details .detail-copy { padding: 0; }
dialog#details .detail h2 {
  font: 600 clamp(48px, 6vw, 82px)/.95 "Cormorant Garamond", serif;
  letter-spacing: -.03em;
  max-width: 850px;
  margin: 8px 0 16px;
}
dialog#details .detail p,
dialog#details .detail blockquote { max-width: 760px; font-size: 16px; }
dialog#details .detail-actions .primary,
dialog#details .detail-actions .secondary {
  padding: 13px 19px;
  border-radius: 999px;
  font-size: 14px;
}
dialog#details .streams,
dialog#details .detail-extra {
  max-width: 920px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #ffffff17;
}

.player-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.player-dialog .theatre-player { height: 100dvh; }
.player-dialog .player-stage { min-height: 100dvh; }
.player-dialog .player-stage video { height: calc(100dvh - 112px); }
.player-dialog .dialog-close {
  position: fixed;
  top: 18px;
  left: 20px;
  right: auto;
  width: 42px;
  height: 42px;
  z-index: 20;
  border-radius: 50%;
  background: #08090bc7;
  color: white;
  border: 1px solid #ffffff26;
}

@media (max-width: 760px) {
  dialog#details .dialog-close { top: 14px; right: 14px; }
  dialog#details .detail {
    grid-template-columns: 1fr;
    align-items: end;
    padding: 260px 18px 40px;
    background-position: 62% top;
  }
  dialog#details .detail-poster { display: none; }
  dialog#details .detail h2 { font-size: 48px; }
  dialog#details .detail p { font-size: 14px; }
}

/* Browse by Provider Rail */
.provider-shelf {
  padding-top: 10px;
  padding-bottom: 20px;
}
.provider-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 2px 14px;
}
.provider-rail::-webkit-scrollbar {
  display: none;
}
.provider-card {
  flex: 0 0 auto;
  height: 48px;
  min-width: 105px;
  padding: 0 18px;
  border-radius: 10px;
  background: #111016;
  border: 1px solid #26222e;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  outline: none;
}
.provider-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  background: #181622;
}
.provider-card.active {
  border-color: var(--red);
  background: #1f1317;
  box-shadow: 0 0 18px rgba(255, 36, 72, 0.35);
}

/* Provider Brand Logos & Typography */
.provider-logo {
  font-size: 13px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.provider-card.netflix .provider-logo {
  color: #e50914;
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 14px;
}
.provider-card.prime .provider-logo {
  color: #00a8e1;
  font-weight: 800;
  font-style: italic;
  font-size: 13px;
}
.provider-card.disney .provider-logo {
  color: #ffffff;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
}
.provider-card.appletv .provider-logo {
  color: #f5f5f7;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.provider-card.hulu .provider-logo {
  color: #1ce783;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.provider-card.max .provider-logo {
  color: #ffffff;
  background: linear-gradient(135deg, #002be7, #9b51e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.1em;
}
.provider-card.paramount .provider-logo {
  color: #0064ff;
  font-weight: 800;
  font-size: 13px;
}
.provider-card.peacock .provider-logo {
  color: #ffc700;
  font-weight: 700;
  font-size: 13px;
}
.provider-card.crunchyroll .provider-logo {
  color: #ff6600;
  font-weight: 800;
  font-size: 13px;
}
.provider-card.starz .provider-logo {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.15em;
  font-size: 13px;
}
.provider-card.amc .provider-logo {
  color: #00b8c6;
  font-weight: 800;
  font-size: 13px;
}
