:root {
  color-scheme: dark;
  --bg-deep: #020617;
  --bg-main: #0f172a;
  --bg-panel: #1e293b;
  --bg-soft: #334155;
  --gold: #f59e0b;
  --gold-light: #fbbf24;
  --text-main: #e5e7eb;
  --text-soft: #94a3b8;
  --text-muted: #64748b;
  --border: rgba(245, 158, 11, 0.22);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 32rem), linear-gradient(180deg, #020617 0%, #0f172a 42%, #111827 100%);
  color: var(--text-main);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

img {
  background: linear-gradient(135deg, #0f172a, #334155);
}

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

.header-inner {
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--gold-light);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #0f172a;
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.36);
}

.logo-text {
  font-size: 1.25rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  color: #cbd5e1;
}

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

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover {
  color: var(--gold-light);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search input,
.filter-bar input,
.filter-bar select {
  border: 1px solid #334155;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.88);
  color: #e5e7eb;
  padding: 0.72rem 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.header-search button,
.hero-button,
.ghost-button,
.play-button,
.load-button {
  border-radius: 0.75rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button,
.hero-button,
.play-button,
.load-button {
  background: var(--gold);
  color: #0f172a;
}

.header-search button {
  padding: 0.72rem 1rem;
}

.header-search button:hover,
.hero-button:hover,
.play-button:hover,
.load-button:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.22);
}

.ghost-button {
  border: 1px solid var(--border);
  color: #e5e7eb;
  padding: 0.85rem 1.15rem;
  background: rgba(15, 23, 42, 0.66);
}

.ghost-button:hover {
  border-color: var(--gold-light);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.mobile-menu-button {
  display: none;
  color: #e5e7eb;
  font-size: 1.6rem;
}

.mobile-nav {
  display: none;
  padding: 0.75rem 0 1rem;
  border-top: 1px solid var(--border);
}

.mobile-nav.is-open {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border-bottom: 1px solid rgba(245, 158, 11, 0.12);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  transition: opacity 0.65s ease;
}

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(15, 23, 42, 0.82) 42%, rgba(2, 6, 23, 0.35) 100%);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% 28%, rgba(245, 158, 11, 0.24), transparent 24rem);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) 360px;
  align-items: center;
  gap: 3rem;
  padding-top: 4rem;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 7vw, 6.2rem);
  line-height: 0.95;
  color: var(--gold-light);
  font-weight: 900;
  margin-bottom: 1.5rem;
  text-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
}

.hero-copy p {
  max-width: 760px;
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.6rem;
}

.hero-tags span,
.movie-card-tags span,
.detail-tags span,
.meta-pill {
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  color: #fcd34d;
  padding: 0.35rem 0.72rem;
  font-size: 0.82rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.3rem;
}

.hero-poster-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.35rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

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

.hero-poster-card div {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.96));
}

.hero-poster-card strong {
  color: #fff7ed;
  font-size: 1.35rem;
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hero-controls button {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.36);
}

.hero-controls button.is-active {
  width: 2.3rem;
  background: var(--gold-light);
}

.section-shell {
  padding: 4.6rem 0;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading span {
  display: inline-flex;
  color: var(--gold-light);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.section-heading h2,
.page-title h1,
.detail-title h1 {
  color: var(--gold-light);
  font-weight: 900;
  line-height: 1.15;
}

.section-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.section-heading p,
.page-title p,
.detail-title p {
  color: var(--text-soft);
  line-height: 1.85;
  margin-top: 0.7rem;
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(30, 41, 59, 0.86);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-0.35rem);
  border-color: rgba(245, 158, 11, 0.36);
  box-shadow: 0 26px 60px rgba(245, 158, 11, 0.12);
}

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

.poster-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #0f172a, #334155);
}

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

.movie-card:hover .poster-wrap img,
.horizontal-card:hover img,
.related-card:hover img {
  transform: scale(1.08);
}

.poster-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, 0.86));
}

.year-badge {
  position: absolute;
  z-index: 2;
  top: 0.8rem;
  right: 0.8rem;
  border-radius: 999px;
  background: var(--gold);
  color: #0f172a;
  font-weight: 900;
  padding: 0.22rem 0.6rem;
  font-size: 0.78rem;
}

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

.movie-card-body h3,
.horizontal-body h3,
.related-card h3 {
  color: #fbbf24;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.movie-card-body h3 {
  font-size: 1.06rem;
}

.movie-card-body p,
.horizontal-body p,
.related-card p {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 0.92rem;
}

.movie-meta-line {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.movie-card-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.category-pill {
  position: absolute;
  z-index: 3;
  left: 0.85rem;
  top: 0.85rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
}

.horizontal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.horizontal-card {
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.96), rgba(51, 65, 85, 0.76));
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.horizontal-card:hover {
  transform: translateY(-0.25rem);
  border-color: rgba(16, 185, 129, 0.35);
}

.horizontal-card a {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  min-height: 8.3rem;
}

.horizontal-poster {
  overflow: hidden;
  background: #0f172a;
}

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

.horizontal-body {
  padding: 1rem;
}

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

.category-card {
  display: block;
  min-height: 13rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 10rem), rgba(30, 41, 59, 0.86);
  padding: 1.4rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-0.25rem);
  border-color: rgba(245, 158, 11, 0.48);
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.11);
}

.category-card strong {
  display: block;
  color: var(--gold-light);
  font-size: 1.35rem;
  margin-bottom: 0.7rem;
}

.category-card p {
  color: #cbd5e1;
  line-height: 1.7;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(30, 41, 59, 0.8);
  padding: 0.9rem 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateX(0.2rem);
  border-color: rgba(245, 158, 11, 0.34);
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  font-weight: 900;
}

.rank-title {
  color: #f8fafc;
  font-weight: 800;
}

.rank-item p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-top: 0.22rem;
}

.page-hero {
  padding: 5rem 0 2.5rem;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 28rem);
}

.page-title h1,
.detail-title h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.filter-bar input {
  flex: 1 1 18rem;
}

.empty-state {
  display: none;
  color: var(--text-soft);
  padding: 2rem;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.empty-state.is-visible {
  display: block;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #000;
  border: 1px solid rgba(245, 158, 11, 0.22);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.75));
  cursor: pointer;
}

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

.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.35rem;
  font-size: 1.05rem;
}

.detail-panel,
.side-panel {
  border-radius: 1.15rem;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 1.35rem;
}

.detail-panel h2,
.side-panel h2 {
  color: var(--gold-light);
  font-weight: 900;
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}

.detail-panel p {
  color: #cbd5e1;
  line-height: 1.92;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.2rem 0;
}

.detail-poster {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(245, 158, 11, 0.16);
  background: #0f172a;
  margin-bottom: 1rem;
}

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

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

.related-card {
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(30, 41, 59, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.related-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.related-card div {
  padding: 0.85rem;
}

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

.breadcrumb a {
  color: #fcd34d;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid rgba(245, 158, 11, 0.16);
  background: rgba(2, 6, 23, 0.86);
  padding: 2rem 0;
  color: var(--text-soft);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.footer-grid strong {
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.35rem;
}

.footer-grid p {
  max-width: 820px;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  white-space: nowrap;
}

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

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

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

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

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

  .hero-poster-card {
    display: none;
  }

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

  .horizontal-list,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .movie-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }

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

  .movie-card-body p,
  .movie-card-tags,
  .category-pill {
    display: none;
  }

  .horizontal-card a {
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }

  .rank-item {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .rank-item .meta-pill {
    display: none;
  }

  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }
}
