:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-strong: #0f172a;
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-strong: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --danger: #fb7185;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 52%, #020617 100%);
}

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

img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(2, 6, 23, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

.site-nav {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.28);
  font-size: 15px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--soft);
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-strong);
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 99px;
}

main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  margin: 34px auto 26px;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  box-shadow: var(--shadow);
  background: #0f172a;
}

.hero-track {
  position: relative;
  min-height: 620px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.58fr);
  gap: 36px;
  align-items: center;
  padding: clamp(32px, 5vw, 72px);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.56s ease, transform 0.56s ease;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.92)),
    linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(59, 130, 246, 0.1)),
    var(--hero-image) center / cover no-repeat;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h1,
.hero-copy h2 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.hero-summary {
  max-width: 680px;
  margin: 24px 0 0;
  color: #e2e8f0;
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.hero-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--soft);
  background: rgba(15, 23, 42, 0.58);
}

.hero-actions,
.page-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.primary-btn,
.ghost-btn,
.section-more,
.rank-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: #111827;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 18px 34px rgba(245, 158, 11, 0.28);
}

.ghost-btn,
.section-more,
.rank-watch {
  color: var(--accent-strong);
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.primary-btn:hover,
.ghost-btn:hover,
.section-more:hover,
.rank-watch:hover {
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  min-height: 420px;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #0f172a 55%, rgba(245, 158, 11, 0.18));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.48);
}

.hero-poster img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.76);
  color: var(--text);
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.hero-control {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
  font-size: 34px;
  line-height: 1;
  z-index: 5;
}

.hero-control.prev {
  left: 18px;
}

.hero-control.next {
  right: 18px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(226, 232, 240, 0.46);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 30px;
  background: var(--accent-strong);
}

.content-section,
.page-hero,
.breadcrumb {
  margin: 28px 0;
}

.content-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
  padding: clamp(20px, 3vw, 34px);
}

.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: center;
}

.intro-copy h2,
.section-head h2,
.page-hero h1,
.detail-content h1,
.article-block h2,
.category-overview-card h2 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 42px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.intro-copy p,
.section-head p,
.page-hero p,
.category-overview-card p,
.movie-desc,
.detail-one-line,
.article-block p,
.ranking-info p,
.site-footer p {
  color: var(--muted);
  line-height: 1.78;
}

.hero-search {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.62);
}

.hero-search input,
.catalog-tools input,
.catalog-tools select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  outline: none;
  padding: 0 14px;
}

.hero-search button {
  white-space: nowrap;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  color: #111827;
  background: var(--accent-strong);
  font-weight: 900;
}

.section-head,
.category-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 22px;
}

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

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

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

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

.movie-card {
  min-width: 0;
}

.poster-shell {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), #1e293b 46%, #020617);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.poster-shell img,
.ranking-cover img,
.category-mini-posters img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease, opacity 0.2s ease;
}

.poster-shell:hover img,
.ranking-card:hover img,
.category-card:hover img {
  transform: scale(1.06);
}

.poster-fallback {
  position: absolute;
  inset: auto 12px 12px;
  z-index: 1;
  border-radius: 12px;
  padding: 10px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.poster-shell.image-missing .poster-fallback,
.ranking-cover.image-missing .poster-fallback {
  opacity: 1;
  transform: translateY(0);
}

.poster-shell.image-missing img,
.ranking-cover.image-missing img {
  opacity: 0;
}

.badge-score,
.badge-year {
  position: absolute;
  z-index: 2;
  top: 10px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.badge-score {
  left: 10px;
  color: #111827;
  background: var(--accent-strong);
}

.badge-year {
  right: 10px;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
}

.movie-card-body {
  padding: 12px 4px 0;
}

.movie-card h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.movie-card h3 a:hover,
.ranking-info h2 a:hover,
.footer-grid a:hover {
  color: var(--accent-strong);
}

.movie-meta {
  margin: 0 0 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.movie-desc {
  margin: 0 0 10px;
  font-size: 13px;
}

.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span,
.detail-tags span {
  display: inline-flex;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--accent-strong);
  background: rgba(245, 158, 11, 0.08);
  font-size: 12px;
  font-weight: 700;
}

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

.category-card,
.category-overview-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.48);
  padding: 16px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.category-card:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(15, 23, 42, 0.92);
}

.category-card h3 {
  margin: 14px 0 8px;
  font-size: 20px;
  font-weight: 900;
}

.category-card p,
.category-overview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.category-mini-posters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 124px;
}

.category-mini-posters img {
  border-radius: 12px;
  background: #1e293b;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.46);
  padding: 10px 14px;
}

.rank-no,
.ranking-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: var(--accent-strong);
  font-weight: 900;
}

.rank-no {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.rank-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

.rank-score {
  color: var(--accent-strong);
  font-weight: 900;
}

.page-hero {
  padding: clamp(34px, 5vw, 76px);
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.16), transparent 42%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.94));
  box-shadow: var(--shadow);
}

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

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 160px 180px 160px;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}

.catalog-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.ranking-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.48);
  padding: 12px;
}

.ranking-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #1e293b;
}

.ranking-info h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 900;
}

.ranking-info p {
  margin: 0 0 8px;
}

.ranking-number {
  width: 58px;
  height: 28px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--accent-strong);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: stretch;
}

.player-box {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 30px;
  background: #000;
  box-shadow: var(--shadow);
}

.movie-player {
  width: 100%;
  height: 100%;
  min-height: 540px;
  object-fit: contain;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  padding: clamp(24px, 4vw, 46px);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.92)),
    var(--poster-image) center / cover no-repeat,
    linear-gradient(135deg, #0f172a, #020617);
}

.player-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.player-overlay h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4.5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.player-overlay p {
  max-width: 680px;
  margin: 0;
  color: #e2e8f0;
  line-height: 1.7;
}

.play-button {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.34);
  font-size: 28px;
}

.player-status {
  position: absolute;
  left: 22px;
  bottom: 18px;
  z-index: 8;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
}

.detail-side {
  min-width: 0;
}

.detail-poster {
  width: 100%;
  height: 100%;
  min-height: 540px;
}

.detail-content {
  margin-top: 22px;
}

.detail-content h1 {
  margin-bottom: 14px;
}

.detail-one-line {
  max-width: 980px;
  font-size: 18px;
}

.detail-tags {
  margin-top: 18px;
}

.article-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.article-block h2 {
  margin-bottom: 12px;
  font-size: 26px;
}

.article-block p {
  margin: 0;
  color: #d1d5db;
  font-size: 16px;
}

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

.footer-grid {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.9fr;
  gap: 36px;
  padding: 42px 0;
}

.footer-grid h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 900;
}

.footer-grid ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.footer-bottom {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: #64748b;
  font-size: 13px;
}

.is-filtered-out {
  display: none !important;
}

@media (max-width: 1100px) {
  .movie-grid,
  .compact-grid,
  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .detail-side {
    display: none;
  }
}

@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.96);
    padding: 12px;
  }

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

  .nav-link {
    padding: 13px 14px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 32px 24px 76px;
  }

  .hero-poster {
    min-height: 260px;
  }

  .hero-poster img {
    min-height: 260px;
  }

  .intro-section,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .catalog-tools {
    grid-template-columns: 1fr 1fr;
  }

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

  .ranking-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .rank-watch {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  main,
  .site-nav,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 22px, 1200px);
  }

  .hero-carousel,
  .hero-track {
    min-height: 620px;
  }

  .hero-copy h1,
  .hero-copy h2 {
    font-size: 40px;
  }

  .hero-control {
    display: none;
  }

  .hero-search,
  .section-head,
  .category-overview-head,
  .rank-item a {
    display: grid;
    grid-template-columns: 1fr;
  }

  .movie-grid,
  .compact-grid,
  .catalog-grid,
  .mini-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .catalog-tools {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 18px;
  }

  .player-box,
  .movie-player {
    min-height: 420px;
  }

  .player-overlay {
    align-items: center;
    flex-direction: column;
    text-align: center;
  }
}
