@import url('https://fonts.googleapis.com/css2?family=Cormorant+SC:wght@600;700&display=swap');
/* ========== БАЗА ==========
   Палитра и токены синхронизированы с web-next (tailwind.config.ts):
   ink — чернильные фоны, gold — фирменное золото, Cinzel — display-шрифт. */

:root {
    --ink-900: #070b14;
    --ink-800: #0a0e1a;
    --ink-700: #0d1424;
    --ink-600: #131c30;
    --ink-500: #1b2740;

    --gold-100: #fff6dc;
    --gold-200: #ffecb2;
    --gold-300: #f5d486;
    --gold-400: #e8be5a;
    --gold-500: #d4af37;
    --gold-600: #a8851f;

    --arcane-400: #6cd8ff;
    --arcane-500: #4cc9f0;

    --text-main: #e2e8f0;   /* slate-200 */
    --text-soft: #cbd5e1;   /* slate-300 */
    --text-dim: #94a3b8;    /* slate-400 */
    --text-faint: #64748b;  /* slate-500 */

    --border-soft: rgba(255, 255, 255, 0.1);
    --border-faint: rgba(255, 255, 255, 0.06);
    --gold-border: rgba(212, 175, 55, 0.35);

    --font-display: 'Cinzel', 'Cormorant SC', Georgia, serif; /* у Cinzel нет кириллицы — её глифы берутся из Cormorant SC */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --gold-grad: linear-gradient(180deg, #ffecb2 0%, #d4af37 100%);
    --shadow-panel:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.06),
        0 28px 64px -32px rgba(3, 7, 18, 0.92),
        0 8px 22px -12px rgba(3, 7, 18, 0.7);
    --shadow-gold: 0 0 30px rgba(212, 175, 55, 0.25);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-sans);
    color: var(--text-main);
}

body {
    line-height: 1.5;
    /* Фон ТОЛЬКО на body (не на html): тогда он уходит на canvas и рисуется
       первым, а .wiki-backdrop с z-index:-1 остаётся видимым поверх него. */
    background: var(--ink-800);
}

a {
    color: var(--gold-300);
    text-decoration: none;
}

a:hover {
    color: var(--gold-200);
    text-decoration: underline;
}

::selection {
    background: rgba(212, 175, 55, 0.3);
    color: var(--gold-100);
}

/* ========== ФОН САЙТА ==========
   Как на web-next: side-bg (ландшафт лёд/огонь) на всех страницах,
   hero-bg (ангел/демон) — на главной. Поверх арта — тёмная вуаль
   + радиальное затемнение центра под колонку контента. */

.wiki-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 72% 80% at 50% 42%, rgba(7, 11, 20, 0.45), transparent 76%),
        linear-gradient(rgba(7, 11, 20, 0.65), rgba(7, 11, 20, 0.65)),
        url('/assets/img/side-bg.webp');
    background-size: cover;
    background-position: center;
}

.wiki--home .wiki-backdrop {
    background-image:
        radial-gradient(ellipse 72% 80% at 50% 42%, rgba(7, 11, 20, 0.45), transparent 76%),
        linear-gradient(rgba(7, 11, 20, 0.55), rgba(7, 11, 20, 0.55)),
        url('/assets/img/hero-bg.webp');
}

/* ========== ЛЕЙАУТ ========== */

.wiki-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------- HEADER --------- */

.wiki-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    height: 64px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(7, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.wiki-header__left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

/* Логотип: герб + золотой вордмарк + бейдж WIKI */
.wiki-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.wiki-logo:hover {
    text-decoration: none;
    transform: scale(1.03);
}

.wiki-logo__img {
    display: block;
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.4));
}

.wiki-logo__wordmark {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.16em;
    white-space: nowrap;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.wiki-logo__badge {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--gold-border);
    background: rgba(212, 175, 55, 0.08);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--gold-300);
}

/* RIGHT */

.wiki-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiki-search {
    position: relative;
}

.wiki-search input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    padding: 7px 34px 7px 12px;
    color: var(--text-main);
    min-width: 220px;
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wiki-search input[type="text"]:focus {
    border-color: var(--gold-border);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.wiki-search input[type="text"]::placeholder {
    color: rgba(148, 163, 184, 0.8);
}

.wiki-search::after {
    content: "⌕";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: rgba(148, 163, 184, 0.95);
}

/* LANG SWITCH */

.wiki-lang-switch {
    display: inline-flex;
    padding: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-soft);
}

.wiki-lang {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
}

.wiki-lang:hover {
    color: var(--gold-200);
    text-decoration: none;
}

.wiki-lang.active {
    background: var(--gold-grad);
    color: var(--ink-900);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

/* --------- MAIN LAYOUT --------- */

.wiki-main {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: calc(100vh - 64px);
}

/* фон сайдбара — плотная тёмная подложка с блюром: арт-фон под ним
   пёстрый, на лёгкой прозрачности меню теряется */
.wiki-sidebar {
    padding: 18px 14px 24px;
    background: rgba(7, 11, 20, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-faint);
}

/* карточка категории */
.wiki-category {
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(13, 20, 36, 0.78);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.wiki-category:hover {
    border-color: var(--gold-border);
}

.wiki-category[open] {
    border-color: var(--gold-border);
    background: rgba(13, 20, 36, 0.92);
}

.wiki-category__summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    user-select: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
}

.wiki-category__summary::-webkit-details-marker {
    display: none;
}

.wiki-category__summary:hover {
    background: rgba(212, 175, 55, 0.07);
}

/* иконка */
.wiki-category__icon {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--ink-600);
    border: 1px solid var(--gold-border);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.wiki-category__icon::before {
    content: "★";
}

.wiki-category__icon--for-beginners::before {
    content: "🎓";
}

.wiki-category__icon--classes::before {
    content: "⚔️";
}

.wiki-category__icon--events::before {
    content: "📅";
}

.wiki-category__icon--game-basics::before {
    content: "📘";
}

.wiki-category__icon--services::before {
    content: "🛠️";
}

.wiki-category__icon--items-options::before {
    content: "💎";
}

.wiki-category__icon--wings::before {
    content: "🪽";
}

.wiki-category__icon--pets::before {
    content: "🐾";
}

.wiki-category__icon--custom-crafts::before {
    content: "⚗️";
}

.wiki-category__icon--other::before {
    content: "⋯";
}

/* иконка задана в menu.json — эмодзи уже внутри span */
.wiki-category__icon--custom::before {
    content: none;
}

/* текст и стрелка */
.wiki-category__title {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-category__chevron {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(245, 212, 134, 0.7);
    border-bottom: 2px solid rgba(245, 212, 134, 0.7);
    transform: rotate(45deg);
    transition: transform 0.18s ease-out;
    opacity: 0.9;
}

.wiki-category[open] .wiki-category__chevron {
    transform: rotate(225deg);
}

/* список страниц */
.wiki-pages {
    margin: 0;
    padding: 4px 0 8px;
    list-style: none;
}

.wiki-page-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 24px;
    font-size: 13px;
    color: var(--text-soft);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, background 0.15s ease;
}

/* Иконка статьи (emoji из menu.json) — фиксированная колонка, чтобы названия выравнивались */
.wiki-page-link__icon {
    flex: 0 0 18px;
    width: 18px;
    text-align: center;
    font-size: 13px;
    line-height: 1;
    filter: saturate(0.85);
    opacity: 0.9;
}

.wiki-page-link__text {
    min-width: 0;
}

.wiki-page-link:hover {
    background: rgba(212, 175, 55, 0.08);
    color: var(--gold-100);
    text-decoration: none;
}

.wiki-page-link.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.04));
    border-left-color: var(--gold-400);
    color: var(--gold-200);
    font-weight: 600;
}

/* CONTENT */

.wiki-content {
    flex: 1;
    padding: 22px 28px 40px;
    /* фон даёт .wiki-backdrop — контент прозрачный */
    overflow-y: auto;
}

.wiki-article {
    margin: 0 auto;
    padding: 24px 28px 26px;
    border-radius: 16px;
    background: rgba(13, 20, 36, 0.86);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-panel);
}

.wiki-article__title {
    margin: 0 0 14px;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.wiki-article__body p {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--text-main);
}

.wiki-article__body h1,
.wiki-article__body h2,
.wiki-article__body h3,
.wiki-article__body h4 {
    font-family: var(--font-display);
    color: var(--gold-200);
    letter-spacing: 0.02em;
}

.wiki-article__body img {
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    display: block;
    margin: 12px auto;
}

/* Мелочи */

.wiki-category__empty {
    height: 6px;
}

/* tables */
/* Таблицы внутри wiki-страниц */
.wiki-article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 13px;
    background: var(--ink-800);
    color: var(--text-main);
    border-radius: 14px;
    overflow: hidden;
    /* чтобы закругление работало */
    box-shadow:
        0 0 0 1px var(--border-soft),
        0 18px 40px rgba(3, 7, 18, 0.6);
}

/* Заголовок таблицы (Reset table Madness x5000) */
.wiki-article__body table caption {
    caption-side: top;
    padding: 10px 14px;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: none;
    color: var(--ink-900);
    background: var(--gold-grad);
}

/* Шапка */
.wiki-article__body table thead th {
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gold-300);
    background: var(--ink-600);
    border-bottom: 1px solid var(--gold-border);
}

/* Ячейки */
.wiki-article__body table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-faint);
}

/* Зебра-строки */
.wiki-article__body table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.wiki-article__body table tbody tr:nth-child(even) {
    background: transparent;
}

/* Ховер по строке */
.wiki-article__body table tbody tr:hover {
    background: rgba(212, 175, 55, 0.08);
}

/* Числа выровнять по центру/правому краю – опционально */
.wiki-article__body table td:nth-child(1),
.wiki-article__body table td:nth-child(n+2) {
    text-align: center;
}

.wiki-article__body .table-scroll {
    overflow-x: auto;
}

.wiki-article__body .table-scroll table {
    min-width: 600px;
    /* чтобы не ломалось узко */
}

/* table end */

/* Search */
/* ============= SEARCH ============= */

.wiki-search-results {
    max-width: 1100px;
    margin: 0 auto;
}

.wiki-search-title {
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.wiki-search-query {
    margin-left: 6px;
    font-weight: 600;
    color: var(--gold-200);
}

.wiki-search-count {
    margin-left: 8px;
    font-size: 13px;
    color: var(--text-faint);
}

.wiki-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wiki-search-item {
    background: var(--ink-700);
    border-radius: 14px;
    padding: 10px 14px 12px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-panel);
}

.wiki-search-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}

.wiki-search-category {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--gold-border);
    color: var(--gold-300);
    white-space: nowrap;
}

.wiki-search-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}

.wiki-search-link:hover {
    color: var(--gold-200);
}

.wiki-search-snippet {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-soft);
}

.wiki-search-highlight {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-100);
    padding: 0 2px;
    border-radius: 2px;
}

.wiki-search-empty {
    font-size: 14px;
    color: var(--text-soft);
}

/* Search END */

/* Mobile Menu Toggle */
.wiki-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
}

.wiki-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--gold-400);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* АДАПТИВ */

@media (max-width: 900px) {
    .wiki-menu-toggle {
        display: flex;
    }

    .wiki-main {
        display: flex;
        flex-direction: column;
    }

    .wiki-sidebar {
        width: 100%;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
        display: none;
        /* Hidden by default */
    }

    /* Show sidebar when menu is open */
    .mobile-menu-open .wiki-sidebar {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    .wiki-content {
        padding: 15px;
    }

    .wiki-article {
        padding: 15px;
    }

    /* Mobile Header Optimizations */
    .wiki-header {
        padding: 0 12px;
        gap: 8px;
    }

    .wiki-logo__wordmark,
    .wiki-logo__badge {
        display: none;
        /* На мобильном остаётся только герб */
    }

    .wiki-header__right {
        gap: 8px;
        flex: 1;
        justify-content: flex-end;
    }

    .wiki-search {
        flex: 1;
        max-width: 160px;
        /* Limit max width */
        min-width: 0;
    }

    .wiki-search input[type="text"] {
        width: 100%;
        min-width: 0;
        /* Allow shrinking */
        padding: 6px 30px 6px 10px;
        font-size: 12px;
    }

    .wiki-search::after {
        right: 8px;
    }

    .wiki-lang-switch {
        flex-shrink: 0;
        /* Don't shrink lang switch */
    }

    .wiki-lang {
        padding: 4px 8px;
        font-size: 10px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== ANCIENT SETS ========== */

.ancient-sets-intro {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(212, 175, 55, 0.06);
    border-left: 4px solid var(--gold-500);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
}

.ancient-grade-title {
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gold-border);
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ancient-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ancient-set-card {
    background: var(--ink-700);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ancient-set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(3, 7, 18, 0.6);
    border-color: var(--gold-border);
}

.ancient-set-header {
    padding: 15px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.12), transparent);
    border-bottom: 1px solid var(--border-faint);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ancient-set-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--gold-300);
    margin: 0;
}

.ancient-set-body {
    padding: 15px;
    flex: 1;
    font-size: 13px;
    color: var(--text-soft);
}

.ancient-section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 12px 0 6px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.ancient-section-title:first-child {
    margin-top: 0;
}

.ancient-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ancient-options-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.ancient-options-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--gold-500);
}

.ancient-parts {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-faint);
    font-size: 12px;
    color: var(--text-dim);
}

.ancient-parts strong {
    color: var(--text-main);
}

/* Images Layout */
.ancient-set-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ancient-set-info {
    flex: 1;
}

.ancient-set-images {
    flex: 0 0 120px;
    /* Fixed width for images column */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    align-content: start;
}

.ancient-set-images img {
    width: 75%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-soft);
    background: rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ancient-set-images img:hover {
    transform: scale(1.1);
    border-color: var(--gold-400);
    z-index: 1;
    position: relative;
}

@media (max-width: 600px) {
    .ancient-set-body {
        flex-direction: column;
    }

    .ancient-set-images {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 15px;
        border-top: 1px solid var(--border-faint);
        padding-top: 15px;
    }

    .ancient-set-images img {
        width: 50px;
        height: 50px;
    }
}

/* Services Images */
.services-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.services-images img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-soft);
}

/* ========= BREADCRUMBS ========= */
.wiki-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 12px;
}

.wiki-breadcrumbs__link {
    color: var(--gold-400);
    text-decoration: none;
    transition: color 0.15s ease;
}

.wiki-breadcrumbs__link:hover {
    color: var(--gold-200);
    text-decoration: underline;
}

.wiki-breadcrumbs__separator {
    color: var(--text-faint);
    user-select: none;
}

.wiki-breadcrumbs__current {
    color: var(--text-dim);
    pointer-events: none;
}

/* ========== SKIP TO CONTENT ========== */
.wiki-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 999;
    padding: 8px 16px;
    background: var(--gold-500);
    color: var(--ink-900);
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}

.wiki-skip-link:focus {
    top: 0;
}

/* ========== ARTICLE DATE ========== */
.wiki-article__date {
    font-size: 12px;
    color: var(--text-faint);
    margin-bottom: 14px;
}

/* ========== TABLE OF CONTENTS ========== */
.wiki-toc {
    margin: 0 0 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}

.wiki-toc__title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-300);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wiki-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-toc__list li {
    margin-bottom: 4px;
}

.wiki-toc__list li a {
    font-size: 13px;
    color: var(--text-soft);
    text-decoration: none;
    transition: color 0.15s;
}

.wiki-toc__list li a:hover {
    color: var(--gold-200);
    text-decoration: underline;
}

.wiki-toc__sub {
    padding-left: 18px;
}

/* ========== RELATED ARTICLES ========== */
.wiki-related {
    margin-top: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}

.wiki-related__title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--gold-300);
    margin: 0 0 12px;
}

.wiki-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wiki-related__list li a {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--gold-300);
    background: rgba(212, 175, 55, 0.07);
    border: 1px solid var(--gold-border);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s;
}

.wiki-related__list li a:hover {
    background: rgba(212, 175, 55, 0.16);
    color: var(--gold-100);
    border-color: var(--gold-400);
}

/* ========== PREV / NEXT NAVIGATION ========== */
.wiki-prevnext {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.wiki-prevnext__link {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.wiki-prevnext__link:hover {
    background: rgba(212, 175, 55, 0.07);
    border-color: var(--gold-border);
    text-decoration: none;
}

.wiki-prevnext__next {
    text-align: right;
}

.wiki-prevnext__label {
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.wiki-prevnext__title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gold-300);
}

/* ========== BACK TO TOP ========== */
.wiki-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--gold-border);
    background: rgba(13, 20, 36, 0.92);
    color: var(--gold-400);
    font-size: 22px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.wiki-back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.wiki-back-to-top:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold-400);
    transform: translateY(-2px);
}

/* ========== LIVE SEARCH DROPDOWN ========== */
.wiki-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(13, 20, 36, 0.98);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
    z-index: 200;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

.wiki-search-dropdown.open {
    display: block;
}

.wiki-search-dropdown__item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-faint);
    transition: background 0.15s;
}

.wiki-search-dropdown__item:last-child {
    border-bottom: none;
}

.wiki-search-dropdown__item:hover {
    background: rgba(212, 175, 55, 0.1);
    text-decoration: none;
}

.wiki-search-dropdown__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.wiki-search-dropdown__cat {
    font-size: 11px;
    color: var(--text-faint);
}

/* ========== COPY BUTTON FOR COMMANDS ========== */
.command-code-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.command-copy-btn {
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 11px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-border);
    border-radius: 4px;
    color: var(--gold-300);
    cursor: pointer;
    transition: all 0.2s;
}

.command-copy-btn:hover {
    background: rgba(212, 175, 55, 0.25);
}

.command-copy-btn.copied {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}

/* ========== PREV/NEXT MOBILE ========== */
@media (max-width: 600px) {
    .wiki-prevnext {
        grid-template-columns: 1fr;
    }

    .wiki-prevnext__next {
        text-align: left;
    }

    .wiki-back-to-top {
        bottom: 16px;
        right: 16px;
    }
}

/* ========== ЧИТАЕМОСТЬ (вычитка 2026-09-28) ========== */

/* Сайдбар остаётся на экране при прокрутке длинных статей; подложка колонки — через фон .wiki-main */
@media (min-width: 901px) {
    .wiki-main {
        background: linear-gradient(90deg, rgba(7, 11, 20, 0.82) 300px, transparent 300px);
    }
    .wiki-sidebar {
        position: sticky;
        top: 64px;
        align-self: start;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
    }
}

/* Статья не растягивается на всю ширину 2K/4K-мониторов */
.wiki-article {
    max-width: 1280px;
}

/* Основной текст: крупнее, с воздухом, строка не длиннее ~85 знаков */
.wiki-article__body p,
.wiki-article__body li {
    font-size: 15px;
    line-height: 1.65;
}
.wiki-article__body > p,
.wiki-article__body > ul,
.wiki-article__body > ol {
    max-width: 85ch;
}
.wiki-article__body ul,
.wiki-article__body ol {
    padding-left: 1.4em;
    margin: 0 0 12px;
}
.wiki-article__body li + li {
    margin-top: 3px;
}
.wiki-article__body h2 {
    margin: 28px 0 10px;
    font-size: 22px;
}
.wiki-article__body h3 {
    margin: 20px 0 8px;
    font-size: 18px;
}
.wiki-article__body h2:first-child,
.wiki-article__body h3:first-child {
    margin-top: 0;
}
/* якоря из оглавления не прячутся под липкой шапкой */
.wiki-article__body [id] {
    scroll-margin-top: 80px;
}
.wiki-article__body th {
    padding: 8px 10px;
}

/* Оглавление: длинное раскладывается в колонки и не съедает экран */
.wiki-toc__list {
    columns: 3 220px;
    column-gap: 28px;
}
.wiki-toc__list li {
    break-inside: avoid;
}
/* очень длинное оглавление (Ancient Sets, 77 пунктов) — плотнее, в 4 колонки */
.wiki-toc__list:has(> li:nth-child(30)) {
    columns: 4 180px;
}
.wiki-toc__list:has(> li:nth-child(30)) li a {
    font-size: 12px;
}

/* Длинные таблицы: своя прокрутка и закреплённая шапка */
.wiki-article__body .table-scroll {
    max-height: 80vh;
    overflow: auto;
    border-radius: 14px;
    margin: 18px 0;
}
.wiki-article__body .table-scroll table {
    overflow: visible;
    margin: 0;
}
.wiki-article__body .table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

@media (max-width: 600px) {
    .wiki-article__body p,
    .wiki-article__body li {
        font-size: 15px;
    }
    .wiki-article__body h2 { font-size: 19px; }
    .wiki-article__body h3 { font-size: 16px; }
    .wiki-toc__list { columns: 1; }
}

/* ===== Встроенное видео (YouTube-ссылка → плеер, см. app.js) ===== */
.wiki-video {
    position: relative;
    max-width: 760px;
    margin: 20px 0 24px;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: var(--ink-900);
    border: 1px solid var(--gold-border);
    box-shadow: var(--shadow-panel), 0 0 0 1px rgba(0, 0, 0, 0.4);
    transition: border-color .25s ease, box-shadow .25s ease;
}
/* На карточных страницах ивентов (заголовок по центру) — плеер тоже по центру */
.events-container > .wiki-video { margin: 0 auto 28px; }

.wiki-video:hover { border-color: rgba(212, 175, 55, 0.6); box-shadow: var(--shadow-panel), var(--shadow-gold); }
.wiki-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.wiki-video__facade {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    padding: 0; margin: 0; border: 0;
    background: none; cursor: pointer;
    color: inherit; font: inherit; text-align: left;
}
.wiki-video__facade:focus-visible { outline: 2px solid var(--gold-400); outline-offset: -4px; }

.wiki-article__body .wiki-video__thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    max-width: none; margin: 0;
    object-fit: cover;
    border: 0; border-radius: 0;
    transform: scale(1.01);
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s ease;
    filter: saturate(.9) brightness(.85);
}
.wiki-video__facade:hover .wiki-video__thumb { transform: scale(1.045); filter: saturate(1) brightness(.95); }

.wiki-video__shade {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 40%, rgba(7, 11, 20, 0.55) 100%),
        linear-gradient(to top, rgba(7, 11, 20, 0.92) 0%, rgba(7, 11, 20, 0.25) 38%, transparent 60%);
}

.wiki-video__play {
    position: absolute; left: 50%; top: 50%;
    width: 76px; height: 76px;
    margin: -38px 0 0 -38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--gold-grad);
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.18), 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 40px rgba(212, 175, 55, 0.35);
    transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s ease;
}
.wiki-video__play::before {
    content: ''; position: absolute; inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 236, 178, 0.45);
    animation: wikiVideoPulse 2.4s ease-out infinite;
}
.wiki-video__play svg { width: 30px; height: 30px; margin-left: 4px; fill: var(--ink-900); }
.wiki-video__facade:hover .wiki-video__play { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.22), 0 12px 34px rgba(0, 0, 0, 0.6), 0 0 60px rgba(212, 175, 55, 0.5); }
.wiki-video__facade:active .wiki-video__play { transform: scale(0.97); }

@keyframes wikiVideoPulse {
    0% { transform: scale(1); opacity: .8; }
    100% { transform: scale(1.45); opacity: 0; }
}

.wiki-video__label {
    position: absolute; left: 14px; bottom: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--gold-200);
    background: rgba(7, 11, 20, 0.72);
    border: 1px solid var(--gold-border);
    backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
    .wiki-video { margin: 14px 0 18px; border-radius: 10px; }
    .wiki-video__play { width: 58px; height: 58px; margin: -29px 0 0 -29px; }
    .wiki-video__play svg { width: 24px; height: 24px; }
    .wiki-video__label { left: 10px; bottom: 10px; font-size: 10px; padding: 4px 9px; }
}
@media (prefers-reduced-motion: reduce) {
    .wiki-video__play::before { animation: none; }
    .wiki-video__thumb, .wiki-video__play { transition: none; }
}
