:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel-2: #1b2130;
  --line: #262d3d;
  --text: #e8ebf2;
  --muted: #9aa3b5;
  --accent: #f5c518;
  --accent-ink: #14110a;
  --radius: 12px;
  --wrap: 1200px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(11, 13, 18, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.logo { font-weight: 900; font-size: 24px; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); background: var(--panel-2); }
.search { margin-left: auto; display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.search input { background: transparent; border: 0; color: var(--text); padding: 9px 14px; width: 220px; font-size: 15px; outline: none; }
.search button { background: transparent; border: 0; color: var(--muted); padding: 0 14px; font-size: 18px; cursor: pointer; }
.menu-toggle { display: none; margin-left: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font-size: 20px; padding: 4px 12px; cursor: pointer; }

/* hero */
.hero { position: relative; min-height: 440px; display: flex; align-items: flex-end; }
.hero::before, .detail-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--backdrop, none); background-size: cover; background-position: center top; opacity: .45; }
.hero::after, .detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 8%, rgba(11, 13, 18, .55) 55%, rgba(11, 13, 18, .25)); }
.hero-inner { position: relative; z-index: 1; padding-top: 80px; padding-bottom: 40px; max-width: 760px; margin-left: max(16px, calc((100% - var(--wrap)) / 2 + 16px)); }
.hero h1 { font-size: clamp(30px, 5vw, 52px); }
.hero h1 span, .detail-main h1 span { color: var(--muted); font-weight: 500; }
.hero-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); flex-wrap: wrap; }
.hero-text { color: #cfd5e1; font-size: 17px; }
.eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: 12px 22px; border-radius: 10px; border: 1px solid var(--accent); }
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* chips */
.chips-block { padding-top: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chip { flex: none; padding: 7px 14px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; font-size: 14px; font-weight: 600; }
.chip.more { color: var(--accent); }

/* blocks & grid */
.block { padding-top: 28px; padding-bottom: 8px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head h2 { font-size: 22px; }
.block-head a { color: var(--accent); font-weight: 600; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.card { display: block; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-3px); border-color: #3a4459; color: var(--text); }
.poster { position: relative; aspect-ratio: 2 / 3; background: var(--panel-2); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.badge-rating { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, .78); color: var(--accent); font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 6px; }
.card-body { padding: 10px 12px 12px; }
.card-body h3 { font-size: 15px; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); }

/* listing head */
.page-head { padding-top: 32px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); }
.page-head p { color: var(--muted); margin: 0; }
.count { color: var(--muted); font-size: 14px; margin-left: 6px; }
.sorts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sorts a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); }
.sorts a[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 32px 0 12px; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; }
.pager .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pager .gap { border: 0; background: none; color: var(--muted); }

/* stars */
.stars { position: relative; display: inline-block; width: 90px; height: 16px; background: linear-gradient(90deg, #3a4153 0 0); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 16'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M8 0l2.4 5 5.6.6-4.2 3.8 1.2 5.6L8 12.2 3 15l1.2-5.6L0 5.6 5.6 5z'/%3E%3Cuse href='%23s' x='18'/%3E%3Cuse href='%23s' x='36'/%3E%3Cuse href='%23s' x='54'/%3E%3Cuse href='%23s' x='72'/%3E%3C/g%3E%3C/svg%3E") no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 16'%3E%3Cg fill='%23000'%3E%3Cpath id='s' d='M8 0l2.4 5 5.6.6-4.2 3.8 1.2 5.6L8 12.2 3 15l1.2-5.6L0 5.6 5.6 5z'/%3E%3Cuse href='%23s' x='18'/%3E%3Cuse href='%23s' x='36'/%3E%3Cuse href='%23s' x='54'/%3E%3Cuse href='%23s' x='72'/%3E%3C/g%3E%3C/svg%3E") no-repeat; }
.stars span { position: absolute; inset: 0 auto 0 0; background: var(--accent); }

/* detail */
.detail-hero { position: relative; padding: 36px 0 32px; }
.detail-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: end; }
.detail-poster img { border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); border: 1px solid var(--line); width: 100%; height: auto; }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.detail-main h1 { font-size: clamp(28px, 4.5vw, 48px); }
.tagline { font-style: italic; color: #cfd5e1; margin: 0 0 14px; }
.score-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.score { display: flex; align-items: baseline; background: var(--accent); color: var(--accent-ink); padding: 4px 12px; border-radius: 10px; }
.score strong { font-size: 26px; }
.score span { font-weight: 700; margin-left: 2px; }
.votes { color: var(--muted); font-size: 14px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.pills span { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding-top: 24px; align-items: start; }
.detail-col { display: grid; gap: 20px; }
.detail-side { position: sticky; top: 84px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { font-size: 21px; }
.panel h3 { font-size: 16px; color: var(--accent); margin-top: 18px; }
.panel p { margin: 0 0 10px; color: #d3d8e3; }
.lead { font-size: 18px; color: var(--text) !important; }
.verdict { border-left: 4px solid var(--muted); }
.verdict h2 { font-size: 26px; }
.tone-great { border-left-color: #22c55e; } .tone-great h2 { color: #4ade80; }
.tone-good { border-left-color: #84cc16; } .tone-good h2 { color: #a3e635; }
.tone-ok { border-left-color: var(--accent); } .tone-ok h2 { color: var(--accent); }
.tone-meh { border-left-color: #f97316; } .tone-meh h2 { color: #fb923c; }
.tone-bad { border-left-color: #ef4444; } .tone-bad h2 { color: #f87171; }
.fine { font-size: 13px; color: var(--muted) !important; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 600; }
.ext { margin: 12px 0 0 !important; }
.ext a { color: var(--accent); font-weight: 600; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.yt .play { position: absolute; inset: 0; margin: auto; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 28px; display: grid; place-items: center; }
.yt iframe { width: 100%; height: 100%; border: 0; }
.cast { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.person img, .person .noimg { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; background: var(--panel-2); }
.person .noimg { display: grid; place-items: center; font-size: 28px; color: var(--muted); }
.person strong { display: block; font-size: 14px; margin-top: 6px; }
.person span { display: block; font-size: 13px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--muted); }
.genre-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.genre-grid a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.genre-grid strong { display: block; font-size: 18px; }
.genre-grid span { color: var(--muted); font-size: 14px; }
.prose { margin-top: 16px; max-width: 820px; }

/* footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: #090b10; padding: 32px 0 20px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; }
.tmdb-note { margin-top: 20px; font-size: 13px; }
.tmdb-note a { color: var(--accent); }
.copy { margin-top: 8px; font-size: 13px; }

/* responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .detail-body { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { position: static; }
  .genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; order: 3; }
  .site-nav.open { display: flex; }
  .search { order: 4; width: 100%; margin: 0 0 12px; }
  .search input { width: 100%; }
  .hero { min-height: 360px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .detail-inner { grid-template-columns: 130px 1fr; gap: 16px; align-items: start; }
  .detail-main h1 { font-size: 26px; }
  .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel { padding: 16px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-inner { grid-template-columns: 1fr; }
  .detail-poster { max-width: 180px; }
  .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .btn { flex: 1; text-align: center; }
}

/* engagement */
.up-next-card { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; background: linear-gradient(135deg, #1d2333, #141821); border: 1px solid #3a4459; border-radius: var(--radius); padding: 18px; }
.up-next-card:hover { border-color: var(--accent); color: var(--text); }
.up-next-card img { border-radius: 10px; width: 120px; height: auto; }
.up-next-card h2 { font-size: 22px; }
.up-next-card h2 span { color: var(--muted); font-weight: 500; }
.up-next-card p:not(.eyebrow) { color: #cfd5e1; margin: 0 0 12px; }
.explore { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.explore a { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.explore a:hover { border-color: var(--accent); }
.side-list { margin-top: 20px; }
.side-list a { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.side-list a:first-of-type { border-top: 0; }
.side-list img { width: 48px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; }
.side-list strong { display: block; font-size: 14px; line-height: 1.3; }
.side-list em { font-style: normal; color: var(--muted); font-size: 13px; }
a.person:hover strong { color: var(--accent); }
.facts dd a { color: var(--accent); }
.next-bar { display: none; }
.ad-slot { margin: 24px 0; text-align: center; min-height: 100px; }
.ad-slot > span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #5d667a; margin-bottom: 4px; }
.detail-col .ad-slot, .detail-side .ad-slot { margin: 0; }
.detail-side .ad-slot { margin-top: 20px; }
@media (max-width: 900px) {
  .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .next-bar { display: flex; align-items: center; gap: 6px; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 15px; }
  .next-bar:hover { color: var(--accent-ink); }
  .next-bar strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .next-bar b { font-size: 20px; }
  body:has(.next-bar) .site-footer { padding-bottom: 80px; }
  .up-next-card { grid-template-columns: 84px 1fr; gap: 12px; padding: 14px; }
  .up-next-card img { width: 84px; }
  .up-next-card h2 { font-size: 18px; }
}
