:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.88);
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --orange: #fb923c;
  --green: #34d399;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 38rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

body::selection {
  background: rgba(34, 211, 238, 0.32);
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

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

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.logo span:last-child,
.footer-logo {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.16);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.26);
}

.search-form {
  flex: 1 1 320px;
  max-width: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
}

.search-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 16px;
  color: #ffffff;
  background: transparent;
}

.search-form input::placeholder,
.local-search-box input::placeholder {
  color: #64748b;
}

.search-form button {
  border: 0;
  padding: 11px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  cursor: pointer;
}

.desktop-links {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #cbd5e1;
  font-size: 14px;
  white-space: nowrap;
}

.desktop-links a,
.mobile-panel a,
.footer-links a {
  transition: color 0.2s ease;
}

.desktop-links a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
  color: var(--cyan);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
}

.mobile-panel {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.98);
}

.mobile-panel a {
  display: block;
  padding: 10px 12px;
  color: #cbd5e1;
}

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

.narrow-page {
  width: min(1100px, calc(100% - 32px));
}

.hero-slider {
  position: relative;
  min-height: 620px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.72fr);
  align-items: center;
  gap: 46px;
  padding: clamp(28px, 6vw, 72px);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.5s ease, transform 0.6s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(26px) saturate(1.2);
  opacity: 0.38;
  transform: scale(1.08);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.88)),
    radial-gradient(circle at 28% 22%, rgba(34, 211, 238, 0.32), transparent 24rem);
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(34px, 6vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content p,
.page-hero p,
.detail-lead {
  max-width: 760px;
  margin: 20px 0 0;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.detail-tags,
.tag-row,
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-tags,
.detail-tags {
  margin-top: 24px;
}

.hero-tags span,
.detail-tags span,
.tag-row span {
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  color: #bae6fd;
  background: rgba(8, 145, 178, 0.15);
  font-size: 12px;
}

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

.primary-btn,
.ghost-btn,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.ghost-btn,
.inline-link {
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.66);
}

.primary-btn:hover,
.ghost-btn:hover,
.inline-link:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 16px 32px rgba(8, 145, 178, 0.18);
}

.hero-poster {
  justify-self: end;
  width: min(360px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  aspect-ratio: 2 / 3;
  background: #0f172a;
}

.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.hero-poster:hover img {
  transform: scale(1.05);
}

.hero-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.hero-prev,
.hero-next,
.hero-dot {
  border: 0;
  color: #ffffff;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
}

.hero-prev,
.hero-next {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

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

.hero-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  padding: 0;
  opacity: 0.5;
}

.hero-dot.is-active {
  width: 30px;
  opacity: 1;
  background: var(--cyan);
}

.quick-search-panel,
.content-section,
.page-hero,
.detail-hero,
.player-section,
.detail-copy,
.ranking-aside {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quick-search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
}

.quick-search-panel h2,
.section-heading h2,
.ranking-aside h2,
.player-section h2,
.detail-copy h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.quick-search-panel p,
.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.filter-chips button {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 9px 15px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.86);
  cursor: pointer;
}

.filter-chips button.is-active,
.filter-chips button:hover {
  color: #ffffff;
  border-color: rgba(34, 211, 238, 0.44);
  background: rgba(6, 182, 212, 0.22);
}

.content-section,
.page-hero,
.player-section,
.detail-copy,
.ranking-aside {
  padding: clamp(22px, 4vw, 36px);
}

.simple-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 24rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.92));
}

.section-heading {
  margin-bottom: 22px;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 20px;
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.small-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.full-library {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

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

.movie-card[hidden],
.ranking-item[hidden] {
  display: none;
}

.movie-card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card-link:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.44);
  box-shadow: 0 24px 48px rgba(8, 145, 178, 0.18);
}

.poster-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.8));
}

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

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

.rank-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #f97316, #ef4444);
  box-shadow: 0 10px 20px rgba(248, 113, 113, 0.24);
}

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

.movie-meta-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.movie-card h3 {
  margin: 8px 0 7px;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.35;
}

.movie-card p {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 12px;
  overflow: hidden;
  color: #a8b3c7;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  gap: 6px;
}

.tag-row span {
  padding: 4px 8px;
  font-size: 11px;
}

.category-grid,
.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.category-card,
.category-overview-card {
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.13), transparent 12rem),
    rgba(15, 23, 42, 0.74);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.42);
}

.category-card span,
.category-overview-title span {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
}

.category-card p,
.category-overview-card p {
  margin: 10px 0 0;
  color: #a8b3c7;
  font-size: 14px;
}

.category-overview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.category-overview-title strong {
  color: var(--cyan);
  font-size: 13px;
}

.category-sample {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.category-sample a {
  min-width: 0;
}

.category-sample img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #0f172a;
}

.category-sample span {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  gap: 24px;
}

.ranking-page-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 42px 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.72);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ranking-item:hover {
  transform: translateX(3px);
  border-color: rgba(34, 211, 238, 0.38);
}

.ranking-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #ffffff;
  font-weight: 900;
  background: rgba(34, 211, 238, 0.18);
}

.ranking-item img {
  width: 56px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  background: #0f172a;
}

.ranking-title {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-meta {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.local-search-box {
  margin-bottom: 18px;
}

.local-search-box input {
  width: min(520px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  outline: 0;
  padding: 13px 18px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.42);
}

.empty-result {
  margin: 20px 0 0;
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  color: #94a3b8;
  font-size: 14px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  padding: clamp(24px, 5vw, 44px);
  background:
    radial-gradient(circle at 24% 20%, rgba(34, 211, 238, 0.16), transparent 20rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.92));
}

.detail-cover {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  aspect-ratio: 2 / 3;
  background: #0f172a;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.44);
}

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

.detail-info h1 {
  font-size: clamp(32px, 5vw, 58px);
}

.player-section {
  scroll-margin-top: 96px;
}

.player-box {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: #000000;
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.74));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

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

.play-circle {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 34px;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.38);
}

.player-overlay strong {
  font-size: 18px;
}

.player-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: #fca5a5;
}

.detail-copy {
  color: #cbd5e1;
}

.detail-copy h2 + p {
  margin: 12px 0 24px;
  font-size: 17px;
}

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

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.7fr);
  gap: 30px;
  color: #94a3b8;
}

.footer-inner p {
  max-width: 640px;
  margin: 12px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px 18px;
  color: #cbd5e1;
  font-size: 14px;
}

@media (max-width: 1080px) {
  .desktop-links {
    display: none;
  }

  .mobile-toggle {
    display: inline-grid;
    place-items: center;
  }

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

  .hero-poster {
    display: none;
  }

  .split-section,
  .ranking-page-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-inner {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .search-form {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .hero-slider,
  .hero-track,
  .hero-slide {
    min-height: 560px;
  }

  .hero-slide {
    padding: 28px;
  }

  .quick-search-panel {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .category-sample {
    grid-template-columns: repeat(2, 1fr);
  }

  .ranking-item {
    grid-template-columns: 34px 50px minmax(0, 1fr);
  }

  .ranking-meta {
    display: none;
  }

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

  .detail-cover {
    width: min(280px, 100%);
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .movie-grid,
  .compact-grid,
  .full-library,
  .small-grid {
    grid-template-columns: 1fr;
  }
}
