/* In-game 1:1 chat overlay (#490) */

.chat-overlay {
    display: flex;
    flex-direction: column;
    width: min(92vw, 480px);
    max-width: 100%;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 45vh;
    max-height: 420px;
    overflow-y: auto;
    padding: 1rem 8px;
    background: var(--bs-tertiary-bg, #f1f3f5);
    border-radius: 10px;
}

.chat-message {
    display: flex;
}

.chat-message--mine {
    justify-content: flex-end;
}

.chat-message--theirs {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 78%;
    padding: 8px 12px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    word-break: break-word;
}

.chat-message--mine .chat-bubble {
    background: var(--bs-info, #0dcaf0);
    color: #05323b;
}

.chat-message-image {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    display: block;
    cursor: pointer;
}

/* Full-screen lightbox for tapping a chat image (mirrors the forum/wiki overlay). */
.chat-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.chat-image-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
}

.chat-message-text + .chat-message-image,
.chat-message-image + .chat-message-text {
    margin-top: 6px;
}

.chat-text-input {
    resize: none;
    max-height: 120px;
}

.chat-image-preview {
    margin-top: 6px;
}

.chat-image-preview img {
    max-height: 80px;
    border-radius: 6px;
}

@media (prefers-color-scheme: dark) {
    .chat-messages {
        background: rgba(255, 255, 255, 0.06);
    }

    .chat-bubble {
        background: #2a2d31;
        color: #e9ecef;
    }
}
