:root {
  --bg: #0d1220;
  --bg2: #151c2f;
  --line: #243050;
  --text: #e9edf7;
  --muted: #8d98b3;
  --sky: #2ec5e6;
  --gold: #ffc72c;
  --live: #3ddc97;
  --radius: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fb; --bg2: #ffffff; --line: #dde3ef; --text: #141a2b; --muted: #5d6882;
    --sky: #0592b3; --gold: #c98f00; --live: #12935b; color-scheme: light;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--sky); }
h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 24px 0 8px; }
h2 { font-size: 21px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); margin: 0 0 20px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; letter-spacing: .3px; }
.sun { width: 18px; height: 18px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
nav a.on, nav a:hover { color: var(--text); background: var(--bg2); }
.search { margin-left: auto; }
.search input, .bigsearch {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font: inherit; width: 220px; }
.bigsearch { width: 100%; font-size: 18px; padding: 12px 16px; margin-bottom: 20px; }
.lang { font-weight: 700; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* блоки */
section { margin: 36px 0; }
.sh { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.more { color: var(--sky); font-size: 14px; white-space: nowrap; }
.hero { padding: 36px 28px; border-radius: 20px; margin-top: 24px;
  background: radial-gradient(circle at 90% 20%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 40%),
              linear-gradient(135deg, color-mix(in srgb, var(--sky) 30%, var(--bg2)), var(--bg2)); }
.hero h1 { margin-top: 0; max-width: 720px; }
.hero p { margin: 0; max-width: 640px; color: var(--muted); }

/* карточки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.card { display: block; }
.poster {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  background:
    radial-gradient(circle at 75% 25%, hsl(calc(var(--h) + 40) 80% 65% / .55), transparent 45%),
    linear-gradient(160deg, hsl(var(--h) 60% 42%), hsl(calc(var(--h) + 30) 55% 16%));
  display: flex; align-items: flex-end; padding: 12px; transition: transform .15s;
}
.card:hover .poster { transform: translateY(-3px); }
.ptitle { color: #fff; font-weight: 800; font-size: 17px; line-height: 1.15;
  text-shadow: 0 2px 10px rgba(0,0,0,.4); display: -webkit-box; -webkit-line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden; }
.poster .kind, .poster .score, .poster .live, .poster .soon {
  position: absolute; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 7px;
  border-radius: 6px; background: rgba(0,0,0,.45); color: #fff; }
.poster .kind { left: 8px; }
.poster .score { right: 8px; color: #ffd75e; }
.poster .live { left: 8px; top: 32px; background: #12935b; }
.poster .soon { left: 8px; top: 32px; background: #b07800; }
.ct { margin-top: 8px; font-weight: 600; font-size: 14px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm { font-size: 12px; color: var(--muted); }

/* календарь */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cal.compact { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.day { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.day.now { border-color: var(--sky); }
.day ul { list-style: none; margin: 0; padding: 0; }
.day li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.day li:first-child { border-top: 0; }
.day time { color: var(--sky); font-weight: 700; font-variant-numeric: tabular-nums; }
.day li a { flex: 1; }
.ep { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tag { background: var(--sky); color: var(--bg); border-radius: 5px; padding: 1px 6px; font-size: 12px; }

/* чипы жанров */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a, .chips span { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; }
.chips b { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chips.big a { font-size: 16px; padding: 8px 16px; }

/* топ */
.toplist { list-style: none; padding: 0; margin: 0; }
.toplist li { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; align-items: baseline;
  padding: 10px 4px; border-bottom: 1px solid var(--line); }
.toplist .n { color: var(--muted); font-weight: 700; grid-row: span 2; }
.toplist a { font-weight: 600; }
.toplist .muted { grid-column: 2; font-size: 13px; }
.toplist .score { grid-column: 3; grid-row: 1; color: var(--gold); font-weight: 700; }

/* страница тайтла */
.anime { display: grid; grid-template-columns: 260px 1fr; gap: 32px; margin-top: 28px; }
.poster.big { aspect-ratio: 3 / 4; }
.poster.big .ptitle { font-size: 26px; }
.anime h1 { margin-top: 0; }
.orig { color: var(--muted); margin: 0 0 16px; }
.lead { font-size: 17px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 20px 0;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* реклама */
.ad { border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 13px;
  height: 100px; display: grid; place-items: center; margin: 28px 0; letter-spacing: .5px; text-transform: uppercase; }

/* подвал */
.foot { border-top: 1px solid var(--line); margin-top: 60px; padding-top: 24px; padding-bottom: 40px;
  color: var(--muted); font-size: 14px; }
.tg { display: inline-block; background: #229ed9; color: #fff; padding: 8px 16px; border-radius: 10px; font-weight: 600; }
.tg:hover { color: #fff; opacity: .9; }

@media (max-width: 860px) {
  .bar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  nav { order: 3; width: 100%; overflow-x: auto; }
  .search { margin-left: auto; }
  .search input { width: 140px; }
  .anime { grid-template-columns: 1fr; }
  .poster.big { max-width: 220px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .hero { padding: 24px 20px; }
}
