.stream-site {
  --bg: #100c13;
  --surface: #1b1320;
  --raised: #251827;
  --line: #372636;
  --text: #f9f2f5;
  --muted: #c9b6c4;
  --stream-edge: clamp(14px, 4.2vw, 62px);
  background: var(--bg);
  font-family: "Tahoma", "Segoe UI", "Inter Variable", Arial, sans-serif;
  line-height: 1.7;
}
.stream-site bdi { unicode-bidi: isolate; }
.stream-site .skip-link { z-index: 11; }
.stream-site :is(h1, h2, h3, p, a, button) { overflow-wrap: anywhere; }
.stream-site :is(h1, h2, h3) { letter-spacing: normal; line-height: 1.27; }
.stream-site :is(input, select, button) { font: inherit; }
.stream-site :is(input, select) { color: inherit; }
.stream-wrap { width: min(100%, 1440px); padding-inline: var(--stream-edge); margin-inline: auto; }
.stream-site .adsterra-rail-layout { direction: ltr; }
.stream-site .adsterra-rail-layout > .container { direction: rtl; }
.stream-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  background: #130e17f5;
  border-block-end: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.stream-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 270px) auto;
  align-items: center;
  gap: clamp(10px, 2.5vw, 42px);
  padding-block: 12px;
}
.stream-brand { display: inline-flex; width: fit-content; align-items: center; gap: 9px; font-size: 16px; font-weight: 750; }
.stream-brand img { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.stream-brand bdi { direction: ltr; }
.stream-nav nav, .stream-footer nav { display: flex; flex-wrap: wrap; gap: 7px clamp(10px, 1.8vw, 25px); align-items: center; }
.stream-nav nav a, .stream-footer nav a { color: var(--muted); font-size: 13px; font-weight: 650; }
.stream-nav nav a:hover, .stream-footer nav a:hover, .stream-nav a[aria-current="page"] { color: var(--accent); }
.stream-language { font: 650 12px/1.3 "Inter Variable", sans-serif; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.stream-search { position: relative; display: flex; min-width: 0; background: #1a131d; border: 1px solid var(--line); border-radius: 9px; }
.stream-search input { min-width: 0; flex: 1 1 0; border: 0; border-radius: 9px; background: transparent; padding: 8px 10px; font-size: 13px; }
.stream-search button { display: grid; place-items: center; width: 40px; border: 0; background: transparent; border-radius: 9px; }
.stream-search svg { width: 19px; height: 19px; color: var(--accent); }
.stream-suggestions {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline: 0;
  max-height: min(360px, 56dvh);
  overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px #0009;
}
.stream-suggestion { display: flex; align-items: center; gap: 10px; padding: 7px; border-radius: 7px; }
.stream-suggestion:is(:hover, :focus-visible) { background: var(--raised); }
.stream-suggestion img { width: 33px; height: 49px; object-fit: cover; border-radius: 4px; flex: none; }
.stream-suggestion span { min-width: 0; }
.stream-suggestion small { display: block; color: var(--muted); }
.stream-featured {
  position: relative;
  min-height: clamp(420px, 47vw, 620px);
  isolation: isolate;
  background: #1c1023;
}
.stream-slide { position: relative; min-height: inherit; display: grid; align-items: center; isolation: isolate; overflow: hidden; }
.stream-featured .is-outgoing { position: absolute; inset: 0; }
.stream-featured[data-active] .stream-slide:not([hidden], .is-outgoing) { animation: hero-enter .5s ease both; }
.stream-hero-art, .stream-slide::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.stream-hero-art { z-index: -2; object-fit: cover; object-position: 50% 48%; }
.stream-slide::before {
  content: "";
  z-index: -1;
  background: linear-gradient(270deg, #120c17 7%, #150d19e8 29%, #1911225c 68%, #130b1466),
    linear-gradient(0deg, var(--bg), transparent 34%);
}
.stream-hero-copy { padding-block: 54px 85px; }
.stream-editor-label { display: inline-block; border: 1px solid #e371a247; color: #ffc4d7; background: #74284062;
  border-radius: 4px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.stream-hero-copy h1, .stream-hero-copy h2, .stream-featured-empty h1 {
  max-width: 14ch;
  margin-block: 11px 14px;
  font-size: clamp(34px, 6.4vw, 84px);
  text-wrap: balance;
}
.stream-hero-meta, .stream-meta { color: #f9bbcc; font-size: 13px; font-weight: 650; }
.stream-hero-description { max-width: 49ch; margin-block: 11px 22px; color: #ecdce6; font-size: 14px; text-align: start; }
.stream-featured-empty { display: grid; align-items: center; background: linear-gradient(90deg, #100c1380, #100c13f2), url("../images/tokyo-feature.jpg") center / cover; }
.stream-featured-empty p { margin-block-end: 18px; }
.stream-button {
  display: inline-flex; min-height: 42px; gap: 7px; align-items: center; justify-content: center;
  padding: 7px 15px; border: 1px solid #775066; border-radius: 8px; background: #251723d9; color: var(--text); font-weight: 700;
  font-size: 13px; text-align: center; transition: background .17s, border-color .17s;
}
.stream-button:hover { background: #382237; border-color: #b87999; }
.stream-primary { background: #a8204b; border-color: #e26088; color: white; }
.stream-primary:hover { background: #811b40; }
.stream-carousel-controls, .stream-rail-controls, .stream-carousel-dots { display: flex; align-items: center; gap: 6px; }
.stream-carousel-controls { position: absolute; z-index: 2; inset-inline-start: max(var(--stream-edge), calc((100% - 1440px) / 2 + var(--stream-edge))); inset-block-end: 21px; }
.stream-carousel-controls button, .stream-rail-controls button {
  width: 36px; height: 36px; padding: 0; border: 1px solid #533846; border-radius: 50%; background: #201523; text-align: center;
}
.stream-carousel-controls button:hover, .stream-rail-controls button:hover:not(:disabled) { border-color: var(--accent); }
.stream-carousel-dots button { width: 10px; height: 10px; background: #bea1b5; border: 0; }
.stream-carousel-dots button[aria-pressed="true"] { width: 23px; border-radius: 6px; background: var(--accent); }
.stream-site button:disabled { opacity: .35; cursor: default; }
.stream-site .stream-home, .stream-interior { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(21px, 4vw, 44px); padding-block: 24px 52px; }
.stream-section { min-width: 0; scroll-margin: 92px; }
.stream-section-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-block-end: 10px; }
.stream-section-heading h2 { font-size: clamp(19px, 2.5vw, 30px); }
.stream-section-heading h2:first-child { margin-inline-end: auto; }
.stream-more { color: #ffabc4; font-size: 13px; font-weight: 650; }
.stream-more:hover { text-decoration: underline; }
.stream-rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(108px, 13.3vw, 224px); gap: 12px; overflow-x: auto; padding: 3px 3px 11px; scroll-snap-type: inline mandatory; scrollbar-width: thin; scrollbar-color: #64364d transparent; }
.stream-card { min-width: 0; scroll-snap-align: start; }
.stream-card a { display: block; border-radius: 9px; }
.stream-poster { position: relative; overflow: hidden; aspect-ratio: 2 / 3; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.stream-poster img { height: 100%; object-fit: cover; transition: transform .24s; }
.stream-card a:is(:hover, :focus-visible) .stream-poster img { transform: scale(1.045); }
.stream-card-copy { padding: 7px 2px 0; }
.stream-card h3 { font-size: clamp(13px, 1.25vw, 17px); font-weight: 740; }
.stream-card p { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: 11px; margin-block-start: 4px; }
.stream-rank { position: absolute; inset-inline-start: 6px; inset-block-end: 6px; min-width: 38px; padding-inline: 5px; border: 1px solid #ffaaac; border-radius: 7px; background: #352132; text-align: center; font-size: 23px; font-weight: 750; }
.stream-empty { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: #17111b; color: var(--muted); font-size: 13px; }
.stream-genres, .stream-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stream-genres a, .stream-chips a { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 7px 11px; font-size: 13px; }
.stream-genres a:hover, .stream-chips a:hover { border-color: var(--accent); }
.stream-genres span { color: #f7aac1; }
.stream-footer { margin-block-start: 5px; padding-block: 22px; background: #150f18; border-block-start: 1px solid var(--line); }
.stream-footer .stream-wrap { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; align-items: center; }
.stream-footer p { color: var(--muted); }
.stream-heading h1 { font-size: clamp(27px, 5.5vw, 55px); }
.stream-heading p, .stream-results { margin-block-start: 8px; color: var(--muted); }
.stream-heading:dir(rtl), .stream-synopsis:dir(rtl) { text-align: start; }
.stream-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(100px, 1fr)); gap: 9px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.stream-filters label, .stream-episode-jump { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.stream-filters :is(input, select), .stream-episode-jump select {
  min-width: 0; width: 100%; padding: 7px 9px; border: 1px solid #694359; border-radius: 7px; background: #161019; color: var(--text);
}
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 146px), 1fr)); gap: 17px 12px; }
.stream-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }
.stream-pagination button { background: var(--raised); border: 1px solid var(--line); border-radius: 7px; padding: 6px 13px; }
.stream-detail { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(140px, 260px) minmax(0, 1fr); align-items: center; gap: clamp(15px, 4vw, 53px); padding: clamp(14px, 3vw, 37px); border: 1px solid var(--line); border-radius: 14px; }
.stream-detail-backdrop, .stream-detail::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.stream-detail-backdrop { z-index: -2; object-fit: cover; }
.stream-detail::before { content: ""; background: linear-gradient(270deg, #170e19e8, #150c19f7 60%, #150c1acc); z-index: -1; }
.stream-detail-poster { aspect-ratio: 2 / 3; height: auto; border: 1px solid #68455d; border-radius: 10px; object-fit: cover; }
.stream-detail h1 { font-size: clamp(22px, 5.3vw, 59px); }
.stream-detail-copy > p { margin-block: 10px; }
.stream-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; }
.stream-synopsis { color: #ebdce7; font-size: clamp(13px, 1.5vw, 16px); max-width: 70ch; }
.stream-actions, .stream-episode-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 12px; }
.stream-episode-group { margin-block-end: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.stream-episode-group summary { padding: 7px 11px; cursor: pointer; color: #ffd0de; font-weight: 650; }
.stream-episode-group[open] > summary { border-block-end: 1px solid var(--line); }
.stream-episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 6px; padding: 9px; }
.stream-episode-grid a { display: grid; place-content: center; min-height: 47px; border: 1px solid #473242; border-radius: 6px; padding: 3px; text-align: center; font-size: 12px; background: #1c1420; }
.stream-episode-grid a:is(:hover, [aria-current]) { border-color: var(--accent); color: #ffd1df; background: #482139; }
.stream-episode-grid small { color: var(--muted); }
.stream-watch-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(13px, 3vw, 36px); align-items: start; }
.stream-watch-sidebar { min-width: 0; display: grid; gap: 16px; }
.stream-player { position: relative; width: min(100%, 880px); aspect-ratio: 16 / 9; overflow: hidden; background: #050406; border: 1px solid var(--line); border-radius: 10px; margin-inline: auto; }
.stream-vertical .stream-player { width: min(100%, 360px, 47vh); aspect-ratio: 9 / 16; }
.stream-player :is(video, iframe) { height: 100%; width: 100%; display: block; border: 0; }
.stream-player video { object-fit: contain; }
.stream-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #100c1380; pointer-events: none; color: white; }
.stream-player-error { margin-block-start: 8px; color: #ffd0df; }
.stream-external { margin-block-start: 10px; }
.stream-external p, .stream-original, .stream-auto-next { color: var(--muted); font-size: 12px; }
.stream-original { display: inline-block; text-decoration: underline; }
.stream-auto-next { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; }
.stream-episode-about p { margin-block: 8px; color: var(--muted); }
.stream-history { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 1fr)); gap: 8px; }
.stream-history > .stream-empty { grid-column: 1 / -1; }
.stream-history-item { display: grid; min-width: 0; grid-template-columns: 49px minmax(0, 1fr); align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 7px; }
.stream-history-item img { width: 49px; height: 73px; object-fit: cover; border-radius: 4px; }
.stream-history-item p { font-size: 12px; color: var(--muted); }
.stream-history-item progress { width: 100%; accent-color: var(--accent); }
.stream-history-item button { grid-column: 2; width: fit-content; border: 0; border-radius: 5px; padding: 3px; background: transparent; color: #ffb5cc; text-decoration: underline; font-size: 12px; }
@media (max-width: 850px) {
  .stream-nav { grid-template-columns: minmax(0, 1fr) minmax(110px, 260px) auto; gap: 9px 12px; }
  .stream-nav nav { grid-row: 2; grid-column: 1 / -1; }
  .stream-nav .stream-search { grid-row: 1; grid-column: 2; }
}
@media (max-width: 560px) {
  .stream-nav { grid-template-columns: minmax(0, 1fr) auto; }
  .stream-nav nav { grid-row: 3; justify-content: space-between; }
  .stream-nav .stream-search { grid-row: 2; grid-column: 1 / -1; }
  .stream-nav nav a { font-size: 12px; }
  .stream-featured { min-height: 440px; }
  .stream-slide { align-items: end; }
  .stream-slide::before { background: linear-gradient(0deg, #100c13 10%, #140c19e8 34%, #180c193d 100%); }
  .stream-hero-copy { padding-block: 42px 62px; }
  .stream-carousel-controls { inset-block-end: 12px; }
  .stream-carousel-controls > button { width: 31px; height: 31px; }
  .stream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stream-filters label:first-child { grid-column: 1 / -1; }
  .stream-detail, .stream-watch-grid { grid-template-columns: minmax(0, 1fr); }
  .stream-detail-poster { width: min(50%, 175px); justify-self: center; }
  .stream-vertical .stream-player { width: min(100%, 360px, 54dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .stream-featured[data-active] .stream-slide { animation: none; }
  .stream-site * { transition: none !important; }
}
