:root {
  --bg: #070b17;
  --bg-2: #0d1426;
  --card: #111a30;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f7;
  --muted: #9aa4bb;
  --gold: #f5b83d;
  --gold-2: #ffd77a;
  --gold-grad: linear-gradient(135deg, #ffe39a 0%, #f5b83d 45%, #c9861a 100%);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(245,184,61,.08), transparent 60%), var(--bg);
  color: var(--text);
  font-family: "Montserrat", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: rgba(7, 11, 23, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold-grad); color: #1a1205;
  font-weight: 900; font-size: 13px; letter-spacing: -.5px;
  box-shadow: 0 0 18px rgba(245,184,61,.45);
}
.logo-text { font-weight: 800; font-size: 18px; white-space: nowrap; }
.logo-text b { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: 14px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: #1a1205; background: var(--gold-grad); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; min-width: 0;
}
.search svg { width: 16px; height: 16px; fill: var(--muted); flex-shrink: 0; }
.search input {
  background: none; border: 0; outline: 0; color: var(--text);
  font: inherit; font-size: 14px; width: 200px; min-width: 0;
}
.search:focus-within { border-color: var(--gold); }

/* ---------- Hero ---------- */
.hero { position: relative; }
.hero-img { width: 100%; aspect-ratio: 2033 / 774; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.hero-cta { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); z-index: 2; display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 22px;
  font-weight: 700; font-size: 14px; transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: var(--gold-grad); color: #1a1205; box-shadow: 0 6px 24px rgba(245,184,61,.35); }
.btn-gold:hover { filter: brightness(1.08); box-shadow: 0 8px 32px rgba(245,184,61,.55); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ---------- Chips ---------- */
.chips {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 8px var(--gutter) 0;
  position: relative; z-index: 2;
}
.chip {
  padding: 9px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.chip.active { color: #1a1205; background: var(--gold-grad); border-color: transparent; }

/* ---------- Blocks ---------- */
.block { padding: 28px var(--gutter) 8px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; }
.block-head h2::before {
  content: ""; display: inline-block; width: 4px; height: .9em;
  margin-right: 10px; vertical-align: -2px; border-radius: 2px;
  background: var(--gold-grad);
}
.count { color: var(--muted); font-size: 13px; }

/* ---------- Featured ---------- */
.featured {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center;
  padding: 24px; border-radius: 20px;
  background: linear-gradient(120deg, rgba(245,184,61,.12), rgba(17,26,48,.9) 40%), var(--card);
  border: 1px solid rgba(245,184,61,.25);
}
.featured .poster { border-radius: 12px; }
.featured .kicker { color: var(--gold); font-weight: 800; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.featured h2 { font-size: clamp(24px, 3.4vw, 40px); margin: 8px 0 10px; line-height: 1.1; }
.featured p { color: var(--muted); line-height: 1.6; max-width: 640px; }
.featured .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- Rows ---------- */
.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 180px);
  gap: 14px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.row > * { scroll-snap-align: start; }
.rank { position: relative; padding-left: 34px; }
.rank-num {
  position: absolute; left: -4px; bottom: 44px; z-index: 2;
  font-size: 84px; font-weight: 900; line-height: 1;
  color: var(--bg); -webkit-text-stroke: 2px var(--gold);
  pointer-events: none;
}

/* ---------- Grid & cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.card { cursor: pointer; }
.poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover .poster, .card:focus-visible .poster {
  transform: translateY(-4px);
  border-color: rgba(245,184,61,.6);
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 24px rgba(245,184,61,.2);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster-gen {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px;
}
.poster-gen .pg-icon { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%); font-size: 46px; opacity: .85; filter: drop-shadow(0 4px 12px rgba(0,0,0,.5)); }
.poster-gen .pg-title { font-family: "Playfair Display", serif; font-style: italic; font-size: 19px; line-height: 1.15; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  background: var(--gold-grad); color: #1a1205;
}
.badge.NEW { background: #22c55e; color: #04220f; }
.badge.AI { background: linear-gradient(135deg, #60a5fa, #6366f1); color: #fff; }
.play-hover {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  background: rgba(7,11,23,.45); opacity: 0; transition: opacity .25s;
}
.play-hover span {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-grad); color: #1a1205; font-size: 20px; padding-left: 4px;
}
.card:hover .play-hover { opacity: 1; }
.card-title { margin: 10px 2px 3px; font-size: 14px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin: 0 2px; color: var(--muted); font-size: 12px; display: flex; gap: 8px; }
.star { color: var(--gold); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3,5,12,.82); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: min(860px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid rgba(245,184,61,.25); border-radius: 20px;
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: 16px;
}
.modal-media { aspect-ratio: 16 / 9; background: #000; position: relative; overflow: hidden; }
.modal-media iframe { width: 100%; height: 100%; border: 0; }
.modal-media .backdrop-gen { position: absolute; inset: 0; display: grid; place-items: center; }
.modal-media .backdrop-gen .big-play {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-grad); color: #1a1205; font-size: 28px; padding-left: 6px;
  box-shadow: 0 0 40px rgba(245,184,61,.6); border: 0;
}
.modal-body { padding: 22px 26px 28px; }
.meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.modal-body h2 { margin: 8px 0 10px; font-size: clamp(22px, 3vw, 30px); }
.modal-body > p { color: #c9d0df; line-height: 1.65; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.sub { margin: 26px 0 12px; font-size: 16px; }
.mini-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini-row .card-title { font-size: 12px; }

/* ---------- Footer ---------- */
.footer { margin-top: 48px; padding: 32px var(--gutter); border-top: 1px solid var(--line); background: #050811; }
.footer-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer .tag { font-family: "Playfair Display", serif; font-style: italic; color: var(--gold-2); margin: 0; }
.social { margin-left: auto; display: flex; gap: 10px; }
.social a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.social a:hover { color: var(--gold); border-color: var(--gold); }
.disclosure, .copy { color: var(--muted); font-size: 12px; line-height: 1.6; max-width: 900px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  background: var(--gold-grad); color: #1a1205; font-weight: 700;
  padding: 10px 18px; border-radius: 999px; font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .search input { width: 140px; }
}
@media (max-width: 640px) {
  .nav { gap: 12px; }
  .logo-text { display: none; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .hero-img { aspect-ratio: 16 / 9; object-position: 50% 50%; }
  .hero-cta { display: block; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { flex-shrink: 0; }
  .featured { grid-template-columns: 1fr; padding: 16px; }
  .featured .poster { max-width: 200px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .row { grid-auto-columns: 42%; }
  .mini-row { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 0; place-items: end center; }
  .modal-card { max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-body { padding: 18px 16px 24px; }
  .modal-actions .btn-gold { flex: 1; }
  .rank-num { font-size: 64px; }
}
