:root {
  --bg: #f8fafc;
  --bg-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --orange: #ea580c;
  --orange-dark: #c2410c;
  --orange-soft: #fff7ed;
  --black: #0f172a;
  --panel: #ffffff;
  --radius: 1rem;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 25px 50px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f9fafb 0%, #eef2f7 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.96), rgba(31, 41, 55, 0.96), rgba(17, 24, 39, 0.96));
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo-mark {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #dc2626);
  box-shadow: 0 10px 24px rgba(234, 88, 12, 0.35);
  font-size: 0.82rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.65rem;
  color: #e5e7eb;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fed7aa;
  background: rgba(255, 255, 255, 0.08);
}

.header-search {
  margin-left: auto;
  width: min(360px, 34vw);
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
  padding: 0.7rem 1rem;
}

.header-search input::placeholder {
  color: #cbd5e1;
}

.header-search button {
  border: 0;
  color: #ffffff;
  background: var(--orange);
  padding: 0.72rem 1rem;
  transition: background 0.2s ease;
}

.header-search button:hover {
  background: var(--orange-dark);
}

.mobile-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.1);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.28rem;
}

.mobile-toggle span {
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.mobile-panel {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-panel.is-open {
  display: grid;
  gap: 0.45rem;
}

.mobile-panel a {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.06);
}

main {
  min-height: 60vh;
}

.hero {
  position: relative;
  height: 540px;
  overflow: hidden;
  background: #000000;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

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

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.48) 48%, rgba(0, 0, 0, 0.1) 100%);
}

.hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 1rem 4rem;
  color: #ffffff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.92);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 720px;
  margin: 0 0 1.4rem;
  color: #e5e7eb;
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-meta,
.detail-meta,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.hero-meta span,
.detail-meta span,
.pill-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

.btn-primary,
.btn-secondary,
.section-more,
.category-link,
.load-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 0.75rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  min-height: 3rem;
  padding: 0.78rem 1.35rem;
  color: #ffffff;
  background: var(--orange);
  box-shadow: 0 16px 32px rgba(234, 88, 12, 0.34);
}

.btn-primary:hover {
  background: var(--orange-dark);
  transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
  min-height: 3rem;
  padding: 0.78rem 1.2rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hero-arrow.prev {
  left: 1rem;
}

.hero-arrow.next {
  right: 1rem;
}

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

.hero-dots button {
  width: 0.55rem;
  height: 0.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
  width: 2rem;
  background: var(--orange);
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.space-stack {
  display: grid;
  gap: 4rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.page-title h1 {
  margin: 0;
  color: #111827;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
  font-weight: 900;
}

.section-heading p,
.page-title p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-more {
  min-width: max-content;
  padding: 0.7rem 1rem;
  color: var(--orange-dark);
  background: var(--orange-soft);
}

.section-more:hover {
  transform: translateY(-2px);
  background: #ffedd5;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.25rem;
}

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

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

.movie-card {
  min-width: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-0.45rem);
  box-shadow: var(--shadow-lg);
}

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

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

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

.poster-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-card:hover .poster-overlay {
  opacity: 1;
}

.rank-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--orange);
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.36);
}

.movie-card-body {
  padding: 1rem;
}

.movie-card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 850;
}

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

.card-meta {
  margin: 0.35rem 0 0;
  color: var(--orange-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

.card-desc {
  display: -webkit-box;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.tag-row span {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  color: #9a3412;
  background: #fff7ed;
  font-size: 0.75rem;
  font-weight: 700;
}

.rail-wrap {
  position: relative;
}

.movie-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 210px);
  gap: 1rem;
  overflow-x: auto;
  padding: 0.2rem 0 1rem;
  scroll-snap-type: x mandatory;
}

.movie-rail .movie-card {
  scroll-snap-align: start;
}

.rail-btn {
  position: absolute;
  top: 42%;
  z-index: 3;
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.58);
}

.rail-btn.prev {
  left: -0.8rem;
}

.rail-btn.next {
  right: -0.8rem;
}

.home-panels {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.rank-panel,
.filter-panel,
.detail-card,
.category-card,
.category-overview-card {
  border-radius: 1.25rem;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.rank-panel {
  padding: 1.2rem;
}

.rank-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.rank-list {
  display: grid;
  gap: 0.7rem;
}

.rank-item {
  display: grid;
  grid-template-columns: auto 64px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 0.9rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: #fff7ed;
  transform: translateX(0.25rem);
}

.rank-number {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--orange);
  font-weight: 900;
}

.rank-item img {
  width: 64px;
  height: 86px;
  object-fit: cover;
  border-radius: 0.65rem;
}

.rank-info {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.rank-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info em {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: normal;
}

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

.category-link,
.category-card {
  position: relative;
  overflow: hidden;
  min-height: 125px;
  padding: 1.2rem;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #b91c1c);
  box-shadow: var(--shadow);
}

.category-link::after,
.category-card::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -2rem;
  width: 7rem;
  height: 7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.category-link strong,
.category-card strong {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
}

.category-link span,
.category-card span {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.45rem;
  color: #ffedd5;
  line-height: 1.6;
}

.category-link:hover,
.category-card:hover {
  transform: translateY(-0.25rem);
}

.page-title {
  margin-bottom: 1.6rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumb a {
  color: var(--orange-dark);
  font-weight: 800;
}

.filter-panel {
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  outline: 0;
  padding: 0.78rem 0.9rem;
  background: #ffffff;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.12);
}

.no-results {
  display: none;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  border-radius: 1rem;
  background: #ffffff;
}

.no-results.is-visible {
  display: block;
}

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

.category-overview-card {
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-overview-card:hover {
  transform: translateY(-0.35rem);
  box-shadow: var(--shadow-lg);
}

.category-overview-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.category-overview-body {
  padding: 1rem;
}

.category-overview-body h2 {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 900;
}

.category-overview-body p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.65;
}

.detail-hero {
  padding: 2.2rem 0 1rem;
  background: linear-gradient(135deg, #111827, #1f2937, #7c2d12);
  color: #ffffff;
}

.detail-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: end;
}

.detail-cover {
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.detail-title h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  font-weight: 950;
}

.detail-title p {
  max-width: 820px;
  margin: 0 0 1rem;
  color: #e5e7eb;
  line-height: 1.8;
  font-size: 1.05rem;
}

.player-card {
  overflow: hidden;
  border-radius: 1.4rem;
  background: #000000;
  box-shadow: var(--shadow-lg);
}

.player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.78));
}

.player-overlay.is-hidden {
  display: none;
}

.player-button {
  width: 5rem;
  height: 5rem;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--orange);
  box-shadow: 0 18px 36px rgba(234, 88, 12, 0.42);
  font-size: 1.9rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.player-button:hover {
  transform: scale(1.08);
  background: var(--orange-dark);
}

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

.detail-card {
  padding: 1.35rem;
}

.detail-card h2,
.detail-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.detail-card p {
  margin: 0 0 1rem;
  color: #374151;
  line-height: 1.9;
}

.detail-card p:last-child {
  margin-bottom: 0;
}

.related-list {
  display: grid;
  gap: 0.85rem;
}

.related-list .rank-item {
  background: #ffffff;
  box-shadow: var(--shadow);
}

.masonry {
  columns: 3 260px;
  column-gap: 1.25rem;
}

.masonry .movie-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.25rem;
  break-inside: avoid;
}

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

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

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

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

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

  .mobile-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .hero {
    height: 520px;
  }

  .hero-content {
    padding-bottom: 4.5rem;
  }

  .hero-arrow {
    display: none;
  }

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

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

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

  .detail-hero-inner {
    grid-template-columns: 125px minmax(0, 1fr);
    align-items: center;
  }
}

@media (max-width: 560px) {
  .header-inner {
    padding: 0.75rem 1rem;
  }

  .site-logo,
  .footer-logo {
    font-size: 1.1rem;
  }

  .logo-mark {
    width: 1.75rem;
    height: 1.75rem;
  }

  .hero {
    height: 500px;
  }

  .hero-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .movie-grid,
  .movie-grid.small-grid,
  .movie-grid.wide-grid,
  .category-overview,
  .category-strip {
    grid-template-columns: 1fr;
  }

  .movie-rail {
    grid-auto-columns: minmax(155px, 72vw);
  }

  .rail-btn {
    display: none;
  }

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

  .detail-cover {
    max-width: 180px;
  }

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

.site-footer {
  margin-top: 4rem;
  color: #d1d5db;
  background: linear-gradient(90deg, #111827, #1f2937, #111827);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.footer-inner p {
  max-width: 320px;
  margin: 1rem 0 0;
  color: #cbd5e1;
  line-height: 1.8;
}

.footer-inner h3 {
  margin: 0 0 1rem;
  color: #ffffff;
  font-size: 1rem;
}

.footer-links {
  display: grid;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: #fb923c;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 1rem;
  text-align: center;
  color: #9ca3af;
}
