.chat-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px; /* Space for messages + input */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    padding: 10px;
    pointer-events: none; /* Let clicks pass to wood if not in UI */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    padding-bottom: 10px;
    pointer-events: auto;
}

.chat-msg {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 14px;
    color: #111; /* Dark text for readability on white */
    font-size: 0.85rem;
    max-width: 85%;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideInUp 0.3s ease-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chat-msg.is-me {
    background: white;
    align-self: flex-end;
    border-color: #fbbf24;
}


.chat-msg .sender {
    font-weight: 800;
    font-size: 0.75rem;
    margin-right: 5px;
}

/* Gender Based Names */
.chat-msg .sender.gender-male {
    color: #0ea5e9; /* Blue */
}

.chat-msg .sender.gender-female {
    color: #ec4899; /* Pink */
}

.chat-msg .sender.gender-none {
    color: #666; /* System messages */
}


.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    pointer-events: auto;
    margin-bottom: constant(safe-area-inset-bottom);
    margin-bottom: env(safe-area-inset-bottom);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 15px;
    font-size: 0.9rem;
    outline: none;
    color: #111;
}

.chat-send-btn {
    background: #fbbf24;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    cursor: pointer;
}

@keyframes slideInUp {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
