/* ============================================================
   MARVEL ВИКИ — дизайн-система
   ============================================================ */
:root {
  --bg: #07070b;
  --bg-2: #0c0c13;
  --surface: #12121b;
  --surface-2: #171724;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f4f7;
  --muted: #a2a2b5;
  --muted-2: #6f6f85;
  --red: #ed1d24;
  --red-hot: #ff3b41;
  --red-deep: #c8102e;
  --hero: #ed1d24;
  --villain: #9b5cff;
  --antihero: #ffb020;
  --grad-red: linear-gradient(135deg, #ff3b41, #c8102e);
  --radius: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 50px -12px rgba(0, 0, 0, .65);
  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

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

::selection { background: var(--red); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(1280px, 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--red); color: #fff; padding: 10px 18px; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; border-radius: 6px; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Шапка ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(7, 7, 11, .78);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transition: background .3s;
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark { width: 40px; height: 40px; filter: drop-shadow(0 4px 14px rgba(237, 29, 36, .45)); }
.brand-name {
  font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: .04em;
  display: inline-flex; gap: 7px; align-items: baseline;
}
.brand-name em { font-style: normal; color: var(--red-hot); }

.main-nav { display: flex; gap: 4px; margin-left: 6px; }
.main-nav a {
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--muted);
  transition: color .2s, background .2s;
}
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.main-nav a.active { color: #fff; background: rgba(237, 29, 36, .16); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search-box { position: relative; }
.search-box .ic {
  position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 17px; height: 17px;
  color: var(--muted-2); pointer-events: none;
}
.search-box input {
  width: 250px; height: 42px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .05); color: var(--text);
  padding: 0 16px 0 40px; font: 500 14px var(--font-body);
  transition: border .2s, background .2s, width .25s;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box input:focus { outline: none; border-color: rgba(237, 29, 36, .65); background: rgba(255, 255, 255, .08); }

.search-results {
  position: absolute; top: calc(100% + 10px); right: 0; width: 380px; max-width: 86vw;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 120;
}
.search-results .sr-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer;
  transition: background .15s;
}
.search-results .sr-item:hover, .search-results .sr-item.sel { background: rgba(237, 29, 36, .12); }
.search-results .sr-item img { width: 38px; height: 52px; object-fit: cover; border-radius: 8px; }
.search-results .sr-item .sr-name { font-weight: 600; font-size: 14px; }
.search-results .sr-item .sr-sub { font-size: 12px; color: var(--muted); }
.search-results .sr-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

.btn-dice {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .05); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: all .2s;
}
.btn-dice:hover { color: #fff; border-color: var(--red); background: rgba(237, 29, 36, .14); transform: rotate(15deg); }

.btn-burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.btn-burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: .25s; }
.btn-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.btn-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Кнопки и общие элементы ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  font: 700 15px var(--font-body); letter-spacing: .01em; color: #fff;
  background: var(--grad-red); box-shadow: 0 10px 30px -8px rgba(237, 29, 36, .55);
  transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px -8px rgba(237, 29, 36, .65); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); box-shadow: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .1); box-shadow: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 12px var(--font-display); letter-spacing: .22em; text-transform: uppercase; color: var(--red-hot);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--grad-red); border-radius: 2px; }

.h2 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3.4vw, 38px);
  line-height: 1.15; letter-spacing: -.01em; margin: 10px 0 0;
}

.section { padding: 72px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-link { color: var(--muted); font-weight: 600; font-size: 14.5px; white-space: nowrap; transition: color .2s; }
.section-link:hover { color: var(--red-hot); }

/* ---------- Герой-блок ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: calc(var(--header-h) + 74px) 0 80px;
  background:
    radial-gradient(ellipse 90% 60% at 80% -10%, rgba(237, 29, 36, .22), transparent 60%),
    radial-gradient(ellipse 60% 50% at 8% 110%, rgba(155, 92, 255, .1), transparent 60%),
    var(--bg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000 30%, transparent 75%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero h1 {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(38px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -.015em; margin: 18px 0 0;
}
.hero h1 .accent {
  background: var(--grad-red); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: clamp(15.5px, 1.4vw, 18px); max-width: 54ch; margin: 22px 0 0; }

.hero-search { position: relative; margin-top: 32px; max-width: 560px; }
.hero-search .ic { position: absolute; left: 20px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted-2); }
.hero-search input {
  width: 100%; height: 60px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .06); color: var(--text);
  padding: 0 150px 0 52px; font: 500 16px var(--font-body);
  transition: border .2s, box-shadow .2s;
}
.hero-search input::placeholder { color: var(--muted-2); }
.hero-search input:focus { outline: none; border-color: rgba(237, 29, 36, .7); box-shadow: 0 0 0 4px rgba(237, 29, 36, .14); }
.hero-search .hs-btn {
  position: absolute; right: 6px; top: 6px; height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px; background: var(--grad-red); color: #fff; cursor: pointer;
  font: 700 15px var(--font-body); transition: filter .2s;
}
.hero-search .hs-btn:hover { filter: brightness(1.12); }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-chips a {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all .2s;
}
.hero-chips a:hover { color: #fff; border-color: var(--red); background: rgba(237, 29, 36, .12); }

.hero-stats { display: flex; gap: 36px; margin-top: 40px; }
.hero-stats b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.hero-stats span { color: var(--muted); font-size: 13.5px; }

.hero-cards { position: relative; height: 480px; }
.hero-card {
  position: absolute; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line-2);
  animation: floaty 7s ease-in-out infinite;
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .hc-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(7, 7, 11, .92));
  font: 700 13px var(--font-body); text-align: center; letter-spacing: .02em;
}
.hero-card.hc-1 { width: 200px; height: 300px; left: 6%; top: 8%; rotate: -5deg; z-index: 1; }
.hero-card.hc-2 { width: 230px; height: 345px; left: 36%; top: 0; rotate: 3deg; z-index: 2; animation-delay: 1.2s; }
.hero-card.hc-3 { width: 200px; height: 300px; left: 68%; top: 14%; rotate: 8deg; z-index: 1; animation-delay: 2.4s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ---------- Карточки персонажей ---------- */
.grid { display: grid; gap: 18px; }
.grid-chars { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }

.char-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1.2), border-color .3s, box-shadow .3s;
  animation: cardIn .45s ease backwards;
}
.char-card:hover { transform: translateY(-6px); border-color: rgba(237, 29, 36, .55); box-shadow: 0 22px 44px -14px rgba(237, 29, 36, .3); }
.char-card .cc-img { aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface-2); }
.char-card .cc-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform .45s cubic-bezier(.2, .7, .3, 1.1);
}
.char-card:hover .cc-img img { transform: scale(1.06); }
.char-card .cc-shade {
  position: absolute; inset: 42% 0 0 0;
  background: linear-gradient(transparent, rgba(7, 7, 11, .94) 78%);
}
.char-card .cc-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; }
.char-card .cc-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.char-card .cc-original { color: var(--muted); font-size: 12px; margin-top: 2px; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.badge-hero { background: rgba(237, 29, 36, .88); color: #fff; }
.badge-villain { background: rgba(122, 63, 233, .88); color: #fff; }
.badge-antihero { background: rgba(255, 176, 32, .9); color: #1c1206; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.img-fallback {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: 100%;
  font: 800 clamp(28px, 4vw, 44px) var(--font-display); letter-spacing: .06em;
  color: rgba(255, 255, 255, .3); text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

/* ---------- Персонаж дня ---------- */
.spotlight {
  display: grid; grid-template-columns: 340px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.spotlight .sp-img { position: relative; min-height: 380px; }
.spotlight .sp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.spotlight .sp-body { padding: 40px 44px; display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.spotlight h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 2.6vw, 34px); margin: 12px 0 0; }
.spotlight .sp-original { color: var(--muted); font-size: 14px; margin-top: 6px; }
.spotlight p { color: #c9c9d8; margin: 18px 0 26px; max-width: 68ch; }
.spotlight .sp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tag {
  padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted);
}

/* ---------- Плитки разделов ---------- */
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat-tile {
  position: relative; padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .3s, border-color .3s, box-shadow .3s; animation: cardIn .45s ease backwards;
}
.cat-tile:hover { transform: translateY(-5px); border-color: var(--cat-color, var(--red)); box-shadow: 0 18px 40px -16px var(--cat-color, var(--red)); }
.cat-tile::after {
  content: ""; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--cat-color, var(--red)); opacity: .13; filter: blur(6px);
}
.cat-tile b { font-family: var(--font-display); font-weight: 700; font-size: 18px; display: block; }
.cat-tile span { color: var(--muted); font-size: 13px; min-height: 40px; }
.cat-tile .ct-count {
  margin-top: auto; padding-top: 18px;
  font-family: var(--font-display); font-weight: 800; font-size: 30px;
  color: var(--cat-color, var(--red)); line-height: 1.15; align-self: flex-start;
}
.cat-tile .ct-count i {
  font-style: normal; font-family: var(--font-body); font-weight: 600;
  font-size: 13px; color: var(--muted); margin-left: 4px; letter-spacing: .01em;
}

/* ---------- Команды ---------- */
.grid-teams { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.team-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .3s, border-color .3s, box-shadow .3s; animation: cardIn .45s ease backwards;
}
.team-card:hover { transform: translateY(-5px); border-color: rgba(237, 29, 36, .5); box-shadow: 0 20px 44px -16px rgba(237, 29, 36, .28); }
.team-card .tc-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.team-card .tc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.team-card:hover .tc-img img { transform: scale(1.05); }
.team-card .tc-body { padding: 16px 18px 18px; }
.team-card .tc-name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; }
.team-card .tc-original { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.team-card .tc-desc { color: #b9b9ca; font-size: 13.5px; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.team-card .tc-count { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(7, 7, 11, .72); backdrop-filter: blur(8px); font-size: 12px; font-weight: 700; }

/* ---------- Вселенные ---------- */
.grid-universes { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.universe-card {
  position: relative; border-radius: var(--radius-lg); padding: 26px; min-height: 210px;
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-2); transition: transform .3s, box-shadow .3s; animation: cardIn .45s ease backwards;
}
.universe-card:hover { transform: translateY(-5px); box-shadow: 0 22px 48px -18px rgba(0, 0, 0, .8); }
.universe-card .uc-bg { position: absolute; inset: 0; background: var(--u-grad); opacity: .85; }
.universe-card .uc-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.4px);
  background-size: 20px 20px; mask-image: linear-gradient(120deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(120deg, #000, transparent 70%);
}
.universe-card > * { position: relative; }
.universe-card .uc-code { font-family: var(--font-display); font-weight: 900; font-size: clamp(19px, 2.2vw, 28px); text-shadow: 0 2px 14px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.universe-card .uc-name { font-weight: 700; font-size: 15px; margin-top: 6px; color: rgba(255, 255, 255, .92); }
.universe-card .uc-tag { color: rgba(255, 255, 255, .75); font-size: 12.5px; margin-top: 3px; }
.universe-card .uc-count { margin-top: auto; padding-top: 22px; font-weight: 700; font-size: 13px; color: rgba(255, 255, 255, .9); }
.universe-card .uc-avatars { display: flex; margin-top: 14px; }
.universe-card .uc-avatars img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top;
  border: 2px solid rgba(7, 7, 11, .9); margin-left: -10px; background: var(--surface);
}
.universe-card .uc-avatars img:first-child { margin-left: 0; }

/* ---------- Страница персонажа ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px; margin: calc(var(--header-h) + 28px) 0 22px;
  color: var(--muted); font-weight: 600; font-size: 14.5px; transition: color .2s;
}
.back-link:hover { color: var(--red-hot); }

.char-page { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 48px; align-items: start; padding-bottom: 40px; }
.char-poster {
  position: sticky; top: calc(var(--header-h) + 24px);
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: var(--shadow); background: var(--surface);
}
.char-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: top; }
.char-poster .cp-origin {
  padding: 14px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line);
  background: var(--surface);
}
.char-title h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.06; margin: 14px 0 0; }
.char-title .ch-original { color: var(--muted); font-size: 16px; margin-top: 8px; }
.char-aliases { color: var(--muted-2); font-size: 13.5px; margin-top: 8px; }
.char-aliases b { color: var(--muted); font-weight: 600; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 28px 0;
}
.meta-cell { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.meta-cell .mc-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.meta-cell .mc-value { font-weight: 600; font-size: 14px; margin-top: 5px; line-height: 1.45; }
.meta-cell .mc-value a { color: var(--red-hot); }
.meta-cell .mc-value a:hover { text-decoration: underline; }

.char-desc { color: #d3d3e0; font-size: 16.5px; max-width: 72ch; }
.powers-wrap h4, .char-section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text); margin: 34px 0 16px;
}
.power-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.powers-wrap .power-chips { margin-top: 16px; }
.power-chips .tag { background: rgba(237, 29, 36, .1); border-color: rgba(237, 29, 36, .3); color: #ffb4b7; }

/* ---------- Страница команды ---------- */
.team-hero {
  position: relative; margin-top: calc(var(--header-h) + 28px);
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2); min-height: 320px;
  display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.team-hero .th-img { position: absolute; inset: 0; }
.team-hero .th-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.team-hero .th-shade { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(7, 7, 11, .94) 20%, rgba(7, 7, 11, .35) 65%, transparent), linear-gradient(transparent 40%, rgba(7, 7, 11, .92)); }
.team-hero .th-body { position: relative; padding: 36px 40px; max-width: 720px; }
.team-hero h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 3.6vw, 44px); margin: 12px 0 0; }
.team-hero .th-original { color: var(--muted); margin-top: 6px; }
.team-hero p { color: #cfcfdd; margin: 16px 0 0; }
.team-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Вселенная (страница) ---------- */
.uni-hero {
  position: relative; margin-top: calc(var(--header-h) + 28px); padding: 44px 40px;
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line-2);
  background: var(--u-grad); box-shadow: var(--shadow);
}
.uni-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.4px);
  background-size: 22px 22px; mask-image: linear-gradient(120deg, #000, transparent 72%);
  -webkit-mask-image: linear-gradient(120deg, #000, transparent 72%);
}
.uni-hero > * { position: relative; }
.uni-hero h1 { font-family: var(--font-display); font-weight: 900; font-size: clamp(28px, 4vw, 46px); margin: 10px 0 0; }
.uni-hero .uh-tag { color: rgba(255, 255, 255, .82); font-weight: 600; margin-top: 6px; }
.uni-hero p { color: rgba(255, 255, 255, .92); max-width: 70ch; margin: 18px 0 0; }

/* ---------- Каталог персонажей ---------- */
.catalog { margin-top: calc(var(--header-h) + 34px); }
.toolbar { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .search-inline { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar .search-inline .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted-2); }
.toolbar .search-inline input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); padding: 0 14px 0 40px; font: 500 14px var(--font-body);
}
.toolbar .search-inline input:focus { outline: none; border-color: rgba(237, 29, 36, .6); }

.chip {
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); font: 600 13.5px var(--font-body); cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
}
.chip:hover { color: var(--text); border-color: var(--line-2); background: rgba(255, 255, 255, .05); }
.chip.active { background: var(--grad-red); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -8px rgba(237, 29, 36, .6); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .9; }

.select {
  height: 44px; padding: 0 38px 0 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a2a2b5' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); font: 600 13.5px var(--font-body); cursor: pointer; appearance: none; -webkit-appearance: none;
}
.select:focus { outline: none; border-color: rgba(237, 29, 36, .6); }
.select option { background: var(--surface-2); }

.result-info { color: var(--muted); font-size: 13.5px; }
.result-info b { color: var(--text); }

.catalog .grid { margin-top: 6px; }
.more-wrap { display: flex; justify-content: center; padding: 34px 0 10px; }

.empty {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.empty .e-icon { font-size: 44px; margin-bottom: 12px; }
.empty b { display: block; font-family: var(--font-display); font-size: 20px; color: var(--text); margin-bottom: 8px; }

/* ---------- Связанные персонажи ---------- */
.related { padding: 26px 0 40px; }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 90px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 36px; padding: 44px 0; }
.footer-brand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 34ch; }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .2s; }
.footer-nav a:hover { color: var(--red-hot); }
.footer-note { color: var(--muted-2); font-size: 13px; }
.footer-note p { margin: 0 0 10px; }
.footer-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-note a:hover { color: var(--red-hot); }

/* ---------- Анимации появления ---------- */
.view { animation: viewIn .38s ease; }
@keyframes viewIn { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Хлебные крошки ---------- */
.crumbs {
  margin: calc(var(--header-h) + 22px) 0 0;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--muted-2);
}
.crumbs a { color: var(--muted); transition: color .2s; }
.crumbs a:hover { color: var(--red-hot); }
.crumbs .ic { width: 13px; height: 13px; opacity: .5; }
.crumbs span { color: var(--text); }

/* ---------- Спойлер ---------- */
.spoiler { position: relative; }
.spoiler .spoiler-body { position: relative; max-height: 132px; overflow: hidden; transition: max-height .5s ease; }
.spoiler .spoiler-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 84px; pointer-events: none;
  background: linear-gradient(transparent, var(--bg) 88%);
  opacity: 1; transition: opacity .3s;
}
.spoiler.open .spoiler-body { max-height: 4000px; }
.spoiler.open .spoiler-fade { opacity: 0; }
.spoiler-toggle {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: rgba(237, 29, 36, .1); border: 1px solid rgba(237, 29, 36, .35);
  color: #ffb4b7; font: 700 13.5px var(--font-body); letter-spacing: .02em;
  transition: background .2s, color .2s;
}
.spoiler-toggle:hover { background: rgba(237, 29, 36, .2); color: #fff; }
.spoiler-toggle .ic { width: 15px; height: 15px; transition: transform .35s; }
.spoiler.open .spoiler-toggle .ic { transform: rotate(180deg); }

/* ---------- Чтение: типографика длинных текстов ---------- */
.char-desc.reading { font-size: 17px; line-height: 1.75; color: #d8d8e4; }
.char-desc.reading p { margin: 0 0 16px; }
.char-desc.reading p:last-child { margin-bottom: 0; }

/* ---------- Поделиться ---------- */
.cp-actions { display: flex; gap: 8px; padding: 12px 14px 4px; background: var(--surface); }
.btn-share {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2);
  color: var(--muted); font: 600 12.5px var(--font-body);
  transition: all .2s;
}
.btn-share:hover { color: #fff; border-color: var(--red); background: rgba(237, 29, 36, .12); }
.btn-share .ic { width: 14px; height: 14px; }
.char-poster .cp-origin { border-top: 0; padding-top: 8px; }
.share-line { margin-top: 30px; }
.btn-sm { height: 42px; padding: 0 20px; font-size: 13.5px; }

.tag-btn { cursor: pointer; transition: all .2s; }
.tag-btn:hover { color: #fff; border-color: var(--red); background: rgba(237, 29, 36, .12); }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font: 600 14px var(--font-body);
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; z-index: 300;
  transition: opacity .3s, transform .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Наверх ---------- */
.to-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--muted);
  display: grid; place-items: center; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s, transform .3s, color .2s, border-color .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--red-hot); border-color: var(--red); }

/* ---------- Реальности мультивселенной ---------- */
.reality-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.reality-card {
  position: relative; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .25s, border-color .25s, box-shadow .25s; animation: cardIn .45s ease backwards;
}
.reality-card:hover { transform: translateY(-4px); border-color: rgba(237, 29, 36, .5); box-shadow: 0 16px 36px -16px rgba(237, 29, 36, .25); }
.reality-card .rc-code { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--red-hot); }
.reality-card .rc-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.reality-card .rc-short { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.reality-card .rc-count { margin-top: auto; padding-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }

.reality-hero { background: linear-gradient(135deg, #1a0b10 0%, #3d1020 55%, #101018 100%); }

/* ---------- Полные биографии ---------- */
.char-desc.bio p { margin: 0 0 14px; }
.char-desc.bio p:last-child { margin-bottom: 0; }
.cp-origin a { color: var(--red-hot); }
.cp-origin a:hover { text-decoration: underline; }

/* ---------- Команда без обложки ---------- */
.team-hero.no-img { background: linear-gradient(135deg, #1c0d12 0%, #42101e 50%, #101018 100%); min-height: 260px; align-items: center; }
.team-hero.no-img .th-body { max-width: 860px; }
.team-card .tc-img .img-fallback { aspect-ratio: 16 / 10; font-size: 34px; }

@media (max-width: 720px) {
  .reality-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reality-card { padding: 14px 16px; }
  .reality-card .rc-short { display: none; }
}

/* ---------- Мобильная версия ---------- */
@media (max-width: 1060px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cards { display: none; }
  .char-page { grid-template-columns: 1fr; }
  .char-poster { position: relative; top: 0; max-width: 420px; }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 99;
    flex-direction: column; padding: 14px 18px 20px; gap: 6px;
    background: rgba(7, 7, 11, .97); border-bottom: 1px solid var(--line);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
  }
  .main-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 13px 16px; font-size: 16px; }
  .btn-burger { display: block; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; min-width: 120px; }
  .header-tools { flex: 1; }
  .search-results { left: 0; right: auto; width: min(400px, 92vw); }
  .header-inner { gap: 14px; }
}

@media (max-width: 720px) {
  .wrap { width: min(1280px, 100% - 32px); }
  .hero { padding: calc(var(--header-h) + 44px) 0 56px; }
  .hero h1 { font-size: clamp(30px, 9.4vw, 44px); }
  .hero-search input { padding-right: 20px; height: 58px; }
  .hero-search .hs-btn { position: static; width: 100%; margin-top: 10px; height: 48px; }
  .hero-search { display: flex; flex-direction: column; }
  .hero-search .ic { top: 29px; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .hero-stats b { font-size: 21px; }
  .spotlight { grid-template-columns: 1fr; }
  .spotlight .sp-img { min-height: 400px; }
  .spotlight .sp-body { padding: 26px 22px 32px; }
  .section { padding: 52px 0 6px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; padding: 34px 0; }
  .team-hero .th-body { padding: 24px 22px; }
  .uni-hero { padding: 30px 22px; }
  .grid-chars { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid-teams, .grid-universes, .grid-cats { grid-template-columns: 1fr 1fr; }
  .char-card .cc-name { font-size: 13.5px; }
  .cat-tile { padding: 18px; }
  .cat-tile .ct-count { font-size: 24px; }
  .toolbar .search-inline { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
