/* ===========================================================================
   ФРАКЦИИ (/wiki/factions, factions.js)
   Сетка по подчинению и карточка фракции. Мягкие панели с градиентной гранью,
   цвет фракции (--fc) - в отсвете шапки, значках разделов и гранях.
   Всё, что пришло из Discord (приглашение, профиль лидера), - в палитре
   самого Discord: так видно, что это живые данные оттуда.
   =========================================================================== */
.fac-root { margin-top: 30px; overflow-x: clip; }
/* подложка футера: абсолютная, width:100% после рейла давала прокрутку вбок - прижимаем к краям */
.wiki-body .footer_bg { left: 0; right: 0; width: auto; }

/* фон страницы: тоннель, сверху светлее, к низу и по краям уходит в темноту
   (у картинки слева светлая стена - на широких экранах она выпирала) */
.wiki-body .wiki-bg {
    background:
        linear-gradient(90deg, rgba(8, 9, 10, .5) 0%, rgba(8, 9, 10, 0) 30%, rgba(8, 9, 10, 0) 70%, rgba(8, 9, 10, .5) 100%),
        radial-gradient(110% 80% at 50% 0%, rgba(8, 9, 10, .28), rgba(8, 9, 10, .8) 72%),
        linear-gradient(180deg, rgba(8, 9, 10, .4) 0%, rgba(8, 9, 10, .66) 42%, rgba(8, 9, 10, .94) 100%),
        url(../img/factions/bg-tunnel.webp) 50% 38% / cover no-repeat;
    filter: saturate(.92) contrast(1.04);
}
/* дым позади всего - холст, рисует public/js/smoke.js (клубы-частицы,
   поле течения, реакция на курсор, маска у футера). Без JS холст пуст. */
.fac-smoke { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }

/* общая панель */
.fac-tile, .fac-block, .fac-fold, .fac-pn__a {
    border: 1px solid transparent;
    background: linear-gradient(180deg, #17181a, #0f1011) padding-box,
                linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)) border-box;
}

/* ---- группы и сетка ------------------------------------------------------ */
.fac-group { animation: facIn .5s cubic-bezier(.2,.8,.2,1) both; }
.fac-group:nth-child(2) { animation-delay: .06s; }
.fac-group:nth-child(3) { animation-delay: .12s; }
.fac-group + .fac-group { margin-top: 38px; }
.fac-group__h {
    display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
    font: 600 12px/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #a3a3a3;
}
.fac-group__h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,0)); }
.fac-group__n {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px;
    background: rgba(255,255,255,.07); color: #d6d6d6; letter-spacing: 0;
}
.fac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.fac-tile {
    --fc: #9a9a9a;
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: center; gap: 14px; padding: 15px 16px 15px 14px; border-radius: 14px;
    text-decoration: none; color: inherit;
    transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease;
}
.fac-tile::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(180px 130px at 0% 50%, color-mix(in srgb, var(--fc) 24%, transparent), transparent 72%);
    opacity: .5; transition: opacity .35s ease;
}
/* грань цвета фракции проявляется при наведении */
.fac-tile::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 75%, transparent), transparent 55%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .35s ease;
}
.fac-tile:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -22px rgba(0,0,0,.95); }
.fac-tile:hover::before, .fac-tile:hover::after { opacity: 1; }
.fac-tile__logo { width: 56px; height: 56px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5));
    transition: transform .4s cubic-bezier(.34,1.4,.64,1); }
.fac-tile:hover .fac-tile__logo { transform: scale(1.06); }
.fac-tile__logo.is-none, .fac-hero__logo.is-none, .fac-pn__logo.is-none, .fdc__wm-img.is-none, .fdc__icon-img.is-none {
    display: grid; place-items: center; border-radius: 50%;
    background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
    font: 700 20px/1 "Montserrat", sans-serif; color: #cfcfcf; filter: none;
}
.fac-tile__txt { min-width: 0; }
.fac-tile__name { display: block; font: 700 15px/1.25 "Montserrat", sans-serif; color: #f2f2f2; }
.fac-tile__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 0; font: 500 12.5px/1.3 "Inter", system-ui, sans-serif; color: #9a9a9a; }
.fac-tile__on { display: none; align-items: center; gap: 6px; color: #b9c2bd; }
.fac-tile__on.is-live { display: inline-flex; animation: facFade .4s ease both; }
.fac-tile__meta:has(.is-live) { margin-top: 6px; }
.fac-tile__on i { width: 7px; height: 7px; border-radius: 50%; background: #23a55a; box-shadow: 0 0 0 3px rgba(35,165,90,.15); }
.fac-tile__arrow { margin-left: auto; flex: 0 0 auto; color: #6d6d6d; transition: transform .3s ease, color .3s ease; }
.fac-tile__arrow svg { width: 18px; height: 18px; display: block; }
.fac-tile:hover .fac-tile__arrow { transform: translateX(3px); color: #fff; }

/* ---- карточка: верх ------------------------------------------------------ */
.fac-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fac-back {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 13px; border-radius: 10px;
    font: 500 14px/1 "Inter", system-ui, sans-serif; color: #d6d6d6; text-decoration: none;
    background: rgba(12,13,14,.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); transition: color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.fac-back span { transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.fac-back:hover { color: #fff; background-color: rgba(30,31,34,.7); box-shadow: inset 0 0 0 1px rgba(255,255,255,.32); }
.fac-back:hover span { transform: translateX(-3px); }
.fac-top__pos { font: 600 12px/1 "Inter", system-ui, sans-serif; letter-spacing: .12em; color: #8a8a8a; }
.fac-card { --fc: #9a9a9a; display: grid; gap: 18px; margin-top: 16px; }

/* ---- шапка --------------------------------------------------------------- */
.fac-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: block;
    padding: 30px 36px 32px; border-radius: 20px;
    border: 1px solid transparent;
    /* слева - ровный тихий отсвет цвета фракции, без пятна */
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--fc) 13%, transparent), color-mix(in srgb, var(--fc) 4%, transparent) 30%, transparent 48%) padding-box,
        linear-gradient(180deg, #18191b, #0e0f10) padding-box,
        linear-gradient(160deg, color-mix(in srgb, var(--fc) 55%, rgba(255,255,255,.14)), rgba(255,255,255,.04) 45%, color-mix(in srgb, var(--fc) 22%, transparent)) border-box;
    box-shadow: 0 30px 60px -40px rgba(0,0,0,.9);
}
.fac-hero::after {
    content: ""; position: absolute; left: 36px; right: 36px; bottom: 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fc) 70%, transparent), transparent);
}
.fac-hero__wm {
    position: absolute; z-index: -1; right: -70px; top: 50%; width: 380px; height: 380px; pointer-events: none;
    transform: translateY(-50%) rotate(-8deg); opacity: .07;
}
.fac-hero__wm img { width: 100%; height: 100%; object-fit: contain; }

/* арт фракции за шапкой: справа, неподвижен, растворяется к тексту;
   при открытии карточки только мягко проявляется */
.fac-hero--art { min-height: 300px; }
.fac-hero__art {
    position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 72%;
    overflow: hidden; pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 26%, rgba(0,0,0,.7) 52%, #000 70%);
            mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.16) 26%, rgba(0,0,0,.7) 52%, #000 70%);
    animation: facFade .8s ease both;
}
.fac-hero__art::before {
    content: ""; position: absolute; inset: 0;
    background: var(--art) var(--pos, center) / cover no-repeat;
}
.fac-hero__art::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(14,15,16,.4), transparent 24%, transparent 68%, rgba(14,15,16,.75));
}
.fac-hero--art .fac-hero__main { max-width: 540px; }
.fac-hero--art .fac-hero__name { text-shadow: 0 4px 26px rgba(0,0,0,.85); }
.fac-hero--art .fac-hero__cmd { color: #b0b0b0; text-shadow: 0 2px 12px rgba(0,0,0,.9); }
.fac-hero--art .fac-tag { background: rgba(14,15,16,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* герб - небольшой, над названием */
.fac-hero__ring {
    position: relative; display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 16px; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--fc) 22%, transparent), transparent);
}
.fac-hero__ring::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--fc) 36%, rgba(255,255,255,.08));
}
.fac-hero__logo { width: 54px; height: 54px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,.65)); view-transition-name: fac-logo; }
.fac-hero__logo.is-none { font-size: 22px; }
.fac-hero__main { min-width: 0; }
.fac-hero__name { margin: 0; font: 800 44px/1.06 "Montserrat", sans-serif; letter-spacing: -.01em; color: #fff; text-wrap: balance; }
/* одна строка о фракции под названием */
.fac-hero__tag { margin: 10px 0 0; max-width: 62ch; font: 500 15.5px/1.45 "Inter", system-ui, sans-serif; color: #c4c4c4; text-shadow: 0 2px 14px rgba(0,0,0,.9); }
.fac-tag {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 9px;
    background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
    font: 500 13px/1 "Inter", system-ui, sans-serif; color: #d6d6d6; white-space: nowrap;
}
.fac-tag svg { width: 16px; height: 16px; flex: 0 0 auto; color: color-mix(in srgb, var(--fc) 70%, #fff); }
.fac-tag b { font-weight: 700; color: #fff; }
/* подчинение: сталь - под командованием, янтарь - автономна */
.fac-tag--sub { background: rgba(143,168,200,.12); box-shadow: inset 0 0 0 1px rgba(143,168,200,.3); color: #dce6f2; }
.fac-tag--sub svg { color: rgb(143,168,200); }
.fac-tag--free { background: rgba(214,164,90,.12); box-shadow: inset 0 0 0 1px rgba(214,164,90,.3); color: #f2e3cc; }
.fac-tag--free svg { color: rgb(214,164,90); }
/* «в сети» - живая цифра из Discord, зелёная точка без пульсации */
.fac-tag--on i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #23a55a; }
.fac-tag--on b { color: #fff; }
.fac-tag[hidden] { display: none !important; }   /* inline-flex выше перебивал бы атрибут hidden */

/* ---- тело: основная колонка + боковая ------------------------------------- */
.fac-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "main side"; gap: 18px; align-items: start; }
.fac-body--solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
.fac-main { grid-area: main; display: grid; gap: 14px; min-width: 0; }
.fac-side { grid-area: side; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; position: sticky; top: 92px; min-width: 0; }
.fac-side.is-tall { position: static; }
.fac-side__sec { min-width: 0; }
/* заголовок блока - на своей плашке (у каждого блока своя) */
.fac-side__h {
    display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px 8px 10px; border-radius: 9px;
    background: rgba(9,10,11,.78);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), 0 6px 16px -10px rgba(0,0,0,.8);
    font: 700 11.5px/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #b0b0b0;
}
.fac-side__h svg { width: 15px; height: 15px; flex: 0 0 auto; color: color-mix(in srgb, var(--fc) 65%, #fff); }

.fac-block, .fac-fold { border-radius: 16px; }
.fac-block { padding: 20px 24px 22px; }
.fac-block__h, .fac-fold > summary {
    display: flex; align-items: center; gap: 11px;
    font: 700 16px/1.2 "Montserrat", sans-serif; color: #fff;
}
/* заголовок блока - текст и тонкая линия; счётчик (пунктов правил) справа */
.fac-block__h { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.fac-block__n {
    margin-left: auto; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px;
    background: rgba(255,255,255,.06); font: 500 12.5px/1 "Inter", system-ui, sans-serif; color: #bdbdbd;
}
/* лор открыт сразу, но обрезан до первых строк; «Читать дальше» раскрывает на месте */
.fac-lore { transition: max-height .5s cubic-bezier(.2,.8,.2,1); }
.fac-lore.is-clamped {
    max-height: 106px; overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 50%, transparent 100%);
}
.fac-more {
    display: inline-flex; align-items: center; height: 34px; margin-top: 14px; padding: 0 14px;
    border: 0; border-radius: 9px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
    font: 600 13px/1 "Inter", system-ui, sans-serif; color: #e6e6e6; cursor: pointer;
    transition: background-color .25s ease, box-shadow .25s ease;
}
.fac-more:hover { background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 45%, transparent); }
.fac-p { margin: 0; font: 400 15.5px/1.65 "Inter", system-ui, sans-serif; color: #d6d6d6; }
.fac-p + .fac-p { margin-top: 12px; }
.fac-p--lead { font-size: 16px; color: #e2e2e2; }
.fac-src {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding-bottom: 3px;
    font: 500 13px/1 "Inter", system-ui, sans-serif; color: #9a9a9a; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.16); transition: color .25s ease, border-color .25s ease;
}
.fac-src svg { width: 14px; height: 14px; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.fac-src:hover { color: #fff; border-color: rgba(255,255,255,.5); }
.fac-src:hover svg { transform: translate(2px, -2px); }

/* свет цвета фракции идёт по панели за курсором */
.fx-spot { position: relative; }
.fx-spot::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(460px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--fc) 10%, transparent), transparent 62%);
    opacity: 0; transition: opacity .45s ease;
}
.fx-spot.is-hot::before { opacity: 1; }

/* отношения: карточки с логотипом, статус цветом */
.fac-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fac-rel__i {
    --rc: 150, 160, 175;
    position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 11px; border-radius: 12px;
    background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
    text-decoration: none; color: inherit;
    transition: background-color .25s ease, box-shadow .25s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.fac-rel__i--ally { --rc: 76, 175, 110; }
.fac-rel__i--enemy { --rc: 226, 76, 76; }
.fac-rel__i--other { --rc: 200, 170, 110; }
a.fac-rel__i:hover { background: rgba(var(--rc), .07); box-shadow: inset 0 0 0 1px rgba(var(--rc), .5), 0 12px 26px -18px rgba(var(--rc), .6); transform: translateY(-2px); }
.fac-rel__logo { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; transition: transform .4s cubic-bezier(.34,1.4,.64,1); }
a.fac-rel__i:hover .fac-rel__logo { transform: scale(1.08) rotate(-3deg); }
.fac-rel__logo.is-none { display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.05); color: #9a9a9a; }
.fac-rel__logo.is-none svg { width: 19px; height: 19px; }
.fac-rel__txt { min-width: 0; }
.fac-rel__name { display: block; font: 600 14px/1.25 "Inter", system-ui, sans-serif; color: #f0f0f0; }
.fac-rel__st { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; font: 500 12.5px/1.35 "Inter", system-ui, sans-serif; color: rgb(var(--rc)); }
.fac-rel__st::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--rc)); box-shadow: 0 0 8px rgba(var(--rc), .7); transform: translateY(-1px); }
.fac-rel + .fac-rel__note, .fac-rel__note + .fac-rel__note { margin-top: 12px; }
.fac-rel__note { font-size: 15px; color: #c4c4c4; }

/* раскрывающиеся лор и правила (высоту анимирует factions.js) */
.fac-fold { overflow: hidden; }
.fac-fold > summary { position: relative; list-style: none; cursor: pointer; padding: 15px 18px 15px 24px; border-radius: 16px; transition: background-color .25s ease; }
.fac-fold > summary::-webkit-details-marker { display: none; }
.fac-fold > summary:hover { background-color: rgba(255,255,255,.025); }
.fac-fold__n {
    display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px;
    background: rgba(255,255,255,.06); font: 500 12.5px/1 "Inter", system-ui, sans-serif; color: #bdbdbd;
}
.fac-fold__chev {
    margin-left: auto; display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px;
    background: rgba(255,255,255,.04); transition: transform .38s cubic-bezier(.2,.8,.2,1), background-color .25s ease;
}
.fac-fold__chev::before {
    content: ""; width: 8px; height: 8px; border-right: 2px solid #b5b5b5; border-bottom: 2px solid #b5b5b5;
    transform: translateY(-2px) rotate(45deg);
}
.fac-fold > summary:hover .fac-fold__chev { background: rgba(255,255,255,.08); }
.fac-fold[open]:not(.is-closing) .fac-fold__chev { transform: rotate(180deg); }
.fac-fold__body { position: relative; padding: 2px 24px 22px; }

.fac-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: fr; }
.fac-rules li {
    position: relative; padding: 12px 16px 12px 50px; border-radius: 12px; counter-increment: fr;
    background: rgba(255,255,255,.025); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
    font: 400 15px/1.6 "Inter", system-ui, sans-serif; color: #d6d6d6;
    transition: background-color .25s ease, box-shadow .25s ease;
}
.fac-rules li:hover { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 30%, transparent); }
.fac-rules li.is-in { animation: facFade .4s ease both; }
.fac-rules li::before {
    content: counter(fr); position: absolute; left: 13px; top: 12px;
    display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
    background: color-mix(in srgb, var(--fc) 14%, transparent);
    font: 700 12px/1 "Montserrat", sans-serif; color: color-mix(in srgb, var(--fc) 70%, #fff);
}
.fac-rules b { font-weight: 600; color: #fff; }

/* «Положение» (жители/сталкеры): заголовки, подписи, списки */
.fac-doc__h { margin: 22px 0 10px; font: 700 15px/1.3 "Montserrat", sans-serif; color: #fff; }
.fac-fold__body > .fac-doc__h:first-child { margin-top: 4px; }
.fac-doc__lbl {
    margin: 16px 0 8px; font: 600 12px/1 "Inter", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #9a9a9a;
}
.fac-doc__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fac-doc__list li { position: relative; padding-left: 18px; font: 400 15px/1.6 "Inter", system-ui, sans-serif; color: #d6d6d6; }
.fac-doc__list li::before {
    content: ""; position: absolute; left: 3px; top: .72em; width: 5px; height: 5px; border-radius: 50%;
    background: color-mix(in srgb, var(--fc) 70%, #fff);
}

/* ===========================================================================
   КАРТОЧКИ DISCORD: общее
   Как карточка сервера на лендинге: за карточкой два размытых пятна (цвет
   фракции и фирменный синий Discord), сама карточка наклоняется за курсором
   (--rx/--ry), по ней идёт блик (--gx/--gy). Всё ставит factions.js.
   =========================================================================== */
.fx { position: relative; perspective: 900px; --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 0%; }
.fx::before, .fx::after {
    content: ""; position: absolute; z-index: 0; width: 200px; height: 200px; border-radius: 50%;
    filter: blur(44px); pointer-events: none; opacity: .32; transition: opacity .5s ease;
}
.fx::before { top: -46px; left: -56px; background: radial-gradient(circle, color-mix(in srgb, var(--fc) 85%, transparent), transparent 64%); }
.fx::after { bottom: -46px; right: -56px; background: radial-gradient(circle, rgba(88,101,242,.75), transparent 64%); }
.fx.is-hot::before, .fx.is-hot::after { opacity: .8; }
.fx > .fdc, .fx > .fld {
    position: relative; z-index: 1;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform .7s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
    will-change: transform;
}
.fx.is-hot > .fdc, .fx.is-hot > .fld { transition: transform .14s linear, box-shadow .4s ease; }
.fx__glare {
    position: absolute; inset: 0; z-index: 6; border-radius: inherit; pointer-events: none;
    background: radial-gradient(300px circle at var(--gx) var(--gy), rgba(255,255,255,.1), transparent 58%);
    opacity: 0; transition: opacity .45s ease;
}
.fx.is-hot .fx__glare { opacity: 1; }
.is-swap { animation: facFade .45s ease both; }

/* блик по кнопке - один проход при наведении */
.fdc__btn svg, .fld__btn svg { width: 19px; height: 19px; flex: 0 0 auto; }

/* ---- приглашение в Discord фракции --------------------------------------- */
/* панель - как блок «присоединиться» на лендинге: стеклянный градиент, тонкая грань, при наведении грань в цвет Discord */
.fdc {
    display: block; border-radius: 14px; overflow: hidden;
    text-decoration: none; color: inherit;
    background: linear-gradient(135deg, rgba(88,101,242,.14), rgba(24,25,29,.92) 42%, rgba(35,36,40,.96));
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 20px 44px -22px rgba(0,0,0,.85);
    transition: border-color .25s ease, transform .22s ease, box-shadow .25s ease;
}
.fx.is-hot > .fdc { border-color: rgba(88,101,242,.55); transform: translateY(-2px); box-shadow: 0 28px 54px -22px rgba(0,0,0,.95), 0 0 40px -18px rgba(88,101,242,.6); }
.fdc__banner { position: relative; display: block; height: 112px; overflow: hidden; background: #1e1f22; }
.fdc__art {
    position: absolute; inset: 0;
    background: var(--art) var(--pos, center) / cover no-repeat;
    transform: scale(1.02); transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.fx.is-hot .fdc__art { transform: scale(1.08); }
/* нет баннера сервера и арта - тоннель в цвете фракции и её герб */
.fdc__banner.is-tunnel .fdc__art { filter: saturate(.55) brightness(.72); }
.fdc__banner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(35,36,40,.6)); }
.fdc__banner.is-tunnel::after {
    background: linear-gradient(115deg, color-mix(in srgb, var(--fc) 58%, transparent), rgba(20,20,22,.1) 62%),
                linear-gradient(180deg, transparent 45%, rgba(35,36,40,.7));
}
.fdc__wm {
    position: absolute; z-index: 1; right: 12px; top: 50%; width: 92px; height: 92px;
    transform: translateY(-50%) rotate(-8deg); filter: drop-shadow(0 8px 18px rgba(0,0,0,.65));
    transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.fx.is-hot .fdc__wm { transform: translateY(-54%) rotate(-3deg) scale(1.05); }
.fdc__wm-img { width: 100%; height: 100%; object-fit: contain; }
.fdc__row { position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 12px 16px 0; }
.fdc__icon {
    position: relative; z-index: 2; flex: 0 0 auto; display: grid; place-items: center;
    width: 66px; height: 66px; margin-top: -46px; border-radius: 22px; overflow: hidden;
    background: #1e1f22; box-shadow: 0 0 0 6px #232428;
    transition: border-radius .4s ease, transform .6s cubic-bezier(.34,1.4,.64,1);
}
.fx.is-hot .fdc__icon { border-radius: 16px; transform: translateY(-3px); }
.fdc__icon-img { width: 80%; height: 80%; object-fit: contain; }
.fdc__icon-img.is-guild { width: 100%; height: 100%; object-fit: cover; }
.fdc__info { display: block; min-width: 0; padding-bottom: 1px; }
.fdc__label { display: block; margin-bottom: 3px; font: 700 11px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .02em; text-transform: uppercase; color: #949ba4; }
.fdc__name {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 700 16.5px/1.25 "Inter", system-ui, sans-serif; color: #f2f3f5;
}
.fdc__stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.fdc__stat { display: inline-flex; align-items: center; gap: 7px; font: 500 13px/1.3 "Inter", system-ui, sans-serif; color: #949ba4; white-space: nowrap; }
.fdc__stat b { font-weight: 600; color: #dbdee1; font-variant-numeric: tabular-nums; }
.fdc__dot { width: 9px; height: 9px; border-radius: 50%; background: #80848e; flex: 0 0 auto; }
.fdc__dot.is-on { background: #23a55a; animation: facPing 2s ease-in-out infinite; }
.fdc.is-bare .fdc__stats { display: none; }
/* кнопка - как на лендинге: плоская, дисплейный шрифт, свечение усиливается при наведении */
/* кнопки Discord (приглашение, профиль): без заливки, при наведении заливаются и светятся - как на лендинге */
.fdc__btn, .fld__btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; margin: 14px 16px 16px;
    border-radius: 10px; background: transparent; color: #e6e6ea; border: 1px solid rgba(255,255,255,.16); text-decoration: none;
    font: 800 12.5px/1 "Montserrat", "Inter", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease, transform .18s ease;
}
.fdc:hover .fdc__btn, .fld__btn:hover {
    background: #5865f2; border-color: #5865f2; color: #fff; transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 0 36px -2px rgba(88,101,242,.6), 0 10px 26px -10px rgba(88,101,242,.8);
}
.fdc:active .fdc__btn, .fld__btn:active { transform: translateY(0); }

/* ---- профиль лидера: как всплывающий профиль в Discord --------------------- */
.fac-people { display: grid; gap: 18px; }
.fld {
    border-radius: 12px; overflow: hidden; background: #232428;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 20px 44px -22px rgba(0,0,0,.85);
}
.fx.is-hot > .fld { box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 28px 54px -22px rgba(0,0,0,.95); }
.fld__banner { position: relative; display: block; height: 96px; overflow: hidden; background: #1e1f22; }
/* цвет профиля ровной заливкой - плоско; лёгкий свет сверху даёт объём */
.fld__art.is-color::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 55%, rgba(0,0,0,.25)); }
/* своя картинка в шапке - чуть притемняем, чтобы не спорила с гербом и названием */
.fld__art.is-own::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.42)); }
.fld__art {
    position: absolute; inset: 0; background: var(--art) center / cover no-repeat;
    transform: scale(1.02); transition: transform .9s cubic-bezier(.2,.8,.2,1);
}
.fx.is-hot .fld__art { transform: scale(1.08); }
/* своей шапки нет - тоннель в цвете фракции */
.fld__art:not(.is-own):not(.is-color) { filter: saturate(.5) brightness(.7); }
.fld__banner:has(.fld__art:not(.is-own):not(.is-color))::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(120deg, color-mix(in srgb, var(--fc) 52%, transparent), transparent 66%);
}
.fld__head { position: relative; display: block; height: 50px; }
.fld__ava {
    position: absolute; z-index: 2; left: 14px; top: -48px; width: 90px; height: 90px; border-radius: 50%;
    overflow: hidden; background: #1e1f22; box-shadow: 0 0 0 6px #232428;
    transition: transform .6s cubic-bezier(.34,1.4,.64,1), box-shadow .4s ease;
}
.fx.is-hot .fld__ava { transform: translateY(-3px); box-shadow: 0 0 0 6px #232428, 0 0 0 8px color-mix(in srgb, var(--fc) 55%, transparent); }
.fld__ava img { display: block; width: 100%; height: 100%; object-fit: cover; animation: facFade .45s ease both; }
.fld__deco { position: absolute; z-index: 3; left: 5px; top: -57px; width: 108px; height: 108px; pointer-events: none; }
.fld__badges {
    position: absolute; right: 12px; top: 10px; display: flex; align-items: center; gap: 2px;
    padding: 3px 5px; border-radius: 8px; background: #111214;
}
.fld__badge { display: grid; place-items: center; width: 24px; height: 24px; }
.fld__badge img { width: 20px; height: 20px; object-fit: contain; }
.fld__badge--star svg { width: 17px; height: 17px; color: #f0b232; filter: drop-shadow(0 0 4px rgba(240,178,50,.45)); }
.fld__body { padding: 4px 16px 0; }
.fld__name { margin: 0; font: 700 20px/1.25 "Inter", system-ui, sans-serif; color: #f2f3f5; overflow-wrap: anywhere; }
.fld__user { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 3px 0 0; font: 500 14px/1.3 "Inter", system-ui, sans-serif; color: #b5bac1; }
.fld__tag {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px;
    background: rgba(255,255,255,.08); font: 700 12px/1 "Inter", system-ui, sans-serif; color: #dbdee1;
}
.fld__tag img { width: 14px; height: 14px; }
.fld__sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.fld__k { margin: 0 0 8px; font: 700 12px/1 "Inter", system-ui, sans-serif; color: #b5bac1; }
.fld__role {
    display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 26px; padding: 0 9px; border-radius: 6px;
    background: #2e3035; font: 500 12.5px/1 "Inter", system-ui, sans-serif; color: #dbdee1;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.fld__role i { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--fc); box-shadow: 0 0 8px color-mix(in srgb, var(--fc) 60%, transparent); }
.fld__v { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 14px/1.3 "Inter", system-ui, sans-serif; color: #dbdee1; }
.fld__v svg { width: 16px; height: 16px; flex: 0 0 auto; color: #949ba4; }
.fld__btn { margin: 16px; }
.fld.is-bare .fld__user { color: #949ba4; }
/* профиль ещё в пути - скелет той же формы */
.fld.is-wait { padding-bottom: 20px; }
.fld.is-wait .fld__ava { background: #2e3035; }
.fld__sk {
    display: block; width: 62%; height: 18px; border-radius: 6px;
    background: linear-gradient(90deg, #2e3035 0%, #3a3c42 50%, #2e3035 100%) 0 0 / 200% 100%;
    animation: facSk 1.5s ease-in-out infinite;
}
.fld__sk--s { width: 40%; height: 13px; margin-top: 6px; }

/* ---- соседние фракции ----------------------------------------------------- */
.fac-pn { --i: 7; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fac-pn__a {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; border-radius: 14px;
    text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease;
}
.fac-pn__a::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s ease;
    background: radial-gradient(260px 120px at var(--gx, 0%) 50%, color-mix(in srgb, var(--fc) 22%, transparent), transparent 70%);
}
.fac-pn__a--next { --gx: 100%; align-items: flex-end; text-align: right; }
.fac-pn__a:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -24px rgba(0,0,0,.95); }
.fac-pn__a:hover::before { opacity: 1; }
.fac-pn__k { position: relative; font: 600 11.5px/1 "Inter", system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #8d8d8d; }
.fac-pn__f { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; font: 700 15px/1.25 "Montserrat", sans-serif; color: #f0f0f0; }
.fac-pn__a--next .fac-pn__f { flex-direction: row-reverse; }
.fac-pn__logo { width: 32px; height: 32px; flex: 0 0 auto; object-fit: contain; transition: transform .4s cubic-bezier(.34,1.4,.64,1); }
.fac-pn__a:hover .fac-pn__logo { transform: scale(1.1); }
.fac-pn__logo.is-none { font-size: 14px; }

/* ---- движение ------------------------------------------------------------- */
.fac-in { animation: facIn .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 60ms); }
.fac-side.fac-in { --i: 1; }
@keyframes facIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes facFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes facGlint { to { transform: translateX(420%) skewX(-18deg); } }
@keyframes facSk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes facPing {
    0% { box-shadow: 0 0 6px rgba(35,165,90,.9), 0 0 0 0 rgba(35,165,90,.5); }
    70% { box-shadow: 0 0 6px rgba(35,165,90,.9), 0 0 0 6px rgba(35,165,90,0); }
    100% { box-shadow: 0 0 6px rgba(35,165,90,.9), 0 0 0 0 rgba(35,165,90,0); }
}
/* переход сетка <-> карточка: логотип перетекает, остальное мягко меняется */
::view-transition-group(fac-logo) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }

@media (prefers-reduced-motion: reduce) {
    .fac-group, .fac-in, .fac-tile__on.is-live, .fld__ava img, .is-swap, .fac-hero__art, .fac-hero__art::before,
    .fdc__dot.is-on, .fld__sk, .fx.is-hot .fdc__btn::after, .fx.is-hot .fld__btn::after { animation: none; }
    .fac-tile, .fac-tile__logo, .fac-pn__a, .fac-fold__chev, .fx > .fdc, .fx > .fld, .fdc__art, .fld__art, .fac-hero__art, .fac-hero__ring { transition: none; }
}
@media (max-width: 980px) {
    .fac-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
    .fac-side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); align-items: start; }
}
@media (max-width: 640px) {
    .fac-grid { grid-template-columns: 1fr; }
    .fac-hero { padding: 22px 20px; }
    .fac-hero::after { left: 20px; right: 20px; }
    .fac-hero--art { min-height: 0; padding-top: 150px; }
    .fac-hero__art {
        width: 100%; bottom: auto; height: 260px;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.7) 50%, transparent 100%);
                mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.7) 50%, transparent 100%);
    }
    /* на узком экране кадр по центру: в него входят и боец, и жетон */
    .fac-hero__art::before { background-position: var(--pos-m, var(--pos, 50% 45%)); }
    .fac-hero__ring { width: 56px; height: 56px; margin-bottom: 12px; }
    .fac-hero__logo { width: 46px; height: 46px; }
    .fac-hero__wm { width: 260px; height: 260px; right: -80px; }
    .fac-hero__name { font-size: 30px; }
    .fac-block { padding: 18px 18px 20px; }
    .fac-fold > summary { padding: 14px 14px 14px 18px; }
    .fac-fold__body { padding: 2px 18px 18px; }
    .fac-rules li { padding-left: 46px; }
    .fac-rel { grid-template-columns: 1fr; }
    .fac-pn { grid-template-columns: 1fr; }
    .fac-pn__a--next { align-items: flex-start; text-align: left; }
    .fac-pn__a--next .fac-pn__f { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
    .fac-lore { transition: none; }
    .fac-rules li.is-in { animation: none; }
}

/* ---- живая шапка: холсты эффектов поверх арта (hero-fx.js) ------------------ */
.fac-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.fac-fx--gl { mix-blend-mode: normal; }

/* ---- досье --------------------------------------------------------------- */
.fac-motto { margin: 0 0 16px; font: italic 500 17px/1.5 "Inter", system-ui, sans-serif; color: #e6e2d8; }
.fac-dl { display: grid; gap: 0; margin: 0; }
.fac-dl__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.07); }
.fac-dl__row:first-child { border-top: 0; padding-top: 0; }
.fac-dl dt { margin: 0; font: 600 12px/1.6 "Inter", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8f8f8f; }
.fac-dl dd { margin: 0; font: 400 15px/1.55 "Inter", system-ui, sans-serif; color: #dcdcdc; }
.fac-stations {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border: 0; border-radius: 8px; cursor: pointer;
    background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); color: #e6e6e6; font: 500 13.5px/1 "Inter", system-ui, sans-serif;
    transition: background-color .2s ease;
}
.fac-stations:hover { background: rgba(255,255,255,.1); }
.fac-stations svg { width: 15px; height: 15px; transition: transform .3s ease; }
.fac-stations[aria-expanded="true"] svg { transform: rotate(180deg); }
.fac-stations__list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.fac-stations__list li { padding: 5px 10px; border-radius: 7px; background: rgba(255,255,255,.045); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); font: 500 13px/1.2 "Inter", system-ui, sans-serif; color: #d0d0d0; }

/* ---- развитие: лестница ступеней ------------------------------------------ */
.fac-stages { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.fac-stage { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 14px 0 16px; border-top: 1px solid rgba(255,255,255,.07); }
.fac-stage:first-child { border-top: 0; padding-top: 0; }
.fac-stage__n {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    font: 800 15px/1 "Montserrat", sans-serif; color: #8a8a8a; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
}
.fac-stage.is-done .fac-stage__n { color: #d6d6d6; background: rgba(255,255,255,.09); }
.fac-stage.is-cur .fac-stage__n { color: #fff; background: color-mix(in srgb, var(--fc) 42%, #1a1b1d); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 70%, transparent), 0 0 26px -8px var(--fc); }
.fac-stage.is-next { opacity: .62; }
.fac-stage__name { display: flex; align-items: center; gap: 10px; font: 700 16px/1.3 "Montserrat", sans-serif; color: #f2f2f2; }
.fac-stage__now { font: 600 11px/1 "Inter", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: color-mix(in srgb, var(--fc) 80%, #fff); padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--fc) 18%, transparent); }
.fac-stage__cond { margin: 6px 0 0; font: 400 14.5px/1.55 "Inter", system-ui, sans-serif; color: #cfcfcf; }
.fac-stage__gives { margin: 4px 0 0; font: 400 13.5px/1.5 "Inter", system-ui, sans-serif; color: #9c9c9c; }
.fac-stage__gives::before { content: "Даёт: "; color: #7c7c7c; }
.fac-focus { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fac-focus .fac-tag.is-pick { color: #fff; background: color-mix(in srgb, var(--fc) 30%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 70%, transparent); }
.fac-note { margin: 10px 0 0; font: 400 13px/1.5 "Inter", system-ui, sans-serif; color: #8a8a8a; }
.fac-sub { margin: 22px 0 10px; font: 700 11.5px/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #a3a3a3; }
.fac-goals, .fac-links, .fac-log { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fac-goals li, .fac-links li { position: relative; padding-left: 18px; font: 400 14.5px/1.55 "Inter", system-ui, sans-serif; color: #d2d2d2; }
.fac-goals li::before, .fac-links li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--fc) 75%, #fff); }
.fac-log li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; font: 400 14.5px/1.55 "Inter", system-ui, sans-serif; color: #d2d2d2; }
.fac-log time { font-variant-numeric: tabular-nums; color: #8f8f8f; }

/* ---- отношения ------------------------------------------------------------ */
.fac-ties { display: grid; gap: 8px; }
.fac-tie {
    --tc: #9a9a9a;
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
    text-decoration: none; color: inherit; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
    transition: background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.fac-tie:hover { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); transform: translateX(3px); }
.fac-tie--war { --tc: #e0483f; } .fac-tie--tension { --tc: #e39a3a; } .fac-tie--ally { --tc: #4fbe72; } .fac-tie--trade { --tc: #5fa8e8; }
.fac-tie__logo { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0,0,0,.5)); }
.fac-tie__b { min-width: 0; display: grid; gap: 2px; }
.fac-tie__b b { font: 700 14.5px/1.3 "Montserrat", sans-serif; color: #f0f0f0; }
.fac-tie__b span { font: 400 13px/1.45 "Inter", system-ui, sans-serif; color: #a5a5a5; }
.fac-tie__k { padding: 5px 9px; border-radius: 7px; white-space: nowrap; font: 600 11.5px/1 "Inter", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent); }
@media (max-width: 640px) {
    .fac-dl__row { grid-template-columns: 1fr; gap: 4px; }
    .fac-stage { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
    .fac-stage__n { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
    .fac-log li { grid-template-columns: 1fr; gap: 2px; }
    .fac-tie { grid-template-columns: 34px minmax(0, 1fr); }
    .fac-tie__k { grid-column: 2; justify-self: start; }
    .fac-tie__logo { width: 34px; height: 34px; }
}
.fac-stations__list[hidden] { display: none; }

/* ---- список фракций: одна плашка, заголовок с пояснением ---------------------- */
.fac-group {
    padding: 22px 24px 24px; border-radius: 18px; border: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(180deg, rgba(14,15,17,.74), rgba(10,11,12,.8));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    animation: facFade .5s ease both;
}
.fac-group__h { gap: 10px; color: #f0f0f0; font-size: 15px; letter-spacing: .02em; text-transform: none; font-family: "Montserrat", sans-serif; font-weight: 700; }
.fac-group__d { font: 400 12.5px/1.3 "Inter", system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: #8a8a8a; }
.fac-group__h::after { margin-left: 6px; }
/* шапка раздела - тоже на плашке, а не в воздухе */
.wiki-body #facLead {
    max-width: 900px; margin: 0 auto 26px; padding: 26px 32px 28px; border-radius: 18px; border: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(180deg, rgba(14,15,17,.7), rgba(10,11,12,.78));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
/* перелёт герба: панели вокруг не должны двигаться во время перехода - только проявляться */
.fac-hero.fac-in, .fac-group { animation-name: facFade; }
::view-transition-group(fac-logo) { animation-duration: .6s; animation-timing-function: cubic-bezier(.22,.61,.36,1); }
::view-transition-old(fac-logo), ::view-transition-new(fac-logo) { animation: none; mix-blend-mode: normal; height: 100%; }

/* ---- панели-складки: иконка, заголовок крупнее, описание справа ----------------- */
.fac-fold > summary { gap: 12px; padding: 16px 18px 16px 20px; }
.fac-fold__i {
    display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px;
    background: color-mix(in srgb, var(--fc) 16%, rgba(255,255,255,.03)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 32%, rgba(255,255,255,.06));
    color: color-mix(in srgb, var(--fc) 70%, #fff);
}
.fac-fold__i svg { width: 18px; height: 18px; }
.fac-fold__t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; font: 700 18px/1.2 "Montserrat", sans-serif; color: #fff; }
.fac-fold__t small { font: 400 13px/1.4 "Inter", system-ui, sans-serif; color: rgba(255,255,255,.42); }
.fac-fold[open]:not(.is-closing) > summary { border-bottom: 1px solid rgba(255,255,255,.06); }
.fac-fold__body { padding: 18px 24px 24px; }
.fac-p { font-size: 16px; line-height: 1.7; color: #d8d8d8; }
.fac-p--lead { font-size: 17px; color: #e6e6e6; }
.fac-p + .fac-p { margin-top: 14px; }
.fac-src { margin-top: 16px; }

/* ---- ветки развития: боковая панель ------------------------------------------- */
.fdev {
    position: relative; overflow: hidden; isolation: isolate; padding: 16px 16px 16px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 14%, transparent), rgba(24,25,29,.92) 45%, rgba(35,36,40,.96));
    transition: border-color .25s ease, transform .22s ease, box-shadow .25s ease;
}
.fx.is-hot.fdev { border-color: color-mix(in srgb, var(--fc) 55%, transparent); transform: translateY(-2px); box-shadow: 0 28px 54px -22px rgba(0,0,0,.95), 0 0 40px -18px color-mix(in srgb, var(--fc) 60%, transparent); }
.fdev__stage { display: flex; align-items: center; gap: 12px; }
.fdev__n {
    display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px;
    font: 800 15px/1 "Montserrat", sans-serif; color: #fff;
    background: color-mix(in srgb, var(--fc) 42%, #1a1b1d); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 70%, transparent), 0 0 26px -8px var(--fc);
}
.fdev__t { min-width: 0; display: grid; gap: 2px; }
.fdev__t b { font: 700 16px/1.25 "Montserrat", sans-serif; color: #f4f4f4; }
.fdev__t span { font: 400 13px/1.4 "Inter", system-ui, sans-serif; color: #a9a9a9; }
.fdev__next, .fdev__goals { margin: 12px 0 0; font: 400 13.5px/1.5 "Inter", system-ui, sans-serif; color: #a9a9a9; }
.fdev__next b { font-weight: 600; color: #e6e6e6; }
.fdev__goals { margin-top: 4px; color: color-mix(in srgb, var(--fc) 75%, #fff); }
.fdev__btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; margin-top: 14px;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: #e6e6ea; cursor: pointer;
    font: 800 12px/1 "Montserrat", "Inter", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease, transform .18s ease;
}
.fdev__btn svg { width: 17px; height: 17px; }
.fdev__btn:hover {
    background: color-mix(in srgb, var(--fc) 55%, #2a2b30); border-color: color-mix(in srgb, var(--fc) 70%, transparent); color: #fff; transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 0 36px -2px color-mix(in srgb, var(--fc) 55%, transparent), 0 10px 26px -10px color-mix(in srgb, var(--fc) 80%, transparent);
}
.fdev__btn:active { transform: translateY(0); }

/* ---- модалка «Прогрессия фракции» --------------------------------------------- */
body.has-modal { overflow: hidden; }
.fac-modal { position: fixed; inset: 0; z-index: 9800; display: grid; place-items: center; padding: 24px; }
.fac-modal__bd { position: absolute; inset: 0; background: rgba(6,7,8,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .28s ease; }
.fac-modal__w {
    position: relative; width: min(760px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #17181a, #0f1011) padding-box,
                linear-gradient(160deg, color-mix(in srgb, var(--fc) 55%, rgba(255,255,255,.14)), rgba(255,255,255,.04) 45%, color-mix(in srgb, var(--fc) 22%, transparent)) border-box;
    box-shadow: 0 40px 90px -30px rgba(0,0,0,.95);
    opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .3s ease, transform .34s cubic-bezier(.2,.8,.2,1);
}
.fac-modal.is-on .fac-modal__bd { opacity: 1; }
.fac-modal.is-on .fac-modal__w { opacity: 1; transform: none; }
.fac-modal__h { display: flex; align-items: center; gap: 14px; padding: 18px 20px 16px 22px; border-bottom: 1px solid rgba(255,255,255,.07); background: linear-gradient(90deg, color-mix(in srgb, var(--fc) 14%, transparent), transparent 55%); }
.fac-modal__logo { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.fac-modal__hb { min-width: 0; flex: 1 1 auto; }
.fac-modal__k { margin: 0 0 2px; font: 600 11px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #9a9a9a; }
.fac-modal__h h2 { margin: 0; font: 800 20px/1.2 "Montserrat", sans-serif; color: #fff; }
.fac-modal__x {
    display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 10px; cursor: pointer;
    background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); color: #ddd; transition: background-color .2s ease;
}
.fac-modal__x:hover { background: rgba(255,255,255,.12); }
.fac-modal__x svg { width: 18px; height: 18px; }
.fac-modal__b { padding: 20px 24px 26px; overflow: auto; overscroll-behavior: contain; }

/* ---- отношения: полная таблица в две колонки ---------------------------------- */
.fac-ties { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.fac-tie--neutral { --tc: #8a8a8a; opacity: .82; }
.fac-tie--unknown { --tc: #6f6a7c; opacity: .82; }
.fac-tie--unknown .fac-tie__k { letter-spacing: .06em; }
.fac-tie--neutral:hover { opacity: 1; }

/* ---- фон и дым темнее --------------------------------------------------------- */
.wiki-body .wiki-bg { filter: saturate(.9) contrast(1.04) brightness(.86); }
.fac-smoke { opacity: .8; }

@media (max-width: 640px) {
    .fac-group { padding: 16px 14px 16px; }
    .wiki-body #facLead { padding: 20px 18px 22px; }
    .fac-fold__t { font-size: 16px; }
    .fac-fold__t small { display: none; }
    .fac-modal { padding: 10px; }
    .fac-modal__b { padding: 16px; }
    .fac-ties { grid-template-columns: 1fr; }
}
/* отношения: в одну колонку - в узкой колонке две теснят текст */
.fac-ties { grid-template-columns: 1fr; }
.fac-tie { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 9px 12px; }
.fac-tie__logo { width: 36px; height: 36px; }
.fac-tie__b span { font-size: 12.5px; }

/* ---- плашка «Правила для лидеров» под списком ---------------------------------- */
.fac-lrules {
    position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 16px 18px 16px 18px;
    border-radius: 16px; border: 1px solid rgba(255,255,255,.08); text-decoration: none; color: inherit;
    background: linear-gradient(135deg, rgba(207,41,41,.14), rgba(14,15,17,.8) 40%, rgba(10,11,12,.86));
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: border-color .25s ease, transform .22s ease, box-shadow .25s ease;
}
.fac-lrules:hover { border-color: rgba(207,41,41,.45); transform: translateY(-2px); box-shadow: 0 28px 54px -22px rgba(0,0,0,.95), 0 0 40px -18px rgba(207,41,41,.6); }
.fac-lrules__i { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; background: rgba(207,41,41,.16); box-shadow: inset 0 0 0 1px rgba(207,41,41,.4); color: #f0a0a0; }
.fac-lrules__i svg { width: 20px; height: 20px; }
.fac-lrules__b { display: grid; gap: 3px; min-width: 0; flex: 1 1 auto; }
.fac-lrules__b b { font: 700 16px/1.25 "Montserrat", sans-serif; color: #fff; }
.fac-lrules__b span { font: 400 13.5px/1.45 "Inter", system-ui, sans-serif; color: #a2a2a2; }
.fac-lrules__btn {
    display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; flex: 0 0 auto; border-radius: 10px; border: 1px solid rgba(255,255,255,.16);
    font: 800 12px/1 "Montserrat", "Inter", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #e6e6ea;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .25s ease;
}
.fac-lrules__btn svg { width: 15px; height: 15px; }
.fac-lrules:hover .fac-lrules__btn { background: #b32424; border-color: #cf2929; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 0 30px -4px rgba(207,41,41,.6), 0 10px 24px -10px rgba(207,41,41,.8); }

/* ---- боковая панель веток: иконка вместо цифры ---------------------------------- */
.fdev__n svg { width: 22px; height: 22px; }

/* ---- прогрессия в модалке ------------------------------------------------------- */
.fpr { padding: 16px 18px; border-radius: 14px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.025); }
.fpr + .fpr, .fpr + .fpr__prev, .fpr__prev + .fac-sub { margin-top: 12px; }
.fpr--cur { border-color: color-mix(in srgb, var(--fc) 40%, rgba(255,255,255,.08)); background: linear-gradient(135deg, color-mix(in srgb, var(--fc) 12%, transparent), rgba(255,255,255,.02) 55%); }
.fpr--next { opacity: .78; }
.fpr__k { margin: 0 0 12px; font: 600 11px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #9a9a9a; }
.fpr__head { display: flex; align-items: center; gap: 14px; }
.fpr__n {
    display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px;
    font: 800 15px/1 "Montserrat", sans-serif; color: #fff; background: rgba(255,255,255,.09);
}
.fpr--cur .fpr__n { background: color-mix(in srgb, var(--fc) 42%, #1a1b1d); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 70%, transparent), 0 0 26px -8px var(--fc); }
.fpr__n--s { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; color: #d6d6d6; }
.fpr__hb { min-width: 0; display: grid; gap: 3px; }
.fpr__name { font: 700 18px/1.2 "Montserrat", sans-serif; color: #f4f4f4; }
.fpr__sub { font: 400 14px/1.5 "Inter", system-ui, sans-serif; color: #b0b0b0; }
.fpr__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); font: 400 15px/1.55 "Inter", system-ui, sans-serif; color: #dcdcdc; }
.fpr__row i { font: 600 12px/1.6 "Inter", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8f8f8f; }
.fpr__row .fac-focus { margin: 0; }
.fpr .fac-note { margin: 8px 0 0 76px; }
.fpr__lim { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.fpr__lim li { position: relative; padding-left: 18px; font: 400 15px/1.5 "Inter", system-ui, sans-serif; color: #dcdcdc; }
.fpr__lim li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 2px; border-radius: 1px; background: color-mix(in srgb, var(--fc) 80%, #fff); }
.fpr__end { margin: 0; font: 400 15px/1.55 "Inter", system-ui, sans-serif; color: #c8c8c8; }
.fpr__prev { border-radius: 14px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.02); }
.fpr__prev > summary { display: flex; align-items: center; gap: 10px; padding: 13px 18px; cursor: pointer; list-style: none; font: 700 14px/1.2 "Montserrat", sans-serif; color: #d6d6d6; }
.fpr__prev > summary::-webkit-details-marker { display: none; }
.fpr__prev > summary span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 7px; background: rgba(255,255,255,.08); font: 700 12px/1 "Inter", system-ui, sans-serif; color: #bdbdbd; }
.fpr__prev > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid #8a8a8a; border-bottom: 2px solid #8a8a8a; transform: rotate(45deg); transition: transform .25s ease; }
.fpr__prev[open] > summary::after { transform: rotate(-135deg); }
.fpr__list { margin: 0; padding: 4px 18px 16px; list-style: none; display: grid; gap: 10px; }
.fpr__list li { display: flex; align-items: center; gap: 12px; }
.fpr__list li div { display: grid; gap: 1px; min-width: 0; }
.fpr__list li b { font: 700 14px/1.3 "Montserrat", sans-serif; color: #e4e4e4; }
.fpr__list li span:last-child { font: 400 13px/1.45 "Inter", system-ui, sans-serif; color: #9a9a9a; }

/* ---- «Положение» - как пункты в правилах сервера ------------------------------- */
.fac-di { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; }
.fac-di__n {
    display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 23px; padding: 0 6px; margin-top: 2px; flex: 0 0 auto;
    border: 1px solid color-mix(in srgb, var(--fc) 45%, rgba(255,255,255,.1)); border-radius: 6px;
    font: 800 12.5px/1 "Inter", system-ui, sans-serif; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--fc) 70%, #fff);
}
.fac-di__t { margin: 0; max-width: 72ch; font: 400 15.2px/26px "Inter", system-ui, sans-serif; color: #dcdcdc; }
.fac-di__t b { font-weight: 700; color: #fff; }
.fac-clar {
    display: block; margin: 8px 0 10px 39px; padding: 9px 13px 9px 12px; max-width: 70ch;
    border-left: 3px solid rgba(255,255,255,.28); border-radius: 0 7px 7px 0; background: rgba(255,255,255,.035);
    font: 400 13.5px/22px "Inter", system-ui, sans-serif; color: #bdbdbd;
}
.fac-clar__k { display: block; margin-bottom: 4px; font: 700 11px/1.2 "Inter", system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #d0d0d0; }
.fac-clar--exc { border-color: #d9a441; } .fac-clar--exc .fac-clar__k { color: #d9a441; }
.fac-clar--imp { border-color: #cf2929; } .fac-clar--imp .fac-clar__k { color: #e07070; }
.fac-clar__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fac-clar__lines li { position: relative; padding-left: 14px; }
.fac-clar__lines li::before { content: ""; position: absolute; left: 0; top: 10px; width: 7px; height: 2px; background: #d9a441; }
.fac-doc__h + .fac-di { padding-top: 2px; }

/* ---- совет фракции: карточки в основной колонке, в два столбца ------------------ */
.fac-council { margin-bottom: 4px; }
.fac-council .fac-people { grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
/* ---- досье: главное белым, пояснение серым ------------------------------------- */
.fac-dl dd b { display: block; font-weight: 600; color: #fff; }
.fac-dl dd span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: #9c9c9c; }
/* ---- заглушка прогрессии ---------------------------------------------------------- */
.fac-soon { display: grid; justify-items: center; gap: 10px; padding: 34px 20px 38px; text-align: center; }
.fac-soon svg { width: 44px; height: 44px; color: color-mix(in srgb, var(--fc) 70%, #fff); opacity: .9; }
.fac-soon b { font: 800 22px/1.2 "Montserrat", sans-serif; color: #fff; }
.fac-soon p { margin: 0; max-width: 40ch; font: 400 15px/1.55 "Inter", system-ui, sans-serif; color: #a9a9a9; }
@media (max-width: 640px) { .fac-council .fac-people { grid-template-columns: 1fr; } .fac-lrules { flex-wrap: wrap; } .fac-lrules__btn { width: 100%; justify-content: center; } .fac-clar { margin-left: 0; } }
