/* --- Страница «Правила сервера» --- */
.rules-wrap { display: grid; gap: 16px; }

/* фоновая ambient-анимация: мягкие размытые градиентные «шары», почти незаметны */
.rules-ambient, .ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

/* Парящие ники игроков на «Обзоре» сообщества: только верифицированные
   персонажи, шрифт пиксельный - как игровой ник. Появляются и тают
   мягко: параметры (--fd длительность, --fdel задержка, --fdrift снос)
   задаёт вьюха случайно на каждый запрос. */
.comm-floaters { position: absolute; inset: 0; }
.comm-float {
    position: absolute; transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', 'Courier New', monospace;
    color: rgba(190, 220, 255, .5);
    text-shadow: 0 0 14px rgba(140, 190, 255, .35), 0 2px 6px rgba(0, 0, 0, .45);
    white-space: nowrap; user-select: none;
    opacity: 0;
    animation: comm-float var(--fd, 18s) ease-in-out var(--fdel, 0s) infinite;
    will-change: transform, opacity;
}
@keyframes comm-float {
    0%   { opacity: 0; transform: translate(-50%, -50%) translateY(16px); }
    14%  { opacity: .85; }
    50%  { opacity: .6; transform: translate(calc(-50% + var(--fdrift, 0px)), -50%) translateY(-12px); }
    86%  { opacity: .8; }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(-30px); }
}
@media (prefers-reduced-motion: reduce) {
    .comm-float { animation: none; opacity: .35; }
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; will-change: transform; }
.orb--violet { width: 48vw; height: 48vw; top: -12%; left: -8%;
    background: radial-gradient(circle at 35% 35%, rgba(108, 92, 246, .50), rgba(108, 92, 246, 0) 70%);
    animation: orb-drift-a 28s ease-in-out infinite; }
.orb--ice { width: 42vw; height: 42vw; bottom: -14%; right: -10%;
    background: radial-gradient(circle at 60% 40%, rgba(88, 150, 220, .45), rgba(88, 150, 220, 0) 70%);
    animation: orb-drift-b 34s ease-in-out infinite; }
.orb--brand { width: 36vw; height: 36vw; top: 34%; right: 22%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, .40), rgba(139, 92, 246, 0) 70%);
    animation: orb-drift-c 40s ease-in-out infinite; }
@keyframes orb-drift-a { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(7vw, 5vh); } }
@keyframes orb-drift-b { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6vw, -5vh); } }
@keyframes orb-drift-c { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-5vw, 6vh); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }
.rules-block { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.rules-block > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 19px; }
.rules-block > h2 i { color: var(--brand-light); font-size: 17px; }
.rules-block p { margin: 10px 0; }
/* подраздел внутри блока правил (7.1 и 7.2 одного раздела): кегль между h2 и
   обычным текстом, чтобы он читался как часть раздела, а не как новый раздел;
   якорь под шапкой - тот же приём, что у `.rules-block[id]` */
.rules-sub { display: flex; align-items: center; gap: 8px; margin: 20px 0 8px; font-size: 16px; }
.rules-sub[id] { scroll-margin-top: 84px; }
.rules-h4 { margin: 14px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--brand-soft); }
.rules-lead { border-left: 3px solid var(--brand-light); }
.rules-lead p { margin: 0; }
.rules-note { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* акцентный блок «Кратко» */
.rules-brief { background: linear-gradient(120deg, rgba(139, 92, 246, .12), var(--panel) 60%);
    border-color: rgba(139, 92, 246, .32); }

/* списки с галочками */
.brief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brief-list li { position: relative; padding-left: 28px; }
.brief-list li::before { content: '\2713'; position: absolute; left: 0; top: -1px; color: var(--accent); font-weight: 700; }

/* глоссарий - карточки понятий */
.glossary { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0; }
.glossary__item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.glossary dt { font-weight: 700; color: var(--brand-light); margin: 0 0 3px; }
.glossary dd { margin: 0; color: var(--muted); font-size: 14px; }

/* раскладка: боковое оглавление + блоки правил */
.rules-layout { display: grid; grid-template-columns: 232px 1fr; gap: 24px; align-items: start; }
.rules-side { position: sticky; top: 78px; background: var(--panel); border: 1px solid var(--line);
    border-radius: 16px; padding: 16px 14px; }
.rules-side__title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0 4px;
    font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text); }
.rules-side__title i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    font-size: 15px; color: var(--brand-light); background: rgba(139, 92, 246, .14); border: 1px solid rgba(139, 92, 246, .3); }
.rules-nav { display: grid; gap: 2px; }
.rules-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    font-size: 14px; color: var(--text); border-left: 2px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease; }
.rules-nav a i { width: 16px; text-align: center; color: var(--muted); transition: color .15s ease; }
.rules-nav a:hover { background: var(--panel-2); color: var(--brand-light); border-left-color: var(--brand-light); }
.rules-nav a:hover i { color: var(--brand-light); }
/* якоря разделов не прячутся под sticky-шапкой */
.rules-block[id] { scroll-margin-top: 84px; }
@media (max-width: 900px) {
    .rules-layout { grid-template-columns: 1fr; }
    .rules-side { position: static; }
    .rules-nav { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* пункт правила: номер + текст слева, шкала наказания справа */
.rule { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rules-block .rule:first-of-type { border-top: 0; }
.rule__no { flex: none; width: 36px; font-weight: 700; color: var(--brand-light); font-variant-numeric: tabular-nums; }
.rule__body { flex: 1; min-width: 0; }
.rule__body a { color: var(--brand-light); text-decoration: underline; }

/* шкала наказания - мягкие, не едкие цвета */
.penalty { display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
    color: #d9b98a; background: rgba(224, 163, 60, .10); border: 1px solid rgba(224, 163, 60, .28);
    padding: 2px 10px; border-radius: 999px; vertical-align: baseline; }
.penalty--ban { color: #e7a8a4; background: rgba(217, 83, 79, .10); border-color: rgba(217, 83, 79, .30); }
.penalty--perm { color: #f0c9d0; background: rgba(180, 35, 24, .16); border-color: rgba(180, 35, 24, .40); }

/* запрещённые моды - чипы */
.mod-chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mod-chips li { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--panel-2);
    border: 1px solid var(--line); color: #e7a8a4; }
/* белый список тем же рисунком чипа, но спокойным цветом: два списка одного
   правила различаются глазами сразу, без чтения подписей над ними */
.mod-chips--ok li { color: #a9dcae; border-color: rgba(99, 176, 74, .34); }

@media (max-width: 560px) {
    .rule { flex-wrap: wrap; }
    /* колонку номера НЕ освобождаем по ширине содержимого: с width:auto текст
       пункта «1.1» начинается на 8 px левее, чем у «10.1», и на мобильной
       ширине ровно та же коса, которую правки отступов и лечат. 36 px хватает
       самому длинному номеру на странице (<code>10.4</code>) */
    .penalty { margin-left: 0; }
}

/* ================= РЕЖИМНЫЙ ГЕЙМПЛЕЙ (community/help) ================= */
.gp { margin-bottom: 28px; }
.gp-head h2 { margin: 0 0 8px; font-size: 24px; }
.gp-head p { margin: 0; color: var(--muted); max-width: 780px; line-height: 1.6; }
.gp-h3 { font-size: 16px; line-height: 1.3; margin: 26px 0 12px; display: flex; align-items: center; gap: 9px; }
.gp-h3 > i { color: var(--brand-light); }
.gp-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.55; }

/* --- круговорот: цепочка узлов со стрелками --- */
/* единый вертикальный ритм раздела: содержательные блоки отделены на 14px
   (соседние маргины схлопываются, поэтому двойных щелей не получается) */
.gp-loop { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 14px 0; }
.gp-node { flex: 1 1 150px; min-width: 138px; background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px 12px; text-align: center; display: flex; flex-direction: column;
    align-items: center; gap: 5px; transition: transform .15s, border-color .15s; }
.gp-node:hover { transform: translateY(-3px); border-color: var(--brand-light); }
.gp-node i { font-size: 24px; color: var(--brand-light); }
.gp-node b { font-size: 14px; }
.gp-node span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.gp-node--cold > i { color: #6fb3ff; } .gp-node--fire > i { color: #ff8a5b; }
.gp-node--zone > i { color: #ffb454; } .gp-node--gear > i { color: var(--brand-light); }
.gp-link { align-self: center; color: var(--muted); font-size: 16px; }
.gp-loopback { flex-basis: 100%; text-align: center; margin-top: 6px; color: var(--muted); font-size: 13px; }
.gp-loopback i { color: var(--accent); }

/* --- уровни генератора --- */
.gp-ladder { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.gp-step { flex: 1 1 130px; background: linear-gradient(180deg, rgba(139,92,246,.14), rgba(139,92,246,0));
    border: 1px solid var(--line); border-left: 3px solid var(--brand-light); border-radius: 10px; padding: 10px 12px; }
.gp-step b { display: block; font-size: 13px; margin-bottom: 2px; } .gp-step span { font-size: 12px; color: var(--muted); }

/* --- карточки подсистем --- */
.gp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin: 14px 0; }
.gp-card { --acc: 139,92,246; position: relative; z-index: 0;
    background:
        linear-gradient(90deg, rgba(var(--acc), .95), rgba(var(--acc), 0)) top / 100% 3px no-repeat,
        radial-gradient(130px 130px at 100% 0, rgba(var(--acc), .30), transparent 70%) no-repeat,
        linear-gradient(180deg, rgba(var(--acc), .10), var(--panel) 62%);
    border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px 20px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.gp-card:hover { transform: translateY(-4px); z-index: 5; border-color: rgba(var(--acc), .5);
    box-shadow: 0 18px 36px -20px rgba(var(--acc), .75); }
/* стек: выноска-подсказка (.gp .hint) живёт внутри контекста карточки, а
   панель подвала поднята до 45 ради плавающей плашки «ранняя версия» - иначе
   подсказка на последней карточке уходила бы под подвал */
.gp-card:hover, .gp-card:focus-within { z-index: 46; }
.gp-card h4 { margin: 0 0 12px; font-size: 14px; line-height: 1.3; display: flex; align-items: center; gap: 11px; }
.gp-card h4 i { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px;
    font-size: 15px; color: rgb(var(--acc)); background: rgba(var(--acc), .14);
    border: 1px solid rgba(var(--acc), .4); box-shadow: 0 6px 16px -10px rgba(var(--acc), .9); }
.gp-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.gp-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 13px; line-height: 1.55; }
.gp-card ul:not(.gp-dep) > li { position: relative; padding-left: 22px; }
.gp-card ul:not(.gp-dep) > li::before { content: ''; position: absolute; left: 3px; top: .5em; width: 8px; height: 8px;
    border-radius: 2px; background: rgb(var(--acc)); transform: rotate(45deg); box-shadow: 0 0 9px rgba(var(--acc), .8); }
.gp-dep { display: grid; gap: 10px; }
.gp-dep li { display: flex; align-items: baseline; gap: 9px; font-size: 13px; }
.gp-dep li span:first-child { font-weight: 700; color: rgb(var(--acc)); flex: 0 0 auto; }
.gp-dep li i { color: var(--muted); font-size: 11px; }
.gp-dep li span:last-child { color: var(--muted); }
/* акцентный цвет каждой подсистемы */
.gp-card--fire  { --acc: 255,138,91; }
.gp-card--ice   { --acc: 111,179,255; }
.gp-card--wind  { --acc: 125,211,252; }
.gp-card--chest { --acc: 230,185,95; }
.gp-card--dep   { --acc: 99,176,74; }
.gp-cta { margin-top: 22px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line);
    border-left: 3px solid var(--accent); border-radius: 12px; font-size: 14px; }

/* --- круглая подсказка «?» с тултипом на наведении/фокусе --- */
.gp .hint { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 2px;
    border-radius: 50%; background: var(--panel-2); border: 1px solid var(--brand-light); color: var(--brand-light);
    font-size: 11px; font-weight: 800; line-height: 1; cursor: help; vertical-align: middle; text-transform: none;
    letter-spacing: 0; font-style: normal; }
.gp .hint:hover, .gp .hint:focus-visible { background: var(--brand-light); color: #fff; outline: none; }
.gp .hint::after { content: attr(data-tip); position: absolute; top: calc(100% + 10px); left: 50%;
    transform: translateX(-50%) translateY(-4px); width: max-content; max-width: 250px; padding: 9px 12px;
    border-radius: 10px; background: #0a0818; color: var(--text); border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(0,0,0,.55); font-size: 12px; font-weight: 500; line-height: 1.45;
    white-space: normal; text-align: left; opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s; z-index: 40; }
.gp .hint::before { content: ''; position: absolute; top: calc(100% + 5px); left: 50%; width: 9px; height: 9px;
    transform: translateX(-50%) rotate(45deg); background: #0a0818; border-left: 1px solid var(--line);
    border-top: 1px solid var(--line); opacity: 0; transition: opacity .16s; z-index: 40; }
.gp .hint:hover::after, .gp .hint:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.gp .hint:hover::before, .gp .hint:focus-visible::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .gp-node:hover { transform: none; } .gp .hint::after { transition: none; } }

/* --- SVG-схемы (термальная модель и теплотрасса): круговорот стал интерактивным --- */
.gp-diagram { margin: 14px 0 22px; }
.gp-diagram svg { width: 100%; height: auto; max-width: 780px; margin: 0 auto; display: block; overflow: visible; }
.gp-diagram text { fill: var(--text); font: 700 15px/1 system-ui, "Segoe UI", Roboto, sans-serif; }
.gp-diagram .gp-edge { fill: none; stroke: #8b5cf6; stroke-width: 2.6; stroke-linecap: round;
    stroke-dasharray: 10 10; opacity: .85; animation: gp-dash 1.15s linear infinite; }
.gp-diagram .gp-edges path:nth-child(2) { animation-delay: -.18s; }
.gp-diagram .gp-edges path:nth-child(3) { animation-delay: -.36s; }
@keyframes gp-dash { to { stroke-dashoffset: -40; } }
/* пламя генератора статичное: дёрганое пламя на схеме, которую читают ради цифр, мешает */
.gp-diagram .gp-particle { transform-box: fill-box; animation: gp-float 6s ease-in-out infinite; }
.gp-diagram .gp-particle--b { animation-duration: 7.5s; animation-delay: -2.5s; }
.gp-diagram .gp-particle--c { animation-duration: 5.2s; animation-delay: -1.2s; }
.gp-diagram .gp-particle--d { animation-duration: 8s; animation-delay: -3.4s; }
@keyframes gp-float { 0%,100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-16px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .gp-diagram .gp-edge, .gp-diagram .gp-particle { animation: none; }
}

/* --- интерактивный круговорот: кольцо звеньев + карточка выбранного --- */
.cyc { --c: 139,92,246; display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
    gap: 26px; align-items: center; margin: 16px 0 22px; }
.cyc__ring { position: relative; aspect-ratio: 1 / 1; }
.cyc__spokes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cyc-spoke { stroke: rgba(255,255,255,.10); stroke-width: .8; stroke-linecap: round;
    transition: stroke .25s ease, stroke-width .25s ease; }
.cyc-spoke.is-active { stroke: rgb(var(--c)); stroke-width: 1.1;
    stroke-dasharray: 4 4; animation: cyc-flow 1.1s linear infinite; }
@keyframes cyc-flow { to { stroke-dashoffset: -16; } }   /* бегут к ядру: уголь возвращается в топку */

.cyc__core { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 33%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
    gap: 1px; color: #2a0d05; text-align: center;
    background: radial-gradient(circle at 50% 36%, #ffe6b0, #ff8a5b 46%, #b8341f 100%); }
.cyc__core i { font-size: clamp(20px, 4.4vw, 30px); }
.cyc__core b { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.cyc__core-glow { position: absolute; inset: -24%; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,138,91,.34), transparent 66%);
    animation: cyc-breathe 4.4s ease-in-out infinite; }
.cyc__core-orbit { position: absolute; inset: -13%; border-radius: 50%;
    border: 1px dashed rgba(255,180,84,.34); animation: cyc-spin 44s linear infinite; }
@keyframes cyc-breathe { 0%,100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes cyc-spin { to { transform: rotate(360deg); } }

.cyc-node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%);
    display: grid; justify-items: center; gap: 5px; width: 96px; padding: 11px 6px; border-radius: 16px;
    border: 1px solid var(--line); background: rgba(21,18,42,.92); color: var(--muted); font: inherit;
    cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease,
    box-shadow .2s ease, transform .18s ease; }
.cyc-node i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 15px;
    color: rgb(var(--c)); background: rgba(var(--c), .15); border: 1px solid rgba(var(--c), .42);
    transition: box-shadow .2s ease, transform .2s ease; }
.cyc-node span { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.cyc-node--frost { --c: 111,179,255; } .cyc-node--player { --c: 167,139,250; }
.cyc-node--zone { --c: 255,180,84; } .cyc-node--factories { --c: 99,176,74; }
.cyc-node--coal { --c: 230,169,79; }
.cyc-node:hover { color: var(--text); border-color: rgba(var(--c), .6);
    transform: translate(-50%,-50%) scale(1.06); }
.cyc-node:focus-visible { outline: 2px solid rgb(var(--c)); outline-offset: 3px; }
.cyc-node[aria-selected="true"] { color: #fff; border-color: rgba(var(--c), .85);
    background: linear-gradient(180deg, rgba(var(--c), .22), rgba(21,18,42,.96));
    box-shadow: 0 12px 32px -16px rgba(var(--c), .95); }
.cyc-node[aria-selected="true"] i { box-shadow: 0 0 0 4px rgba(var(--c), .18); animation: cyc-halo 2.8s ease-in-out infinite; }
@keyframes cyc-halo { 0%,100% { box-shadow: 0 0 0 3px rgba(var(--c), .14); }
    50% { box-shadow: 0 0 0 7px rgba(var(--c), .22); } }

.cyc__side { min-width: 0; }
.cyc__timer { display: block; height: 2px; margin-bottom: 10px; border-radius: 2px;
    background: linear-gradient(90deg, rgb(var(--c)), rgba(var(--c), 0)); width: 0; opacity: .8; }
.cyc.is-auto .cyc__timer { animation: cyc-timer 5.4s linear forwards; }
@keyframes cyc-timer { from { width: 0; } to { width: 100%; } }
.cyc__panel { background: var(--panel); border: 1px solid var(--line);
    border-left: 3px solid rgb(var(--c)); border-radius: 16px; padding: 18px 20px; }
.cyc-card[hidden] { display: none; }
.cyc-card { animation: cyc-in .28s ease; }
@keyframes cyc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cyc-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cyc-card header h4 { margin: 0; font-size: 16px; line-height: 1.3; color: rgb(var(--c)); }
.cyc-card header p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.cyc-card__icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px;
    font-size: 16px; color: rgb(var(--c)); background: rgba(var(--c), .14); border: 1px solid rgba(var(--c), .4); }
.cyc-facts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.cyc-facts li { display: grid; grid-template-columns: minmax(96px, 128px) minmax(0, 1fr); gap: 10px;
    align-items: baseline; padding: 8px 11px; border-radius: 10px; background: var(--panel-2);
    border-left: 2px solid rgba(var(--c), .55); }
.cyc-facts b { font-size: 14px; color: rgb(var(--c)); font-variant-numeric: tabular-nums; }
.cyc-facts b span { font-size: 11px; color: var(--muted); margin-left: 1px; }
.cyc-facts li span { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cyc-card > p:not(.cyc-facts) { margin: 0 0 14px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.cyc-card__link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
    border: 1px solid rgba(var(--c), .45); color: rgb(var(--c)); font-size: 13px; font-weight: 700;
    transition: gap .18s ease, background .18s ease; }
.cyc-card__link:hover { gap: 12px; background: rgba(var(--c), .12); }
.cyc__hint { display: flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
.cyc__hint i { color: rgba(var(--c), .9); }

@media (max-width: 900px) {
    .cyc { grid-template-columns: 1fr; gap: 18px; align-items: start; }
    .cyc__ring { max-width: 400px; margin: 0 auto; }
}
/* на узком экране кольцо превращаем в ряд: пять кружков на 340px сливаются в кашу */
@media (max-width: 560px) {
    .cyc__ring { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        gap: 8px; aspect-ratio: auto; max-width: none; }
    .cyc__spokes, .cyc__core { display: none; }
    .cyc-node, .cyc-node:hover { position: static; width: auto; transform: none; }
    .cyc-node:hover { transform: translateY(-2px); }
    .cyc-facts li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .cyc-spoke.is-active, .cyc__core-glow, .cyc__core-orbit, .cyc-card, .cyc.is-auto .cyc__timer,
    .cyc-node[aria-selected="true"] i { animation: none; }
    .cyc__timer { opacity: .3; }
}

/* --- термальная модель холода (вторая SVG-схема) --- */
.gp-thermal .gp-edge { stroke: #8b5cf6; stroke: url(#gp2Edge); }
.gp-thermal .gp-edges path:nth-child(2) { animation-delay: -.3s; }
.gp-thermal .gp-edges path:nth-child(3) { animation-delay: -.6s; }
.gp-thermal .gp-chip { transform-box: fill-box; transform-origin: center; transition: transform .18s ease; cursor: default; }
.gp-thermal .gp-chip:hover { transform: scale(1.045); }
.gp-thermal .gp-chip text { fill: var(--text); font: 600 13px/1 system-ui, "Segoe UI", Roboto, sans-serif; }
.gp-thermal .gp-stage-title { fill: var(--muted); font: 700 12px/1 system-ui, "Segoe UI", sans-serif; letter-spacing: .5px; }
.gp-thermal .gp-big { fill: #fff; font: 800 26px/1 system-ui, "Segoe UI", sans-serif; }
.gp-thermal .gp-tick { fill: var(--muted); font: 600 11px/1 system-ui, "Segoe UI", sans-serif; }
.gp-thermal .gp-needle { transform-box: view-box; transform-origin: 330px 210px; animation: gp-needle 4.6s ease-in-out infinite; }
@keyframes gp-needle { 0%,100% { transform: rotate(-52deg); } 50% { transform: rotate(-40deg); } }
.gp-thermal .gp-level { transform-box: view-box; animation: gp-level 7.5s ease-in-out infinite; }
@keyframes gp-level { 0%,12% { transform: translateY(0); } 55%,67% { transform: translateY(150px); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .gp-thermal .gp-needle, .gp-thermal .gp-level { animation: none; }
    .gp-thermal .gp-chip:hover { transform: none; }
}

/* --- теплотрасса (третья SVG-схема) --- */
.gp-track .gp-stage-title { fill: var(--muted); font: 700 12px/1 system-ui, "Segoe UI", sans-serif; letter-spacing: .5px; }
.gp-track .gp-cap { fill: var(--text); font: 700 13px/1 system-ui, "Segoe UI", Roboto, sans-serif; }
.gp-track .gp-cap--cold { fill: #9cc4ff; font-size: 12px; }
.gp-track .gp-cap--mute { fill: #b8b2cc; font-weight: 600; font-size: 12px; }
.gp-track .gp-cap--big { fill: #ffb454; font-size: 12px; letter-spacing: .4px; }
.gp-track .gp-chip { transform-box: fill-box; transform-origin: center; transition: transform .18s ease; cursor: default; }
.gp-track .gp-chip:hover { transform: scale(1.045); }
.gp-track .gp-chip text { fill: var(--text); font: 600 13px/1 system-ui, "Segoe UI", Roboto, sans-serif; }
.gp-track .gp-edge { stroke: #e6a94f; stroke: url(#gp3Edge); }
.gp-track .gp-pipes rect { stroke: rgba(0,0,0,.28); stroke-width: .8; }
.gp-track .gp-dead rect { stroke: #8fa3a8; stroke-width: 1; stroke-dasharray: 4 3; }
/* бегущий жар по трубе: штрихи, а не фильтры - на анимации blur стоит дорого */
.gp-track .gp-flow { stroke-dasharray: 9 11; opacity: .9; animation: gp-dash 1.3s linear infinite; }
.gp-track .gp-corridor { transform-box: fill-box; transform-origin: center; animation: gp-breathe 5.4s ease-in-out infinite; }
@keyframes gp-breathe { 0%,100% { opacity: .66; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .gp-track .gp-flow, .gp-track .gp-corridor { animation: none; }
    .gp-track .gp-chip:hover { transform: none; }
}

/* Узкие экраны: SVG-схемы не сжимаем в нечитаемую кашу, а даём им горизонтальный скролл */
@media (max-width: 860px) {
    .gp-diagram { overflow-x: auto; overscroll-behavior-x: contain; }
    .gp-diagram svg { min-width: 690px; max-width: none; }
    .gp-loop { flex-direction: column; }
    .gp-loop .gp-link { transform: rotate(90deg); }
    .gp-toc { position: static; }
}

/* Подсказка не должна уезжать за край окна */
.gp .hint::after { max-width: min(250px, calc(100vw - 28px)); }
@media (max-width: 600px) {
    /* на телефоне подсказка - «тост» внизу экрана: её нельзя столкнуть за край, */
    /* потому что кружок «?» стоит в конце длинной строки */
    .gp .hint::after { position: fixed; top: auto; bottom: 18px; left: 50%; transform: translateX(-50%);
        max-width: calc(100vw - 32px); width: auto; }
    .gp .hint::before { display: none; }
}

/* Числовые плашки делим на ширину схемы, чтобы секция читалась одной колонной */
.gp-facts { max-width: 782px; margin-left: auto; margin-right: auto; }

/* --- фабрики: секция с вкладками --- */
.fac { margin: 14px 0 26px; }
.fac-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.fac-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.fac-tab:hover { color: var(--text); border-color: var(--brand-light); }
.fac-tab.is-active { background: linear-gradient(135deg, var(--brand), #5a2fe0); color: #fff; border-color: transparent;
    box-shadow: 0 8px 20px -12px var(--brand-light); }
.fac-panel { display: none; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c, var(--brand-light));
    border-radius: 16px; padding: 18px 20px; }
.fac-panel.is-active { display: block; animation: fac-fade .28s ease; }
@keyframes fac-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fac-panel__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fac-panel__icon { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 15px;
    font-size: 23px; color: var(--c, var(--brand-light)); background: var(--panel-2); border: 1px solid var(--c, var(--line));
    box-shadow: 0 8px 20px -12px var(--c, var(--brand-light)); }
.fac-panel__head h4 { margin: 0 0 3px; font-size: 14px; line-height: 1.3; }
.fac-panel__head p { margin: 0; font-size: 13px; line-height: 1.55; }
.fac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.fac-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.fac-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.fac-stat b { font-size: 18px; color: var(--c, var(--text)); }
.fac-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.fac-block { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fac-block h5 { margin: 0 0 9px; font-size: 13px; line-height: 1.3; display: flex; gap: 8px; align-items: center; color: var(--text); }
.fac-block h5 i { color: var(--c, var(--brand-light)); }
.fac-out, .fac-cost { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fac-out li, .fac-cost li { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 11px;
    border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.fac-out li i { color: var(--c, var(--brand-light)); }
.fac-craft { background: linear-gradient(135deg, rgba(139,92,246,.07), transparent);
    border: 1px solid var(--line); border-left: 3px solid var(--c, var(--brand-light)); border-radius: 12px; padding: 12px 14px; }
.fac-craft h5 { margin: 0 0 9px; font-size: 13px; line-height: 1.3; display: flex; gap: 8px; align-items: center; }
.fac-craft h5 i { color: var(--c, var(--brand-light)); }
.fac-craft p { margin: 0; }
.fac-craft__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fac-craft__time { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.fac-craft__time i { color: var(--c, var(--brand-light)); }
@media (prefers-reduced-motion: reduce) { .fac-panel.is-active { animation: none; } }

/* --- улучшения фабрик --- */
.fac-ups { margin: 14px 0; }
.fac-ups > h5 { margin: 0 0 10px; font-size: 13px; line-height: 1.3; display: flex; align-items: center; gap: 8px; color: var(--text); }
.fac-ups > h5 i { color: var(--c, var(--brand-light)); }
.fac-ups__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.fac-up { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; display: flex; flex-direction: column; gap: 7px; }
.fac-up__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fac-up__top b { font-size: 14px; }
.fac-up__lvl { flex: none; font-size: 11px; font-weight: 700; color: var(--c, var(--brand-light)); background: var(--panel); border: 1px solid var(--c, var(--brand-light)); border-radius: 999px; padding: 2px 9px; }
.fac-up__eff { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.fac-up__meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.fac-up__meta i { color: var(--c, var(--brand-light)); margin-right: 5px; }
.fac-up__cost { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.fac-up__cost li { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.fac-up__tag { font-size: 11px; color: #e0a33c; }
.fac-up__tag--req { color: #8fbdf0; }
.fac-common__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 14px 0; }
.fac-ccard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.fac-ccard h4 { margin: 0 0 8px; font-size: 14px; line-height: 1.3; display: flex; align-items: center; gap: 9px; }
.fac-ccard h4 i { color: var(--brand-light); }
.fac-ccard p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }

/* --- редизайн геймплея: TOC, номера разделов, аккордеоны --- */
html { scroll-behavior: smooth; }
.gp-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px -8px 10px; padding: 7px 8px;
    /* прилипаем под шапкой: подсветка активного раздела нужна там, где читаешь, а не на входе */
    position: sticky; top: 78px; z-index: 6; background: rgba(12,10,26,.95);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 30px -24px #000; }
.gp-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 600;
    transition: color .15s ease, border-color .15s ease; }
.gp-toc a:hover { color: var(--text); border-color: var(--brand-light); }
/* раздел, до которого доскроллили */
.gp-toc a.is-active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), #5a2fe0);
    box-shadow: 0 8px 20px -12px var(--brand-light); }
.gp-toc a.is-active .gp-toc__no { background: rgba(255,255,255,.24); }
/* Значок есть у каждого пункта (раздел он повторяет иконку заголовка), но на
   странице показывается только номер: два знака в одном месте спорят между собой. */
.gp-toc__ico { display: none; }
/* таблетка, а не кружок: в ней и «3.1», и «6.1» умещаются без переноса */
.gp-toc__no { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; flex: none;
    border-radius: 999px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800;
    font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.gp-h3 { scroll-margin-top: 148px; }
.gp-h3 .gp-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-light)); color: #fff; font-size: 14px; font-weight: 800; margin-right: 2px; }
/* Лесенка кеглей держится явной: h3 16 > h4 15 > заголовок карточки 14 > h5 13,
   иначе подраздел выглядел бы равным разделу (было: 16 и 17 внутри раздела) */
.gp-h4 { margin: 24px 0 10px; font-size: 15px; line-height: 1.3; display: flex; align-items: center; gap: 9px;
    scroll-margin-top: 148px; }
.gp-h4 i { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
    font-size: 12px; color: var(--brand-light); background: rgba(139,92,246,.14);
    border: 1px solid rgba(139,92,246,.42); }
.gp-lead { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 12px; max-width: 80ch; }
/* вступ, после которого сразу таблица или сетка: обычный отступ слишком велик */
.gp-lead--tight { margin-bottom: 8px; }
.gp-tips { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
/* Иконка абсолютно, а текст течёт строкой. display:flex ломался на любой подсказке
   со <b> или <a>: флекс делает элементом каждый фрагмент текста и каждый inline-тег,
   из-за чего «машинист» уезжал в свою колонку посреди фразы. */
.gp-tips li { position: relative; font-size: 14px; background: var(--panel);
    border: 1px solid var(--line); border-left: 3px solid var(--brand-light); border-radius: 10px;
    padding: 10px 14px 10px 40px; }
.gp-tips li > i:first-child { position: absolute; left: 14px; top: 10px; width: 18px; text-align: center;
    line-height: 1.55; }
.gp-tips li i { color: var(--brand-light); }
/* Без overflow: hidden: иначе всплывающие подсказки «?» внутри аккордеона
   обрезались по краю блока. Скругление держим на summary - у тела фона нет. */
.gp-acc { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin: 12px 0; }
.gp-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; font-size: 14px; font-weight: 700; color: var(--text); user-select: none;
    border-radius: 11px 11px 0 0; }
.gp-acc > summary::-webkit-details-marker { display: none; }
.gp-acc > summary > i:first-child { color: var(--brand-light); }
.gp-acc__chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.gp-acc[open] > summary .gp-acc__chev { transform: rotate(180deg); }
.gp-acc > summary:hover { background: rgba(139,92,246,.06); }
.gp-acc__body { padding: 2px 16px 16px; border-top: 1px solid var(--line); }
.gp-acc__body > :first-child { margin-top: 12px; }
.gp-tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gp-tiers li { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 10px;
    background: var(--panel-2); border-left: 3px solid var(--c, var(--brand-light)); }
.gp-tiers b { font-size: 14px; color: var(--c, var(--text)); }
.gp-tiers span { font-size: 13px; color: var(--muted); }
.gp-cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.gp-h5 { margin: 0 0 8px; font-size: 13px; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.gp-h5--cold i { color: #6fb3ff; } .gp-h5--warm i { color: #ff8a5b; }
.gp-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.gp-list li::marker { color: var(--brand-light); }
.gp-list b { color: var(--text); }
.gp-tablewrap { overflow-x: auto; margin: 14px 0; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 460px; }
.gp-table th, .gp-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.gp-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.gp-table tbody tr:hover { background: rgba(139,92,246,.06); }

