:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f5;
  --ink: #171b22;
  --muted: #697280;
  --line: #dfe6eb;
  --red: #a61f3d;
  --red-deep: #7a1730;
  --teal: #126c73;
  --gold: #c78b2d;
  --shadow: 0 20px 50px rgba(24, 35, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(18, 108, 115, 0.08), transparent 420px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

body::selection {
  background: rgba(166, 31, 61, 0.2);
}

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(223, 230, 235, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
}

.top-nav {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.top-nav a,
.auth-button,
.btn,
.chip,
.episode-list button {
  min-height: 40px;
  border-radius: 8px;
}

.top-nav a {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.top-nav a:hover {
  color: var(--red);
  background: rgba(166, 31, 61, 0.08);
}

.auth-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0 16px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.auth-button--ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.auth-button--ghost:hover {
  border-color: rgba(166, 31, 61, 0.2);
  background: rgba(166, 31, 61, 0.08);
  color: var(--red);
}

.hero {
  min-height: min(760px, calc(100svh - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  gap: 28px;
  align-items: end;
  padding: clamp(80px, 12vw, 150px) clamp(18px, 5vw, 72px) 42px;
  background:
    linear-gradient(90deg, rgba(11, 17, 24, 0.9), rgba(11, 17, 24, 0.54) 48%, rgba(11, 17, 24, 0.22)),
    linear-gradient(0deg, rgba(11, 17, 24, 0.82), transparent 44%),
    var(--hero-image) center / cover;
  color: #fff;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-title {
  margin: 24px 0 4px;
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
  font-weight: 800;
}

.hero-meta {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.hero-copy > p:last-of-type,
.page-hero p,
.detail-copy > p {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.btn:hover,
.auth-button:hover {
  background: var(--red-deep);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-small {
  min-height: 34px;
  padding: 0 13px;
  font-size: 0.9rem;
}

.hero-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(11, 17, 24, 0.58);
  backdrop-filter: blur(10px);
}

.hero-panel span,
.hero-panel a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.hero-panel strong {
  display: block;
  margin: 6px 0 14px;
  font-size: 1.4rem;
}

.hero-panel a {
  color: #fff;
  font-weight: 800;
}

.ticker {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px clamp(18px, 5vw, 72px);
  background: var(--ink);
  color: #fff;
}

.ticker span {
  color: var(--gold);
  font-weight: 800;
}

.ticker-viewport {
  overflow: hidden;
  min-width: 0;
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 34s linear infinite;
}

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker-group {
  display: flex;
  flex-shrink: 0;
  gap: 18px;
  padding-right: 18px;
  white-space: nowrap;
}

.ticker a {
  color: rgba(255, 255, 255, 0.82);
}

.ticker a:hover {
  color: #fff;
}

@keyframes ticker-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
    overflow-x: auto;
    scrollbar-width: none;
    width: auto;
  }
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 56px auto;
}

.section-tight {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-heading h2,
.facts h2,
.prose-section h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading > a,
.result-count {
  color: var(--muted);
  font-weight: 700;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.compact-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(24, 35, 48, 0.06);
}

.compact-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.compact-card span {
  display: inline-flex;
  margin: 10px 10px 2px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(18, 108, 115, 0.1);
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
}

.compact-card strong,
.compact-card small {
  display: block;
  min-width: 0;
  padding: 0 10px;
}

.compact-card strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-card small {
  margin: 3px 0 12px;
  color: var(--muted);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.catalog-surface {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(140px, 0.55fr));
  gap: 12px;
  margin-bottom: 14px;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.filters input,
.filters select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.filters input:focus,
.filters select:focus {
  outline: 3px solid rgba(18, 108, 115, 0.16);
  border-color: var(--teal);
}

.chip-row {
  display: flex;
  gap: 8px;
  margin: 4px 0 22px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.chip.is-active {
  border-color: rgba(166, 31, 61, 0.18);
  background: rgba(166, 31, 61, 0.1);
  color: var(--red);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

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

.title-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(24, 35, 48, 0.07);
}

.title-card[hidden] {
  display: none;
}

.poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--surface-strong);
}

.poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 220ms ease;
}

.title-card:hover .poster img,
.compact-card:hover img {
  transform: scale(1.04);
}

.quality,
.rating {
  position: absolute;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
}

.quality {
  left: 10px;
  background: var(--teal);
}

.rating {
  right: 10px;
  background: rgba(23, 27, 34, 0.74);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 14px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.card-tags span {
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(199, 139, 45, 0.14);
  color: #8a5c12;
  font-size: 0.74rem;
  font-weight: 800;
}

.card-body h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.2;
}

.card-body p {
  margin: 9px 0;
  color: #3a424d;
  font-size: 0.94rem;
}

.muted {
  color: var(--muted) !important;
}

.mini-meta {
  display: grid;
  gap: 8px;
  margin: auto 0 12px;
}

.mini-meta div,
.facts dl div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

dd {
  margin: 0;
}

.title-card--wide .poster img {
  aspect-ratio: 16 / 11;
}

.page-hero {
  padding: 78px clamp(18px, 5vw, 72px) 54px;
  background:
    linear-gradient(90deg, rgba(23, 27, 34, 0.92), rgba(23, 27, 34, 0.76)),
    url("https://images.unsplash.com/photo-1741198166163-99230d4b5b50?auto=format&fit=crop&w=1800&q=80")
      center / cover;
  color: #fff;
}

.page-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 780px) minmax(300px, 360px);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  justify-content: space-between;
}

.page-hero-copy {
  min-width: 0;
}

.page-hero h1 {
  max-width: 880px;
  font-size: clamp(2.25rem, 5vw, 5rem);
}

.page-hero p {
  max-width: 680px;
}

.hero-subscription {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(14, 20, 30, 0.62);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.plan-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.plan-card-head span {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 800;
}

.plan-card-head strong {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.96rem;
  font-weight: 900;
}

.plan-preview {
  display: grid;
  min-height: 122px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.16), rgba(7, 11, 18, 0.72)),
    url("/static/images/posters/zimorodok.jpg") center 18% / cover;
}

.plan-preview span {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.hero-subscription p {
  margin: 12px 0;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 700;
  text-align: center;
}

@media (min-width: 1021px) {
  .hero {
    grid-template-columns: minmax(0, 760px) minmax(280px, 340px);
    gap: clamp(32px, 7vw, 120px);
    align-items: center;
    justify-content: space-between;
  }

  .hero .hero-subscription {
    width: min(100%, 340px);
    justify-self: end;
  }

  .page-hero {
    min-height: 430px;
    display: grid;
    align-items: center;
  }
}

.plan-action {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.plan-action:hover {
  background: var(--red-deep);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 760px);
  gap: clamp(20px, 5vw, 54px);
  align-items: end;
  min-height: 600px;
  padding: 94px clamp(18px, 5vw, 72px) 44px;
  background:
    linear-gradient(90deg, rgba(12, 16, 22, 0.92), rgba(12, 16, 22, 0.56)),
    linear-gradient(0deg, rgba(12, 16, 22, 0.8), transparent 52%),
    var(--detail-image) center / cover;
  color: #fff;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-copy h1 {
  font-size: clamp(2.4rem, 6vw, 5.7rem);
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.detail-badges span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.facts,
.watch-area,
.prose-section {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(24, 35, 48, 0.07);
}

.facts dl {
  display: grid;
  gap: 14px;
  margin: 22px 0 0;
}

.facts dl div {
  grid-template-columns: 110px 1fr;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.player {
  display: grid;
  width: 100%;
  min-height: 380px;
  place-items: center;
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(166, 31, 61, 0.34), transparent 36%),
    linear-gradient(135deg, #10141b, #050608);
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.player:hover,
.player:focus-visible {
  box-shadow: 0 24px 58px rgba(166, 31, 61, 0.28);
  filter: saturate(1.1);
  transform: translateY(-2px);
}

.player:focus-visible {
  outline: 3px solid rgba(199, 139, 45, 0.44);
  outline-offset: 4px;
}

.player span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.player strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

.player p {
  max-width: 420px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.7);
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.episode-list button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.episode-list button:hover,
.episode-list button.is-active {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.prose-section {
  max-width: 940px;
}

.prose-section p {
  color: #3f4854;
}

.empty-state,
.empty-page {
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.empty-page {
  width: min(760px, calc(100% - 36px));
  margin: 80px auto;
}

.site-footer {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 70px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: var(--ink);
  color: #fff;
}

.site-footer p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.68);
}

.site-footer .copyright {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.74);
}

.auth-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(23, 27, 34, 0.58), rgba(23, 27, 34, 0.42)),
    rgba(246, 248, 251, 0.18);
  backdrop-filter: blur(10px);
}

.auth-backdrop[hidden] {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(92svh, 860px);
  overflow-y: auto;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.auth-close:hover {
  background: rgba(166, 31, 61, 0.08);
  color: var(--red);
}

.auth-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 56px;
}

.auth-tab,
.auth-submit {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.is-active,
.auth-submit {
  border-color: transparent;
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 28px rgba(166, 31, 61, 0.2);
}

.auth-tab:not(.is-active):hover {
  border-color: rgba(166, 31, 61, 0.2);
  background: rgba(166, 31, 61, 0.08);
  color: var(--red);
}

.auth-submit:hover {
  background: var(--red-deep);
}

.auth-alert {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(166, 31, 61, 0.16);
  border-radius: 8px;
  background: rgba(166, 31, 61, 0.08);
  color: var(--red-deep);
  font-weight: 700;
}

.auth-panel {
  display: none;
  margin-top: 24px;
}

.auth-panel.is-active {
  display: block;
}

.auth-panel h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.auth-form label small {
  display: inline;
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 108, 115, 0.16);
}

.auth-form input::placeholder {
  color: #98a2ad;
}

.auth-submit {
  justify-self: start;
  margin-top: 8px;
}

.auth-note {
  margin: -2px 0 0;
  color: var(--muted);
}

.auth-message {
  min-height: 28px;
  margin: 0;
  color: var(--teal);
  font-size: 0.98rem;
  font-weight: 700;
}

.auth-message.is-error {
  color: var(--red);
}

@media (max-width: 1020px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .auth-actions {
    grid-column: 2;
  }

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

  .hero-subscription {
    max-width: 430px;
  }

  .hero-panel {
    max-width: 420px;
  }

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

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

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

  .detail-poster {
    width: min(280px, 70vw);
  }
}

@media (max-width: 640px) {
  .site-header {
    gap: 10px;
    padding: 12px 14px;
  }

  .brand span:last-child {
    font-size: 0.95rem;
  }

  .auth-button {
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .auth-actions {
    gap: 6px;
  }

  .auth-dialog {
    padding: 24px 18px;
    border-radius: 8px;
  }

  .auth-close {
    top: 16px;
    right: 14px;
  }

  .auth-tabs {
    gap: 8px;
    padding-right: 46px;
  }

  .auth-tab,
  .auth-submit {
    min-height: 44px;
    padding: 0 16px;
  }

  .auth-form input {
    min-height: 48px;
    border-radius: 8px;
  }

  .hero {
    min-height: 690px;
    padding: 92px 18px 28px;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 16vw, 4rem);
  }

  .ticker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .section {
    width: min(100% - 24px, 1180px);
    margin: 38px auto;
  }

  .section-heading {
    display: grid;
    gap: 8px;
    align-items: start;
  }

  .compact-grid,
  .featured-grid,
  .cards-grid,
  .cards-grid--small {
    grid-template-columns: 1fr;
  }

  .compact-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 150px;
  }

  .compact-card img {
    grid-row: 1 / 5;
    height: 100%;
    aspect-ratio: auto;
  }

  .compact-card span {
    align-self: end;
    width: fit-content;
  }

  .compact-card small {
    padding-bottom: 8px;
  }

  .detail-hero {
    min-height: 700px;
    padding: 90px 18px 28px;
  }

  .detail-badges span {
    font-size: 0.86rem;
  }

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

  .site-footer {
    display: grid;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 116px;
  }

  body {
    background:
      linear-gradient(180deg, rgba(18, 108, 115, 0.1), transparent 280px),
      var(--bg);
    font-size: 15px;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand auth"
      "nav nav";
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand span:last-child {
    display: block;
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-actions {
    grid-area: auth;
    gap: 6px;
    justify-self: end;
  }

  .auth-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.84rem;
  }

  .top-nav {
    grid-area: nav;
    display: grid;
    justify-self: center;
    width: 100%;
    max-width: 360px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    gap: 8px;
    margin-inline: auto;
    overflow: visible;
    padding-bottom: 2px;
  }

  .top-nav::-webkit-scrollbar,
  .chip-row::-webkit-scrollbar {
    display: none;
  }

  .top-nav a {
    min-width: 0;
    min-height: 34px;
    padding: 7px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    font-size: clamp(0.78rem, 3.4vw, 0.86rem);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    min-height: auto;
    align-items: start;
    gap: 18px;
    padding: 68px 14px 18px;
    background:
      linear-gradient(180deg, rgba(11, 17, 24, 0.7), rgba(11, 17, 24, 0.88)),
      var(--hero-image) center / cover;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 15vw, 3.7rem);
    line-height: 0.96;
  }

  .hero-title {
    margin-top: 16px;
    font-size: 1.45rem;
  }

  .hero-copy > p:last-of-type,
  .page-hero p,
  .detail-copy > p {
    font-size: 0.98rem;
  }

  .hero-actions {
    gap: 9px;
    margin-top: 18px;
  }

  .hero-actions .btn {
    flex: 1 1 142px;
    min-height: 42px;
    padding: 0 12px;
  }

  .hero-subscription {
    width: 100%;
    max-width: none;
    padding: 12px;
  }

  .plan-card-head {
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .plan-card-head strong {
    min-height: 30px;
    font-size: 0.88rem;
  }

  .plan-preview {
    min-height: 86px;
  }

  .hero-subscription p {
    margin: 9px 0 10px;
    font-size: 0.92rem;
    text-align: left;
  }

  .plan-action {
    min-height: 38px;
    margin-top: 8px;
  }

  .ticker {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 14px;
  }

  .ticker-group {
    gap: 14px;
    padding-right: 14px;
  }

  .section {
    width: min(100% - 24px, 1180px);
    margin: 34px auto;
  }

  .section-tight {
    margin-top: 26px;
  }

  .section-heading {
    display: grid;
    gap: 8px;
    align-items: start;
    margin-bottom: 14px;
  }

  .section-heading h2,
  .facts h2,
  .prose-section h2 {
    font-size: clamp(1.35rem, 8vw, 2rem);
  }

  .compact-grid {
    gap: 10px;
  }

  .compact-card {
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 132px;
  }

  .compact-card span {
    margin: 9px 9px 2px;
    font-size: 0.72rem;
  }

  .compact-card strong,
  .compact-card small {
    padding-inline: 9px;
  }

  .featured-grid,
  .cards-grid,
  .cards-grid--small {
    gap: 12px;
  }

  .title-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    min-height: 174px;
  }

  .title-card .poster {
    height: 100%;
  }

  .title-card .poster img,
  .title-card--wide .poster img {
    height: 100%;
    aspect-ratio: auto;
  }

  .quality,
  .rating {
    top: 7px;
    min-height: 24px;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .quality {
    left: 7px;
  }

  .rating {
    right: 7px;
  }

  .card-body {
    min-width: 0;
    padding: 11px;
  }

  .card-tags {
    gap: 5px;
    margin-bottom: 7px;
  }

  .card-tags span {
    padding: 2px 6px;
    font-size: 0.68rem;
  }

  .card-tags span:nth-child(n + 3) {
    display: none;
  }

  .card-body h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .card-body p {
    margin: 6px 0;
    font-size: 0.86rem;
  }

  .card-body p:not(.muted) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mini-meta {
    display: none;
  }

  .btn-small {
    align-self: flex-start;
    min-height: 32px;
    margin-top: auto;
  }

  .catalog-surface {
    padding: 14px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .filters .search-box {
    grid-column: 1 / -1;
  }

  .filters input,
  .filters select {
    height: 42px;
    padding-inline: 10px;
    font-size: 0.92rem;
  }

  .chip-row {
    margin: 0 -2px 16px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }

  .chip {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 0.86rem;
  }

  .page-hero {
    padding: 72px 14px 24px;
  }

  .page-hero-inner {
    gap: 18px;
  }

  .page-hero h1 {
    font-size: clamp(1.9rem, 9vw, 2.85rem);
    line-height: 1.02;
  }

  .detail-hero {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: end;
    min-height: auto;
    gap: 14px;
    padding: 72px 14px 24px;
    background:
      linear-gradient(180deg, rgba(12, 16, 22, 0.7), rgba(12, 16, 22, 0.9)),
      var(--detail-image) center / cover;
  }

  .detail-poster {
    width: 100%;
  }

  .detail-copy h1 {
    font-size: clamp(1.9rem, 11vw, 3.1rem);
  }

  .detail-badges {
    gap: 6px;
    margin: 12px 0;
  }

  .detail-badges span {
    padding: 5px 7px;
    font-size: 0.78rem;
  }

  .facts,
  .watch-area,
  .prose-section {
    padding: 16px;
  }

  .facts dl {
    gap: 10px;
    margin-top: 16px;
  }

  .facts dl div,
  .mini-meta div {
    grid-template-columns: 88px 1fr;
    gap: 8px;
  }

  .player {
    min-height: 220px;
    padding: 18px;
  }

  .episode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .empty-state,
  .empty-page {
    padding: 24px 16px;
  }

  .site-footer {
    display: grid;
    gap: 18px;
    margin-top: 44px;
    padding: 24px 14px;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .brand span:last-child {
    display: none;
  }

  .auth-button {
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .hero,
  .page-hero,
  .detail-hero {
    padding-inline: 12px;
  }

  .plan-preview {
    display: none;
  }

  .title-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 166px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .auth-dialog {
    padding: 20px 14px;
  }
}
