:root {
  --bg: #210033;
  --bg-deep: #12001e;
  --panel: rgba(255, 255, 255, 0.10);
  --panel-strong: rgba(255, 255, 255, 0.16);
  --line: rgba(255, 255, 255, 0.16);
  --muted: rgba(255, 255, 255, 0.66);
  --soft: rgba(255, 255, 255, 0.48);
  --text: #ffffff;
  --twilight: #a855f7;
  --dusk: #d946ef;
  --sunset: #fb923c;
  --shadow: 0 20px 60px rgba(12, 0, 24, 0.35);
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(168, 85, 247, 0.32), transparent 34rem),
    radial-gradient(circle at top right, rgba(217, 70, 239, 0.22), transparent 30rem),
    linear-gradient(135deg, #3b0764 0%, #581c87 46%, #4a044e 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

img {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(251, 146, 60, 0.2));
}

main {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(33, 0, 51, 0.72);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
  box-shadow: 0 14px 34px rgba(168, 85, 247, 0.32);
}

.brand-text {
  font-size: 1.32rem;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.nav-link {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  font-weight: 700;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #f0abfc;
  transform: translateY(-1px);
}

.top-search,
.mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.10);
}

.top-search input,
.mobile-search input {
  width: 220px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  padding: 8px 10px;
}

.top-search button,
.mobile-search button,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.top-search button,
.mobile-search button,
.btn-primary {
  padding: 10px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
  box-shadow: 0 12px 34px rgba(168, 85, 247, 0.28);
}

.btn-ghost {
  padding: 10px 16px;
  color: #fff;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
}

.top-search button:hover,
.mobile-search button:hover,
.btn-primary:hover,
.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(217, 70, 239, 0.30);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: #fff;
}

.mobile-nav {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.page-section,
.hero-slider,
.detail-hero,
.catalog-hero,
.search-hero {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-slider {
  position: relative;
  min-height: 76vh;
  padding-top: 38px;
  display: grid;
  align-items: center;
}

.hero-slide {
  display: none;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.hero-slide.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  animation: fadeIn 0.55s ease both;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(32px, 7vw, 78px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-kicker,
.section-kicker,
.eyebrow {
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 12px;
  border: 1px solid rgba(240, 171, 252, 0.34);
  border-radius: 999px;
  color: #f0abfc;
  background: rgba(168, 85, 247, 0.18);
  font-weight: 800;
  font-size: 0.88rem;
}

.hero-content h1,
.hero-content h2,
.detail-title,
.catalog-hero h1,
.search-hero h1 {
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -0.055em;
  text-shadow: 0 0 24px rgba(168, 85, 247, 0.25);
}

.hero-content h2 {
  margin-top: 12px;
  font-size: clamp(1.75rem, 4vw, 3.7rem);
}

.hero-content p,
.catalog-hero p,
.search-hero p {
  margin-top: 18px;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.9;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-art {
  position: relative;
  min-height: 100%;
  overflow: hidden;
}

.hero-art img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(44, 2, 70, 0.92), rgba(44, 2, 70, 0.15) 55%, rgba(0, 0, 0, 0.30)),
    linear-gradient(0deg, rgba(18, 0, 30, 0.72), transparent 52%);
}

.hero-mini-list {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-mini-list a,
.category-chip,
.footer-tags a {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-weight: 800;
  transition: transform 0.25s ease, background 0.25s ease;
}

.hero-mini-list a:hover,
.category-chip:hover,
.footer-tags a:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-controls button,
.hero-dots button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 999px;
}

.hero-controls button {
  width: 42px;
  height: 42px;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 34px;
  height: 8px;
  font-size: 0;
  opacity: 0.58;
}

.hero-dots button.is-active {
  width: 52px;
  opacity: 1;
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
}

.page-section {
  padding: 52px 0;
}

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

.section-head h2,
.detail-block h2,
.player-card h2 {
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  font-weight: 950;
  letter-spacing: -0.035em;
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
}

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

.movie-card {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--line);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(240, 171, 252, 0.42);
  box-shadow: 0 24px 70px rgba(168, 85, 247, 0.24);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.08);
  filter: saturate(1.12);
}

.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent 54%);
}

.play-dot {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(168, 85, 247, 0.86);
  backdrop-filter: blur(8px);
}

.movie-card-body {
  padding: 18px;
}

.movie-meta-row,
.detail-meta,
.tag-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.movie-meta-row {
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 0.86rem;
}

.score,
.rank-score {
  color: #fed7aa;
  font-weight: 900;
}

.movie-card h3 {
  min-height: 3.15rem;
  font-size: 1.08rem;
  line-height: 1.45;
  font-weight: 900;
}

.movie-card p {
  display: -webkit-box;
  min-height: 3.4rem;
  margin-top: 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-line {
  margin-top: 14px;
}

.tag-line span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 10px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 750;
}

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

.category-chip {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-chip strong {
  font-size: 1.1rem;
}

.category-chip span {
  margin-top: 5px;
  color: var(--soft);
  font-size: 0.88rem;
}

.rank-list {
  display: grid;
  gap: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 70px 92px minmax(0, 1fr) 90px;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.09);
}

.rank-number {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
  font-weight: 950;
}

.rank-poster {
  display: block;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 3 / 4;
}

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

.rank-info h2 {
  font-size: 1.16rem;
  font-weight: 920;
}

.rank-info p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.rank-score {
  justify-self: end;
  font-size: 1.15rem;
}

.catalog-hero,
.search-hero,
.detail-hero {
  padding: 58px 0 30px;
}

.breadcrumbs {
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft);
  font-size: 0.94rem;
}

.breadcrumbs a {
  color: #f0abfc;
}

.detail-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

.detail-main,
.detail-side,
.player-card,
.detail-block,
.search-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.detail-main,
.detail-side,
.detail-block,
.search-panel {
  padding: 24px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
}

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

.detail-title {
  margin-bottom: 18px;
}

.detail-meta {
  margin-bottom: 20px;
}

.player-card {
  overflow: hidden;
  margin-bottom: 24px;
}

.player-card h2 {
  padding: 22px 24px 0;
}

.player-shell {
  position: relative;
  margin: 20px 24px 24px;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.player-shell video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, rgba(18, 0, 30, 0.20), rgba(0, 0, 0, 0.55));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.player-button {
  width: 92px;
  height: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
  box-shadow: 0 20px 60px rgba(168, 85, 247, 0.45);
  font-size: 2.2rem;
}

.detail-block {
  margin-bottom: 24px;
}

.detail-block p {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.92;
  font-size: 1.04rem;
}

.side-list {
  display: grid;
  gap: 12px;
}

.side-list a {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.side-list img {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
}

.side-list strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.side-list span {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 0.84rem;
}

.pagination {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pagination a,
.pagination span {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}

.pagination .current {
  background: linear-gradient(135deg, var(--twilight), var(--dusk));
  font-weight: 900;
}

.search-panel {
  margin-bottom: 28px;
}

.search-box-large {
  display: flex;
  gap: 12px;
}

.search-box-large input {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.10);
  padding: 0 16px;
  color: #fff;
  outline: none;
}

.search-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: rgba(18, 0, 30, 0.62);
  backdrop-filter: blur(14px);
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr 1.1fr;
  gap: 30px;
}

.site-footer h2 {
  margin-bottom: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.site-footer p,
.site-footer a {
  color: var(--muted);
  line-height: 1.7;
}

.site-footer a {
  display: block;
  margin-top: 8px;
}

.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-tags a {
  display: inline-flex;
  margin-top: 0;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: var(--soft);
  border-top: 1px solid var(--line);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .desktop-nav,
  .top-search {
    display: none;
  }

  .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }

  .mobile-nav.is-open {
    display: grid;
    gap: 10px;
  }

  .mobile-search input {
    width: 100%;
  }

  .hero-slide.is-active,
  .detail-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
    max-height: 360px;
  }

  .hero-art img {
    min-height: 360px;
  }

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

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

@media (max-width: 760px) {
  .hero-slider {
    min-height: auto;
    padding-top: 18px;
  }

  .hero-slide {
    min-height: auto;
    border-radius: 24px;
  }

  .hero-content {
    padding: 24px;
  }

  .hero-mini-list,
  .movie-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head {
    display: block;
  }

  .rank-row {
    grid-template-columns: 46px 72px minmax(0, 1fr);
  }

  .rank-score {
    grid-column: 3;
    justify-self: start;
  }

  .search-box-large {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .page-section,
  .hero-slider,
  .detail-hero,
  .catalog-hero,
  .search-hero,
  .detail-layout,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 22px, 1280px);
  }

  .brand-text {
    font-size: 1.08rem;
  }

  .movie-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-mini-list {
    grid-template-columns: 1fr;
  }
}
