/* ==========================================================================
   Библиотека — уникальное оформление (тест)
   Концепция: древний фолиант при свете свечей.
   Файл подключается ПОСЛЕ login.css и переопределяет базовые блоки.
   ========================================================================== */

.lib-page {
    background-color: #120a06;
    background-image:
        radial-gradient(ellipse at 50% -10%, rgba(214, 160, 60, 0.18) 0%, rgba(18, 10, 6, 0) 55%),
        radial-gradient(circle at 15% 20%, #33200f 0%, rgba(18, 10, 6, 0) 45%),
        radial-gradient(circle at 85% 80%, #2b160a 0%, rgba(18, 10, 6, 0) 45%),
        linear-gradient(160deg, #1c100a 0%, #0b0503 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* Тёмная виньетка поверх фона */
.lib-page::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.75) 100%);
}

.lib-page > * {
    position: relative;
    z-index: 1;
}

/* ===== Летящие искры ===== */
.lib-embers {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lib-ember {
    position: absolute;
    bottom: -20px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffcf6b;
    box-shadow: 0 0 6px 2px rgba(255, 176, 60, 0.55);
    opacity: 0;
    animation: lib-float linear infinite;
}

@keyframes lib-float {
    0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
    12%  { opacity: 0.9; }
    70%  { opacity: 0.7; }
    100% { transform: translate3d(40px, -100vh, 0) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lib-embers { display: none; }
    .lib-page * { animation: none !important; transition: none !important; }
}

/* ===== Шапка ===== */
.lib-page header {
    background:
        linear-gradient(to bottom, rgba(90, 52, 26, 0.95) 0%, rgba(28, 14, 7, 0.98) 100%);
    border-bottom: 3px double #c39a4e;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.75), inset 0 -1px 0 rgba(255, 210, 130, 0.25);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 20px 14px;
    position: relative;
    overflow: hidden;
}

.lib-page header::after {
    content: "";
    position: absolute;
    left: -60%;
    top: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 226, 160, 0.14) 50%, transparent 100%);
    animation: lib-sheen 7s ease-in-out infinite;
}

@keyframes lib-sheen {
    0%, 60% { left: -60%; }
    100%    { left: 130%; }
}

.lib-page .logo {
    background: linear-gradient(to bottom, #fff3cd 0%, #e5c072 45%, #a9762c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
    font-size: 22px;
}

.lib-subtitle {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d7b374;
    font-family: "Georgia", serif;
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.lib-subtitle::before,
.lib-subtitle::after {
    content: "";
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, #c39a4e, transparent);
}

/* ===== Сетка ===== */
.lib-page .game-container {
    grid-template-columns: 300px 1fr;
    max-width: 1280px;
    align-items: start;
}

/* ===== Боковые панели-фолианты ===== */
.lib-page .sidebar {
    gap: 16px;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #8c6939 rgba(0, 0, 0, 0.25);
}

.lib-page .sidebar::-webkit-scrollbar,
.lib-article-scroll::-webkit-scrollbar {
    width: 9px;
}

.lib-page .sidebar::-webkit-scrollbar-track,
.lib-article-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.lib-page .sidebar::-webkit-scrollbar-thumb,
.lib-article-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #c39a4e, #6e512c);
    border-radius: 6px;
    border: 1px solid #3a2712;
}

.lib-page .dwar-box {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 40%),
        radial-gradient(circle at 20% 0%, #fbf1d8 0%, #ecd9ae 55%, #ddc79b 100%);
    background-color: #f0e1bb;
    border: 3px solid #6e512c;
    border-radius: 10px;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(140, 105, 57, 0.28);
    padding: 16px 16px 18px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.lib-page .dwar-box:hover {
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(212, 175, 55, 0.5),
        inset 0 0 40px rgba(140, 105, 57, 0.28);
}

.lib-page .dwar-box::before {
    border: 1px solid rgba(212, 175, 55, 0.75);
    border-radius: 7px;
}

.lib-page .dwar-box h3 {
    position: relative;
    color: #63200a;
    border-bottom: none;
    padding-bottom: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Разделитель с ромбом под заголовком группы */
.lib-page .dwar-box h3::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, #a9834a, transparent);
}

.lib-page .dwar-box h3::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 1px;
    transform: translateX(-50%) rotate(45deg);
    width: 7px;
    height: 7px;
    background: #b8873f;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.85);
    z-index: 1;
}

/* ===== Навигация-закладки ===== */
.lib-page .side-menu {
    gap: 5px;
}

.lib-page .side-menu a {
    position: relative;
    overflow: hidden;
    padding: 9px 12px 9px 22px;
    background: linear-gradient(to bottom, #fffdf5 0%, #e8d7ae 100%);
    border: 1px solid #7c5c33;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.3;
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}

/* Ленточка-закладка слева */
.lib-page .side-menu a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to bottom, #b8873f, #6e512c);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.25);
    transition: width 0.18s ease, background 0.18s ease;
}

/* Блик, пробегающий при наведении */
.lib-page .side-menu a::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 232, 175, 0.55), transparent);
    transition: left 0.45s ease;
}

.lib-page .side-menu a:hover {
    background: linear-gradient(to bottom, #7d1f0c 0%, #4c0f04 100%);
    color: #ffe9b8;
    border-color: #3d0c02;
    transform: translateX(3px);
    padding-left: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(212, 175, 55, 0.25);
}

.lib-page .side-menu a:hover::before {
    width: 8px;
    background: linear-gradient(to bottom, #ffd579, #c8912f);
}

.lib-page .side-menu a:hover::after {
    left: 130%;
}

.lib-page .side-menu a.is-active,
.lib-page .side-menu a.side-menu-active {
    background: linear-gradient(to bottom, #8d240e 0%, #500f04 100%);
    color: #ffe9b8;
    border-color: #3d0c02;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.55), 0 0 16px rgba(255, 160, 50, 0.35);
    animation: lib-glow 3.2s ease-in-out infinite;
}

.lib-page .side-menu a.is-active::before {
    width: 8px;
    background: linear-gradient(to bottom, #ffd579, #c8912f);
}

@keyframes lib-glow {
    0%, 100% { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.45), 0 0 10px rgba(255, 160, 50, 0.22); }
    50%      { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.75), 0 0 22px rgba(255, 170, 60, 0.45); }
}

/* ===== Поиск по разделам ===== */
.lib-search-box {
    padding-bottom: 14px;
}

.lib-search {
    position: relative;
}

.lib-search input {
    width: 100%;
    box-sizing: border-box;
    background: #fffbef;
    border: 1px solid #7c5c33;
    border-radius: 4px;
    padding: 9px 10px 9px 32px;
    font-family: "Georgia", serif;
    font-size: 13px;
    color: #3b240f;
    box-shadow: inset 0 2px 5px rgba(110, 81, 44, 0.25);
}

.lib-search input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: inset 0 2px 5px rgba(110, 81, 44, 0.25), 0 0 10px rgba(212, 175, 55, 0.55);
}

.lib-search::before {
    content: "\1F50D";
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.65;
    pointer-events: none;
}

.lib-hidden {
    display: none !important;
}

/* ===== Основной разворот ===== */
.lib-page .library-section {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 35%),
        radial-gradient(circle at 50% 0%, #fdf5e2 0%, #f2e4c1 40%, #e6d3a6 100%);
    border: 3px solid #6e512c;
    border-radius: 12px;
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.65),
        inset 0 0 60px rgba(150, 112, 60, 0.25);
    overflow: visible;
    animation: lib-rise 0.5s ease-out both;
}

@keyframes lib-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.lib-page .library-section::before {
    border: 1px solid rgba(212, 175, 55, 0.75);
    border-radius: 9px;
}

/* Золотые уголки разворота */
.lib-corner {
    position: absolute;
    width: 26px;
    height: 26px;
    border: 2px solid #c39a4e;
    z-index: 3;
    pointer-events: none;
    opacity: 0.9;
}

.lib-corner-tl { top: 8px;    left: 8px;    border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.lib-corner-tr { top: 8px;    right: 8px;   border-left: none;  border-bottom: none; border-radius: 0 8px 0 0; }
.lib-corner-bl { bottom: 8px; left: 8px;    border-right: none; border-top: none;    border-radius: 0 0 0 8px; }
.lib-corner-br { bottom: 8px; right: 8px;   border-left: none;  border-top: none;    border-radius: 0 0 8px 0; }

.lib-page .library-section h2 {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(140, 105, 57, 0.55);
    font-size: 19px;
    letter-spacing: 2px;
    background: linear-gradient(to bottom, #8c2a10 0%, #63200a 55%, #3d1305 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

/* Хлебные крошки */
.lib-crumbs {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 20px 0;
    font-size: 12px;
    color: #7a5a30;
    font-family: Tahoma, "Segoe UI", sans-serif;
}

.lib-crumbs a {
    color: #8c2a10;
    text-decoration: none;
    border-bottom: 1px dotted rgba(140, 42, 16, 0.6);
}

.lib-crumbs a:hover {
    color: #bd2c16;
    border-bottom-style: solid;
}

.lib-crumbs .lib-crumb-sep {
    opacity: 0.6;
}

/* ===== Вкладки статей ===== */
.lib-page .library-toc {
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(140, 105, 57, 0.5);
    margin-bottom: 20px;
}

.lib-page .library-toc a {
    position: relative;
    overflow: hidden;
    padding: 8px 14px;
    background: linear-gradient(to bottom, #fffdf5 0%, #e8d7ae 100%);
    border: 1px solid #7c5c33;
    border-radius: 20px;
    font-size: 12.5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.lib-page .library-toc a::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 55%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 236, 190, 0.6), transparent);
    transition: left 0.45s ease;
}

.lib-page .library-toc a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 12px rgba(212, 175, 55, 0.3);
}

.lib-page .library-toc a:hover::after {
    left: 130%;
}

.lib-page .library-toc a.is-active {
    background: linear-gradient(to bottom, #8d240e 0%, #500f04 100%);
    border-color: #3d0c02;
    color: #ffe9b8;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.6), 0 0 16px rgba(255, 160, 50, 0.35);
}

/* ===== Тело статьи ===== */
.lib-page .library-body {
    padding: 16px 26px 26px;
}

.lib-page .library-article-title {
    position: relative;
    margin: 0 0 20px;
    padding-bottom: 14px;
    font-size: 20px;
    letter-spacing: 0.5px;
    color: #63200a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.lib-page .library-article-title::after {
    content: "❖";
    position: absolute;
    left: 50%;
    bottom: -2px;
    transform: translateX(-50%);
    color: #b8873f;
    font-size: 13px;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}

.lib-page .library-article-title::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    width: 70%;
    max-width: 420px;
    height: 1px;
    background: linear-gradient(to right, transparent, #b8873f, transparent);
}

.lib-page .library-article {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 14px;
    line-height: 1.75;
    color: #4a2a12;
    text-align: left;
    animation: lib-fade 0.6s ease-out both;
}

@keyframes lib-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lib-page .library-article a {
    color: #a3260a;
    text-decoration: none;
    border-bottom: 1px dotted rgba(163, 38, 10, 0.5);
    transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}

.lib-page .library-article a:hover {
    color: #d63a12;
    border-bottom-color: #d63a12;
    text-shadow: 0 0 8px rgba(214, 58, 18, 0.35);
    text-decoration: none;
}

.lib-page .library-article img {
    border-radius: 3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lib-page .library-article table {
    border-collapse: collapse;
    margin: 10px auto;
}

.lib-page .library-article td,
.lib-page .library-article th {
    padding: 4px 6px;
}

/* Мягкая горизонтальная прокрутка для широких таблиц из старых статей */
.lib-article-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
}

/* ===== Переход между статьями ===== */
.lib-pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 26px auto 0;
    max-width: 760px;
    padding-top: 16px;
    border-top: 1px solid rgba(140, 105, 57, 0.5);
}

.lib-pager a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 46%;
    padding: 9px 14px;
    background: linear-gradient(to bottom, #fffdf5 0%, #e8d7ae 100%);
    border: 1px solid #7c5c33;
    border-radius: 4px;
    color: #3b240f;
    font-size: 12.5px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lib-pager a:hover {
    background: linear-gradient(to bottom, #7d1f0c 0%, #4c0f04 100%);
    border-color: #3d0c02;
    color: #ffe9b8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.lib-pager .lib-pager-next {
    margin-left: auto;
}

/* ===== Пустые состояния ===== */
.lib-page .empty-state,
.lib-page .empty-state-small {
    font-family: "Georgia", serif;
    color: #7a5a30;
}

.lib-page .empty-state {
    padding: 34px 20px;
    font-size: 15px;
}

/* ===== Кнопка «наверх» ===== */
.lib-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #8d240e 0%, #500f04 100%);
    border: 2px solid #c39a4e;
    border-radius: 50%;
    color: #ffe9b8;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 170, 60, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lib-top.is-visible {
    display: flex;
}

.lib-top:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7), 0 0 22px rgba(255, 180, 70, 0.55);
}

/* ===== Адаптив ===== */
@media (max-width: 900px) {
    .lib-page .game-container {
        grid-template-columns: 1fr;
    }

    .lib-page .sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .lib-page .library-body {
        padding: 14px 14px 20px;
    }

    .lib-subtitle::before,
    .lib-subtitle::after {
        width: 28px;
    }

    .lib-pager a {
        max-width: 48%;
    }
}

/* ===== Общие внешние страницы (форум, новости, рейтинг, регистрация) ===== */
.lib-page .dwar-box h1 {
    color: #5c1306;
    text-align: center;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #8c6939;
    text-transform: uppercase;
    font-size: 20px;
    letter-spacing: 1px;
}

.lib-page input[type="text"],
.lib-page input[type="email"],
.lib-page input[type="password"],
.lib-page input[type="search"],
.lib-page textarea,
.lib-page select {
    width: 100%;
    box-sizing: border-box;
    background: #fffbef;
    border: 1px solid #7c5c33;
    border-radius: 4px;
    padding: 9px 10px;
    font-family: "Georgia", serif;
    font-size: 13px;
    color: #3b240f;
    box-shadow: inset 0 2px 5px rgba(110, 81, 44, 0.18);
}

.lib-page textarea {
    min-height: 120px;
    resize: vertical;
}

.lib-page input:focus,
.lib-page textarea:focus,
.lib-page select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: inset 0 2px 5px rgba(110, 81, 44, 0.18), 0 0 10px rgba(212, 175, 55, 0.45);
}

.lib-page .form-group {
    margin: 0 0 14px;
}

.lib-page .form-group label {
    display: block;
    margin-bottom: 5px;
}

.lib-page .error,
.lib-page .error-block,
.lib-page .error-message {
    background: rgba(140, 32, 18, 0.12);
    border: 1px solid #8c2012;
    border-left: 4px solid #bd2c16;
    color: #5c1306;
    padding: 12px 14px;
    border-radius: 4px;
    margin: 0 0 16px;
}

.lib-page .info,
.lib-page .alert-info {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid #c39a4e;
    color: #4a2a12;
    padding: 12px 14px;
    border-radius: 4px;
    margin: 0 0 16px;
}

.lib-page .forum-breadcrumb,
.lib-page .lib-crumbs {
    font-family: Tahoma, "Segoe UI", sans-serif;
}

.lib-page .forum-breadcrumb a {
    color: #8c2a10;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dotted rgba(140, 42, 16, 0.6);
}

.lib-rating-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Tahoma, "Segoe UI", sans-serif;
    font-size: 13px;
}

.lib-rating-table th {
    text-align: left;
    color: #5c1306;
    border-bottom: 1px solid #c39a4e;
    padding: 8px 10px;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.lib-rating-table td {
    padding: 9px 10px;
    border-bottom: 1px dashed #c9b07a;
    color: #4a2a12;
}

.lib-rating-table tr:hover td {
    background: rgba(212, 175, 55, 0.12);
}

.lib-rating-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(to bottom, #fffdf5, #e8d7ae);
    border: 1px solid #7c5c33;
    font-weight: bold;
    color: #3b240f;
}

.lib-rating-table tr:nth-child(1) .lib-rating-place { background: linear-gradient(to bottom, #ffe27a, #d4af37); }
.lib-rating-table tr:nth-child(2) .lib-rating-place { background: linear-gradient(to bottom, #f0f0f0, #b8b8b8); }
.lib-rating-table tr:nth-child(3) .lib-rating-place { background: linear-gradient(to bottom, #e8c4a0, #a06b3c); color: #fff; }

.lib-prose {
    font-family: "Georgia", "Times New Roman", serif;
    font-size: 14px;
    line-height: 1.75;
    color: #4a2a12;
}

.lib-prose h3 {
    color: #5c1306;
    margin: 18px 0 8px;
    text-align: left;
    border-bottom: none;
    text-transform: none;
    font-size: 16px;
}

.lib-prose ul {
    margin: 0 0 14px 20px;
}

.lib-prose a {
    color: #a3260a;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dotted rgba(163, 38, 10, 0.5);
}

.lib-page .password-container,
.lib-page .news-container,
.lib-page .forum-page-content,
.lib-page .recruitment-container {
    position: relative;
    animation: lib-rise 0.5s ease-out both;
}

/* ==========================================================================
   Кнопки: вход, регистрация, ссылка восстановления пароля
   ========================================================================== */

.lib-page button[type="submit"],
.lib-page .btn-reg,
.lib-page .btn-primary {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border-radius: 5px;
    font-family: "Georgia", serif;
    font-size: 13.5px;
    font-weight: bold;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Бегущий блик по кнопке */
.lib-page button[type="submit"]::after,
.lib-page .btn-reg::after,
.lib-page .btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 55%;
    height: 100%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 244, 214, 0.45) 50%, transparent 100%);
    transform: skewX(-18deg);
    transition: left 0.5s ease;
    z-index: -1;
}

.lib-page button[type="submit"]:hover::after,
.lib-page .btn-reg:hover::after,
.lib-page .btn-primary:hover::after {
    left: 135%;
}

.lib-page button[type="submit"]:active,
.lib-page .btn-reg:active,
.lib-page .btn-primary:active {
    transform: translateY(2px);
}

.lib-page button[type="submit"]:focus-visible,
.lib-page .btn-reg:focus-visible,
.lib-page .btn-primary:focus-visible {
    outline: 2px solid #ffd579;
    outline-offset: 2px;
}

/* --- Войти в игру --- */
.lib-page button[type="submit"],
.lib-page .btn-primary {
    background:
        linear-gradient(to bottom, #c8371c 0%, #96230f 45%, #6a1508 75%, #4d0e04 100%);
    border: 1px solid #3a0a02;
    border-top-color: #e8654a;
    color: #ffeec4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 190, 160, 0.45),
        inset 0 0 0 1px rgba(212, 175, 55, 0.35);
    margin-top: 16px;
}

.lib-page button[type="submit"]:hover,
.lib-page .btn-primary:hover {
    filter: brightness(1.12);
    box-shadow:
        0 7px 20px rgba(0, 0, 0, 0.6),
        0 0 18px rgba(255, 130, 60, 0.4),
        inset 0 1px 0 rgba(255, 190, 160, 0.5),
        inset 0 0 0 1px rgba(212, 175, 55, 0.6);
}

.lib-page button[type="submit"]:active,
.lib-page .btn-primary:active {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

/* Золотые ромбы по краям кнопки входа */
.lib-page .login-widget button[type="submit"] {
    position: relative;
}

.lib-page .login-widget button[type="submit"]::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: #ffd579;
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(255, 213, 121, 0.8);
}

/* --- Создать персонажа --- */
.lib-page .btn-reg {
    background:
        linear-gradient(to bottom, #3fbc3f 0%, #248f24 45%, #146414 78%, #0c440c 100%);
    border: 1px solid #0a3a0a;
    border-top-color: #7bec7b;
    color: #f4ffe8;
    padding: 14px 24px;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(190, 255, 190, 0.4),
        inset 0 0 0 1px rgba(212, 175, 55, 0.3);
    margin-top: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    animation: lib-reg-glow 3.6s ease-in-out infinite;
}

.lib-page .btn-reg::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: #ffe9a8;
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(255, 233, 168, 0.85);
}

@keyframes lib-reg-glow {
    0%, 100% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.55),
            0 0 0 rgba(120, 230, 120, 0),
            inset 0 1px 0 rgba(190, 255, 190, 0.4),
            inset 0 0 0 1px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.55),
            0 0 20px rgba(120, 230, 120, 0.4),
            inset 0 1px 0 rgba(190, 255, 190, 0.5),
            inset 0 0 0 1px rgba(212, 175, 55, 0.6);
    }
}

.lib-page .btn-reg:hover {
    filter: brightness(1.12);
    animation: none;
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(130, 240, 130, 0.55),
        inset 0 1px 0 rgba(190, 255, 190, 0.5),
        inset 0 0 0 1px rgba(212, 175, 55, 0.7);
}

.lib-page .btn-reg:active {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0 3px 8px rgba(0, 0, 0, 0.45);
}

/* --- Забыли пароль? --- */
.lib-page .login-forgot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
}

.lib-page .login-forgot::before,
.lib-page .login-forgot::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(to right, transparent, #b8873f, transparent);
}

.lib-page .login-widget .login-forgot a {
    position: relative;
    flex: 0 0 auto;
    padding: 2px 2px 4px;
    color: #7a4a1e;
    font-family: "Georgia", serif;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}

.lib-page .login-widget .login-forgot a::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
    transition: left 0.22s ease, right 0.22s ease;
}

.lib-page .login-widget .login-forgot a:hover {
    color: #bd2c16;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.lib-page .login-widget .login-forgot a:hover::after {
    left: 0;
    right: 0;
}

/* Разделитель перед кнопкой регистрации */
.lib-page .login-widget .login-or {
    display: block;
    margin: 0 0 10px;
    color: #7a5a30;
    font-size: 11px;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
}

/* Чекбокс «Запомнить меня» */
.lib-page .login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 4px;
    cursor: pointer;
    font-size: 13px;
}

.lib-page .login-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #8d240e;
    cursor: pointer;
}
