/* Chat panel: message log and form. */

.chat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    min-height: 24rem;
}

.chat__log {
    flex: 1;
    min-height: 10rem;
    margin: 0;
    padding: 0.75rem;
    overflow-y: auto;
    border: 2px ridge #000;
    background: url("../../images/player/binding_dark.png");
    list-style: none;
}

.chat-message {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    padding: 0.5rem;
    background: rgb(0 0 0 / 0.4);
    color: var(--kp-burlywood);
    font-family: var(--kp-font-ui);
    font-size: 0.9rem;
    animation: chat-in 400ms ease-out;
}

.chat-message__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.4rem;

    & strong {
        color: var(--kp-orange);
    }

    & time,
    & .chat-message__source {
        color: var(--kp-text-muted);
        font-size: 0.85em;
    }
}

.chat-message__content {
    overflow-wrap: anywhere;
    white-space: pre-line;
}

@keyframes chat-in {
    from { opacity: 0; }
}

@media (orientation: portrait), (max-width: 56rem) {
    .chat__log {
        max-height: 60dvh;
    }
}
