.chatcontainer0 {
    background-color: #222;
    margin-top: 210px;
    display: block;
    position: relative;
    max-width: 650px;
    width: 100%;
    padding: 0px 5px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chatcontainer {
    width: 100%;
}

.ban-notice {
    background-color: #f73632;
    color: white;
    width: 200px;
    padding: 8px 14px;
    margin: 10px auto; /* Центрирует по горизонтали */
    text-align: center;
    font-weight: bold;
    display: block;
}

#chat {
    background-color: #222;
    height: 60vh;
    width: 100%; /* Растягиваться на всю ширину родителя */
    max-width: 640px; /* Но не больше 600px */
    max-height: 550px;
    min-height: 300px;
    min-width: 400px;
    overflow-y: auto;
    padding: 0;
    margin: 0 auto;
    display: block;
    box-sizing: border-box;
    border: 2px solid rgb(0, 0, 0);
}

.semiheader {
    display: flex;
    justify-content: flex-end;
    align-items: center;

}

#message {
    display: none;
    width: 270px;
    padding: 8px 5px;
    padding-right: 40px;
    margin: 10px;
    background-color: #ffd500;
    color: rgb(0, 0, 0);
    border: 2px solid rgb(0, 0, 0);
    font-weight: bold;
}

#username {
    width: 305px;
    padding: 8px 5px;
    margin: 10px;
    background-color: #ffd500;
    color: rgb(0, 0, 0);
    border: 2px solid rgb(0, 0, 0);
    font-weight: bold;
}

#message:focus {
    outline: none;
    display: flex;
}

.message {
    display: fixed;
    bottom: 0;
    text-align: left;
    padding-bottom: 10px;
    display: flex;
    color: #EFEFF1;
    max-width: 90ch; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
    white-space: pre-wrap; 
    word-break: break-all; 
    margin-left: 3px;
    font-weight: bold;

}

#logout-button {
    position: absolute;
    background-color: transparent;
    right: 70px;
    top: 10px;
    float: right;
    border: none;
    display: none;
    font-size: 14px;
    color: #ffd500;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.chatheader {
    background-color: #222;
    justify-content:space-between;
    align-items: center;
    display: flex;
    max-width:700px;
    width: 100%;
    max-height: 50px;
    height: 100%;
    min-height: 30px;
}

#toggleChatButton {
    float: left;
    padding: 10px 10px;
    background-color: transparent;
    color: rgb(0, 0, 0);
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 0px;
    cursor: pointer;
    border: none;
}


#send-button {
    display: none;
    margin: 10px;
    margin-left: 0;
    height: 35px;
    max-width: 50px;
    width: 100%;
    border: none;
    background-color: #ffd500;
    color: black;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.chatfooter {
    display: flex;
    justify-content: center;
}

#set-username {
    margin: 10px;
    margin-left: 0;
    height: 35px;
    max-width: 50px;
    width: 100%;
    border: none;
    background-color: #ffd500;
    color: black;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

#recaptcha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}



#CAPTCHA {
    width: 320px;
    padding: 8px 50px;
    margin: 15px;
    background-color: rgb(238,238,238);
    color: rgb(0, 0, 0);
    border: 2px solid rgb(182, 181, 181);
    cursor: pointer;
    font-weight: bold;
}


.username {
    font-size: 14px;
    height: 20px;
    font-weight: 600;
    color: #ffd500;
    white-space: nowrap;
    cursor: pointer;
}

.admin-username {
    font-weight: 600;  
    font-size: 14px;
    height: 20px;
    color: #AD3D3D;  
    white-space: nowrap;
}

.ban-button {
    background-color: red;
    color: white;
    border: none;
    padding: 2px 5px;
    margin: 0px 5px;
    cursor: pointer;
}

.hidden {
    display: none;
}

.text {
    color: #EFEFF1;
    font-size: 14px;
    padding-left: 5px;
}

#messages {
    height: calc(100% - 50px);
    overflow-y: auto;
}

#message-input {
    display: flex;
    align-items: center;
    margin-top: 10px;
}


#username-input {
    margin-bottom: 10px;
}



#username-input {
    margin-bottom: 10px;
}

#username:focus {
    outline: none;  
}



.PLNDRMC {
    color: #ffd500;
    font-weight: bold;
    font-size: 18px;
}

.chatlogo img {
    width: 40px;
    height: auto;

}

.hidden {
    display: none;
}

.hidden-chat {
    display: none;
}



#chat::-webkit-scrollbar {
    width: 10px;
}

#chat::-webkit-scrollbar-thumb {
    background-color: #000000;
    padding-left: 30px;
}



.emoji-container {
    position: relative;
    display: inline-block;
}

#emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    margin: 10px;
    margin-left: -55px;
    outline: none;
}

.emoji-picker {
    position: absolute;
    bottom: 40px;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 150px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.emoji-picker span {
    cursor: pointer;
    font-size: 20px;
    text-align: center;
    display: inline-block;
    padding: 5px;
    transition: transform 0.2s;
}

.emoji-picker span:hover {
    transform: scale(1.2);
}

.hidden {
    display: none !important;
}

@media (min-width: 769px) {
    #toggleChatButton {
        display: none !important;
    }
}


.chatheader.collapsed {
    background-color: black;
    font-size: 8px;
    justify-content: center;
}


@media (max-width: 768px) {
    .chatcontainer0 {
        margin: 0 0; /* Убираем все отступы */
        padding: 0 0 !important;
        position: fixed; /* Чтобы чат был фиксированным */
        bottom: 0; /* Прикрепляем к низу экрана */
        left: 0;
        width: 100vw; /* Полная ширина экрана */
        max-width: none; /* Снимаем ограничения ширины */
        z-index: 1000; /* Чтобы поверх всего было */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #chat {
        width: 100vw; /* ВСЯ ширина экрана */
        height: 40vh; /* ПОЛОВИНА высоты экрана */
        max-width: 100%; /* Ограничение по максимуму */
        max-height: 50vh;
        min-width: 0; /* Убираем ограничения */
        min-height: 0;
        margin: 0;
    }
    #message {
        width: 100%;
        width: 172px;
        padding: 8px 5px;
        padding-right: 40px;
        margin: 10px;
        color: rgb(0, 0, 0);
        font-weight: bold;
        font-size: 11px;
    }

    #username {
        width: 100%;
        width: 180px;
        padding: 8px 5px;
        padding-right: 40px;
        margin: 10px;
        color: rgb(0, 0, 0);
        font-weight: bold;
        font-size: 11px;
    }

    .chatheader {
        text-align: center;
        justify-content: center;
        
    }

    #emoji-picker {
        width: 150px;
        max-height: 120px;
        bottom: 50px;
        right: 5px;
    }
    
    #emoji-picker span {
        font-size: 16px;
    }

    .PLNDRMC {
        font-weight: bold;
        font-size: 14px;
    }

    #toggleChatButton {
        display: block;
        float: left;
        padding: 10px 10px;
        background-color: transparent;
        color:rgb(0, 0, 0);
        font-family: 'Courier New', Courier, monospace;
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 0px;
        cursor: pointer;
        border: none;
    }

    .chatlogo img {
        width: 30px;
        height: auto;
    
    }

    #logout-button {
        background-color: transparent;
        position: absolute;
        right: 40px;
        top: 10px;
        float: right;
        border: none;
        display: none;
        font-size: 14px;
        color: #ffd500;
        cursor: pointer;
        font-family: 'Courier New', Courier, monospace;
        font-weight: bold;
    }


}

