:root {
    --accent: #ff8a00;
    --line: rgba(255, 160, 88, 0.18);
    --brand-sub: #f4a95f;
    --brand-note: #f0ebe6;
    --badge-line: rgba(255, 191, 122, 0.55);
    --badge-bg: rgba(255, 153, 51, 0.2);
    --badge-text: #ffd29d;
    --switch-line: rgba(255, 166, 102, 0.28);
    --switch-thumb: #ff980b;
    --cta-grad-1: #ffca2d;
    --cta-grad-2: #ff980b;
    --cta-text: #180c02;
    --cta-shadow: rgba(255, 123, 16, 0.45);
    --talk-btn-text: #231304;
    --talk-btn-grad-1: #ffcb4d;
    --talk-btn-grad-2: #ff9f10;
    --talk-btn-shadow: rgba(255, 145, 36, 0.38);
}

body.theme-telegram {
    --accent: #39a7ff;
    --line: rgba(99, 190, 255, 0.28);
    --brand-sub: #7cc8ff;
    --brand-note: #d8eeff;
    --badge-line: rgba(142, 219, 255, 0.55);
    --badge-bg: rgba(75, 185, 255, 0.22);
    --badge-text: #c5ecff;
    --switch-line: rgba(109, 202, 255, 0.34);
    --switch-thumb: #38aef2;
    --cta-grad-1: #8ad8ff;
    --cta-grad-2: #3aa9f0;
    --cta-text: #032341;
    --cta-shadow: rgba(46, 152, 222, 0.46);
    --talk-btn-text: #042039;
    --talk-btn-grad-1: #79d2ff;
    --talk-btn-grad-2: #31a7ee;
    --talk-btn-shadow: rgba(35, 155, 231, 0.4);
}

.shared-topbar-wrap {
    width: min(1200px, 100% - 40px);
    margin: 0 auto;
    padding-top: 22px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 34px;
}

.main-menu {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line, rgba(255, 160, 88, 0.18));
    background: rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(6px);
}

.main-menu a {
    color: var(--brand-note, #f0ebe6);
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.main-menu a:hover {
    color: var(--accent, #ff8a00);
}

.brand {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}

.brand-home {
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    font-family: "Russo One", sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--accent, #ff8a00);
    text-transform: uppercase;
}

.brand-sub {
    margin-top: 5px;
    font-family: "Manrope", sans-serif;
    font-size: 0.8rem;
    color: var(--brand-sub, #f4a95f);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-badges {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.brand-badge {
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--badge-line, rgba(255, 191, 122, 0.55));
    background: var(--badge-bg, rgba(255, 153, 51, 0.2));
    color: var(--badge-text, #ffd29d);
    font-family: "Manrope", sans-serif;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

.contact {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    background: rgba(8, 8, 12, 0.34);
    box-shadow: inset 0 0 0 1px var(--switch-line, rgba(255, 166, 102, 0.28));
}

.lang-btn {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--brand-note, #f0ebe6);
    font-family: "Manrope", sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 7px 11px;
    cursor: pointer;
    text-transform: uppercase;
    transition: .2s ease;
}

.lang-btn.is-active {
    background: linear-gradient(180deg, var(--cta-grad-1, #ffca2d) 0%, var(--cta-grad-2, #ff980b) 100%);
    color: var(--cta-text, #180c02);
    box-shadow: 0 5px 14px var(--cta-shadow, rgba(255, 123, 16, 0.45));
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 86px;
    height: 36px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(8, 8, 12, 0.34);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 0 1px var(--switch-line, rgba(255, 166, 102, 0.28));
    transition: .2s ease;
}

.theme-icon {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    opacity: .95;
}

.icon-fire {
    right: 12px;
}

.icon-snow {
    left: 12px;
}

.theme-thumb {
    position: absolute;
    top: 4px;
    left: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--switch-thumb, #ff980b);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
    transition: transform .2s ease, background .2s ease;
}

#themeToggle:checked + .theme-slider .theme-thumb {
    transform: translateX(46px);
}

.talk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 0;
    padding: 9px 16px;
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--talk-btn-text, #231304);
    background: linear-gradient(180deg, var(--talk-btn-grad-1, #ffcb4d) 0%, var(--talk-btn-grad-2, #ff9f10) 100%);
    box-shadow: 0 6px 16px var(--talk-btn-shadow, rgba(255, 145, 36, 0.38));
}

@media (max-width: 1080px) {
    .topbar {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .brand,
    .contact {
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .shared-topbar-wrap {
        width: min(1200px, 100% - 24px);
        padding-top: 14px;
    }

    .main-menu {
        width: 100%;
        justify-content: center;
    }

    .topbar {
        margin-bottom: 18px;
    }
}


.user-panel {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--line, rgba(255, 160, 88, 0.18));
    background: rgba(0, 0, 0, 0.26);
    color: var(--brand-note, #f0ebe6);
    font-family: "Manrope", sans-serif;
}

.user-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    line-height: 1.18;
}

.user-display-name {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 800;
    font-size: 0.86rem;
}

.user-display-handle {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
    color: var(--brand-sub, #f4a95f);
}

.user-menu > summary {
    list-style: none;
}

.user-menu > summary::-webkit-details-marker {
    display: none;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 138px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--line, rgba(255, 160, 88, 0.18));
    background: rgba(8, 12, 20, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
    z-index: 40;
}

.user-logout-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3c4d64;
    border-radius: 10px;
    background: #16253a;
    color: #dce6f4;
    text-decoration: none;
    font-family: "Manrope", sans-serif;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 8px 12px;
    cursor: pointer;
}

.user-logout-btn:hover {
    border-color: var(--accent, #ff8a00);
    color: var(--accent, #ff8a00);
}

@media (max-width: 760px) {
    .user-panel {
        max-width: none;
    }
}



.user-panel-trigger {
    list-style: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.user-panel-trigger::-webkit-details-marker {
    display: none;
}

.user-panel-menu {
    cursor: pointer;
}

.user-panel-menu[open] {
    border-color: var(--accent, #ff8a00);
}
