.main-header {
    background: var(--bg);
    padding: 0 160px;
    display: flex;
    align-items: center;
    gap: 52px;
    justify-content: space-between;
    height: 80px;
}

.nav-section {
    display: flex;
    align-items: center;
    gap: 52px;
}

.logo {
    width: 180px;
    height: 60px;
}

.nav-btn {
    color: #8f8f8f;
    text-decoration: none;
    font-family: 'Handjet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {

    color: #ffffffcc;
}

.nav-btn.locked {
    opacity: 0.5;
    cursor: default;
}

.nav-btn.locked:hover {
    color: #8f8f8f;
}

.nav-btn img {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

.nav-btn.active {

    color: #8f8f8f;
    text-decoration: none;
}


.nav-btn.new-post {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.nav-btn:hover {
    scale: 1.05;
}

.search-section {
    align-items: center;
    display: flex;
    flex: 1;
    margin: 0;
    min-width: 140px;
}

.search-input {
    width: 100%;
    background-color: #444;
    background-image: url('/static/image/search-icon.svg');
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
    background-blend-mode: normal;
    border: 1px solid #404040;
    color: #fff;
    padding: 12px 16px 12px 42px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Handjet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s;
    display: block;
}


.search-input:focus {
    border-color: var(--accent);
}

.search-input::placeholder {
    color: #8f8f8f;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 80px;
}

.auth-btn {
    display: inline-block;
    width: 158px;
    height: 45px;
    background: url('/static/image/twitch-auth.png') no-repeat center/contain;
    border: none;
    cursor: pointer;
    vertical-align: middle;
}

.avatar-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    height: 45px;
}

.avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    position: relative;
    top: 0;
}

.avatar-img {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    box-shadow: none;
}


.dropdown-menu {
    display: none;
    position: absolute;
    top: 58px;
    right: 0;
    background: #252525;
    border: 1px solid #333;
    border-radius: 10px;
    box-shadow: none;
    min-width: 200px;

    font-family: 'Handjet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
}

.dropdown-username {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
}

.dropdown-admin-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #ff2b2b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.dropdown-admin-btn:hover {
    background: #ff4545;
}

.dropdown-admin-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ddd;
    font-size: 16px;
    padding: 12px 18px;
    text-decoration: none;
    transition: background 0.15s;
    font-weight: 600;
}

.dropdown-item:hover {
    background: #343434;
    color: #fff;
}

.dropdown-item.logout {
    border-top: 1px solid #333;
}

.dropdown-item img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}


#search-overlay {
    backdrop-filter: none;
}

.mobile-header {
    display: none;
}

@media(max-width: 1024px) and(min-width: 481px) {
    .main-header {
        padding: 0 24px;
        gap: 24px;
    }

    .nav-section {
        gap: 24px;
    }

    .nav-section .logo {
        margin-right: 0;
    }

    .logo {
        width: 120px;
        height: 40px;
    }

    .search-section {
        max-width: 200px;
        margin: 0 16px;
    }

    .auth-btn {
        font-size: 12px;
        padding: 6px 10px;
        height: 32px;
    }

    .auth-btn img {
        width: 20px !important;
        height: 20px !important;
    }

    .nav-btn[href="/"] {
        display: none;
    }
}

@media(max-width: 480px) {
    .main-header {
        display: none;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        height: 64px;
        padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left));
        background: var(--bg);
        overflow: visible;

        position: relative;
        z-index: 1001;
    }

    .mobile-header .mobile-left,
    .mobile-header .mobile-right {
        flex: 0 0 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-header .mobile-left img {
        width: 28px;
        height: 28px;
        display: block;
    }

    .mobile-header .mobile-right img {
        width: 28px;
        height: 28px;
        display: block;
    }

    .mobile-header .mobile-search {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0 4px;
        display: flex;
    }

    .mobile-header .mobile-search input {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
        display: block;
        background: #444444;
        border: 1px solid #404040;
        color: #fff;
        padding: 10px 12px 10px 40px;
        background-image: url('/static/image/search.png');
        background-repeat: no-repeat;
        background-position: 10px center;
        background-size: 18px 18px;
        border-radius: 10px;
        font-size: 16px;

        font-family: 'Handjet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
        outline: none;
        box-sizing: border-box;
    }

    .mobile-header .mobile-search input::placeholder {
        color: #8f8f8f;
    }


    .mobile-dropdown {
        position: fixed;
        top: 0;
        left: env(safe-area-inset-left);
        right: env(safe-area-inset-right);
        bottom: 0;
        background: var(--bg);
        z-index: 9999;
        padding: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .mobile-dropdown:not(.show) {
        display: none;
    }

    .mobile-menu-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 20px;
        gap: 40px;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px calc(16px + env(safe-area-inset-right)) 20px calc(16px + env(safe-area-inset-left));
        border-bottom: 1px solid #404040;
    }

    .mobile-menu-search {
        padding: 12px calc(16px + env(safe-area-inset-right)) 12px calc(16px + env(safe-area-inset-left));
    }

    .mobile-menu-search .search-input {
        width: 100%;
        min-width: 0;
        display: block;
        background: #444444;
        border: 1px solid #404040;
        color: #fff;
        padding: 10px 12px 10px 40px;
        background-image: url('/static/image/search.png');
        background-repeat: no-repeat;
        background-position: 10px center;
        background-size: 18px 18px;
        border-radius: 10px;
        font-size: 16px;
        font-family: 'Handjet', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
        outline: none;
        box-sizing: border-box;
    }

    .mobile-menu-logo {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-menu-logo img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 60px;
    }

    .mobile-menu-close {
        background: var(--accent);
        border: none;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        cursor: pointer;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-close img {
        width: 28px;
        height: 28px;
        object-fit: contain;
        display: block;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }

    .mobile-menu-items {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .mobile-menu-item {
        font-family: Handjet;
        font-weight: 700;
        font-style: bold;
        font-size: 28px;
        line-height: 100%;
        letter-spacing: 0;
        text-align: center;
        color: #FFFFFF80;
        text-decoration: none;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 8px 16px;
        gap: 8px;
        flex: none;
        order: 0;
        align-self: center;
        flex-grow: 0;
        transition: color 0.2s;
        border-radius: 8px;
    }

    .mobile-menu-item:hover {
        color: var(--accent);
    }

    .mobile-menu-item.active {
        color: var(--accent);
        font-weight: 600;
        text-decoration: underline;
        text-decoration-color: var(--accent);
        text-underline-offset: 4px;
    }

    .mobile-menu-item.locked {
        opacity: 0.5;
        cursor: default;
    }

    .mobile-menu-item.locked:hover {
        color: #e0e6ed;
    }


    .mobile-menu-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 12px;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 12px 16px;
        gap: 8px;
        width: 330px;
        min-height: 48px;
        background: #789D2A;
        border-radius: 10px;
        border: none;
        font-family: 'Handjet';
        font-style: normal;
        font-weight: 700;
        font-size: 18px;
        line-height: 100%;
        text-transform: capitalize;
        color: #FFFFFF;
        text-decoration: none;
        cursor: pointer;
        box-sizing: border-box;
        flex: none;
        order: 0;
        flex-grow: 0;
    }

    .mobile-menu-btn.new-post {
        background: var(--accent);
        color: #FFFFFF;
        text-decoration: none;
    }

    .mobile-menu-btn.new-post:hover {
        color: #7fe84a;
        text-decoration-color: #7fe84a;
    }


    .mobile-menu-btn.twitch-login {
        background: #9146ff;
    }

    .mobile-menu-btn.my-account {
        background: #404040;
        background: #2a2a2a;
        border: 1px solid var(--accent);
        color: var(--accent);
    }

    .mobile-menu-btn img {
        width: 20px;
        height: 20px;
        flex: none;
        order: 2;
        flex-grow: 0;
        flex-shrink: 0;
    }

    .mobile-menu-item img {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    @media(max-width: 380px) {
        .mobile-header {
            gap: 8px;
            padding: 0 calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left));
        }

        .mobile-header .mobile-left,
        .mobile-header .mobile-right {
            flex-basis: 24px;
        }

        .mobile-header .mobile-left img,
        .mobile-header .mobile-right img {
            width: 24px;
            height: 24px;
        }

        .mobile-header .mobile-search input {
            font-size: 16px;
            padding: 9px 10px 9px 38px;
            background-position: 9px center;
            background-size: 16px 16px;
        }

        .mobile-menu-buttons {
            bottom: 16px;
            left: calc(12px + env(safe-area-inset-left));
            right: calc(12px + env(safe-area-inset-right));
            gap: 6px;
        }

        .mobile-menu-btn {
            padding: 12px 14px;
            font-size: 14px;
            min-height: 44px;
        }

        .mobile-menu-items {
            padding: 15px 0;
            gap: 16px;
        }

        .mobile-menu-item {
            font-size: 16px;
        }
    }
}