<style>
    /* Общие стили чата */
    #chat-container {
        position: fixed;
        right: 20px;
        bottom: 20px;
        width: 350px;
        background: #1a1a1a;
        border: 1px solid #444;
        border-radius: 5px;
        z-index: 1000;
        display: none;
        box-shadow: 0 0 15px rgba(0,0,0,0.5);
    }
    
    #chat-header {
        background: #333;
        color: white;
        padding: 8px 15px;
        cursor: pointer;
        border-radius: 5px 5px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #chat-content {
        display: flex;
        height: 400px;
    }
    
    #chat-sidebar {
        width: 100px;
        background: #252525;
        border-right: 1px solid #444;
        overflow-y: auto;
    }
    
    .chat-tab {
        padding: 10px;
        cursor: pointer;
        border-bottom: 1px solid #444;
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .chat-tab.active {
        background: #4CAF50;
    }
    
    .chat-tab.unread {
        font-weight: bold;
        color: #FFD700;
    }
    
    #chat-main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    
    #chat-messages {
        flex-grow: 1;
        overflow-y: auto;
        padding: 10px;
        background: #222;
        color: #eee;
    }
    
    #chat-input-area {
        padding: 10px;
        background: #333;
        border-radius: 0 0 5px 0;
    }
    
    #chat-controls {
        display: flex;
        margin-bottom: 5px;
    }
    
    #chat-recipient {
        flex-grow: 1;
        padding: 5px;
        background: #444;
        color: white;
        border: none;
        border-radius: 3px;
        margin-right: 5px;
    }
    
    #chat-message-input {
        width: 100%;
        padding: 5px;
        border: none;
        border-radius: 3px;
    }
    
    #chat-send-button {
        margin-top: 5px;
        padding: 5px 10px;
        width: 100%;
        background: #4CAF50;
        color: white;
        border: none;
        border-radius: 3px;
        cursor: pointer;
    }
    
    .message {
        margin-bottom: 8px;
        line-height: 1.4;
        padding: 5px;
        border-radius: 3px;
        background: #2a2a2a;
    }
    
    .message-owner {
        font-weight: bold;
        color: #4CAF50;
    }
    
    .message-private {
        border-left: 3px solid #FF5722;
        padding-left: 5px;
    }
    
    .message-time {
        font-size: 0.8em;
        color: #aaa;
    }
    
    #chat-toggle {
        position: fixed;
        right: 20px;
        bottom: 20px;
        background: #4CAF50;
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 20px;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }
    
    #login-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #333;
        padding: 20px;
        border-radius: 5px;
        z-index: 1002;
        color: white;
        width: 300px;
    }
    
    #login-form {
        display: flex;
        flex-direction: column;
    }
    
    #username-input {
        margin-bottom: 10px;
        padding: 8px;
        border-radius: 3px;
        border: none;
    }
    
    #login-submit, #login-cancel {
        padding: 8px;
        margin-top: 5px;
        border: none;
        border-radius: 3px;
        cursor: pointer;
    }
    
    #login-submit {
        background: #4CAF50;
        color: white;
    }
    
    #login-cancel {
        background: #f44336;
        color: white;
    }
    
    #new-chat-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: #333;
        padding: 20px;
        border-radius: 5px;
        z-index: 1003;
        color: white;
        width: 300px;
    }
    
    #new-chat-type {
        width: 100%;
        padding: 8px;
        margin-bottom: 10px;
        background: #444;
        color: white;
        border: none;
        border-radius: 3px;
    }
    
    #new-chat-name, #new-chat-users {
        width: 100%;
        padding: 8px;
        margin-bottom: 10px;
        border: none;
        border-radius: 3px;
    }
    
    #add-chat-button {
        width: 100%;
        padding: 8px;
        background: #4CAF50;
        color: white;
        border: none;
        border-radius: 3px;
        cursor: pointer;
    }
    
    .user-list {
        max-height: 150px;
        overflow-y: auto;
        margin-bottom: 10px;
        border: 1px solid #444;
        padding: 5px;
        border-radius: 3px;
    }
    
    .user-item {
        padding: 5px;
        cursor: pointer;
    }
    
    .user-item:hover {
        background: #444;
    }
    
    .user-item.selected {
        background: #4CAF50;
    }
    
    #chat-title {
        font-weight: bold;
        margin-right: 10px;
    }
    
    /* Общие стили для меню */
        .navbar {
            display: flex;
            justify-content: center;
            gap: 1rem;
            padding: 0.5rem;
            background: linear-gradient(to right, #3a2c1a, #5a4a30);
            border-bottom: 2px solid #8b6b3d;
            font-family: 'Times New Roman', Times, serif;
        }
        
        .menu-bars {
            color: #f0e6d2 !important;
            text-decoration: none !important;
            font-size: 1rem;
            letter-spacing: 1px;
            text-transform: uppercase;
            text-shadow: 1px 1px 2px #000;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            transition: all 0.3s ease;
            position: relative;
        }
        
        .menu-bars:hover {
            background-color: rgba(139, 107, 61, 0.3);
            transform: translateY(-2px);
        }
        
        .menu-bars:active, 
        .menu-bars:visited {
            color: #f0e6d2 !important;
        }
        
        .menu-bars::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: 0;
            left: 0;
            background-color: #8b6b3d;
            transition: width 0.3s ease;
        }
        
        .menu-bars:hover::after {
            width: 100%;
        }
        
        .map-navbar {
            display: flex;
            justify-content: center;
            gap: 1rem;
            padding: 0.5rem;
            background: linear-gradient(to right, #3a2c1a, #5a4a30);
            border-bottom: 2px solid #8b6b3d;
            font-family: 'Times New Roman', Times, serif;
        }
        
        /* Адаптивность */
        @media (max-width: 768px) {
            .menu-container {
                flex-direction: column;
                align-items: center;
                gap: 0.5rem;
                padding: 0.5rem;
            }
            
            .menu-link {
                font-size: 1rem;
                padding: 0.3rem 0.6rem;
                width: 100%;
                text-align: center;
            }
            
            /* Другие адаптивные стили для мобильных устройств */
            body {
                font-size: 14px;
            }
            
            /* Уменьшаем размеры элементов интерфейса */
            .game-interface {
                padding: 5px;
            }
            
            /* Оптимизация для мобильных устройств */
            * {
                -webkit-tap-highlight-color: transparent;
            }
            
            /* Убираем задержку при клике на мобильных */
            a, button {
                touch-action: manipulation;
            }
        }
        
        @media (max-width: 480px) {
            .menu-link {
                font-size: 0.9rem;
            }
            
            /* Дополнительные стили для очень маленьких экранов */
        }
        
        /* Убираем стандартные стили для ссылок */
        a {
            text-decoration: none;
            color: inherit;
        }
        
        a:focus, a:active {
            outline: none;
        }
        
        /* Убираем выделение фиолетовым после нажатия */
        a:visited {
            color: inherit !important;
        }
</style>