/* ==========================================================================
   PORTAL TOPBAR — стеклянная коричнево-золотая шапка
   --------------------------------------------------------------------------
   Подключается на всех страницах портала. Разметка:
     .topPanel > .topPanel__inner > .menuBlock
       .menu_block > .menuButton + nav.nav > ul.menu
       .auth_block
   ========================================================================== */

body .topPanel {
    height: 72px;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(76, 51, 31, 0.62), rgba(26, 17, 10, 0.8));
    border-bottom: 1px solid rgba(216, 180, 106, 0.38);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 230, 170, 0.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    backdrop-filter: blur(18px) saturate(1.12);
}

body .topPanel__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1500px;
    height: 100%;
    margin: 0 auto;
    padding: 0 22px;
}

body .topPanel .menuBlock {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 14px;
}

body .topPanel .menu_block {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

/* Кнопка «домой» на ПК / «гамбургер» на мобильном */
body .topPanel .menuButton {
    position: relative;
    left: auto;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(216, 180, 106, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

body .topPanel .menuButton:hover {
    border-color: rgba(216, 180, 106, 0.55);
    background: rgba(216, 180, 106, 0.09);
    transform: translateY(-1px);
}

body .topPanel .menuButton .home__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    line-height: 0;
    box-sizing: border-box;
    color: #f1d9a4;
    top: 0;
}

body .topPanel .menuButton .home__icon {
    display: block;
    width: 22px;
    height: 22px;
}

body .topPanel .menuButton:hover .home__icon {
    color: #fff0c2;
}

body .topPanel .menuButton .menu__mobail {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

body .topPanel .menuButton .menu__mobail img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Навигация */
body .topPanel .nav {
    position: static;
    top: auto;
    left: auto;
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    width: auto;
    min-width: 0;
    background: transparent;
}

body .topPanel .menu {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body .topPanel .menu li {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 0;
}

body .topPanel .menu li a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #e8d9c0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.045em;
    line-height: 1.2;
    text-transform: uppercase;
    text-shadow: none;
    white-space: nowrap;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

body .topPanel .menu li a:hover {
    border-color: rgba(216, 180, 106, 0.22);
    background: rgba(216, 180, 106, 0.09);
    color: #f5dfae;
    filter: none;
}

body .topPanel .menu li a span {
    margin: 0;
    color: #cbb58f;
    font-size: 10px;
    text-transform: none;
}

body .topPanel .menu_log,
body .topPanel .menu_reg {
    font-weight: 700 !important;
}

/* Авторизация / профиль */
body .topPanel .auth_block {
    position: static;
    right: auto;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
    padding: 4px;
    border: 1px solid rgba(216, 180, 106, 0.2);
    border-radius: 12px;
    background: rgba(18, 11, 6, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body .topPanel .profile {
    display: flex;
    align-items: center;
    gap: 8px;
    float: none;
    width: auto;
    max-width: 430px;
    padding: 0;
}

body .topPanel .menuBlock-logo {
    display: flex;
    align-items: center;
}

body .topPanel .login_panel {
    display: contents;
}

body .topPanel .login_panel input {
    width: 138px;
    height: 38px;
    padding: 0 12px 0 38px;
    border: 1px solid rgba(216, 180, 106, 0.24);
    border-radius: 8px;
    background: rgba(14, 9, 5, 0.55);
    color: #f3ecdf;
    font-size: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body .topPanel .login_panel input:focus {
    border-color: rgba(216, 180, 106, 0.55);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 180, 106, 0.1);
}

body .topPanel .login_panel input::placeholder {
    color: #a99478;
}

body .topPanel .header__lk {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(255, 230, 170, 0.55);
    border-radius: 10px;
    background: linear-gradient(180deg, #f4dda8 0%, #ddb56e 52%, #c4944e 100%);
    color: #211508;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.015em;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    box-shadow:
        0 8px 20px rgba(160, 110, 50, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

body .topPanel .header__lk:hover {
    transform: translateY(-1px);
    filter: brightness(1.025);
    box-shadow:
        0 12px 26px rgba(160, 110, 50, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body .topPanel .header__lk .btn-icon {
    display: block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

body .topPanel .user-items {
    margin-right: 0;
    padding: 4px 8px;
    border: 1px solid rgba(216, 180, 106, 0.28);
    border-radius: 12px;
    background: rgba(18, 11, 6, 0.45);
}

body .topPanel .item-icon img {
    border-color: rgba(216, 180, 106, 0.45);
}

body .topPanel .item-icon:hover img {
    border-color: rgba(240, 201, 116, 0.9);
    box-shadow: 0 0 15px rgba(216, 180, 106, 0.45);
}

@media (min-width: 993px) and (max-width: 1200px) {
    body .topPanel .menu li a {
        padding: 7px 7px;
        font-size: 10px;
    }

    body .topPanel .login_panel input {
        width: 100px;
    }

    body .topPanel .login_panel button {
        padding: 0 8px;
    }
}

/* --------------------------------------------------------------------------
   Мобильная версия
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    body .topPanel {
        height: 60px;
    }

    body .topPanel__inner {
        height: 60px;
        padding: 0 12px;
    }

    body .topPanel__inner::before {
        content: "ОСТОВ ТИТАНОВ";
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(241, 217, 164, 0.9);
        font-family: "Philosopher", Georgia, serif;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.2em;
        white-space: nowrap;
        pointer-events: none;
    }

    body .topPanel .menuBlock {
        height: 60px;
        gap: 0;
    }

    body .topPanel .menu_block {
        height: 60px;
        gap: 0;
    }

    body .topPanel .menuButton {
        position: static;
        left: auto;
        width: 42px;
        height: 42px;
        margin-right: auto;
        border-radius: 11px;
    }

    body .topPanel .menuButton .home__item {
        display: none;
    }

    body .topPanel .menuButton .menu__mobail {
        display: flex;
    }

    body .topPanel .auth_block {
        display: none;
    }

    body .topPanel .menuBlock-logo {
        display: none;
    }

    body .topPanel .nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        display: none;
        width: 100%;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding: 10px 14px 18px;
        border-bottom: 1px solid rgba(216, 180, 106, 0.45);
        background:
            linear-gradient(180deg, rgba(54, 36, 22, 0.97), rgba(18, 11, 7, 0.985));
        box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    body .topPanel .nav.is-open {
        display: block;
    }

    body .topPanel .menu {
        display: block;
        padding: 0;
    }

    body .topPanel .menu li {
        display: block;
        min-height: 0;
        border-bottom: 1px solid rgba(216, 180, 106, 0.12);
    }

    body .topPanel .menu li.only-mob {
        display: block !important;
    }

    body .topPanel .menu li:last-child {
        border-bottom: 0;
    }

    body .topPanel .menu li a {
        display: flex;
        padding: 14px 8px;
        border: 0;
        border-radius: 0;
        font-size: 14px;
        letter-spacing: 0.03em;
    }

    body .topPanel .menu li a:hover {
        background: rgba(216, 180, 106, 0.07);
    }
}

/* «Запомнить меня» в компактной форме входа */
body .topPanel .login_panel .remember-me {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: #b8a58e;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
body .topPanel .login_panel .remember-me input[type="checkbox"] {
    width: 13px;
    height: 13px;
    min-width: 13px;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #c9913c;
}
@media (max-width: 1500px) {
    body .topPanel .login_panel .remember-me span { display: none; }
}
