/* --- Сообщество: карточки соцсетей --- */
.community-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.social-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--panel); color: var(--text);
    transition: transform .12s ease, border-color .12s ease; }
.social-card:hover { transform: translateY(-2px); border-color: var(--brand-light); color: var(--text); }
.social-card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
    font-size: 22px; color: #fff; background: var(--brand); }
.social-card__name { font-size: 18px; font-weight: 800; margin-top: 4px; }
.social-card__desc { color: var(--muted); font-size: 14px; }
.social-card--discord .social-card__icon { background: #5865f2; }
.social-card--telegram .social-card__icon { background: #229ed9; }
.social-card--vk .social-card__icon { background: #0077ff; }
.social-card--youtube .social-card__icon { background: #ff0000; }

/* --- «Сообщество»: шапка и навигация по разделам (каждая вкладка - отдельная страница) --- */
.comm-head { margin-bottom: 2px; }
.comm-head__title { margin: 0 0 6px; font-size: clamp(26px, 3.6vw, 32px); }
.comm-head__lead { margin: 0; max-width: 66ch; color: var(--muted);
    min-height: 3.1em;   /* 2 строки при 15px/1.55: ряд вкладок не прыгает */ }

.comm-tabs { display: flex; gap: 10px; margin: 18px 0 22px; flex-wrap: wrap; }
.comm-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
    font-weight: 700; font-size: 15px; color: var(--text); background: var(--panel);
    border: 1px solid var(--line); border-radius: 999px; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.comm-tabs a:hover { border-color: var(--brand-light); color: var(--brand-light); }
.comm-tabs a.is-active { color: #fff; border-color: transparent;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    box-shadow: 0 4px 14px -6px rgba(108, 63, 245, .6); }

/* --- Каталог предметов YItems (вкладка «Предметы») ---
   Плитка двусторонняя: лицо с предметом на постаменте и оборот с характеристиками.
   Переворот - настоящий 3D (rotateY + preserve-3d), но включается только классом
   .is-3d, который навешивает скрипт: без JS обе стороны идут в обычном потоке. */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 16px; }
.itm { perspective: 950px; }
.itm__inner { position: relative; }
.itm.is-back .itm__inner { --flip: 180deg; }

/* Весь объём живёт под .is-3d: без JS поворачивать нечего, и трансформация
   здесь только испортила бы обычный список зеркальным контентом. */
.items-grid.is-3d .itm__inner { transform-style: preserve-3d;
    transform: rotateY(calc(var(--flip, 0deg) + var(--tx, 0deg))) rotateX(var(--ty, 0deg));
    transition: transform .55s cubic-bezier(.22, .61, .36, 1); }

.itm__face { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center;
    padding: 14px 14px 16px; border-radius: 15px; border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(var(--rg), .10), rgba(0, 0, 0, 0) 46%), var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 14px 30px -22px rgba(0, 0, 0, .9); }
.itm__face + .itm__face { margin-top: 12px; }          /* без JS: лицо и оборот друг под другом */
/*
 * Одинаковая высота плиток: ряд получает фиксированную строку, обе стороны
 * растягиваются на неё, а длинный оборот (у предмета с четырьмя бонусами
 * комплекта способностей больше, чем у соседки) прокручивается внутри себя.
 * Только под .is-3d: без JS стороны идут в обычном потоке, и высота у них
 * своя - там обрезка была бы потерей текста.
 */
.items-grid.is-3d { grid-auto-rows: 384px; }
.items-grid.is-3d .itm { height: 100%; }
.items-grid.is-3d .itm__inner { display: grid; height: 100%; }
.items-grid.is-3d .itm__face { grid-area: 1 / 1; margin: 0; backface-visibility: hidden;
    height: 100%; overflow: hidden auto; }
.items-grid.is-3d .itm__face--back { transform: rotateY(180deg); }
/* скрытую сторону убираем из порядка обхода Tab: visibility, а не opacity */
.items-grid.is-3d .itm.is-back .itm__face--front,
.items-grid.is-3d .itm:not(.is-back) .itm__face--back { visibility: hidden; }
.items-grid.is-3d .itm__face--back { border-color: rgba(var(--rg), .42);
    background: linear-gradient(180deg, rgba(var(--rg), .16), rgba(0, 0, 0, 0) 60%), var(--panel-2); }

/* постамент: сам предмет, тёплое сияние редкости и тень-пол под ним */
.itm__plinth { position: relative; display: grid; place-items: center; width: 100%; height: 104px; }
.itm__art, .itm__mono { position: relative; z-index: 2; width: 72px; height: 72px; }
.itm__art { object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .6));
    transition: transform .3s ease; }
.itm__mono { display: grid; place-items: center; border-radius: 16px; font-size: 30px; font-weight: 800;
    color: var(--rc); background: linear-gradient(160deg, rgba(var(--rg), .26), rgba(var(--rg), .06));
    border: 1px solid rgba(var(--rg), .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
    transition: transform .3s ease; }
.itm:hover .itm__art, .itm:hover .itm__mono { transform: translateY(-6px) scale(1.06); }
.itm__glow { position: absolute; inset: 6px 22% 22%; border-radius: 50%; filter: blur(13px);
    background: radial-gradient(circle, rgba(var(--rg), .5), rgba(var(--rg), 0) 68%); }
.itm__floor { position: absolute; left: 50%; bottom: 8px; width: 104px; height: 26px; transform: translateX(-50%);
    border-radius: 50%; background: radial-gradient(ellipse at center, rgba(var(--rg), .34), rgba(0, 0, 0, .34) 62%, transparent 74%);
    transition: width .3s ease, opacity .3s ease; }
.itm:hover .itm__floor { width: 86px; opacity: .8; }   /* предмет поднялся - тень собралась */

/*
 * Верх ступени: собственная подсветка, а не очередной оттенок.
 * Артефактной синий уже занят интерфейсом и редкой ступенью, реликтовой
 * платина - обычным серым. Свободных мест в ряду цветов не осталось, потому
 * эти две различаются светом: переливом подписи, двойным ореолом и призмой
 * на плашке с буквой.
 */
/* --- верх пирамиды: артефактная - бирюза, реликтовая - радуга ---
   Бег перелива живёт переменной: prefers-reduced-motion выключает её одной
   строкой, а сам градиент остаётся - человек просит спокойствия, а не другого цвета.
   Радуга навешана на все места, где подписана или названа ступень, иначе верх
   пирамиды на полке и в кабинете продолжал бы выглядеть белым текстом. */
[data-rarity="relic"] { --rainbow: linear-gradient(100deg, #ffffff, #a5f3fc 18%, #f0abfc 38%,
                                                 #fde68a 58%, #86efac 78%, #ffffff);
                         --rainbow-run: rg-shine 6s linear infinite; }
@keyframes rg-shine { from { background-position: 0 0; } to { background-position: 260% 0; } }

.itm[data-rarity="relic"] .itm__rarity,
.case-win[data-rarity="relic"] .case-win__rarity,
.case-row[data-rarity="relic"] .case-row__rarity,
.mg-tier[data-rarity="relic"] .mg-tier__name,
.mg-history__won[data-rarity="relic"],
.mg-modal__result[data-rarity="relic"] .mg-modal__tier {
    background-image: var(--rainbow); background-size: 260% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: var(--rainbow-run); }

/* имена наград переливом не бегают: на итогах открытия и слияния они уже
   всплывают, а два анимационных имени на одном элементе сплетаются в помеху */
.case-result[data-rarity="relic"] .case-result__item,
.mg-modal__result[data-rarity="relic"] .mg-modal__item {
    background-image: var(--rainbow);
    -webkit-background-clip: text; background-clip: text; color: transparent; }

.itm[data-rarity="artifact"] .itm__rarity {
    background-image: linear-gradient(100deg, #5eead4, #2dd4bf 45%, #22d3ee);
    -webkit-background-clip: text; background-clip: text; color: transparent; }
/* самоцвет внутри подписи: color: transparent наследуется и глиф исчезал */
.itm[data-rarity="artifact"] .itm__rarity i,
.itm[data-rarity="relic"] .itm__rarity i { color: var(--rc); }

/* плашка с буквой: призма фоном и свечением - градиентом текста он бы спорал
   с фоном самой плашки */
.itm[data-rarity="artifact"] .itm__mono { color: #ccfbf1; text-shadow: 0 0 12px rgba(94, 234, 212, .8), 0 0 24px rgba(45, 212, 191, .45);
    border-color: rgba(94, 234, 212, .55);
    background: linear-gradient(160deg, rgba(94, 234, 212, .3), rgba(34, 211, 238, .12)); }
.itm[data-rarity="relic"] .itm__mono { color: #fdfcff; text-shadow: 0 0 12px rgba(165, 243, 252, .85), 0 0 26px rgba(240, 171, 252, .5);
    border-color: rgba(226, 232, 240, .6);
    background: linear-gradient(160deg, rgba(165, 243, 252, .22), rgba(240, 171, 252, .14) 62%, rgba(253, 230, 138, .1)); }

/* ореол плитки: у артефактной холодный бирюзовый в два тона, у реликтовой радужный */
.itm[data-rarity="artifact"] .itm__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 0 0 1px rgba(94, 234, 212, .18), 0 14px 30px -22px rgba(0, 0, 0, .9),
    0 0 26px -6px rgba(94, 234, 212, .38); }
.itm[data-rarity="relic"] .itm__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px rgba(226, 232, 240, .22), 0 14px 30px -22px rgba(0, 0, 0, .9),
    0 0 30px -4px rgba(165, 243, 252, .3), 0 0 46px -10px rgba(240, 171, 252, .3); }
.itm[data-rarity="artifact"]:hover .itm__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px rgba(94, 234, 212, .3), 0 18px 34px -22px rgba(0, 0, 0, .9),
    0 0 34px -4px rgba(94, 234, 212, .5); }
.itm[data-rarity="relic"]:hover .itm__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 0 0 1px rgba(226, 232, 240, .34), 0 18px 34px -22px rgba(0, 0, 0, .9),
    0 0 38px -2px rgba(165, 243, 252, .42), 0 0 56px -8px rgba(240, 171, 252, .36); }

/* под светом верхних ступеней и сияние под предметом теплее */
.itm[data-rarity="relic"] .itm__glow { background: radial-gradient(circle, rgba(165, 243, 252, .55), rgba(240, 171, 252, .18) 46%, rgba(0, 0, 0, 0) 70%); }
.itm[data-rarity="artifact"] .itm__glow { background: radial-gradient(circle, rgba(94, 234, 212, .5), rgba(45, 212, 191, .16) 48%, rgba(0, 0, 0, 0) 70%); }

.itm__title { margin: 2px 0 0; font-size: 15px; line-height: 1.3; }
.itm__rarity { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
    color: var(--rc); }
.itm__rarity i { font-size: 9px; }
.itm__brief { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.itm__lines { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; width: 100%; }
.itm__lines li { padding: 5px 9px; border-radius: 9px; background: rgba(0, 0, 0, .22);
    border-left: 2px solid rgba(var(--rg), .6); font-size: 12.5px; line-height: 1.45; color: var(--text); text-align: left; }
.itm__obtain { margin: 6px 0 0; display: grid; gap: 4px; width: 100%; font-size: 12px; text-align: left; }
.itm__obtain-what { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.itm__obtain-what i { color: var(--rc); }
.itm__source { display: flex; flex-wrap: wrap; gap: 4px 6px; line-height: 1.45; }
.itm__source a { color: var(--brand-light); text-decoration: underline; }
/* способности и зачарования на обороте: плотные плашки вместо простыни текста */
.itm__chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.itm__chip { padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
    color: var(--rc, var(--muted)); background: rgba(var(--rg), .12); border: 1px solid rgba(var(--rg), .35); }
.itm__chip--ench { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.itm__lore { font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: left; }

.itm__turn { margin-top: auto; align-self: stretch; display: inline-flex; align-items: center; justify-content: center;
    gap: 7px; padding: 8px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700;
    color: var(--rc); background: rgba(var(--rg), .12); border: 1px solid rgba(var(--rg), .45);
    transition: background .18s ease, gap .18s ease; }
.itm__turn:hover { background: rgba(var(--rg), .24); gap: 10px; color: var(--rc); }
.itm__turn:focus-visible { outline: 2px solid var(--rc); outline-offset: 2px; }

@media (max-width: 560px) {
    .items-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .items-grid.is-3d { grid-auto-rows: 440px; }   /* узкая плитка: текст в несколько строк */
    .itm__plinth { height: 88px; }
    .itm__art, .itm__mono { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
    .itm__inner, .itm__art, .itm__mono, .itm__floor { transition: none; }
    .itm:hover .itm__art, .itm:hover .itm__mono { transform: none; }
    /* переворот остаётся (это смена стороны, а не движение), но без полёта */
    .items-grid.is-3d .itm__inner { transition-duration: .01ms; }
}

/* панель поиска/фильтров каталога предметов */
.items-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.items-filter label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); flex: 1 1 150px; min-width: 150px; }
.items-filter__search { flex: 2 1 220px; }
.items-filter__actions { display: flex; gap: 8px; align-items: flex-end; flex: 0 0 auto; }
.items-count { margin: 0 0 12px; }

/* выбор для сравнения и подпись источника на обороте плитки: ссылки, а не
   кнопки - чтобы выбор работал и без JS */
.itm__cmp { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 11.5px; }
.itm__cmp-link { display: inline-grid; place-items: center; width: 26px; height: 26px;
    border: 1px solid var(--line); border-radius: 8px; color: var(--muted);
    font-weight: 800; text-decoration: none; background: rgba(12, 10, 26, .5); }
.itm__cmp-link:hover { color: var(--text); border-color: var(--brand-light); }
.itm__cmp-link:focus-visible { outline: none; box-shadow: var(--ring); }
.itm__cmp-link.is-on { color: #fff; border-color: transparent;
    background: linear-gradient(120deg, var(--brand), var(--brand-light)); }
.itm__sources { margin-left: auto; text-align: right; }

/* таблица сравнения двух предметов: широкие ячейки крутятся горизонтально,
   а не ломают сетку на мобильном */
.cmp-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp th, .cmp td { padding: 9px 10px; border-bottom: 1px solid var(--line);
    text-align: left; vertical-align: top; }
.cmp thead th { font-size: 13px; }
.cmp__label { width: 160px; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.cmp__rarity { display: block; font-size: 11.5px; font-weight: 700; }
.cmp__cell div + div { margin-top: 4px; }
.cmp__buy { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
@media (max-width: 640px) {
    .cmp__label { width: 96px; }
}

/* --- Сообщество: сводная панель (вкладка «Обзор») --- */
.comm-dash { display: grid; gap: 18px; }
.comm-dash > * { animation: rise .5s ease both; }
.comm-dash > *:nth-child(2) { animation-delay: .07s; }
.comm-dash > *:nth-child(3) { animation-delay: .14s; }
.comm-dash > *:nth-child(4) { animation-delay: .21s; }

/* карточка «сервер сейчас»: статус, онлайн и вход в игру */
.comm-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center;
    gap: 18px; padding: 22px 24px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.comm-hero::after { content: ''; position: absolute; right: -90px; top: -120px; width: 340px; height: 340px;
    border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, rgba(99, 176, 74, .16), rgba(99, 176, 74, 0) 68%); }
.comm-hero.is-on { border-color: rgba(99, 176, 74, .38); }
.comm-hero__pulse { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
    font-size: 21px; color: var(--accent); background: rgba(99, 176, 74, .14); border: 1px solid rgba(99, 176, 74, .35); }
.comm-hero:not(.is-on) .comm-hero__pulse { color: var(--muted); background: rgba(157, 151, 181, .10); border-color: var(--line); }
.comm-hero__text { flex: 1 1 260px; min-width: 0; }
.comm-hero__cap { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px;
    text-transform: uppercase; color: var(--muted); }
.comm-hero__state { margin: 0; font-size: 21px; font-weight: 700; }
.comm-hero__state b { font-size: 30px; color: var(--accent); font-variant-numeric: tabular-nums; }
.comm-hero__facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.comm-hero__facts i { color: var(--brand-light); margin-right: 6px; }
.comm-hero__actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }

.comm-block { display: grid; gap: 12px; }
.comm-block__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.comm-block__title i { color: var(--brand-light); font-size: 16px; }
.comm-block__foot { margin: 2px 0 0; }

/* плитки-ссылки: акцентный цвет своей задаче, как у карточек геймплея */
.comm-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.comm-quick__card { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 15px 16px 15px 58px;
    border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.comm-quick__card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--acc, var(--brand)); }
.comm-quick__card i { position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 10px;
    display: grid; place-items: center; font-size: 13px; color: #fff; background: var(--acc, var(--brand));
    box-shadow: 0 8px 18px -10px var(--acc, var(--brand)); }
.comm-quick__name { font-weight: 700; font-size: 15px; }
.comm-quick__hint { font-size: 12.5px; color: var(--muted); }
.comm-quick__card:hover { transform: translateY(-3px); border-color: var(--acc, var(--brand-light)); color: #fff;
    box-shadow: 0 16px 30px -20px var(--acc, rgba(108, 63, 245, .9)); }

.comm-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.comm-board { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.comm-board__head { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 12px; font-weight: 800;
    letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.comm-board__head i { color: var(--warning); }
.comm-board__empty { margin: 0; font-size: 14px; }

/* строчки рейтинга: место, ник и результат */
.board { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; gap: 6px; }
.board li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); }
.board li::before { counter-increment: rank; content: counter(rank); flex: none; width: 22px; height: 22px;
    display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 800;
    color: var(--brand-light); background: rgba(139, 92, 246, .14); }
.board li:first-child::before { color: #1a1400; background: linear-gradient(135deg, #f0c483, #e0a33c); }
.board li:nth-child(2)::before { color: #1c1c22; background: linear-gradient(135deg, #dfe3ea, #a9b0be); }
.board li:nth-child(3)::before { color: #241309; background: linear-gradient(135deg, #d79a6b, #a4673a); }
.board__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.board__val { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
/* престиж - старший разряд рейтинга, поэтому и рисуется первым в строке */
.board__pr { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-light); }
.board__pr i { font-size: 11px; }

/* --- Медиа-партнёры: карточка = ник + площадка + кликабельный канал --- */
.comm-partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.comm-partner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text);
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.comm-partner:hover { transform: translateY(-3px); border-color: var(--brand-light); color: var(--text);
    box-shadow: 0 14px 30px -20px rgba(108, 63, 245, .9); }
.comm-partner__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.comm-partner__body { display: grid; gap: 2px; min-width: 0; }
.comm-partner__nick, .comm-partner__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-partner__nick { font-size: 15px; font-weight: 700; }
.comm-partner__meta { font-size: 12.5px; color: var(--muted); }
.comm-partner__out { flex: none; margin-left: auto; font-size: 11px; color: var(--muted); }
.comm-partner:hover .comm-partner__out { color: var(--brand-light); }
.board__empty { justify-content: center; }
.board__empty::before { display: none; }

/* ================= ИСТОРИЯ ПРОЕКТА («Сообщество» и своя страница) ==========
   Карточка периода: обложка, статус-чип, даты, счётчики и подробности.
   Тему ведёт переменная --c - её администрация ставит в записи истории, поэтому
   сезон с другой палитрой не просит править стили. */
.hist { gap: 14px; scroll-margin-top: 88px; }
.hist-sub { display: flex; align-items: center; gap: 9px; margin: 8px 0 0; font-size: 15px; }
.hist-sub i { color: #7fc6ff; }
.hist-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.hist-list { display: grid; gap: 10px; }

/* общая рама карточки: зимняя панель, иней сверху, акцент слева */
.history-card { position: relative; display: grid; gap: 14px; padding: 16px 18px; text-align: left;
    background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
    border-left: 3px solid rgb(var(--c, 111, 179, 255)); }
.history-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit;
    pointer-events: none; background: radial-gradient(110% 60% at 50% 0, rgba(var(--c, 111, 179, 255), .12), transparent 62%); }
.history-card__head { display: grid; gap: 5px; position: relative; }
.history-chip { justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px;
    border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: #0b1020; background: rgb(var(--c, 111, 179, 255)); }
.history-chip i { font-size: 11px; }
.history-card__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px;
    margin: 2px 0 0; font-size: 19px; line-height: 1.25; min-width: 0; }
.history-card__no { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    color: rgb(var(--c, 111, 179, 255)); }
.history-card__dates { margin: 0; font-size: 12.5px; color: var(--muted); }
.history-card__dates i { margin-right: 5px; color: rgb(var(--c, 111, 179, 255)); }
.history-card__pic { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px;
    border: 1px solid var(--line); }
.history-card__body { display: grid; gap: 12px; position: relative; }
.history-card__summary { margin: 0; font-size: 14px; line-height: 1.55; }
.history-card__text { font-size: 14px; line-height: 1.65; }
.history-card__announce { margin: 0; font-size: 13px; }
.history-card__announce i { margin-right: 6px; color: rgb(var(--c, 111, 179, 255)); }
.history-card__foot { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 0; }

/* идущий период - самый заметный: он и есть ответ на «что сейчас» */
.history-card--current { box-shadow: 0 18px 44px -26px rgba(var(--c, 111, 179, 255), .9); }
/* архив приглушён, но не серой ветошью: читать его всё равно должны */
.history-card--archive { border-left-width: 2px; background: var(--panel-2); }
.history-card--archive > summary { flex-wrap: wrap; }
.history-card--archive > summary > i:first-child { color: rgb(var(--c, 111, 179, 255)); }
.history-card--archive .history-card__title { font-size: 15px; font-weight: 700; }
.hist-mini__meta { flex: 1 1 100%; margin-left: 27px; font-size: 12px; font-weight: 500; color: var(--muted); }
.history-card--archive[open] > summary { border-bottom: 1px solid var(--line); }
.history-card--archive[open] > summary .gp-acc__chev { transform: rotate(180deg); }
/* запланированный - намеренно бледнее: обещать расписание, которого нет, нельзя */
.history-card--planned { opacity: .78; border-left-style: dashed; }
.history-card--planned .history-chip { background: transparent; color: var(--muted);
    border: 1px solid var(--line); }

.history-bar { height: 8px; border-radius: 999px; overflow: hidden; background: var(--panel-2);
    border: 1px solid var(--line); }
.history-bar__fill { display: block; height: 100%; width: calc(var(--w, 0) * 1%);
    background: linear-gradient(90deg, rgb(var(--c, 111, 179, 255)), #ffb454); }
.history-bar__cap { margin: 0; font-size: 12px; }
.history-facts { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.history-facts li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px;
    background: var(--panel-2); border: 1px solid var(--line); }
.history-facts b { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums;
    color: rgb(var(--c, 111, 179, 255)); }
.history-facts span { font-size: 12px; color: var(--muted); }
.history-leaders { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.hist-xp { margin-left: 7px; color: var(--muted); font-weight: 600; }

.hist-cols { display: grid; gap: 4px 16px; margin-top: 12px;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.hist-col h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px;
    font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.hist-col h4 i { color: rgb(var(--c, 111, 179, 255)); }
.hist-rewards, .hist-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist-rewards li { padding: 7px 10px; border-radius: 9px; background: var(--panel);
    border-left: 2px solid rgba(var(--c, 111, 179, 255), .55); font-size: 13px; line-height: 1.45; }
.hist-rewards li i { margin-right: 6px; color: rgb(var(--c, 111, 179, 255)); font-size: 11px; }
.hist-rewards--premium { border-left-color: #e0a33c; }
.hist-rewards--premium i { color: #e0a33c; }
.hist-timeline a { display: grid; grid-template-columns: auto 1fr; gap: 2px 9px; align-items: baseline;
    padding: 7px 10px; border-radius: 9px; background: var(--panel); color: var(--text);
    transition: background .16s ease; }
.hist-timeline a:hover { background: rgba(139, 92, 246, .14); color: var(--text); }
.hist-timeline__date { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
    color: rgb(var(--c, 111, 179, 255)); }
.hist-timeline b { font-size: 13.5px; }
@media (max-width: 620px) {
    .history-card { padding: 14px; }
    .history-card--archive .history-card__title { font-size: 14px; }
}
/* Архивная карточка - это и .gp-acc, и .history-card сразу. Селекторы составные
   намеренно: .gp-acc объявлен ниже по файлу, и его background/border/padding
   перебили бы стили карточки, если брать по одной классе. */
.gp-acc.history-card--archive { padding: 0; background: var(--panel-2); border-radius: 18px;
    border-left: 3px solid rgb(var(--c, 111, 179, 255)); }
.gp-acc.history-card--archive > summary { padding: 13px 16px; }
.gp-acc.history-card--archive .gp-acc__body { padding: 2px 16px 16px; }
.gp-acc.history-card--archive > summary:hover { background: rgba(139, 92, 246, .06); }
.gp-acc.history-card--archive::before { border-radius: 17px; }

@media (prefers-reduced-motion: reduce) { .comm-dash > * { animation: none; } }


/* ---- Кланы (community/clans) ---- */
.clan-block { margin-bottom: 16px; padding: 18px 20px; }
.clan-block .card__title { margin: 0 0 12px; font-size: 15px; }
.clan-tag { display: inline-block; padding: 3px 8px; border-radius: 7px; font-weight: 800;
    font-size: 12.5px; letter-spacing: .04em; color: var(--clan-color, var(--brand-light));
    background: color-mix(in srgb, var(--clan-color, var(--brand-light)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--clan-color, var(--brand-light)) 40%, transparent);
    text-decoration: none; }
a.clan-tag:hover { filter: brightness(1.2); color: var(--clan-color, var(--brand-light)); }
.clan-tag--big { font-size: 15px; padding: 6px 12px; }
.clan-form { display: grid; gap: 12px; margin-top: 10px; max-width: 560px; }
.clan-form__row { display: flex; gap: 12px; flex-wrap: wrap; }
.clan-form__row .field { flex: 1 1 160px; }
.clan-form__tag { max-width: 140px; }
.clan-form__color { max-width: 110px; }
.clan-form input[type="color"] { width: 100%; height: 38px; padding: 3px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.clan-invites { display: grid; gap: 8px; }
.clan-invites--pending { margin-top: 12px; }
.clan-invite { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); flex-wrap: wrap; }
.clan-invite__name { font-weight: 700; }
.clan-invite__actions { display: flex; gap: 8px; margin-left: auto; }
.clan-mine { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.clan-mine__info { display: grid; gap: 2px; margin-right: auto; }
.clan-list { margin-top: 6px; }
.clan-list > .card__title { margin: 0 0 12px; font-size: 15px; }
.clan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.clan-card { display: grid; gap: 6px; padding: 16px; text-decoration: none; color: var(--text); }
.clan-card:hover { border-color: var(--brand-light); }
.clan-card__name { font-size: 15px; }
.clan-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.clan-card__meta { font-size: 12px; }
.clan-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.clan-head__info { margin-right: auto; }
.clan-head__name { margin: 0; font-size: 19px; }
.clan-head__desc { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.clan-invite-form { display: flex; gap: 10px; align-items: end; max-width: 340px; }
.clan-invite-form .field { flex: 1; }
.clan-members { display: grid; gap: 8px; }
.clan-member { display: flex; align-items: center; gap: 12px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); flex-wrap: wrap; }
.clan-member__nick { font-size: 14px; }
.clan-member__role { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
    background: rgba(157, 151, 181, .12); color: var(--muted); }
.clan-member__role--leader { background: rgba(255, 205, 92, .14); color: #ffcd5c; }
.clan-member__role--officer { background: rgba(139, 92, 246, .16); color: var(--brand-soft); }
.clan-member__actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 620px) {
    .clan-form__row { flex-direction: column; }
    .clan-form__tag, .clan-form__color { max-width: none; }
    .clan-invite__actions, .clan-member__actions { margin-left: 0; width: 100%; }
}

/* Прокачка клана: полоса XP и вклад YCoin */
.clan-level { display: grid; gap: 8px; max-width: 560px; }
.clan-level__bar { height: 10px; border-radius: 6px; overflow: hidden;
    background: color-mix(in srgb, var(--line) 55%, transparent); }
.clan-level__fill { display: block; height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    transition: width .35s ease; }
.clan-level__text { margin: 0; font-size: 13px; }
.clan-perks { margin: 2px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; }
.clan-perks__next { color: var(--brand-light); }
.clan-member__flags { display: inline-flex; gap: 6px; font-size: 11px; }
.clan-member__perms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.clan-perm { margin: 0; }
.clan-perm__btn { padding: 3px 9px; font-size: 11px; border-radius: 20px; cursor: pointer;
    border: 1px dashed var(--line); background: transparent; color: var(--muted); }
.clan-perm__btn--on { border-style: solid; border-color: var(--brand-light);
    color: var(--brand-light); background: color-mix(in srgb, var(--brand-light) 12%, transparent); }
.clan-perm__btn:disabled { opacity: .45; cursor: default; }

/* ================================================================ кланы: общий набор
   cl-* - компактные кнопки, панели и строки каталога, карточки клана и настроек;
   pt-* - доска древа прокачки. Цвет клана приходит в --clan-color, ветви - в --branch. */
.cl { display: grid; gap: 14px; }
.cl-panel { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.cl-panel__title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.cl-panel--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.cl-small { margin: 0; font-size: 12.5px; }
.cl-note { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.cl-note > i { color: var(--brand-light); font-size: 18px; }

.cl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 34px; padding: 0 13px; border-radius: 10px; font: inherit; font-size: 13px;
    font-weight: 700; white-space: nowrap; cursor: pointer; color: var(--text);
    border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
    transition: border-color .15s ease, background .15s ease, transform .15s ease, color .15s ease; }
.cl-btn:hover { border-color: var(--brand-light); color: var(--text);
    background: color-mix(in srgb, var(--brand-light) 12%, transparent); }
.cl-btn:active { transform: translateY(1px); }
.cl-btn:focus-visible, .cl-chip:focus-visible, .pt-node:focus-visible { outline: none; box-shadow: var(--ring); }
.cl-btn:disabled { opacity: .5; cursor: not-allowed; }
.cl-btn--primary { border-color: transparent; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.cl-btn--primary:hover { filter: brightness(1.1); color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.cl-btn--icon { width: 34px; padding: 0; }
.cl-btn--sm { height: 28px; padding: 0 10px; font-size: 12px; }
.cl-btn--danger { color: #fca5a5; }
.cl-btn--danger:hover { border-color: var(--danger); color: #fff;
    background: color-mix(in srgb, var(--danger) 30%, transparent); }
.cl-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-actions form, .cl-toolbar form, .cl-perms form { margin: 0; }

.cl-input { height: 34px; min-width: 0; flex: 1 1 140px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: rgba(10, 8, 22, .55); color: var(--text); font: inherit; }
.cl-input:focus { outline: none; border-color: var(--brand-light); box-shadow: var(--ring); }
.cl-inline { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }

.cl-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
    border-radius: 999px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
    color: var(--muted); border: 1px solid var(--line); background: transparent; position: relative;
    transition: color .15s ease, border-color .15s ease, background .15s ease; }
.cl-chip small { font-weight: 600; opacity: .75; }
.cl-chip:hover { color: var(--text); }
.cl-chip.is-on { color: var(--text); border-color: var(--branch, var(--brand-light));
    background: color-mix(in srgb, var(--branch, var(--brand-light)) 16%, transparent); }
.cl-chip i { color: var(--branch, inherit); }

.cl-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 7px;
    font-size: 11px; font-weight: 800; letter-spacing: .02em; border: 1px solid var(--line); color: var(--muted); }
.cl-badge--open { color: #86efac; border-color: color-mix(in srgb, #22c55e 45%, transparent);
    background: color-mix(in srgb, #22c55e 10%, transparent); }
.cl-badge--closed { color: #c4b5fd; border-color: color-mix(in srgb, var(--brand-light) 40%, transparent); }
.cl-badge--gold { color: #fcd34d; border-color: color-mix(in srgb, #d4af37 55%, transparent);
    background: color-mix(in srgb, #d4af37 12%, transparent); }

.cl-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cl-seg__opt { position: relative; cursor: pointer; }
.cl-seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.cl-seg__opt span { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; font-weight: 700;
    font-size: 13.5px; border: 1px solid var(--line); transition: border-color .15s ease, background .15s ease; }
.cl-seg__opt small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.cl-seg__opt input:checked + span { border-color: var(--brand-light);
    background: color-mix(in srgb, var(--brand-light) 14%, transparent); }
.cl-seg__opt input:focus-visible + span { box-shadow: var(--ring); }

.cl-form { display: grid; gap: 12px; margin-top: 12px; }
.cl-form__row { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-form__grow { flex: 1 1 220px; }
.cl-form__tag { flex: 0 1 120px; }
.cl-form__color { flex: 0 0 88px; }
.cl-form input[type="color"] { width: 100%; height: 38px; padding: 3px; border-radius: 10px;
    border: 1px solid var(--line); background: transparent; }
.cl-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; font-size: 12.5px; }

.cl-create { padding: 0; overflow: hidden; }
.cl-create__summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
    cursor: pointer; list-style: none; }
.cl-create__summary::-webkit-details-marker { display: none; }
.cl-create__summary > span:nth-child(2) { display: grid; flex: 1; }
.cl-create__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-light)); }
.cl-create__chev { color: var(--muted); transition: transform .2s ease; }
.cl-create[open] .cl-create__chev { transform: rotate(180deg); }
.cl-create .cl-form { margin: 0; padding: 0 18px 16px; }

.cl-mine { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap;
    border-color: color-mix(in srgb, var(--clan-color) 45%, var(--line)); }
.cl-mine__info { display: grid; flex: 1; min-width: 160px; }

.cl-rows { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
    background: rgba(255, 255, 255, .025); border: 1px solid transparent; flex-wrap: wrap; }
.cl-row:hover { border-color: var(--line); }
.cl-row__main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px; flex-wrap: wrap; }

.cl-list { display: grid; gap: 12px; }
.cl-list__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cl-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.cl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cl-card { position: relative; display: grid; gap: 6px; align-content: start; padding: 14px 16px;
    transition: transform .2s ease, border-color .2s ease; }
.cl-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--clan-color) 60%, var(--line)); }
.cl-card__link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.cl-card__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-card__name { font-size: 15px; }
.cl-card__desc { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.cl-card__foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12.5px; }
.cl-card__foot > .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-card__join { position: relative; z-index: 2; margin: 0; }
.cl-lvl { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
    border-radius: 8px; font-size: 11.5px; font-weight: 900; color: var(--clan-color);
    border: 1px solid color-mix(in srgb, var(--clan-color) 50%, transparent); }
.cl-seats { font-weight: 700; }
.cl-seats.is-full { color: var(--warning); }

/* --- страница клана */
.cl-hero { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 16px;
    align-items: center; padding: 18px 20px; overflow: hidden; }
.cl-hero--banner::before { content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, color-mix(in srgb, var(--clan-color) 34%, transparent),
        transparent 60%); }
.cl-hero > * { position: relative; }
.cl-ring { width: 74px; height: 74px; border-radius: 50%; display: grid; place-content: center;
    text-align: center; line-height: 1;
    background: radial-gradient(closest-side, var(--panel) 78%, transparent 80% 100%),
        conic-gradient(var(--clan-color) calc(var(--pct) * 1%), color-mix(in srgb, var(--line) 80%, transparent) 0); }
.cl-ring__num { font-size: 24px; font-weight: 900; }
.cl-ring__lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.cl-hero__info { min-width: 0; display: grid; gap: 4px; }
.cl-hero__line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-hero__name { margin: 0; font-size: 20px; }
.cl-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.cl-stats i { color: var(--clan-color); margin-right: 3px; }
.cl-toolbar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-hero__desc { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13.5px; }
.cl-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cl-fx, .pt-fx { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.cl-fx li, .pt-fx li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
    border-radius: 8px; font-size: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.cl-fx i, .pt-fx i { color: var(--brand-light); }
.cl-members { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cl-member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.cl-member:hover { background: rgba(255, 255, 255, .03); }
.cl-member__ava { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; }
.cl-member__nick { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cl-member__since { font-size: 11.5px; }
.cl-role { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800;
    padding: 2px 7px; border-radius: 6px; color: var(--muted); border: 1px solid var(--line); }
.cl-role--leader { color: #fcd34d; border-color: color-mix(in srgb, #d4af37 50%, transparent); }
.cl-role--officer { color: #93c5fd; border-color: color-mix(in srgb, #3b82f6 45%, transparent); }

/* --- настройки */
.cl-sethead { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap;
    position: sticky; top: 76px; z-index: 5; }
.cl-sethead__info { display: grid; flex: 1; min-width: 160px; }
.cl-setnav { display: flex; gap: 4px; flex-wrap: wrap; }
.cl-setnav a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
    border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cl-setnav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.cl-panel[id] { scroll-margin-top: 150px; }
.cl-perms { display: flex; gap: 4px; flex-wrap: wrap; }
.cl-toggle { height: 26px; padding: 0 9px; border-radius: 999px; font: inherit; font-size: 11px;
    font-weight: 700; cursor: pointer; color: var(--muted); border: 1px dashed var(--line); background: transparent; }
.cl-toggle.is-on { color: var(--brand-light); border-style: solid; border-color: var(--brand-light);
    background: color-mix(in srgb, var(--brand-light) 12%, transparent); }
.cl-toggle:disabled { opacity: .55; cursor: default; }

/* ================================================================ древо прокачки */
.pt-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.pt-head__info { flex: 1; min-width: 180px; }
.pt-head__title { margin: 0; font-size: 19px; }
.pt-head__info p { margin: 2px 0 0; font-size: 12.5px; }
.pt-orb { position: relative; display: grid; place-content: center; text-align: center;
    width: 72px; height: 72px; border-radius: 50%; line-height: 1;
    background: radial-gradient(circle at 35% 30%, #fde68a, #d4af37 45%, #7c5a10);
    box-shadow: 0 0 26px rgba(212, 175, 55, .45), inset 0 -6px 12px rgba(0, 0, 0, .35);
    animation: pt-orb 3.2s ease-in-out infinite; }
.pt-orb__num { font-size: 26px; font-weight: 900; color: #1c1404; font-variant-numeric: tabular-nums; }
.pt-orb__lbl { font-size: 9.5px; font-weight: 800; color: #3b2a06; text-transform: uppercase; letter-spacing: .08em; }
@keyframes pt-orb { 50% { box-shadow: 0 0 40px rgba(212, 175, 55, .7), inset 0 -6px 12px rgba(0, 0, 0, .35); } }
.pt-next { display: grid; text-align: right; font-size: 13px; }
.pt-next__lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.pt-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--branch);
    box-shadow: 0 0 8px var(--branch); animation: pt-blink 1.6s ease-in-out infinite; }
@keyframes pt-blink { 50% { opacity: .3; } }

.pt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.pt-board { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px; padding: 14px; border-radius: var(--radius-card); overflow-x: auto;
    border: 1px solid var(--line);
    background: radial-gradient(900px 400px at 50% 0%, rgba(139, 92, 246, .10), transparent 70%),
        rgba(12, 10, 26, .72); }
.pt-board.is-single { grid-template-columns: minmax(220px, 420px); justify-content: center; }
.pt-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.pt-link { fill: none; stroke: color-mix(in srgb, var(--line) 90%, transparent); stroke-width: 2;
    stroke-dasharray: 4 6; transition: stroke .3s ease, opacity .3s ease; }
.pt-link.is-ready { stroke: color-mix(in srgb, var(--branch) 70%, transparent);
    animation: pt-flow 1.2s linear infinite; }
.pt-link.is-lit { stroke: var(--branch); stroke-dasharray: none; stroke-width: 2.5;
    filter: drop-shadow(0 0 4px var(--branch)); }
.pt-link.is-dead { opacity: .25; }
.pt-link.is-path { stroke-width: 3.5; opacity: 1; }
@keyframes pt-flow { to { stroke-dashoffset: -20; } }

.pt-branch { position: relative; z-index: 1; display: grid; gap: 22px; align-content: start;
    padding: 10px 6px 14px; border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--branch) 10%, transparent), transparent 35%); }
.pt-branch__head { display: grid; justify-items: center; gap: 3px; text-align: center; }
.pt-branch__head b { font-size: 14px; }
.pt-branch__head small { font-size: 10.5px; line-height: 1.3; min-height: 2.6em; }
.pt-branch__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
    color: #0d0f14; background: var(--branch); box-shadow: 0 0 16px color-mix(in srgb, var(--branch) 60%, transparent); }
.pt-branch__bar { width: 70%; height: 4px; border-radius: 4px; overflow: hidden;
    background: color-mix(in srgb, var(--line) 80%, transparent); }
.pt-branch__bar span { display: block; height: 100%; background: var(--branch); border-radius: inherit;
    transition: width .5s ease; }
.pt-tier { position: relative; display: flex; justify-content: center; gap: 8px; }
.pt-tier__lbl { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); white-space: nowrap;
    font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
    color: color-mix(in srgb, var(--branch) 80%, #fff); }

.pt-node { display: grid; justify-items: center; gap: 5px; width: 100%; max-width: 128px; padding: 4px 2px;
    font: inherit; color: var(--text); background: none; border: 0; border-radius: 12px; cursor: pointer;
    animation: pt-in .45s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.pt-tier--fork .pt-node { max-width: 50%; }
.pt-tier:nth-of-type(2) .pt-node { animation-delay: .05s; }
.pt-tier:nth-of-type(3) .pt-node { animation-delay: .1s; }
.pt-tier:nth-of-type(4) .pt-node { animation-delay: .15s; }
.pt-tier:nth-of-type(5) .pt-node { animation-delay: .2s; }
.pt-tier:nth-of-type(6) .pt-node { animation-delay: .25s; }
@keyframes pt-in { from { opacity: 0; transform: translateY(10px) scale(.9); } }
.pt-node__gem { display: grid; place-items: center; width: 48px; height: 48px; font-size: 18px;
    clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    background: linear-gradient(160deg, #2b2549, #15122a); color: var(--muted);
    transition: transform .18s ease, background .25s ease, color .25s ease, filter .25s ease; }
.pt-node--apex .pt-node__gem { width: 58px; height: 58px; font-size: 22px; }
.pt-node__name { font-size: 11.5px; font-weight: 700; line-height: 1.2; text-align: center; }
.pt-node__cost { font-size: 10.5px; font-weight: 800; color: var(--muted); padding: 1px 7px;
    border-radius: 6px; border: 1px solid var(--line); }
.pt-node--unlocked .pt-node__gem { color: #0d0f14;
    background: linear-gradient(160deg, color-mix(in srgb, var(--branch) 60%, #fff), var(--branch));
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--branch) 70%, transparent)); }
.pt-node--unlocked .pt-node__cost { color: var(--branch); border-color: color-mix(in srgb, var(--branch) 50%, transparent); }
.pt-node--available .pt-node__gem { color: var(--branch);
    background: linear-gradient(160deg, color-mix(in srgb, var(--branch) 28%, #1e1a37), #15122a);
    animation: pt-ready 2s ease-in-out infinite; }
.pt-node--available .pt-node__cost { color: #0d0f14; background: var(--branch); border-color: transparent; }
@keyframes pt-ready { 50% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--branch) 80%, transparent)); } }
.pt-node--poor .pt-node__gem { color: color-mix(in srgb, var(--branch) 70%, var(--muted)); }
.pt-node--locked { opacity: .55; }
.pt-node--blocked { opacity: .35; }
.pt-node--blocked .pt-node__gem { filter: grayscale(1); }
.pt-node:hover .pt-node__gem { transform: scale(1.08); }
.pt-node.is-selected .pt-node__name { color: var(--branch); }
.pt-node.is-selected .pt-node__gem { outline: 0; filter: drop-shadow(0 0 12px var(--branch)); }
.pt-node.is-path { opacity: 1; }
.pt-node.is-new .pt-node__gem { animation: pt-new 1s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes pt-new { 0% { transform: scale(.4) rotate(-60deg); } 70% { transform: scale(1.25); } }

.pt-panel { position: sticky; top: 84px; padding: 16px; display: grid; gap: 10px;
    border-color: color-mix(in srgb, var(--branch, var(--line)) 50%, var(--line)); }
.pt-panel__empty { display: grid; gap: 8px; justify-items: center; text-align: center; color: var(--muted); font-size: 13px; }
.pt-panel__empty > i { font-size: 22px; color: var(--brand-light); }
.pt-panel__empty p { margin: 0; }
.pt-legend { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; text-align: left; font-size: 12px; }
.pt-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.pt-sw--unlocked { background: var(--brand-light); }
.pt-sw--available { border: 2px solid var(--brand-light); }
.pt-sw--poor { background: color-mix(in srgb, var(--brand-light) 35%, transparent); }
.pt-sw--locked { background: var(--line); }
.pt-sw--blocked { background: var(--line); opacity: .4; }
.pt-panel__body { display: grid; gap: 10px; }
.pt-panel [hidden], .cl [hidden] { display: none !important; }
.pt-panel__top { display: flex; align-items: center; gap: 12px; }
.pt-panel__gem { display: grid; place-items: center; flex: 0 0 52px; height: 52px; font-size: 20px;
    color: #0d0f14; background: var(--branch);
    clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.pt-panel__name { margin: 0; font-size: 17px; }
.pt-panel__desc { margin: 0; font-size: 14px; }
.pt-panel__state { margin: 0; font-size: 12.5px; color: var(--muted); }
.pt-panel[data-status="available"] .pt-panel__state { color: var(--branch); }
.pt-panel form { margin: 0; }
.pt-panel__buy { width: 100%; height: 40px;
    background: linear-gradient(135deg, var(--branch), color-mix(in srgb, var(--branch) 55%, #fff)); color: #0d0f14; }
.pt-panel__buy:hover { color: #0d0f14; background: linear-gradient(135deg, var(--branch), color-mix(in srgb, var(--branch) 55%, #fff)); }

@media (prefers-reduced-motion: reduce) {
    .pt-orb, .pt-dot, .pt-node, .pt-node__gem, .pt-link.is-ready { animation: none !important; }
}
@media (max-width: 1100px) {
    .pt-layout { grid-template-columns: 1fr; }
    .pt-panel { position: static; }
}
@media (max-width: 860px) {
    .cl-split { grid-template-columns: 1fr; }
    .cl-hero { grid-template-columns: auto 1fr; }
    .cl-toolbar { grid-column: 1 / -1; justify-content: flex-start; }
    .cl-sethead { position: static; }
}
@media (max-width: 520px) {
    .cl-seg { grid-template-columns: 1fr; }
}

/* Косметика ветви «Слава» в каталоге и на странице клана */
.clan-card { position: relative; }
.clan-card__legend { position: absolute; top: 10px; right: 10px; font-size: 10px;
    font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #d4af37;
    padding: 3px 8px; border-radius: 8px;
    border: 1px solid color-mix(in srgb, #d4af37 55%, transparent);
    background: color-mix(in srgb, #d4af37 12%, transparent); }
.clan-card--showcase { border-color: color-mix(in srgb, #d4af37 60%, transparent) !important;
    box-shadow: 0 0 18px color-mix(in srgb, #d4af37 16%, transparent); }
.clan-card--aura { animation: clan-aura 3s ease-in-out infinite; }
@keyframes clan-aura {
    0%, 100% { box-shadow: 0 0 10px color-mix(in srgb, var(--clan-color) 18%, transparent); }
    50% { box-shadow: 0 0 26px color-mix(in srgb, var(--clan-color) 42%, transparent); } }

@media (prefers-reduced-motion: reduce) {
    .clan-card--aura { animation: none; }
}

/* Поселение и задания клана: панели в духе остальных cl-блоков */
.cl-settle { display: grid; gap: 8px; }
.cl-settle__state { display: inline-flex; align-items: center; gap: 7px; width: fit-content;
    font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    padding: 5px 11px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    color: var(--muted); background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.cl-settle--on .cl-settle__state,
.cl-settle__state--wait { color: var(--brand-light);
    border-color: color-mix(in srgb, var(--brand) 50%, transparent);
    background: color-mix(in srgb, var(--brand) 12%, transparent); }
.cl-settle--on .cl-settle__state { color: #4ade80;
    border-color: color-mix(in srgb, #4ade80 50%, transparent);
    background: color-mix(in srgb, #4ade80 10%, transparent); }
.cl-settle__hint { color: #4ade80; }
.cl-settle code { padding: 1px 6px; border-radius: 6px; font-size: 12px;
    background: color-mix(in srgb, var(--panel-2) 85%, transparent);
    border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.cl-settle-list { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.cl-settle-list > .cl-settle { padding: 10px 12px; border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.cl-settle--frozen .cl-settle__state { color: #93c5fd;
    border-color: color-mix(in srgb, #60a5fa 50%, transparent);
    background: color-mix(in srgb, #60a5fa 12%, transparent); }
.cl-settle--frozen .cl-settle__hint { color: #93c5fd; }
.cl-txlist { display: grid; gap: 4px; margin: 8px 0 0; padding: 10px 12px 0 0; list-style: none;
    border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); }
.cl-rank { flex-shrink: 0; font-size: 12px; font-weight: 900; letter-spacing: .03em;
    padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); }
.cl-rank--1 { color: #fcd34d; border-color: color-mix(in srgb, #d4af37 55%, transparent);
    background: color-mix(in srgb, #d4af37 14%, transparent); }
.cl-rank--2 { color: #e2e8f0; border-color: color-mix(in srgb, #cbd5e1 45%, transparent);
    background: color-mix(in srgb, #cbd5e1 10%, transparent); }
.cl-rank--3 { color: #fdba74; border-color: color-mix(in srgb, #d97706 50%, transparent);
    background: color-mix(in srgb, #d97706 12%, transparent); }

.cl-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px; margin: 0; padding: 0; list-style: none; }
.cl-task { padding: 10px 12px; border-radius: 12px; display: grid; gap: 6px;
    border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.cl-task__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-task__head b { font-size: 13.5px; }
.cl-task__head p { margin: 0; }
.cl-task p { margin: 0; }
.cl-task__reward { flex-shrink: 0; font-size: 12px; font-weight: 800; color: #fbbf24; }
.cl-task__foot { display: flex; align-items: center; gap: 10px; }
.cl-task__bar { flex: 1; height: 6px; border-radius: 999px; overflow: hidden;
    background: color-mix(in srgb, var(--line) 60%, transparent); }
.cl-task__fill { display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--brand-light));
    transition: width .5s ease; }
.cl-task__count { flex-shrink: 0; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cl-task--done { border-color: color-mix(in srgb, #4ade80 40%, transparent); }
.cl-task--done .cl-task__count { color: #4ade80; }
.cl-task--done .cl-task__fill { background: #4ade80; }
.cl-tasks__note { margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
    .cl-task__fill { transition: none; }
}
