:root {
  color-scheme: light;
  --bg: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --red: #ef4444;
  --orange: #f97316;
  --green: #10b981;
  --emerald: #059669;
  --dark: #111827;
  --shadow: 0 18px 45px rgb(17 24 39 / 0.10);
  --shadow-soft: 0 10px 25px rgb(17 24 39 / 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.84);
  border-bottom: 1px solid rgb(229 231 235 / 0.8);
  box-shadow: 0 10px 30px rgb(17 24 39 / 0.08);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(1240px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 12px 28px rgb(239 68 68 / 0.28);
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong,
.footer-brand strong {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, #dc2626, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 6px;
  color: #374151;
  font-weight: 700;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--emerald);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 310px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.nav-search input,
.mobile-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 9px 12px;
  background: transparent;
}

.nav-search button,
.mobile-search button {
  border: 0;
  color: #fff;
  font-weight: 800;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--emerald));
  cursor: pointer;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #111827;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316 45%, #db2777);
}

.hero-track {
  position: relative;
  min-height: 620px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.55fr);
  align-items: center;
  gap: 44px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

.hero-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(1.15);
  transform: scale(1.08);
  opacity: 0.32;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 20%, rgb(255 255 255 / 0.25), transparent 24%),
    radial-gradient(circle at 78% 14%, rgb(250 204 21 / 0.26), transparent 22%),
    linear-gradient(90deg, rgb(0 0 0 / 0.42), rgb(0 0 0 / 0.06));
}

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

.hero-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.20);
  color: rgb(255 255 255 / 0.92);
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgb(255 255 255 / 0.9);
  font-size: 20px;
}

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

.hero-tags span,
.movie-tags span {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

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

.primary-button,
.ghost-button,
.ghost-dark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  color: #dc2626;
  background: #fff;
  box-shadow: 0 16px 35px rgb(0 0 0 / 0.16);
}

.ghost-button {
  color: #fff;
  border: 2px solid rgb(255 255 255 / 0.48);
  background: rgb(255 255 255 / 0.16);
  backdrop-filter: blur(10px);
}

.ghost-dark-button {
  color: #111827;
  border: 1px solid var(--line);
  background: #fff;
}

.primary-button:hover,
.ghost-button:hover,
.ghost-dark-button:hover {
  transform: translateY(-2px) scale(1.02);
}

.hero-poster {
  display: block;
  overflow: hidden;
  border: 10px solid rgb(255 255 255 / 0.20);
  border-radius: 34px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.35);
  aspect-ratio: 3 / 4;
  background: rgb(255 255 255 / 0.14);
}

.hero-poster img,
.poster-frame img,
.detail-poster img,
.rank-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 34px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.36);
  cursor: pointer;
}

.hero-dot.active {
  background: #fff;
}

.quick-panel {
  position: relative;
  z-index: 4;
  width: min(1080px, calc(100% - 32px));
  margin: -36px auto 42px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background: rgb(255 255 255 / 0.88);
  border: 1px solid rgb(255 255 255 / 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.quick-panel a {
  display: grid;
  place-items: center;
  min-height: 52px;
  color: #374151;
  font-weight: 900;
  border-radius: 16px;
  background: #fff;
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-panel a:hover {
  color: var(--emerald);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.content-section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.tint-section {
  width: 100%;
  max-width: none;
  padding: 64px max(16px, calc((100% - 1240px) / 2));
  background: linear-gradient(135deg, #fff7ed, #fefce8);
}

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

.section-heading h2,
.ranking-title h2,
.detail-article h2,
.detail-side h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

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

.section-more,
.ranking-title a {
  color: #dc2626;
  font-weight: 900;
}

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

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

.movie-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgb(16 185 129 / 0.38);
  box-shadow: 0 24px 55px rgb(17 24 39 / 0.16);
}

.poster-frame {
  position: relative;
  height: 260px;
  margin: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.poster-frame figcaption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: rgb(0 0 0 / 0.68);
}

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

.movie-card .movie-tags span,
.detail-tags span,
.search-card .movie-tags span {
  color: #047857;
  background: #ecfdf5;
}

.movie-card h3,
.wide-card h3,
.search-card h3 {
  margin: 12px 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.movie-card p,
.search-card p {
  min-height: 52px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

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

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

.wide-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.wide-card .poster-frame {
  height: 100%;
  min-height: 170px;
}

.ranking-card,
.detail-side,
.detail-article,
.search-panel,
.player-section {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.ranking-card {
  padding: 24px;
  align-self: start;
  position: sticky;
  top: 96px;
}

.ranking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #f9fafb;
}

.ranking-row:hover {
  background: #ecfdf5;
}

.ranking-row strong,
.rank-item strong {
  color: #dc2626;
  font-size: 18px;
}

.ranking-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.ranking-row em,
.rank-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.page-hero {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 64px 16px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #16a34a, #059669);
  overflow: hidden;
}

.small-hero {
  background: linear-gradient(135deg, #ef4444, #f97316, #db2777);
}

.category-hero {
  background: linear-gradient(135deg, #9333ea, #db2777);
}

.ranking-hero {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.search-hero {
  background: linear-gradient(135deg, #059669, #14b8a6);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -0.06em;
}

.page-hero p {
  max-width: 720px;
  margin: 0 auto;
  color: rgb(255 255 255 / 0.88);
  font-size: 18px;
}

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

.category-card {
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.category-cover {
  height: 150px;
  background-size: cover;
  background-position: center;
}

.category-card div:last-child {
  padding: 20px;
}

.category-card span {
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.category-card h2 {
  margin: 5px 0 8px;
  font-size: 24px;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.pagination a,
.pagination strong,
.pagination span {
  min-width: 42px;
  padding: 9px 14px;
  border-radius: 12px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
}

.pagination strong {
  color: #fff;
  border-color: var(--emerald);
  background: var(--emerald);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 60px 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.rank-item img {
  width: 100px;
  height: 128px;
  border-radius: 16px;
}

.rank-item h2 {
  margin: 0 0 6px;
  font-size: 22px;
}

.rank-item p {
  margin: 0 0 12px;
  color: var(--muted);
}

.breadcrumbs {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-main {
  padding-bottom: 32px;
}

.detail-hero {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 34px;
  border-radius: 32px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  box-shadow: var(--shadow);
}

.detail-poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 24px;
  background: rgb(255 255 255 / 0.08);
  box-shadow: 0 22px 60px rgb(0 0 0 / 0.35);
}

.detail-kicker {
  margin: 0 0 10px;
  color: #fbbf24;
  font-weight: 900;
}

.detail-info h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.detail-line {
  max-width: 760px;
  margin: 0 0 20px;
  color: rgb(255 255 255 / 0.86);
  font-size: 19px;
}

.player-section {
  position: relative;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto 34px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-player {
  width: 100%;
  height: 100%;
  background: #000;
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.58));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-cover span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #dc2626;
  background: #fff;
  box-shadow: 0 16px 45px rgb(0 0 0 / 0.35);
}

.play-cover strong {
  font-size: 20px;
}

.player-section.is-playing .play-cover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.detail-content {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.detail-article,
.detail-side {
  padding: 28px;
}

.detail-article h2,
.detail-side h2 {
  margin-bottom: 16px;
}

.detail-article p {
  margin: 0 0 24px;
  color: #374151;
  font-size: 17px;
}

.detail-side dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.detail-side dt {
  color: var(--muted);
}

.detail-side dd {
  margin: 0;
  font-weight: 800;
}

.genre-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.genre-links a {
  padding: 7px 10px;
  border-radius: 999px;
  color: #047857;
  background: #ecfdf5;
  font-size: 13px;
  font-weight: 800;
}

.related-section {
  margin-top: 18px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  padding: 18px;
  margin-bottom: 24px;
}

.search-panel input,
.search-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  outline: 0;
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 4px rgb(16 185 129 / 0.12);
}

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

.search-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.search-card img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  text-align: center;
  color: var(--muted);
  border-radius: 24px;
  background: #fff;
}

.site-footer {
  margin-top: 36px;
  color: #d1d5db;
  background: linear-gradient(135deg, #111827, #1f2937);
}

.footer-grid {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 34px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 18px;
}

.site-footer p {
  max-width: 460px;
  color: #9ca3af;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: #d1d5db;
}

.site-footer a:hover {
  color: #34d399;
}

.footer-bottom {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  color: #9ca3af;
}

@media (max-width: 1100px) {
  .nav-search {
    display: none;
  }

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

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

  .ranking-card {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .mobile-nav.open {
    display: grid;
    gap: 10px;
  }

  .mobile-nav .nav-link {
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
  }

  .mobile-search {
    display: flex;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
  }

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

  .hero-slide {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 24px;
  }

  .hero-poster {
    width: min(300px, 82vw);
    margin: 0 auto;
  }

  .quick-panel {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .detail-poster {
    width: min(320px, 100%);
    margin: 0 auto;
  }

  .rank-item {
    grid-template-columns: 44px 82px minmax(0, 1fr);
  }

  .rank-item em {
    display: none;
  }

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

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

@media (max-width: 560px) {
  .nav-shell {
    height: 68px;
  }

  .brand-text small {
    display: none;
  }

  .brand-text strong {
    font-size: 20px;
  }

  .hero h1,
  .detail-info h1,
  .page-hero h1 {
    font-size: 38px;
  }

  .hero p,
  .detail-line {
    font-size: 16px;
  }

  .quick-panel,
  .movie-grid,
  .compact-grid,
  .category-grid,
  .wide-grid,
  .search-results {
    grid-template-columns: 1fr;
  }

  .wide-card,
  .search-card {
    grid-template-columns: 1fr;
  }

  .poster-frame {
    height: 330px;
  }

  .rank-item {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .rank-item img {
    width: 100%;
    height: 220px;
  }

  .footer-grid,
  .footer-bottom {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}
