:root {
  --jelly-bg-primary: #f8f9fe;
  --jelly-bg-secondary: #ffffff;
  --jelly-text-primary: #2d3748;
  --jelly-text-secondary: #718096;
  --jelly-accent-mint: #b8e6d5;
  --jelly-accent-lavender: #d4c5f9;
  --jelly-accent-pink: #ffc4dd;
  --jelly-accent-blue: #c4ddff;
  --jelly-accent-peach: #ffd4c4;
  --jelly-moon: #e8eaf6;
  --jelly-purple: #667eea;
  --jelly-violet: #764ba2;
  --jelly-rose: #f093fb;
  --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.16);
  --shadow-lift: 0 18px 52px rgba(31, 38, 135, 0.28);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--jelly-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe, #00f2fe);
  background-size: 400% 400%;
  animation: gradientShift 30s ease infinite;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.38), transparent 32%),
    radial-gradient(circle at 78% 10%, rgba(255, 196, 221, 0.35), transparent 28%),
    radial-gradient(circle at 74% 76%, rgba(184, 230, 213, 0.28), transparent 34%),
    rgba(248, 249, 254, 0.68);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(54px);
  pointer-events: none;
}

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

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

button,
input {
  font: inherit;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes moonPulse {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 18px 0;
}

.nav-shell,
.mobile-panel,
.glass-panel,
.jelly-card,
.movie-card,
.category-card,
.ranking-row,
.site-footer {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(32px);
}

.nav-shell {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 22px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #667eea, #f093fb);
  box-shadow: 0 10px 24px rgba(102, 126, 234, 0.35);
}

.moon-glow::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(232, 234, 246, 0.48) 0%, transparent 70%);
  animation: moonPulse 4s ease-in-out infinite;
}

.brand-text {
  display: inline-block;
  color: transparent;
  font-size: 21px;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  -webkit-background-clip: text;
  background-clip: text;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.main-nav a,
.nav-dropdown > button,
.mobile-panel a {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #4a5568;
  background: transparent;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active,
.nav-dropdown:hover > button,
.mobile-panel a:hover {
  color: #6750d6;
  background: rgba(255, 255, 255, 0.68);
  transform: translateY(-1px);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 8px;
  width: 310px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(30px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.header-search {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.header-search input,
.mobile-panel input,
.quick-search-actions input,
.search-page-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  outline: none;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--jelly-text-primary);
  background: rgba(255, 255, 255, 0.82);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.header-search input:focus,
.mobile-panel input:focus,
.quick-search-actions input:focus,
.search-page-form input:focus {
  border-color: rgba(102, 126, 234, 0.58);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.header-search button,
.mobile-panel button,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.header-search button,
.mobile-panel button,
.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #667eea, #f093fb);
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.28);
}

.ghost-button {
  color: #6750d6;
  border: 1px solid rgba(102, 126, 234, 0.22);
  background: rgba(255, 255, 255, 0.78);
}

.header-search button:hover,
.mobile-panel button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(102, 126, 234, 0.30);
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.mobile-panel {
  display: none;
  max-width: 1240px;
  margin: 12px auto 0;
  padding: 16px;
  border-radius: 24px;
}

.mobile-panel.is-open {
  display: grid;
  gap: 14px;
}

.mobile-panel form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mobile-panel nav,
.mobile-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.page-shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 20px;
}

.home-page {
  padding-top: 24px;
}

.inner-page,
.detail-page {
  padding-top: 42px;
}

.hero-carousel {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border-radius: 34px;
  box-shadow: var(--shadow-lift);
}

.hero-stage,
.hero-slide {
  min-height: 610px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: center;
  padding: 68px;
  color: #ffffff;
  opacity: 0;
  visibility: hidden;
  background-image: linear-gradient(120deg, rgba(27, 32, 70, 0.88), rgba(118, 75, 162, 0.54)), var(--hero-image);
  background-position: center;
  background-size: cover;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.hero-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.23), transparent 28%),
    linear-gradient(90deg, rgba(10, 18, 46, 0.72), rgba(10, 18, 46, 0.28));
  pointer-events: none;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: #6b5ce7;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-copy .eyebrow {
  color: #ffe1ff;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.26);
}

.hero-summary {
  max-width: 720px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
  line-height: 1.75;
}

.hero-tags {
  margin-top: 22px;
}

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

.hero-poster {
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  transform: rotate(2deg);
  transition: transform 0.35s ease;
}

.hero-poster:hover {
  transform: rotate(0deg) translateY(-4px);
}

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

.hero-dots {
  position: absolute;
  right: 36px;
  bottom: 30px;
  z-index: 3;
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.is-active {
  width: 34px;
  background: #ffffff;
}

.quick-search-panel,
.page-hero,
.detail-hero,
.player-section,
.prose-panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.quick-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: center;
  margin-top: 26px;
}

.quick-search-panel h2,
.page-hero h1,
.section-heading h2,
.detail-intro h1,
.prose-panel h2 {
  margin: 0;
  color: #1f2937;
  letter-spacing: -0.03em;
}

.quick-search-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quick-search-actions.single-line {
  margin-top: 24px;
}

.section-block {
  margin-top: 46px;
}

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

.section-heading a {
  color: #6750d6;
  font-weight: 800;
}

.compact-heading {
  align-items: center;
}

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

.home-grid,
.category-movie-grid,
.ranking-grid,
.search-results,
.related-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.overview-grid {
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
}

.movie-card {
  overflow: hidden;
  border-radius: 24px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  animation: fadeUp 0.55s ease both;
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--shadow-lift);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}

.poster-link::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.56), transparent 54%);
  transition: opacity 0.3s ease;
}

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

.poster-link img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.45s ease;
}

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

.card-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(102, 126, 234, 0.88);
  backdrop-filter: blur(12px);
}

.card-badge {
  left: 10px;
  top: 10px;
}

.rank-badge {
  right: 10px;
  top: 10px;
  background: rgba(240, 147, 251, 0.9);
}

.movie-card-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.meta-line {
  margin: 0;
  color: var(--jelly-text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.movie-card h3 {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.35;
}

.movie-card h3 a:hover,
.ranking-row h3 a:hover,
.category-card a:hover {
  color: #6750d6;
}

.line-clamp,
.ranking-row p,
.category-card small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.line-clamp {
  min-height: 42px;
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  color: #5f45cd;
  font-size: 12px;
  font-weight: 700;
  background: rgba(212, 197, 249, 0.38);
}

.hero-tags .pill {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.category-card {
  overflow: hidden;
  border-radius: 24px;
}

.category-card-main {
  display: grid;
  gap: 10px;
  min-height: 142px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(212, 197, 249, 0.42));
}

.category-card-main span {
  font-size: 22px;
  font-weight: 900;
}

.category-card-main small {
  color: var(--jelly-text-secondary);
  line-height: 1.7;
  -webkit-line-clamp: 2;
}

.category-card-links {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.category-card-links a {
  color: #4b5563;
  font-size: 14px;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 54px 84px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border-radius: 22px;
  padding: 12px;
}

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

.ranking-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea, #f093fb);
}

.ranking-thumb {
  overflow: hidden;
  border-radius: 16px;
}

.ranking-thumb img {
  width: 84px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.ranking-row h3,
.ranking-row p {
  margin: 0;
}

.ranking-row p:last-child {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
}

.page-hero {
  margin-bottom: 32px;
}

.page-hero h1 {
  font-size: clamp(34px, 6vw, 64px);
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.75;
}

.category-overview-block {
  margin-top: 36px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 18px;
  color: rgba(31, 41, 55, 0.82);
  font-size: 14px;
}

.breadcrumb a {
  color: #6750d6;
  font-weight: 700;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 32px;
  align-items: stretch;
}

.detail-poster {
  overflow: hidden;
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.detail-intro h1 {
  font-size: clamp(34px, 5vw, 62px);
}

.detail-one-line {
  color: #4b5563;
  font-size: 19px;
  line-height: 1.8;
}

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

.detail-meta-grid span {
  display: grid;
  gap: 6px;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.detail-meta-grid strong {
  color: #6b7280;
  font-size: 12px;
}

.detail-meta-grid a {
  color: #6750d6;
  font-weight: 800;
}

.player-section {
  margin-top: 28px;
}

.video-player {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #0e1026;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.video-player video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0e1026;
  object-fit: contain;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 14px;
  place-content: center;
  border: 0;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 45%, rgba(240, 147, 251, 0.28), transparent 30%),
    linear-gradient(180deg, rgba(14, 16, 38, 0.16), rgba(14, 16, 38, 0.58));
  cursor: pointer;
}

.play-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  color: #6750d6;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.video-player.is-playing .play-overlay {
  display: none;
}

.player-status {
  position: absolute;
  left: 18px;
  bottom: 14px;
  margin: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.36);
}

.video-player.is-playing .player-status {
  opacity: 0;
  pointer-events: none;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
  margin-top: 28px;
}

.prose-panel p:not(.eyebrow) {
  margin: 18px 0 0;
  color: #374151;
  font-size: 17px;
  line-height: 1.95;
}

.search-page-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  max-width: 760px;
  margin-top: 24px;
}

.search-empty {
  grid-column: 1 / -1;
  border-radius: 24px;
  padding: 28px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.site-footer {
  width: min(1240px, calc(100% - 36px));
  margin: 56px auto 28px;
  border-radius: 28px;
  padding: 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.site-footer p,
.site-footer a {
  display: block;
  margin: 8px 0;
  color: #4b5563;
  line-height: 1.7;
}

.site-footer a:hover {
  color: #6750d6;
}

[data-card].is-hidden {
  display: none;
}

@media (max-width: 1120px) {
  .nav-shell {
    grid-template-columns: auto 1fr auto;
  }

  .header-search {
    display: none;
  }

  .hero-slide {
    grid-template-columns: minmax(0, 1fr) 290px;
    padding: 48px;
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .wide-ranking {
    grid-template-columns: 1fr;
  }
}

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

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

  .nav-shell {
    grid-template-columns: auto 1fr auto;
    border-radius: 26px;
  }

  .brand-text {
    font-size: 18px;
  }

  .hero-carousel,
  .hero-stage,
  .hero-slide {
    min-height: 700px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    align-content: end;
    gap: 24px;
    padding: 34px 24px 72px;
  }

  .hero-poster {
    max-width: 230px;
    margin: 0 auto;
    order: -1;
  }

  .quick-search-panel,
  .detail-hero,
  .detail-content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-poster img {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-inline: 10px;
  }

  .page-shell,
  .site-footer {
    width: min(100% - 20px, 1240px);
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-summary,
  .page-hero p:not(.eyebrow),
  .detail-one-line,
  .prose-panel p:not(.eyebrow) {
    font-size: 15px;
  }

  .hero-actions,
  .search-page-form {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .detail-meta-grid,
  .mobile-panel nav,
  .mobile-categories {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 42px 66px minmax(0, 1fr);
    gap: 10px;
  }

  .ranking-thumb img {
    width: 66px;
  }
}
