/* Руководство «Цитадели» — стили (UTF-8) */

:root {
    --bg-deep: #0e0c16;
    --bg-mid: #1a1628;
    --bg-panel: rgba(36, 32, 52, 0.95);
    --bg-card: linear-gradient(165deg, #3d3658 0%, #2a2540 100%);
    --border: rgba(180, 160, 220, 0.2);
    --border-bright: rgba(220, 200, 255, 0.35);
    --text: #ebe6f5;
    --text-muted: #a89ec4;
    --accent: #8b6fd4;
    --accent-bright: #b49aff;
    --gold: #e8c547;
    --gold-dim: rgba(232, 197, 71, 0.15);
    --success: #3ecf8e;
    --felt: #1e5c32;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --radius: 14px;
    --nav-width: 260px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(139, 111, 212, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30, 92, 50, 0.12), transparent),
        var(--bg-deep);
    min-height: 100vh;
}

a {
    color: var(--accent-bright);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Шапка --- */

.guide-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(18, 16, 28, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.guide-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-header-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, var(--accent-bright) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.guide-header-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.guide-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.guide-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-bright);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.guide-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.guide-btn--primary {
    background: linear-gradient(180deg, #9b7ee8 0%, #6b52b8 100%);
    border-color: transparent;
}

/* --- Макет --- */

.guide-layout {
    display: grid;
    grid-template-columns: var(--nav-width) 1fr;
    max-width: 1280px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.guide-nav {
    position: sticky;
    top: 60px;
    align-self: start;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 24px 16px 40px 20px;
    border-right: 1px solid var(--border);
}

.guide-nav-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 12px 4px;
}

.guide-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-nav li {
    margin-bottom: 2px;
}

.guide-nav a {
    display: block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.guide-nav a:hover,
.guide-nav a.active {
    background: rgba(139, 111, 212, 0.2);
    color: var(--text);
    text-decoration: none;
}

.guide-main {
    padding: 32px 40px 80px;
    max-width: 820px;
}

/* --- Секции --- */

.guide-section {
    margin-bottom: 56px;
    scroll-margin-top: 72px;
}

.guide-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gold-dim);
}

.guide-section h3 {
    font-size: 1.15rem;
    margin: 28px 0 12px;
    color: var(--accent-bright);
}

.guide-section p {
    margin: 0 0 14px;
}

.guide-section ul,
.guide-section ol {
    margin: 0 0 16px;
    padding-left: 1.4em;
}

.guide-section li {
    margin-bottom: 6px;
}

.guide-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 20px !important;
}

/* --- Карточки и блоки --- */

.guide-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.guide-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--gold);
}

.guide-card span.rank {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
    background: var(--gold-dim);
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 6px;
}

.guide-tip {
    background: rgba(52, 152, 219, 0.12);
    border-left: 4px solid #3498db;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 14px 18px;
    margin: 20px 0;
    font-size: 0.95rem;
}

.guide-tip strong {
    color: #7ec8f0;
}

.guide-callout {
    background: var(--gold-dim);
    border: 1px solid rgba(232, 197, 71, 0.35);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 20px 0;
}

/* --- Таблицы --- */

.guide-table-wrap {
    overflow-x: auto;
    margin: 16px 0 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

table.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.guide-table th,
.guide-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.guide-table th {
    background: rgba(139, 111, 212, 0.15);
    color: var(--accent-bright);
    font-weight: 600;
    white-space: nowrap;
}

.guide-table tr:last-child td {
    border-bottom: none;
}

.guide-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-yellow { background: rgba(232, 197, 71, 0.25); color: #f0d878; }
.badge-blue { background: rgba(100, 149, 237, 0.25); color: #8ab4ff; }
.badge-green { background: rgba(62, 207, 142, 0.2); color: #6eeaa8; }
.badge-red { background: rgba(224, 90, 106, 0.25); color: #f08898; }
.badge-purple { background: rgba(155, 126, 232, 0.3); color: #c4a8ff; }

/* --- Иллюстрации --- */

.guide-figure {
    margin: 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-mid);
    box-shadow: var(--shadow);
}

.guide-figure img {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
}

.guide-figure img[data-missing="1"] {
    display: none;
}

.guide-figure-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(139, 111, 212, 0.06),
            rgba(139, 111, 212, 0.06) 10px,
            transparent 10px,
            transparent 20px
        );
}

.guide-figure-placeholder.visible {
    display: flex;
}

.guide-figure-placeholder .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.guide-figure-placeholder code {
    font-size: 0.8rem;
    margin-top: 8px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    color: var(--accent-bright);
}

.guide-figure figcaption {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

/* --- Чек-лист --- */

.guide-checklist {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.guide-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.guide-checklist li::before {
    content: '☐';
    color: var(--accent-bright);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* --- FAQ --- */

.guide-faq-intro {
    margin-bottom: 24px;
    padding: 16px 18px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    font-size: 0.95rem;
}

.guide-faq-category {
    margin-top: 32px;
}

.guide-faq-category h3 {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--gold);
}

.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-faq-item details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.guide-faq-item summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.guide-faq-item summary::-webkit-details-marker {
    display: none;
}

.guide-faq-item summary::before {
    content: '▸';
    color: var(--accent-bright);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.guide-faq-item details[open] summary::before {
    transform: rotate(90deg);
}

.guide-faq-item .guide-faq-answer {
    padding: 0 16px 14px 36px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.guide-faq-item .guide-faq-source {
    margin-top: 8px;
    font-size: 0.82rem;
    opacity: 0.85;
}

.guide-faq-item .guide-faq-source a {
    color: var(--accent-bright);
}

/* --- Футер --- */

.guide-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* --- Адаптив --- */

@media (max-width: 900px) {
    .guide-layout {
        grid-template-columns: 1fr;
    }

    .guide-nav {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px 20px;
    }

    .guide-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .guide-nav li {
        margin: 0;
    }

    .guide-main {
        padding: 24px 20px 60px;
    }

    .guide-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media print {
    .guide-nav,
    .guide-header-actions {
        display: none;
    }

    .guide-layout {
        display: block;
    }

    body {
        background: white;
        color: black;
    }
}
