#chat {
    width: 350px;
    height: 500px;

    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;

    user-select: text;
}

#chat-list {
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: stretch;

    flex-grow: 1;
}

#chat-input-container {
    position: relative;

    display: flex;
    flex-direction: row;
    gap: 5px;
}

#chat-input {
    flex-grow: 1;
}

.chat-entry {
    min-height: 20px;
    height: max-content;

    overflow: hidden;
    text-wrap: wrap;
    word-break: break-word;

    flex-shrink: 0;

    white-space: pre-wrap;
}

.chat-entry.special {
    padding: 5px;
    font-size: 0.9em;
}

.chat-entry.whisper {
    background-color: #7733ff77;
}

.chat-entry.command-response {
    background-color: #ff773377;
}

.chat-entry.server-announcement {
    text-align: center;

    background-color: #ffbb0077;
}

.chat-entry.server-error {
    background-color: #ff000077;
}

.chat-entry:nth-child(1 of .chat-entry:not(.hidden)) {
    margin-top: auto;
}

#chat-autocomplete {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: fit-content;

    min-height: 30px;
    max-height: 350px;

    overflow-y: scroll;

    background-color: #00000077;

    display: flex;
    flex-direction: column;

    &.hidden {
        display: none;
    }
}

.autocomplete-entry {
    padding: 5px;
    height: 28px;
    flex-shrink: 0;

    background-color: transparent;
    border: none;
    color: white;
    font-weight: bold;

    text-align: start;

    transition: background-color 0.2s ease-in-out;

    &.selected,
    &:hover {
        background-color: #ffffff77;
    }

    &:focus {
        outline: none;
    }
}