/* ТВ База — единая тёмная тема. Без JS и сборщиков. */
:root {
  --bg: #10151c;
  --surface: #19212c;
  --surface-2: #1f2937;
  --line: #2a3545;
  --text: #dfe6ee;
  --muted: #8b98a9;
  --accent: #f2b134;        /* янтарный — рейтинги, акценты */
  --accent-ink: #1a1405;
  --link: #6fb8ff;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .75rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: .5rem 0 .15rem; }
code { background: var(--surface-2); padding: .15em .4em; border-radius: 5px; font-size: .9em; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.years { color: var(--muted); font-weight: 400; }

/* ---------- шапка ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-row { display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-weight: 800; font-size: 1.15rem; color: var(--accent); letter-spacing: .3px; }
.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    text-decoration: none;
}

.logo svg {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: block;
}
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 14px; }
.nav a { color: var(--text); }
.header-search { display: flex; gap: 0; margin-left: auto; flex: 0 1 340px; min-width: 200px; }
.header-search input {
  flex: 1; min-width: 0; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; padding: 7px 11px;
}
.header-search button {
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  border: 0; border-radius: 0 8px 8px 0; padding: 7px 14px; cursor: pointer;
}

/* ---------- блоки ---------- */
.block { margin: 26px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head .more { white-space: nowrap; }
.notice {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 12px 16px;
}
.breadcrumbs { font-size: .85rem; color: var(--muted); margin: 14px 0; }

/* ---------- сетки карточек ---------- */
.grid, .people-grid {
  display: grid; gap: 18px 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card-poster, .person-photo {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); aspect-ratio: 210 / 295;
}
.card-poster img, .person-photo img { width: 100%; height: 100%; object-fit: cover; }
.noposter {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 2.4rem; font-weight: 800; color: var(--muted);
}
.noposter.big { aspect-ratio: 210/295; border-radius: var(--radius); background: var(--surface-2); }
.badge-rating, .badge-time {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: var(--accent-ink);
  font-size: .78rem; font-weight: 800; padding: 2px 7px; border-radius: 6px;
}
.badge-time { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.card-title { font-size: .95rem; }
.card-title a { color: var(--text); }
.card-sub, .card-genres { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }

/* ---------- фильтры ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.filters input, .filters select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; min-width: 0;
}
.filters input[type="search"] { flex: 1 1 180px; }
.filters input[type="number"] { width: 96px; }
.filters select { flex: 0 1 auto; max-width: 200px; }
.filters button {
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
  border: 0; border-radius: 8px; padding: 7px 16px; cursor: pointer;
}
.filters .reset { align-self: center; padding: 0 6px; }
.filters .check { display: flex; align-items: center; gap: 6px; color: var(--muted); }

/* ---------- пагинация ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.pagination a, .pagination .current, .pagination .gap {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
}
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.pagination .gap { border: 0; color: var(--muted); }

/* ---------- страница сериала / персоны ---------- */
.show-head { display: flex; gap: 24px; align-items: flex-start; }
.show-poster { flex: 0 0 210px; }
.show-poster img { border-radius: var(--radius); }
.show-info { flex: 1; min-width: 0; }
.rating-line { color: var(--accent); font-weight: 800; font-size: 1.1rem; margin: 0 0 10px; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 14px; }
.props dt { color: var(--muted); }
.props dd { margin: 0; }
.summary { max-width: 760px; }
.summary p { margin: 0 0 .8em; }
.anchors { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; font-size: .9rem; }
.anchors a {
  background: var(--surface); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; color: var(--text);
}

/* сезоны / таблица эпизодов */
.season {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin: 0 0 10px; overflow: hidden;
}
.season summary { cursor: pointer; padding: 11px 16px; font-weight: 700; }
.season[open] summary { border-bottom: 1px solid var(--line); }
.ep-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ep-table th, .ep-table td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); }
.ep-table thead th { color: var(--muted); font-weight: 600; border-top: 0; }
.ep-table tr:hover td { background: var(--surface-2); }
.schedule-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* списки crew / aka, галерея */
.crew-list, .aka-list { columns: 2; column-gap: 32px; padding-left: 18px; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.gallery img { border-radius: 8px; width: 100%; height: 120px; object-fit: cover; }

/* эпизод */
.ep-layout { display: flex; gap: 24px; align-items: flex-start; margin: 14px 0; flex-wrap: wrap; }
.ep-still { flex: 0 1 420px; border-radius: var(--radius); }
.ep-nav { display: flex; justify-content: space-between; gap: 14px; margin: 20px 0; flex-wrap: wrap; }
.ep-nav .next { margin-left: auto; }

/* ---------- подвал ---------- */
.site-footer {
  margin-top: 40px; border-top: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: .85rem;
}
.site-footer .wrap { padding-top: 18px; padding-bottom: 18px; }

/* ---------- адаптив ---------- */
@media (max-width: 720px) {
  .show-head { flex-direction: column; }
  .show-poster { flex-basis: auto; width: 180px; }
  .crew-list, .aka-list { columns: 1; }
  .header-search { flex-basis: 100%; order: 3; }
  .props { grid-template-columns: 1fr; gap: 0; }
  .props dt { margin-top: 6px; }
  .ep-table th:nth-child(5), .ep-table td:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .card-poster img, .person-photo img { transition: transform .25s ease; }
  .card-poster:hover img, .person-photo:hover img { transform: scale(1.04); }
}

.orig-name { margin: -4px 0 10px; font-size: .95rem; }
