:root {
  color-scheme: dark;
  --bg-main: #0f172a;
  --bg-soft: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.72);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --gold: #fbbf24;
  --gold-deep: #d97706;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(251, 191, 36, 0.12),
      transparent 34rem
    ),
    linear-gradient(135deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.logo-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted-strong);
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.top-search {
  position: relative;
  display: flex;
  align-items: center;
}

.top-search input {
  width: 240px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.88);
  padding: 0 44px 0 16px;
  outline: none;
}

.top-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.12);
}

.top-search button {
  position: absolute;
  right: 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}

.menu-button {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(30, 41, 59, 0.8);
  border-radius: 10px;
  padding: 8px 10px;
}

.hero-carousel {
  position: relative;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  background: var(--bg-main);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(15, 23, 42, 0.98),
      rgba(15, 23, 42, 0.78),
      transparent
    ),
    linear-gradient(
      to right,
      rgba(15, 23, 42, 0.94),
      rgba(15, 23, 42, 0.22),
      rgba(15, 23, 42, 0.85)
    );
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
  padding: 80px 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  padding: 8px 16px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.14);
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.hero-copy h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 6.8rem);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p {
  width: min(760px, 100%);
  margin: 24px auto 0;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.75;
}

.hero-tags,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.hero-tags a,
.hero-tags span,
.badge,
.detail-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.hero-tags a,
.hero-tags span {
  padding: 9px 16px;
  background: rgba(30, 41, 59, 0.68);
  color: var(--muted-strong);
  backdrop-filter: blur(10px);
}

.hero-tags a {
  color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 28px;
  font-weight: 900;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-primary {
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  box-shadow: 0 18px 36px rgba(251, 191, 36, 0.26);
}

.btn-ghost {
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: var(--text);
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
}

.hero-dots {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero-dots button {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition:
    width 0.22s ease,
    background 0.22s ease;
}

.hero-dots button.is-active {
  width: 34px;
  background: var(--gold);
}

.content-section {
  padding: 72px 0;
}

.alt-section {
  background: rgba(15, 23, 42, 0.32);
}

.section-heading,
.movie-grid,
.poster-grid,
.rank-grid,
.category-grid,
.filter-panel,
.category-panels,
.detail-layout,
.breadcrumbs {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  line-height: 1.12;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.section-link {
  color: var(--gold);
  font-weight: 800;
}

.section-link span {
  margin-left: 4px;
}

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

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(30, 41, 59, 0.94);
  box-shadow: 0 22px 48px rgba(251, 191, 36, 0.14);
}

.movie-card a {
  display: block;
  height: 100%;
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020617;
}

.poster-card .card-image {
  aspect-ratio: 2 / 3;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

.movie-card:hover .card-image img {
  transform: scale(1.09);
}

.card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.92), transparent 58%);
}

.card-badges {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.badge-gold {
  color: #111827;
  background: rgba(251, 191, 36, 0.92);
}

.badge-dark {
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
}

.play-ring {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: auto;
  border-radius: 999px;
  color: #111827;
  background: rgba(251, 191, 36, 0.92);
  opacity: 0;
  transform: scale(0.76);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  font-weight: 900;
}

.movie-card:hover .play-ring {
  opacity: 1;
  transform: scale(1);
}

.rank-badge {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  min-width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.card-content {
  padding: 16px;
}

.card-content h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--gold);
}

.card-content p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: 12px;
  color: var(--muted-strong);
  font-size: 0.88rem;
}

.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-row span,
.detail-tags span {
  padding: 5px 9px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.78rem;
}

.category-tile {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: #020617;
  box-shadow: var(--shadow);
}

.category-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
  transition:
    transform 0.5s ease,
    opacity 0.3s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.22)
  );
}

.category-tile span,
.category-tile small {
  position: relative;
  z-index: 1;
}

.category-tile span {
  font-size: 1.35rem;
  font-weight: 900;
}

.category-tile small {
  margin-top: 8px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.category-tile:hover img {
  opacity: 0.65;
  transform: scale(1.08);
}

.page-hero {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 16px;
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(251, 191, 36, 0.2),
      transparent 30rem
    ),
    linear-gradient(180deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
}

.slim-hero {
  min-height: 360px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  margin-bottom: 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.64);
  backdrop-filter: blur(14px);
}

.filter-panel input,
.filter-panel select {
  height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.88);
  padding: 0 16px;
  outline: none;
}

.empty-state {
  width: min(1180px, calc(100% - 32px));
  margin: 40px auto 0;
  padding: 48px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.55);
}

.category-panels {
  display: grid;
  gap: 26px;
}

.category-panel {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.64);
  backdrop-filter: blur(14px);
}

.category-panel-cover {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 18px;
  background: #020617;
}

.category-panel-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
}

.category-panel-cover span {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
  font-size: 1.45rem;
  font-weight: 900;
}

.category-panel-body h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.category-panel-body p {
  margin: 0 0 18px;
  color: var(--muted-strong);
  line-height: 1.75;
}

.small-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.small-card-list.stacked {
  grid-template-columns: 1fr;
}

.small-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.54);
  transition:
    border-color 0.22s ease,
    transform 0.22s ease;
}

.small-card:hover {
  border-color: rgba(251, 191, 36, 0.48);
  transform: translateX(3px);
}

.small-card img {
  grid-row: 1 / span 2;
  width: 74px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  background: #020617;
}

.small-card span {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.small-card small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-main {
  padding: 32px 0 72px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

.breadcrumbs a {
  color: var(--gold);
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background: #000;
  box-shadow: var(--shadow);
}

.main-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: var(--text);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}

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

.player-overlay span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), #f59e0b);
  font-size: 2rem;
  box-shadow: 0 18px 40px rgba(251, 191, 36, 0.35);
}

.player-overlay strong {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
}

.detail-card,
.side-panel {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.68);
  padding: 26px;
  backdrop-filter: blur(14px);
}

.detail-card h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.18;
}

.detail-card h2,
.side-panel h2 {
  margin: 24px 0 12px;
  font-size: 1.45rem;
}

.detail-card p {
  color: var(--muted-strong);
  line-height: 1.9;
}

.detail-lead {
  padding: 18px;
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.52);
  font-size: 1.08rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-meta a,
.detail-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.68);
}

.detail-meta a {
  color: var(--gold);
}

.side-poster {
  overflow: hidden;
  border-radius: 22px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

.footer-inner p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.75;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
}

.footer-links a {
  color: var(--muted-strong);
}

.footer-links a:hover {
  color: var(--gold);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1024px) {
  .movie-grid,
  .featured-grid,
  .catalog-grid,
  .rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .detail-side {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
  }

  .side-panel {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .nav-wrap {
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 0;
  }

  .menu-button {
    display: inline-flex;
  }

  .nav-links {
    order: 4;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }

  .top-search {
    order: 3;
    width: 100%;
  }

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

  .hero-carousel {
    min-height: 650px;
  }

  .section-heading,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

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

  .small-card-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .movie-grid,
  .featured-grid,
  .catalog-grid,
  .rank-grid,
  .poster-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-tags,
  .hero-actions {
    justify-content: flex-start;
  }

  .detail-side {
    display: block;
  }

  .side-panel {
    margin-top: 18px;
  }
}
