:root {
  --bg: #1A130E;
  --surface: #2B1F17;
  --primary: #D9A441;
  --accent: #4FD1C5;
  --text: #F2E9DC;
  --muted: #8A7A6A;
  --radius: 8px;
  --border: 2px solid #0d0906;
  --shadow: 4px 4px 0 #0d0906;
  --font-heading: 'Cinzel', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 19, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
  box-shadow: 0 4px 0 rgba(13, 9, 6, 0.5);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  white-space: nowrap;
  text-shadow: 2px 2px 0 #0d0906;
  flex-shrink: 0;
}

.logo img { height: 34px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--text);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav a:hover {
  color: var(--bg);
  background: var(--primary);
  box-shadow: 2px 2px 0 #0d0906;
  transform: translate(-1px, -1px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.search-box input {
  width: 160px;
  padding: 8px 12px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 209, 197, 0.3);
}
.search-box button {
  padding: 8px 14px;
  background: var(--primary);
  border: var(--border);
  border-radius: var(--radius);
  color: #0d0906;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}
.search-box button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #0d0906; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--primary);
  color: #0d0906;
  font-weight: 700;
  font-size: 14px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #0d0906; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #0d0906; }

/* ===== Hero Carousel ===== */
.hero {
  position: relative;
  margin: 24px auto;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  aspect-ratio: 21 / 9;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26,19,14,0.95) 0%, rgba(26,19,14,0.5) 45%, transparent 75%);
}
.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 32px;
  max-width: 560px;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 10px;
  text-shadow: 2px 2px 0 #0d0906;
}
.hero-info p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Sections ===== */
.sec { margin: 40px auto; }

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--surface);
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--primary);
  letter-spacing: 1px;
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--muted);
  padding: 4px 12px;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
.sec-more:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Movie Grid & Cards ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #0d0906;
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0d0906;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  background: var(--primary);
  color: #0d0906;
  font-weight: 700;
  font-size: 12px;
  border: 2px solid #0d0906;
  border-radius: 4px;
  box-shadow: 2px 2px 0 #0d0906;
}
.card-info { padding: 10px; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Category Collage ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 10px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.cat-item:nth-child(4n+1) { background: linear-gradient(135deg, #2B1F17, #3a2a1e); }
.cat-item:nth-child(4n+2) { background: linear-gradient(135deg, #2B1F17, #1f2b28); }
.cat-item:nth-child(4n+3) { background: linear-gradient(135deg, #2B1F17, #33241a); }
.cat-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #0d0906;
  border-color: var(--accent);
}
.cat-item .name { font-size: 15px; font-weight: 600; color: var(--text); }
.cat-count { font-size: 12px; color: var(--muted); }

/* ===== Ranking ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}
.rank-item:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #0d0906; }
.rank-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: #0d0906;
  background: var(--primary);
  border: 2px solid #0d0906;
  border-radius: 6px;
}
.rank-item:nth-child(1) .rank-num { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.rank-item:nth-child(2) .rank-num { background: #c9c9c9; }
.rank-item:nth-child(3) .rank-num { background: #b98a5a; }
.rank-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-score {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ===== Detail Page ===== */
.detail {
  margin: 32px auto;
}
.detail-head {
  display: flex;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { flex: 1; min-width: 0; }
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 14px;
  line-height: 1.3;
}
.detail-meta p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-meta p strong { color: var(--text); font-weight: 600; }
.detail-score {
  display: inline-block;
  margin: 12px 0;
  padding: 4px 14px;
  background: var(--primary);
  color: #0d0906;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid #0d0906;
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 #0d0906;
}
.detail-body {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--primary);
  margin: 20px 0 12px;
}
.detail-body p { margin-bottom: 12px; }

/* ===== Tags ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag {
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(79, 209, 197, 0.1);
  border: 1px solid var(--accent);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.tag:hover { background: var(--accent); color: #0d0906; }

/* ===== Pagination ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 36px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 #0d0906;
  transition: all 0.15s ease;
}
.pg:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #0d0906; }
.pg.current {
  background: var(--primary);
  color: #0d0906;
  font-weight: 700;
  pointer-events: none;
}
.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
.link-item:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Breadcrumbs ===== */
.crumbs {
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; }

/* ===== Search Highlight ===== */
.hl {
  color: #0d0906;
  background: var(--accent);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 700;
}

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 32px 0;
  background: var(--surface);
  border-top: var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer p { margin-bottom: 6px; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .wrap { padding: 0 14px; }

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .logo { font-size: 18px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 120px; }

  .hero { aspect-ratio: 4 / 5; margin: 16px auto; }
  .hero-info { padding: 20px; max-width: 100%; }
  .hero-info h2 { font-size: 22px; }
  .hero-info p { font-size: 13px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-list { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item { padding: 16px 8px; }

  .rank-list { grid-template-columns: 1fr; }

  .sec { margin: 28px auto; }
  .sec-title { font-size: 18px; }

  .detail-head {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }
  .detail-cover { width: 100%; max-width: 220px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; }
  .detail-body { padding: 16px; font-size: 14px; }

  .footer { margin-top: 40px; padding: 24px 0; }
}