:root {
  color-scheme: dark;
  --page-bg: #020617;
  --panel-bg: rgba(15, 23, 42, 0.78);
  --card-bg: rgba(15, 23, 42, 0.9);
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --line: rgba(51, 65, 85, 0.78);
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --amber: #fbbf24;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.16), transparent 30rem),
    radial-gradient(circle at 80% 15%, rgba(59, 130, 246, 0.18), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: #f8fafc;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.site-header {
  border-bottom: 1px solid rgba(51, 65, 85, 0.72);
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f8fafc;
  white-space: nowrap;
}

.logo-mark {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-size: 0.85rem;
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.35);
}

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

.nav-link {
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  color: #cbd5e1;
  font-size: 0.95rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
  background: rgba(15, 23, 42, 0.86);
}

.top-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.top-search input,
.mobile-search input,
.library-tools input,
.library-tools select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search input,
.mobile-search input {
  width: 16rem;
  padding: 0.62rem 0.85rem;
}

.top-search input:focus,
.mobile-search input:focus,
.library-tools input:focus,
.library-tools select:focus {
  border-color: rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  background: rgba(15, 23, 42, 0.98);
}

.top-search button,
.mobile-search button {
  border-radius: 0.85rem;
  padding: 0.62rem 1rem;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 700;
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.75rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.8);
}

.mobile-nav {
  display: none;
  padding: 0 0 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
}

.mobile-nav.is-open {
  display: grid;
  gap: 0.4rem;
}

.mobile-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

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

.hero-shell {
  position: relative;
  height: min(76vh, 45rem);
  min-height: 34rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(51, 65, 85, 0.58);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 1.1s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(14, 116, 144, 0.24));
}

.hero-bg img,
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: saturate(1.15) contrast(1.05);
}

.hero-bg img.image-missing,
.detail-bg img.image-missing,
.poster-frame img.image-missing {
  opacity: 0;
}

.hero-overlay,
.detail-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.97), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.22)),
    linear-gradient(180deg, rgba(2, 6, 23, 0.35), #020617);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-copy {
  max-width: 55rem;
  padding-top: 4rem;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  color: #fff;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.7rem, 7vw, 5.9rem);
  max-width: 56rem;
}

.hero-copy p {
  max-width: 48rem;
  margin: 1.35rem 0 0;
  color: #cbd5e1;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.8;
}

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

.hero-meta {
  margin-top: 1.45rem;
}

.hero-meta span,
.detail-meta span,
.movie-meta-row span {
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  color: #dbeafe;
}

.hero-meta span,
.detail-meta span {
  padding: 0.42rem 0.8rem;
}

.movie-meta-row span {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.primary-button,
.ghost-button,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border-radius: 0.95rem;
  padding: 0.78rem 1.15rem;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  box-shadow: 0 18px 44px rgba(14, 165, 233, 0.22);
}

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

.primary-button:hover,
.ghost-button:hover,
.section-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.42);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 2rem;
}

.hero-dots {
  display: flex;
  gap: 0.6rem;
}

.hero-dot {
  width: 2rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 4rem;
  background: var(--cyan);
}

.content-section,
.page-main {
  padding-top: 4.5rem;
  padding-bottom: 1.5rem;
}

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

.section-heading h2,
.rank-panel h2,
.story-panel h2,
.info-panel h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-heading p,
.page-hero p,
.footer-grid p,
.story-panel p,
.ranking-item p,
.detail-one-line {
  color: var(--muted);
  line-height: 1.78;
}

.section-heading p {
  max-width: 48rem;
  margin: 0.55rem 0 0;
}

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

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.98));
  box-shadow: 0 22px 50px rgba(2, 6, 23, 0.26);
  transition: transform 0.23s ease, border-color 0.23s ease, box-shadow 0.23s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.58);
  box-shadow: 0 28px 70px rgba(8, 47, 73, 0.28);
}

.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background:
    radial-gradient(circle at 28% 20%, rgba(34, 211, 238, 0.32), transparent 11rem),
    linear-gradient(145deg, #0f172a, #020617 62%, #0e7490);
}

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

.movie-card:hover .poster-frame img {
  transform: scale(1.055);
}

.poster-shine {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.88));
}

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

.movie-card-title {
  margin: 0.75rem 0 0.45rem;
  color: #f8fafc;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
}

.movie-card-title a:hover {
  color: var(--cyan);
}

.movie-card-text {
  min-height: 3.3rem;
  margin: 0;
  color: #94a3b8;
  line-height: 1.65;
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(8, 145, 178, 0.12);
  color: #a5f3fc;
  font-size: 0.78rem;
}

.link-pill:hover {
  border-color: rgba(34, 211, 238, 0.62);
  background: rgba(8, 145, 178, 0.22);
}

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

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

.category-card {
  position: relative;
  min-height: 10rem;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.78);
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.9);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: end;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-card.large {
  min-height: 9rem;
}

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

.category-bg {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background: linear-gradient(145deg, #0f172a, #0e7490);
}

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

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.94));
}

.category-name,
.category-arrow {
  position: relative;
  z-index: 1;
}

.category-name {
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
}

.category-arrow {
  margin-top: 0.45rem;
  color: var(--cyan);
  font-size: 0.92rem;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem;
  gap: 1.5rem;
  align-items: start;
}

.rank-panel,
.story-panel,
.info-panel,
.library-tools,
.ranking-item {
  border: 1px solid rgba(51, 65, 85, 0.76);
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 22px 52px rgba(2, 6, 23, 0.24);
}

.rank-panel {
  position: sticky;
  top: 6rem;
  padding: 1.2rem;
}

.rank-panel-head {
  margin-bottom: 1rem;
}

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

.rank-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.95rem;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid transparent;
}

.rank-link:hover {
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(8, 47, 73, 0.38);
}

.rank-no {
  grid-row: span 2;
  width: 2.15rem;
  height: 2.15rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.rank-title {
  overflow: hidden;
  color: #f8fafc;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-meta {
  color: #94a3b8;
  font-size: 0.88rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.72);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.18), transparent 24rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.96));
  padding: clamp(2rem, 5vw, 4rem);
}

.page-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
}

.page-hero p {
  max-width: 48rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
}

.library-tools {
  margin: 1.5rem 0;
  padding: 1rem;
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.library-tools input,
.library-tools select {
  width: 100%;
  padding: 0.78rem 0.9rem;
}

.library-card.is-hidden {
  display: none;
}

.ranking-board {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.ranking-item {
  padding: 0.8rem;
}

.ranking-item p {
  margin: 0.55rem 0 0;
  padding-left: 3rem;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 36rem;
}

.detail-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #020617, #0f172a);
}

.detail-inner {
  position: relative;
  z-index: 2;
  min-height: 36rem;
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 3rem;
}

.detail-poster {
  border-radius: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 28px 74px rgba(2, 6, 23, 0.48);
}

.detail-copy h1 {
  max-width: 60rem;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
}

.detail-meta {
  margin-top: 1.25rem;
}

.detail-one-line {
  max-width: 62rem;
  margin: 1.35rem 0 0;
  font-size: 1.1rem;
}

.detail-tags {
  max-width: 62rem;
}

.scroll-play {
  margin-top: 1.6rem;
}

.player-section {
  padding-top: 3rem;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 1.3rem;
  background:
    radial-gradient(circle at center, rgba(34, 211, 238, 0.12), transparent 22rem),
    #020617;
  aspect-ratio: 16 / 9;
  box-shadow: 0 32px 88px rgba(2, 6, 23, 0.48);
  cursor: pointer;
}

.movie-player {
  width: 100%;
  height: 100%;
  background: #020617;
  object-fit: contain;
}

.play-trigger {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.56));
}

.play-trigger span {
  width: clamp(4.4rem, 10vw, 6.6rem);
  height: clamp(4.4rem, 10vw, 6.6rem);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  box-shadow: 0 0 50px rgba(34, 211, 238, 0.42);
}

.player-shell.is-playing .play-trigger {
  display: none;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: 1.5rem;
  padding-top: 2rem;
}

.story-panel,
.info-panel {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.story-panel h2 + p {
  margin-top: 0.7rem;
}

.info-panel dl {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.7rem 1rem;
  margin: 1rem 0 0;
}

.info-panel dt {
  color: var(--cyan);
  font-weight: 800;
}

.info-panel dd {
  margin: 0;
  color: #cbd5e1;
}

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid rgba(51, 65, 85, 0.72);
  background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr 1fr;
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-grid h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  color: #f8fafc;
  font-weight: 900;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.footer-links a {
  color: #94a3b8;
}

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

.footer-bottom {
  border-top: 1px solid rgba(51, 65, 85, 0.48);
  padding: 1rem;
  text-align: center;
  color: #64748b;
}

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

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

  .two-column-section,
  .detail-content {
    grid-template-columns: 1fr;
  }

  .rank-panel {
    position: relative;
    top: 0;
  }

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

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

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

  .hero-shell {
    height: auto;
    min-height: 36rem;
  }

  .hero-copy {
    padding-top: 2rem;
  }

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

  .detail-poster {
    max-width: 14rem;
  }

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

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

  .hero-shell {
    min-height: 39rem;
  }

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

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

  .movie-card-content {
    padding: 0.85rem;
  }

  .movie-card-text {
    min-height: 0;
  }

  .ranking-item p {
    padding-left: 0;
  }
}

@media (max-width: 420px) {
  .movie-grid,
  .featured-grid,
  .mini-grid,
  .category-grid,
  .all-movie-grid,
  .all-category-grid {
    grid-template-columns: 1fr;
  }
}
