
/* ========== СТИЛЬ СТРАНИЦЫ НОВОСТЕЙ PRIME (ФЭНТЕЗИ) ========== */
html, body {
    overflow-x: hidden; /* на всякий случай запрещаем горизонтальный скролл */
    max-width: 100%;
}

.news-page {
    --news-bg: rgba(26, 17, 12, 0.92);
    --news-gold: #d4af37;
    --news-gold-light: #f5e6b3;
    --news-red: #a84444;
    --news-brown: #5a3e2b;
    --news-light: #f0e6d2;
    --news-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --news-border: 1.5px solid #8b5a2b;
    --news-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
    background: transparent;
}

.news-page .content {
    background: var(--news-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px 32px 32px 32px;
    box-shadow: var(--news-shadow), var(--news-inner-glow);
    border: var(--news-border);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    max-width: 100%;
    overflow-x: hidden; /* если какой-то внутренний элемент вылезает */
    padding: 30px 25px; /* уменьшаем боковые отступы на маленьких экранах */
}

.news-page .content:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.4), inset 0 0 30px rgba(212,175,55,0.12);
}

.news-page .content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212,175,55,0.02) 2px, rgba(212,175,55,0.02) 4px),
        radial-gradient(circle at 20% 30%, rgba(210,180,140,0.05) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(139,69,19,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

.news-page .page-title {
    background: linear-gradient(145deg, rgba(44,30,21,0.9), rgba(26,17,12,0.9)) !important;
    padding: 15px 25px !important;
    margin: 0 0 25px 0 !important;
    border: 2px solid #a0522d;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,215,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.news-page .page-title h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
}

/* Вкладки категорий */
.news-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid #6b4f2a;
    box-shadow: inset 0 1px 4px #000;
}

.news-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    color: #fff8e7;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    background: linear-gradient(145deg, #a0522d, #8b4513, #a0522d);
    border: none;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    min-height: 44px;
}

.news-tab.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c !important;
    font-weight: 700;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    pointer-events: none;
}

/* Карточка новости (используем существующие классы с переопределением) */
.news-card {
    background: rgba(91, 69, 50, 0.7);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #b07d44;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 10px 25px #000, 0 0 0 1px #d4af37 inset;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.8), 0 0 0 2px #d4af37 inset;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed rgba(212,175,55,0.3);
    border-radius: 11px;
    pointer-events: none;
    z-index: 0;
}

.news-card .news_info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.news-card .news_ava {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #d4af37;
    box-shadow: 0 0 15px rgba(212,175,55,0.5);
    overflow: hidden;
    background: #2b1e0e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card .news_ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card .news_cont_text {
    flex: 1;
}

.news-card .news-Title {
    margin-bottom: 10px;
}

.news-card .news-Title .news_type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(212,175,55,0.2);
    border: 1px solid #d4af37;
    color: #ffd966;
    margin-right: 10px;
}

.news-card .news-Title b {
    font-size: 22px;
    color: #fff8e7;
    text-shadow: 1px 1px 2px #000;
    font-weight: 700;
    text-transform: uppercase;
}

.news-card .news-Title .color-green {
    color: #d4af37;
    font-size: 14px;
    font-style: italic;
    margin-left: 10px;
}

.news-card .rank-lvl {
    color: #f5e6d3;
    font-size: 16px;
    line-height: 1.6;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #b07d44;
}

.news-card .rank-lvl p {
    margin-bottom: 10px;
}

.news-card .rank-lvl a {
    color: #ffd966;
    text-decoration: none;
    border-bottom: 1px dotted #d4af37;
}

.news-card .rank-lvl a:hover {
    color: #fff;
    border-bottom: 1px solid #ffd700;
    text-shadow: 0 0 8px gold;
}

/* Детальная новость */
.news-detail .news-card {
    margin-bottom: 0;
}

/* Пагинация */
.pagination {
    list-style: none; /* убираем стандартные маркеры ul */
    padding-left: 0;  /* убираем внутренний отступ, который добавляют некоторые браузеры */
    margin: 40px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.3);
    border-radius: 50px;
    border: 1px solid #6b4f2a;
    padding: 15px;
}

.pagination li {
    list-style: none; /* дополнительно для старых браузеров */
}

.pagination .number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #8b5a2b;
    color: #fff8e7;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    text-decoration: none;
}

.pagination .number:hover:not(.active) {
    background: #b8860b;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 5px 0 #3f2e22, 0 8px 15px #000, 0 0 15px gold;
}

.pagination .number.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    cursor: default;
}

.pagination .pag-arrow {
    background: #3f2e22;
    border: 2px solid #8b5a2b;
    color: #fff8e7;
    font-size: 18px;
    line-height: 40px;
    text-align: center;
}

.pagination .pag-arrow:hover {
    background: #b8860b;
    border-color: #ffd700;
}

/* Пустое состояние */
.no-data-message {
    font-size: 28px;
    color: #c0b09a;
    text-align: center;
    padding: 70px 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    border: 2px dashed #b8860b;
    box-shadow: inset 0 0 30px #000;
}

/* Адаптивность */
@media (max-width: 768px) {
    .news-page .content {
        padding: 20px;
    }
    .news-page .page-title h1 {
        font-size: 32px;
    }
    .news-card .news_info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .news-card .news_ava {
        margin-bottom: 15px;
    }
    .news-card .news-Title b {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .news-tabs {
        flex-direction: column;
    }
    .news-tab {
        width: 100%;
    }
}

/* Улучшенная пагинация со стрелками и disabled-состоянием */
.pagination .prev,
.pagination .next {
    background: none; /* отключаем фоновые картинки, если они были */
    font-size: 0; /* скрываем возможный текст */
    position: relative;
}

.pagination .prev::before {
    content: "←";
    font-size: 20px;
    color: #fff8e7;
    line-height: 40px;
}

.pagination .next::before {
    content: "→";
    font-size: 20px;
    color: #fff8e7;
    line-height: 40px;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
    filter: grayscale(1);
}

/* Если вы всё же хотите оставить фоновые изображения, раскомментируйте и замените пути
.pagination .prev {
    background: url(../images/prev-arrow.png) center no-repeat;
}
.pagination .next {
    background: url(../images/next-arrow.png) center no-repeat;
}
.pagination .prev::before,
.pagination .next::before {
    display: none;
}
*/
/* Адаптивные корректировки */
@media (max-width: 768px) {
    .news-page .content {
        padding: 20px 15px;
    }
    .news-card .news_info {
        flex-wrap: wrap; /* предотвращаем выход за пределы */
    }
    .news_ava {
        margin: 0 auto 15px;
    }
    .news_cont_text {
        width: 100%;
    }
}

/* Если какая-то таблица или изображение всё ещё создают скролл */
.news-card img,
.news-card table {
    max-width: 100%;
    height: auto;
}

/* Дополнительно: для карточек с длинными ссылками */
.news-card a {
    word-break: break-word;
}

/* ========== СОВРЕМЕННЫЙ СТИЛЬ БИБЛИОТЕКИ PRIME (ФЭНТЕЗИ-РЕДИЗАЙН) ========== */
.lib-page {
    --lib-bg: rgba(26, 17, 12, 0.92);        /* глубокий тёмный дуб */
    --lib-gold: #d4af37;                      /* благородное золото */
    --lib-gold-light: #f5e6b3;                 /* светлое золото */
    --lib-red: #a84444;                        /* акцентный тёмно-красный */
    --lib-brown: #5a3e2b;                      /* кора дуба */
    --lib-light: #f0e6d2;                      /* цвет старого пергамента */
    --lib-shadow: 0 10px 25px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(212,175,55,0.2);
    --lib-border: 1.5px solid #8b5a2b;
    --lib-inner-glow: inset 0 0 20px rgba(212,175,55,0.08);
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Philosopher', serif;
    background: transparent;
}

/* Главный контейнер – стилизован под древний фолиант */
.lib-page .content {
    background: var(--lib-bg);
    backdrop-filter: blur(10px);
    border-radius: 32px 32px 32px 32px;
    padding: 30px 40px;
    box-shadow: var(--lib-shadow), var(--lib-inner-glow);
    border: var(--lib-border);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.lib-page .content:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 0 1px rgba(212,175,55,0.4), inset 0 0 30px rgba(212,175,55,0.12);
}

/* Текстурный фон (имитация старой бумаги / кожи) */
.lib-page .content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent 0px, transparent 2px, rgba(212,175,55,0.02) 2px, rgba(212,175,55,0.02) 4px),
        radial-gradient(circle at 20% 30%, rgba(210,180,140,0.05) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(139,69,19,0.05) 0%, transparent 30%);
    pointer-events: none;
    z-index: 0;
}

/* Заголовок страницы */
.lib-page .page-title {
    background: linear-gradient(145deg, rgba(44,30,21,0.9), rgba(26,17,12,0.9)) !important;
    padding: 15px 25px !important;
    margin: 0 0 25px 0 !important;
    border: 2px solid #a0522d;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,215,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.lib-page .page-title h1 {
    font-size: 42px;
    font-weight: 800;
    margin: 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
}

/* ===== ВКЛАДКИ: всегда по 6 в ряд (сетка) ===== */
.lib-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 25px;
    padding: 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    border: 1px solid #6b4f2a;
    box-shadow: inset 0 1px 4px #000;
}

.lib-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    color: #fff8e7;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 #3f2e22, 0 5px 12px #000;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #a0522d, #8b4513, #a0522d);
    border: none;
    border-radius: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    min-height: 44px;
    word-break: break-word;
    white-space: normal;
}

.lib-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.2), transparent);
    transition: left 0.4s;
    z-index: 0;
}

.lib-tab:hover {
    background: linear-gradient(145deg, #8b4513, #5d2906, #8b4513);
    transform: translateY(-2px);
    box-shadow: 0 5px 18px rgba(139, 69, 19, 0.35), 0 0 15px rgba(255, 215, 0, 0.15);
    color: #ffd700 !important;
}

.lib-tab:hover::before {
    left: 100%;
}

.lib-tab.active {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #1f140c !important;
    font-weight: 700;
    box-shadow: 0 5px 0 #5a3e2b, 0 0 20px #ffd700, inset 0 0 10px #fff8e7;
    pointer-events: none;
}

/* Подменю (дочерние пункты) */
.lib-submenu {
    list-style: none;
    padding: 12px 16px;
    margin: 20px 0 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(145deg, #2f241b, #1f150e);
    border-radius: 10px;
    border: 1.5px solid #a0522d;
    box-shadow: inset 0 2px 5px #000, 0 6px 12px rgba(0,0,0,0.6);
    position: relative;
    z-index: 2;
}

.lib-submenu li {
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
}

.lib-submenu a {
    display: block;
    padding: 10px 24px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border-radius: 10px;
    color: #fff8e7;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid #8b5a2b;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 0 #3f2e22, 0 4px 8px #000;
    position: relative;
    overflow: hidden;
}

.lib-submenu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.15), transparent);
    transition: left 0.3s;
}

.lib-submenu a:hover {
    background: linear-gradient(145deg, #5a3e2b, #3f2e22);
    border-color: #ffd700;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 0 #3f2e22, 0 6px 12px #000, 0 0 12px #ffd700;
}

.lib-submenu a:hover::before {
    left: 100%;
}

.lib-submenu .lib_act_men a {
    background: linear-gradient(145deg, #b8860b, #8b5a2b);
    border-color: #ffe68f;
    color: #fff9f2;
    font-weight: 700;
    box-shadow: 0 0 15px gold, inset 0 0 8px #fff3b0;
    cursor: default;
    pointer-events: none;
    text-shadow: none;
}

/* Основная контентная область */
.lib-content {
    background: rgba(26,17,12,0.75);
    backdrop-filter: blur(6px);
    border-radius: 15px;
    padding: 45px 45px;
    border: 2px solid #b07d44;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.7), 0 10px 25px #000, 0 0 0 1px #d4af37 inset;
    position: relative;
    z-index: 1;
    color: #f5e6d3;
    font-size: clamp(16px, 4vw, 18px);
    line-height: 1.7;
    word-wrap: break-word;
    animation: libFadeIn 0.6s ease-out;
}

@keyframes libFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Декоративный узор по краям (уже есть в .lib-content::before, оставляем как есть) */
.lib-content::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed rgba(212,175,55,0.3);
    border-radius: 11px;
    pointer-events: none;
    z-index: 0;
}

.lib-content::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(212,175,55,0.03) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(160,82,45,0.05) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 18px;
}

.lib-content h1.news-title {
    font-size: 48px;
    margin: 0 0 25px 0;
    color: #ffd966;
    text-shadow: 2px 2px 0 #2b1e0e;
    border-left: 10px solid #a84444;
    padding-left: 30px;
    line-height: 1.2;
    font-weight: 700;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.lib-content .rank-lvl {
    color: #f5e6d3;
    font-size: 18px;
    line-height: 1.7;
    font-family: 'Open Sans', 'Segoe UI', sans-serif;
    position: relative;
    z-index: 2;
}

/* Стилизация текстовых элементов */
.lib-content p {
    margin-bottom: 25px;
}

.lib-content a {
    color: #ffd966;
    text-decoration: none;
    border-bottom: 1px dotted #d4af37;
    transition: all 0.2s;
    font-weight: 500;
}

.lib-content a:hover {
    color: #fff;
    border-bottom: 1px solid #ffd700;
    text-shadow: 0 0 8px gold, 0 0 15px #ffaa00;
}

.lib-content strong, .lib-content b {
    color: #ffe8b5;
    font-weight: 700;
}

.lib-content em, .lib-content i {
    color: #e0cba0;
    font-style: italic;
}

/* Таблицы с артефактами */
.lib-content table.artifact-table {
    display: inline-block;
    margin: 10px;
    border: 2px solid #d4af37;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212,175,55,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
    .lib-content table.artifact-table:hover {
        transform: scale(1.05) rotate(0.5deg);
        box-shadow: 0 0 30px gold;
    }
}

.lib-content table.artifact-table td {
    padding: 0 !important;
    background: rgba(20,15,10,0.05);
}

.lib-content table.artifact-table img {
    display: block;
    border: none;
    box-shadow: none;
    margin: 0;
}

/* Контейнер для горизонтального скролла артефактов (если нужно) */
.lib-content .artifact-table-container {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
}
.lib-content .artifact-table-container .artifact-table {
    display: inline-block;
    margin: 0 5px;
}

/* Изображения */
.lib-content img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    border: 3px solid #d4af37;
    box-shadow: 0 0 25px rgba(0,0,0,0.8), 0 0 15px #b8860b;
    margin: 25px 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.lib-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 35px #ffd700, 0 0 0 2px #fff3b0;
}

.lib-content .lib_img {
    text-align: center;
}

/* Списки */
.lib-content ul, .lib-content ol {
    padding-left: 40px;
    margin: 20px 0;
}

.lib-content li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.lib-content li::marker {
    color: #d4af37;
}

/* Цитаты */
.lib-content blockquote {
    border-left: 6px solid #d4af37;
    background: rgba(212,175,55,0.08);
    padding: 20px 30px;
    font-style: italic;
    border-radius: 0 30px 30px 0;
    margin: 30px 0;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
    color: #f0ddc0;
}

.lib-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Код или особые вставки */
.lib-content .underline a {
    border-bottom: 2px dotted #d4af37;
    text-decoration: none;
    font-weight: 600;
}

.lib-content .underline a:hover {
    border-bottom-style: solid;
}

/* ===== УЛУЧШЕНИЯ: Навигация (предыдущая / следующая) ===== */
.lib-navigation {
    display: flex;
    gap: 15px;
    margin-top: 45px;
    padding-top: 20px;
    border-top: 2px dashed #b8860b;
}

.lib-navigation a {
    flex: 1;
    text-align: center;
    padding: 14px 20px;
    background: linear-gradient(145deg, #3f2e22, #2b1e0e);
    border: 2px solid #b8860b;
    border-radius: 50px;
    color: #fff8e7 !important;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 5px 0 #3f2e22, 0 8px 15px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lib-navigation a:first-child::before {
    content: "← ";
    font-size: 1.2em;
}

.lib-navigation a:last-child::after {
    content: " →";
    font-size: 1.2em;
}

.lib-navigation a:hover {
    background: #b8860b;
    color: #1f140c !important;
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #3f2e22, 0 12px 20px #000, 0 0 20px gold;
}

/* Адаптация навигации для мобильных */
@media (max-width: 640px) {
    .lib-navigation {
        flex-direction: column;
        gap: 10px;
    }
    .lib-navigation a {
        white-space: normal;
        padding: 12px 15px;
        font-size: 16px;
    }
    .lib-navigation a:first-child::before,
    .lib-navigation a:last-child::after {
        content: none;
    }
}

/* Пустое состояние / нет данных */
.lib-content .no-data-message {
    font-size: 28px;
    color: #c0b09a;
    text-align: center;
    padding: 70px 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 20px;
    border: 2px dashed #b8860b;
    box-shadow: inset 0 0 30px #000;
}

/* ===== УЛУЧШЕНИЯ: Стили качества артефактов ===== */
a.macros_artifact_quality0,
span.macros_artifact_quality0 { color: #a5a5a5 !important; font-weight: bold; }
a.macros_artifact_quality1,
span.macros_artifact_quality1 { color: #5cff69 !important; font-weight: bold; }
a.macros_artifact_quality2,
span.macros_artifact_quality2 { color: #23b2e9 !important; font-weight: bold; }
a.macros_artifact_quality3,
span.macros_artifact_quality3 { color: #f11dff !important; font-weight: bold; }
a.macros_artifact_quality4,
span.macros_artifact_quality4 { color: #ff2e2e !important; font-weight: bold; }
a.macros_artifact_quality5,
span.macros_artifact_quality5 { color: #2effe2 !important; font-weight: bold; }
a.macros_artifact_quality6,
span.macros_artifact_quality6 { color: #e09100 !important; font-weight: bold; }

/* ===== УЛУЧШЕНИЯ: Стили для выпадающего подменю на мобильных ===== */
.lib-submenu-select {
    display: none;
    width: 100%;
    padding: 12px 16px;
    margin: 0 0 25px 0;
    background: #2b1e0e;
    color: #fff8e7;
    border: 2px solid #b8860b;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

@media (max-width: 480px) {
    .lib-submenu {
        display: none;
    }
    .lib-submenu-select {
        display: block;
    }
}

/* ===== УЛУЧШЕНИЯ: Focus-стили для доступности ===== */
.lib-tab:focus,
.lib-submenu a:focus,
.lib-navigation a:focus,
.lib-content a:focus {
    outline: 2px solid gold;
    outline-offset: 2px;
}

/* Адаптивность для вкладок на узких экранах */
@media (max-width: 900px) {
    .lib-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr)); /* на планшетах по 3 */
    }
}

@media (max-width: 600px) {
    .lib-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* на телефонах по 2 */
    }
    .lib-tab {
        font-size: 14px;
        padding: 10px 5px;
    }
}

@media (max-width: 400px) {
    .lib-tabs {
        grid-template-columns: 1fr; /* на совсем маленьких по 1 */
    }
}

/* Адаптивность (общие медиазапросы) */
@media (max-width: 1200px) {
    .lib-page .content { padding: 25px; }
    .lib-content { padding: 30px; }
    .lib-content h1.news-title { font-size: 38px; }
}

@media (max-width: 768px) {
    .lib-page .content { padding: 20px 15px; }
    .lib-content { padding: 20px; }
    .lib-content h1.news-title { font-size: 32px; padding-left: 20px; }
}

@media (max-width: 480px) {
    .lib-page .content { padding: 10px; }
    .lib-content h1.news-title {
        font-size: 26px;
        border-left-width: 6px;
        padding-left: 15px;
    }
    .lib-content { font-size: 16px; }
    .lib-navigation a { font-size: 15px; }
    .lib-content .artifact-table {
        width: 50px;
        height: 50px;
    }
}

/* Поддержка тёмной темы браузера */
@media (prefers-color-scheme: dark) {
    .lib-page .content { background: rgba(20, 15, 10, 0.95); }
}

/* Отключение анимаций для пользователей с reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lib-content,
    .lib-tab:hover,
    .lib-submenu a:hover,
    .lib-navigation a:hover,
    .lib-content a:hover,
    .lib-content table.artifact-table:hover {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        text-shadow: none !important;
    }
    .lib-tab::before, .lib-submenu a::before, .lib-navigation a::before {
        transition: none;
    }
}
   #blink1 {
   -webkit-animation: blink1 3s linear infinite;
      animation: blink1 3s linear infinite;
   }
   @-webkit-keyframes blink1 {
      0% { color: rgba(20, 255, 16, 1); }
      50% { color: rgba(20, 255, 16, 0); }
      100% { color: rgba(20, 255, 16, 1); }
   }
   @keyframes blink1 {
      0% { color: rgba(20, 255, 16, 1); }
      50% { color: rgba(20, 255, 16, 0); }
      100% { color: rgba(20, 255, 16, 1); }
   }
   .welcome{
      font-size: 11px;
      color: #cacaca;
   }
   .unread-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      background-color: #ff4444;
      border-radius: 50%;
      margin-left: 5px;
      box-shadow: 0 0 8px #ff0000;
      vertical-align: middle;
   }
   .lib-progress-indicator {
      margin-left: 5px;
      font-size: 0.8em;
      color: #ffd966;
   }
   .user-info {
       display: flex;
       align-items: center;
       gap: 10px;
   }
   .user-name {
        display: block;
		color: #fff;
		font-size: 17px;
		text-transform: uppercase;
		text-shadow: 0px 3px 2px rgba(38, 26, 16, .25);
	line-height: 34px;
   }
   .logout-btn {
       color: #fff;
       background: #b8860b;
       padding: 5px 10px;
       border-radius: 5px;
       text-decoration: none;
       transition: background 0.3s;
   }
   .logout-btn:hover {
       background: #d4a017;
   }
   .profile{	   
		padding-top: 7px;
   }
   .menu li a{	   
		flex-direction: row;
   }
   .page .menuBlock-logo {
		display: flex;
	}
   .admin-badge { color: #ffaa00; font-weight: bold; margin-left: 5px; }
   .reaction-btn.active {
    background: #b8860b !important;
    color: #1f140c !important;
    border-color: #ffd966 !important;
   }
   .unread-comments {
        background: #ff4444;
        color: #fff;
        border-radius: 10px;
        padding: 2px 6px;
        font-size: 12px;
        margin-left: 5px;
   }
   /* Модальные окна */
   .modal_div {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 500px;
        background: #2a1e15;
        border: 2px solid #b8860b;
        border-radius: 10px;
        padding: 25px;
        box-shadow: 0 0 20px rgba(0,0,0,0.8);
        z-index: 10000;
        color: #fff;
        font-family: 'Philosopher', sans-serif;
        display: none;
		opacity: 1;
   }
   .modal_div h3 {
        margin: 0 0 20px 0;
        color: #ffd966;
        font-size: 24px;
        text-align: center;
        border-bottom: 1px solid #b8860b;
        padding-bottom: 10px;
   }
   .modal_close {
        position: absolute;
        top: 10px;
        right: 10px;
        cursor: pointer;
        width: 70px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
   }
   .closeButton {
        width: 31px;
		height: 7px;
		position: relative;
   }
   .closeButton span {
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: #b8860b;
        top: 50%;
        left: 0;
   }
   .closeButton span:first-child {
        transform: rotate(45deg);
   }
   .closeButton span:last-child {
        transform: rotate(-45deg);
   }
   .modal_div textarea,
   .modal_div input[type="text"],
   .modal_div input[type="number"] {
        width: 100%;
        background: #3f2e22;
        border: 1px solid #b8860b;
        color: #fff;
        padding: 10px;
        border-radius: 5px;
        font-size: 14px;
        box-sizing: border-box;
        margin-bottom: 10px;
   }
   .modal_div textarea:focus,
   .modal_div input:focus {
        outline: none;
        border-color: #ffd966;
        box-shadow: 0 0 5px #b8860b;
   }
   .modal_div button {
        background: #b8860b;
        border: none;
        color: #1f140c;
        padding: 10px 20px;
        border-radius: 5px;
        font-weight: bold;
        cursor: pointer;
        transition: background 0.3s;
        font-family: 'Philosopher', sans-serif;
        font-size: 16px;
   }
   .modal_div button:hover {
        background: #d4a017;
   }
   .modal_div button[type="button"] {
        background: #3f2e22;
        border: 1px solid #b8860b;
        color: #fff;
   }
   .modal_div button[type="button"]:hover {
        background: #5a3e2c;
   }
   #overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.7);
        z-index: 9999;
        display: none;
   }
   @media (max-width: 768px) {
        .modal_div {
            width: 95%;
            padding: 15px;
        }
        .modal_div h3 {
            font-size: 20px;
        }
   }
   .activity-feed {
		font-size: 13px;
	}		
	.activity-item {
		display: flex;
		align-items: flex-start;
		gap: 8px;
		padding: 8px;
		border-bottom: 1px solid #3f2e22;
	}
	.activity-item:last-child {
		border-bottom: none;
	}
	.activity-item a {
		color: #ffd966;
		text-decoration: none;
	}
	.activity-item a:hover {
		text-decoration: underline;
	}
	.activity-item .time {
		color: #aaa;
		font-size: 11px;
		margin-left: auto;
	}
	.filter-btn {
		background: #3f2e22;
		border: 1px solid #b8860b;
		color: #fff;
		padding: 3px 8px;
		border-radius: 15px;
		cursor: pointer;
	}
	.filter-btn.active {
		background: #b8860b;
		color: #1f140c;
	}			
/* ===== Фильтры новостей ===== */
.news-filters {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
}

.filter-submit,
.date-apply {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.clear-filters {
    color: #ffd966;
    font-size: 18px;
    text-decoration: none;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-range label {
    color: #fff;
}

.date-input {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 8px;
    border-radius: 5px;
}

/* ===== Реакции ===== */
.reactions-block {
    margin-top: 20px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

.reactions-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-btn {
    background: none;
    border: 1px solid #b8860b;
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.reaction-btn.active {
    background: #b8860b !important;
    color: #1f140c !important;
    border-color: #ffd966 !important;
}

.reaction-btn .count {
    margin-left: 3px;
}

/* ===== Комментарии ===== */
.comments-block {
    margin-top: 20px;
}

.comment-item {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-author a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

.comment-author a:hover {
    color: #ffd966;
}

.admin-badge {
    color: #ffaa00;
    font-weight: bold;
    margin-left: 5px;
}

.comment-date {
    color: #aaa;
    font-size: 0.9em;
}

.comment-body {
    margin-top: 8px;
}

.edited-mark {
    font-size: 0.8em;
    color: #aaa;
    margin-left: 10px;
}

.comment-actions {
    margin-top: 10px;
}

.comment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
    background: #761313;
    padding: 15px;
    border-radius: 5px;
}

.comment-actions .delete-comment-btn {
    color: #ff6666;
    background: #5a3737;
    padding: 15px;
    border-radius: 5px;
}

.comment-actions .edit-comment-btn {
    color: #ffd966;
    background: #52523e;
    padding: 15px;
    border-radius: 5px;
}

.comment-actions .report-comment-btn {
    color: #ffaa00;
    background: #6a3e24;
    padding: 15px;
    border-radius: 5px;
}

.add-comment-form textarea {
    width: 100%;
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    resize: vertical;
    margin-bottom: 10px;
}

.add-comment-form button {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.add-comment-form button:hover {
    background: #d4a017;
}

/* Сообщения об ошибках */
.error-message {
    color: #ff6666;
}

.unread-dot{
    right: 9px !important;
    padding-right: 0px !important;
    top: 40px;
}

/* Всплывающий блок непрочитанных комментариев */
.unread-popup {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-width: 90vw;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    font-size: 14px;
}

.unread-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #b8860b;
    padding-bottom: 8px;
    margin-bottom: 10px;
    color: #ffd966;
    font-weight: bold;
}

.unread-popup .popup-header button {
    background: #b8860b;
    border: none;
    color: #1f140c;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.unread-popup .popup-content {
    max-height: 300px;
    overflow-y: auto;
}

.unread-item {
    border-bottom: 1px solid #3f2e22;
    padding: 8px 0;
}

.unread-item:last-child {
    border-bottom: none;
}

.unread-item a {
    color: #ffd966;
    text-decoration: none;
    font-weight: 500;
}

.unread-item a:hover {
    text-decoration: underline;
}

.unread-item .comment-meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

.unread-item .comment-time {
    font-size: 11px;
    color: #888;
    text-align: right;
}

.unread-popup .popup-footer {
    text-align: center;
    margin-top: 10px;
    border-top: 1px solid #3f2e22;
    padding-top: 8px;
}

.unread-popup .popup-footer a {
    color: #b8860b;
    text-decoration: none;
}

.unread-popup .popup-footer a:hover {
    text-decoration: underline;
}

/* Индикатор непрочитанных комментариев */
.unread-comments {
    background: #ff4444;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    margin-left: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.unread-comments:hover {
    background: #ff6666;
}

.login_panel>div .profile{
    float: left;
    position: absolute;
    right: 100px;
}

.emoji-picker-container {
    position: relative;
    display: inline-block;
    margin-top: 5px;
}

.emoji-toggle-btn {
    background: #3f2e22;
    border: 1px solid #b8860b;
    color: #ffd966;
    font-size: 1.5em;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
}

.emoji-toggle-btn:hover {
    background: #b8860b;
    color: #1f140c;
}

.emoji-panel {
    position: absolute;
    bottom: 100%;    /* открывается вверх */
    left: 0;
    background: #2a1e15;
    border: 2px solid #b8860b;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    width: 500px;
    max-width: 90vw;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.emoji-item {
    font-size: 1.5em;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}

.emoji-item:hover {
    background: #b8860b;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.but_send{
	    bottom: 2px;
}
.but_sendt{
	    bottom: 5px;
}