@import url("https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap");

:root {
  --blackboard-dark: #0f1a0f;
  --blackboard: #1a2e1a;
  --blackboard-light: #2d4a2d;
  --chalk-white: #f5f5dc;
  --chalk-yellow: #fffacd;
  --chalk-pink: #ffb6c1;
  --chalk-blue: #add8e6;
  --chalk-green: #90ee90;
  --vintage-gold: #ffd700;
  --line-soft: rgba(255, 250, 205, 0.3);
  --line-faint: rgba(255, 250, 205, 0.18);
  --shadow-chalk: 0 2px 4px rgba(245, 245, 220, 0.3);
  --shadow-deep: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--blackboard);
  color: var(--chalk-white);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(26, 46, 26, 0.96);
  border-bottom: 2px solid var(--line-soft);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--chalk-white);
  font-family: "Patrick Hand", cursive, system-ui;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--chalk-yellow);
  border-radius: 12px;
  color: var(--chalk-yellow);
  box-shadow: var(--shadow-chalk);
}

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

.nav-link,
.mobile-nav-link {
  color: rgba(245, 245, 220, 0.78);
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--chalk-yellow);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-panel input,
.filter-panel select {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--blackboard-light);
  color: var(--chalk-white);
  outline: none;
}

.header-search input {
  width: 220px;
  padding: 10px 14px;
}

.header-search input::placeholder,
.mobile-search input::placeholder,
.filter-panel input::placeholder {
  color: rgba(245, 245, 220, 0.55);
}

.header-search button,
.mobile-search button,
.primary-btn,
.ghost-btn,
.more-link,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.header-search button,
.mobile-search button,
.primary-btn {
  background: var(--chalk-yellow);
  color: var(--blackboard);
}

.header-search button:hover,
.mobile-search button:hover,
.primary-btn:hover {
  background: var(--chalk-white);
  transform: translateY(-2px);
}

.ghost-btn {
  border: 1px solid var(--line-soft);
  color: var(--chalk-white);
  background: rgba(15, 26, 15, 0.44);
}

.ghost-btn:hover {
  border-color: var(--chalk-yellow);
  color: var(--chalk-yellow);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--chalk-white);
  font-size: 1.8rem;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line-faint);
  padding: 16px;
}

.mobile-panel.open {
  display: block;
}

.mobile-nav {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-search {
  display: flex;
  gap: 10px;
}

.mobile-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
}

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 540px;
  overflow: hidden;
  background: var(--blackboard-dark);
}

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

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--blackboard) 0%, rgba(26, 46, 26, 0.75) 48%, rgba(26, 46, 26, 0.32) 100%);
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  padding-bottom: 70px;
}

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

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--chalk-yellow);
  font-weight: 900;
  font-size: 1.1rem;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1,
.section-heading h2 {
  margin: 0;
  font-family: "Patrick Hand", cursive, system-ui;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero-copy h1 {
  max-width: 780px;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.95;
  color: var(--chalk-white);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.55);
}

.hero-copy p {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(245, 245, 220, 0.9);
  font-size: 1.13rem;
}

.hero-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.hero-meta span,
.detail-meta span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--chalk-white);
  background: rgba(15, 26, 15, 0.6);
  border: 1px solid var(--line-faint);
  font-size: 0.88rem;
}

.hero-meta span:first-child {
  background: var(--chalk-yellow);
  color: var(--blackboard);
  font-weight: 900;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.hero-dots button {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 245, 220, 0.35);
  cursor: pointer;
}

.hero-dots button.active {
  background: var(--chalk-yellow);
}

.content-section {
  padding: 54px 0;
}

.board-section,
.ranking-strip,
.player-section,
.story-panel,
.related-panel {
  border: 2px solid var(--line-soft);
  border-radius: 24px;
  background: var(--blackboard-light);
  box-shadow: var(--shadow-deep);
}

.board-section,
.ranking-strip {
  padding: 34px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.section-heading > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 250, 205, 0.1);
  color: var(--chalk-yellow);
  font-size: 1.25rem;
}

.section-heading h2 {
  color: var(--chalk-white);
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-heading p {
  grid-column: 2;
  margin: 0;
  color: rgba(245, 245, 220, 0.72);
}

.movie-grid {
  display: grid;
  gap: 22px;
}

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

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

.movie-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid var(--line-faint);
  border-radius: 18px;
  background: rgba(15, 26, 15, 0.52);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: var(--chalk-yellow);
  box-shadow: var(--shadow-chalk);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--blackboard-dark);
}

.large-card .card-cover {
  aspect-ratio: 16 / 20;
}

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

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

.card-shadow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 26, 15, 0.88), transparent 56%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .card-shadow {
  opacity: 1;
}

.play-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 250, 205, 0.9);
  color: var(--blackboard);
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.score-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: 900;
}

.score-badge {
  right: 10px;
  top: 10px;
  background: rgba(15, 26, 15, 0.82);
  color: var(--chalk-yellow);
}

.rank-badge {
  left: 10px;
  top: 10px;
  background: var(--chalk-pink);
  color: var(--blackboard);
}

.card-body {
  padding: 14px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: rgba(245, 245, 220, 0.72);
  font-size: 0.82rem;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.card-body h3 a:hover {
  color: var(--chalk-yellow);
}

.card-body p {
  min-height: 3.2em;
  margin: 0 0 12px;
  color: rgba(245, 245, 220, 0.7);
  font-size: 0.9rem;
}

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

.tag-row span {
  padding: 4px 8px;
  color: var(--chalk-blue);
  font-size: 0.78rem;
}

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

.category-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 2px solid var(--line-faint);
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(255, 250, 205, 0.16), transparent 35%),
    linear-gradient(135deg, rgba(45, 74, 45, 0.95), rgba(15, 26, 15, 0.92));
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--chalk-yellow);
}

.category-card strong {
  color: var(--chalk-yellow);
  font-family: "Patrick Hand", cursive, system-ui;
  font-size: 1.65rem;
}

.category-card span {
  color: rgba(245, 245, 220, 0.76);
  font-size: 0.92rem;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line-faint);
  padding: 12px 0;
}

.ranking-row span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chalk-yellow);
  color: var(--blackboard);
  font-weight: 900;
}

.ranking-row strong:hover,
.text-link:hover,
.more-link:hover {
  color: var(--chalk-yellow);
}

.ranking-row em {
  color: var(--vintage-gold);
  font-style: normal;
  font-weight: 900;
}

.more-link,
.text-link {
  width: fit-content;
  margin-top: 20px;
  padding-left: 0;
  color: var(--chalk-yellow);
  background: transparent;
}

.page-main,
.detail-main {
  padding: 34px 0 70px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: rgba(245, 245, 220, 0.66);
  font-size: 0.92rem;
}

.breadcrumb a:hover {
  color: var(--chalk-yellow);
}

.page-hero {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line-soft);
  border-radius: 26px;
  padding: clamp(28px, 6vw, 58px);
  background:
    radial-gradient(circle at 8% 16%, rgba(255, 182, 193, 0.18), transparent 30%),
    radial-gradient(circle at 92% 14%, rgba(173, 216, 230, 0.18), transparent 34%),
    linear-gradient(135deg, var(--blackboard-light), var(--blackboard-dark));
  box-shadow: var(--shadow-deep);
}

.page-hero span {
  color: var(--chalk-yellow);
  font-weight: 900;
}

.page-hero h1 {
  margin-top: 8px;
  color: var(--chalk-white);
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.page-hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(245, 245, 220, 0.78);
}

.category-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 18px;
  align-items: center;
  border: 2px solid var(--line-faint);
  border-radius: 22px;
  padding: 18px;
  background: rgba(15, 26, 15, 0.48);
}

.category-thumb-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.category-thumb-stack img {
  aspect-ratio: 2 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.category-overview-card h2 {
  margin: 0 0 8px;
  color: var(--chalk-yellow);
}

.category-overview-card p {
  margin: 0;
  color: rgba(245, 245, 220, 0.74);
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  margin: 26px 0;
  border: 2px solid var(--line-faint);
  border-radius: 20px;
  padding: 16px;
  background: rgba(15, 26, 15, 0.48);
}

.filter-panel label {
  display: grid;
  gap: 8px;
}

.filter-panel span {
  color: var(--chalk-yellow);
  font-size: 0.88rem;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  padding: 11px 12px;
}

.empty-state {
  display: none;
  margin-top: 24px;
  border: 2px dashed var(--line-soft);
  border-radius: 20px;
  padding: 42px;
  text-align: center;
  color: rgba(245, 245, 220, 0.72);
}

.empty-state.show {
  display: block;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 34px;
}

.detail-poster {
  overflow: hidden;
  border: 2px solid var(--line-soft);
  border-radius: 24px;
  background: var(--blackboard-dark);
  box-shadow: var(--shadow-deep);
}

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

.detail-info {
  border: 2px solid var(--line-soft);
  border-radius: 24px;
  padding: clamp(24px, 5vw, 46px);
  background:
    radial-gradient(circle at top right, rgba(255, 250, 205, 0.13), transparent 34%),
    linear-gradient(135deg, var(--blackboard-light), var(--blackboard-dark));
  box-shadow: var(--shadow-deep);
}

.detail-info h1 {
  color: var(--chalk-white);
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1;
}

.detail-one-line {
  max-width: 780px;
  margin: 18px 0 0;
  color: rgba(245, 245, 220, 0.86);
  font-size: 1.1rem;
}

.detail-tags {
  margin-bottom: 24px;
}

.player-section {
  padding: clamp(18px, 4vw, 34px);
  margin-bottom: 32px;
}

.player-section h2,
.story-panel h2,
.related-panel h2 {
  margin: 0 0 18px;
  color: var(--chalk-yellow);
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: radial-gradient(circle, rgba(15, 26, 15, 0.25), rgba(0, 0, 0, 0.56));
  color: var(--blackboard);
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-overlay span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(255, 250, 205, 0.94);
  font-size: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
}

.story-panel,
.related-panel {
  padding: clamp(20px, 4vw, 30px);
}

.story-panel p {
  margin: 0 0 24px;
  color: rgba(245, 245, 220, 0.83);
  font-size: 1.02rem;
}

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

.related-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: start;
}

.related-item img {
  grid-row: span 2;
  aspect-ratio: 2 / 3;
  width: 82px;
  object-fit: cover;
  border: 2px solid var(--line-faint);
  border-radius: 12px;
}

.related-item span {
  color: var(--chalk-white);
  font-weight: 800;
}

.related-item:hover span {
  color: var(--chalk-yellow);
}

.related-item em {
  color: rgba(245, 245, 220, 0.64);
  font-style: normal;
  font-size: 0.88rem;
}

.site-footer {
  border-top: 2px solid var(--line-soft);
  background: var(--blackboard-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 46px 0;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: var(--chalk-yellow);
}

.site-footer p,
.site-footer a,
.footer-bottom {
  color: rgba(245, 245, 220, 0.72);
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a:hover {
  color: var(--chalk-yellow);
}

.footer-bottom {
  border-top: 1px solid var(--line-faint);
  padding: 18px 16px;
  text-align: center;
}

@media (max-width: 1080px) {
  .feature-grid,
  .compact-grid,
  .catalog-grid,
  .ranking-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .menu-toggle {
    display: block;
  }

  .hero-carousel {
    height: 64vh;
    min-height: 500px;
  }

  .feature-grid,
  .compact-grid,
  .catalog-grid,
  .ranking-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-panel,
  .category-overview-grid,
  .detail-hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-poster img {
    min-height: auto;
    aspect-ratio: 2 / 3;
  }
}

@media (max-width: 620px) {
  .site-container {
    width: min(100% - 22px, 1180px);
  }

  .header-inner {
    min-height: 66px;
  }

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

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

  .hero-content {
    padding-bottom: 62px;
  }

  .hero-copy h1 {
    font-size: 3rem;
  }

  .feature-grid,
  .compact-grid,
  .catalog-grid,
  .ranking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .board-section,
  .ranking-strip {
    padding: 20px;
  }

  .section-heading > div {
    grid-template-columns: 1fr;
  }

  .section-heading p {
    grid-column: auto;
  }

  .category-overview-card {
    grid-template-columns: 1fr;
  }

  .category-thumb-stack {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .card-body {
    padding: 12px;
  }

  .card-body p {
    display: none;
  }
}
