:root {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --bg-card: #1f2937;
  --bg-card-light: #334155;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --radius: 18px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 32rem),
    linear-gradient(180deg, #0f172a 0%, #1e293b 46%, #0f172a 100%);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

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

.header-inner {
  width: min(100% - 32px, var(--container));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.32);
  font-size: 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(245, 158, 11, 0.14);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(51, 65, 85, 0.7);
  cursor: pointer;
}

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

.hero {
  position: relative;
  height: min(72vh, 720px);
  min-height: 520px;
  overflow: hidden;
  background: #0f172a;
}

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

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

.hero-image {
  position: absolute;
  inset: 0;
}

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

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.72) 38%, rgba(15, 23, 42, 0.12) 100%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.86) 0%, rgba(15, 23, 42, 0.35) 52%, rgba(15, 23, 42, 0.08) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, var(--container));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  padding-bottom: 82px;
}

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

.hero-copy h1,
.hero-copy h2 {
  margin: 0 0 18px;
  font-size: clamp(34px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-copy p {
  max-width: 680px;
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags {
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
}

.hero-meta,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.hero-meta {
  margin-bottom: 28px;
  color: var(--text-soft);
}

.hero-meta strong,
.meta-row strong {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.26);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.hero-search {
  display: flex;
  width: min(100%, 480px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(12px);
}

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

.hero-search button {
  border: 0;
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 800;
}

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

.hero-control:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.06);
}

.hero-prev {
  left: 20px;
}

.hero-next {
  right: 20px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.main {
  padding: 52px 0 72px;
}

.main.tight {
  padding-top: 32px;
}

.section-stack {
  display: grid;
  gap: 70px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-heading p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--text-muted);
}

.section-heading a {
  color: var(--accent);
  font-weight: 800;
}

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

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

.large-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

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

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

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

.default-card,
.large-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.88);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.default-card:hover,
.large-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.78);
  box-shadow: var(--shadow);
}

.poster,
.large-poster,
.horizontal-poster {
  position: relative;
  overflow: hidden;
  background: #111827;
}

.poster {
  aspect-ratio: 2 / 3;
}

.compact-poster {
  margin-bottom: 10px;
  border-radius: 14px;
}

.large-poster {
  aspect-ratio: 16 / 9;
}

.horizontal-poster {
  width: 168px;
  min-height: 112px;
  flex: 0 0 168px;
}

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

.movie-card:hover img {
  transform: scale(1.08);
}

.year-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 16px;
}

.card-body h3,
.compact-card h3,
.horizontal-title-line h3 {
  margin: 0;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.compact-card h3 {
  font-size: 14px;
}

.movie-card:hover h3,
.horizontal-card:hover h3 {
  color: var(--accent);
}

.card-body p,
.compact-card p,
.horizontal-body p,
.large-overlay p {
  display: -webkit-box;
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--text-muted);
  -webkit-box-orient: vertical;
}

.card-body p {
  min-height: 44px;
  -webkit-line-clamp: 2;
}

.compact-card p {
  margin: 3px 0 0;
  font-size: 13px;
  -webkit-line-clamp: 1;
}

.horizontal-body p {
  margin: 5px 0 0;
  -webkit-line-clamp: 1;
}

.large-overlay p {
  -webkit-line-clamp: 2;
}

.horizontal-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.9);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.horizontal-card:hover {
  transform: translateX(4px);
  border-color: rgba(245, 158, 11, 0.78);
}

.horizontal-card a {
  display: flex;
  min-height: 112px;
}

.horizontal-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.horizontal-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  min-width: 40px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.large-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 26px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
}

.large-overlay h3 {
  margin: 10px 0 0;
  font-size: 25px;
}

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

.category-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(30, 41, 59, 0.9);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-card:hover img {
  transform: scale(1.1);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.18));
}

.category-info {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 2;
}

.category-info h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.category-info p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.filter-panel {
  margin: 0 0 28px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 14px;
}

.filter-grid label {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  padding: 0 12px;
  color: #ffffff;
  background: rgba(30, 41, 59, 0.92);
}

.filter-grid input:focus,
.filter-grid select:focus {
  border-color: rgba(245, 158, 11, 0.85);
}

.filter-count {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state {
  display: none;
  padding: 30px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--text-muted);
  text-align: center;
}

.detail-hero {
  padding: 34px 0 0;
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 14px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.detail-main,
.detail-side,
.info-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.86);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
}

.detail-main {
  overflow: hidden;
}

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

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(0deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.14)),
    rgba(2, 6, 23, 0.08);
  cursor: pointer;
  transition: opacity 0.25s ease;
}

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

.play-button {
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
  font-size: 30px;
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.34);
}

.player-message {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  color: #ffffff;
  font-size: 14px;
}

.detail-content {
  padding: 26px;
}

.detail-content h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.detail-content .lead {
  color: #fbbf24;
  font-size: 18px;
  font-weight: 700;
}

.info-card {
  padding: 24px;
  margin-top: 22px;
}

.info-card h2,
.info-card h3,
.detail-side h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.info-card p {
  margin: 0;
  color: var(--text-soft);
}

.detail-side {
  position: sticky;
  top: 92px;
  padding: 20px;
}

.related-list {
  display: grid;
  gap: 16px;
}

.related-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
}

.related-item img {
  width: 78px;
  height: 116px;
  border-radius: 10px;
  object-fit: cover;
}

.related-item h3 {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.more-grid {
  margin-top: 46px;
}

.page-hero {
  padding: 46px 0 18px;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 820px;
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 17px;
}

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

.ranking-list .horizontal-card {
  counter-increment: ranking;
}

.ranking-list .rank-number::before {
  content: counter(ranking, decimal-leading-zero);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.footer-grid {
  padding: 32px 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--text-muted);
}

.footer-logo {
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
}

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

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

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

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

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

  .detail-side {
    position: static;
  }

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

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 68px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.98);
  }

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

  .nav-toggle {
    display: block;
  }

  .nav-link {
    border-radius: 12px;
  }

  .hero {
    min-height: 620px;
    height: auto;
  }

  .hero-content {
    align-items: flex-end;
    padding-top: 120px;
    padding-bottom: 80px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-search {
    width: 100%;
    min-height: 48px;
  }

  .hero-control {
    display: none;
  }

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

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

  .horizontal-card a {
    min-height: 104px;
  }

  .horizontal-poster {
    width: 126px;
    min-height: 104px;
    flex-basis: 126px;
  }

  .horizontal-body {
    padding: 12px;
  }

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

  .detail-content,
  .info-card {
    padding: 20px;
  }

  .footer-grid {
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .movie-grid,
  .compact-grid,
  .large-grid,
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 14px;
  }

  .card-body p {
    min-height: 40px;
    font-size: 13px;
  }

  .tag {
    font-size: 12px;
  }

  .play-button {
    width: 68px;
    height: 68px;
    font-size: 25px;
  }
}
