/* Styling for the Live chat page. Self-contained so it does not depend on
   uncompiled Tailwind utilities. */

.chat {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.25rem;
    background: #faf8f5;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.chat-namebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    font-size: 0.95rem;
    color: #6b6258;
}
.chat-name-label strong { color: #2a2622; }
.chat-link {
    background: none;
    border: none;
    color: #5d7e1c;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 0.4rem;
    -webkit-tap-highlight-color: transparent;
}
.chat-link:hover { text-decoration: underline; }

.chat-messages {
    height: clamp(320px, 52vh, 560px);
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-empty {
    margin: auto;
    color: #9a9186;
    font-style: italic;
    text-align: center;
}

.msg {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-self: flex-start;
}
.msg.mine { align-self: flex-end; align-items: flex-end; }

.msg-meta {
    font-size: 0.78rem;
    color: #9a9186;
    padding: 0 0.35rem;
}
.msg-meta .msg-author { font-weight: 700; color: #6b6258; }
.msg.mine .msg-meta .msg-author { color: #5d7e1c; }

.msg-bubble {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    padding: 0.6rem 0.9rem;
    border-radius: 1rem;
    border-top-left-radius: 0.3rem;
    color: #2a2622;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.msg.mine .msg-bubble {
    background: #6b8e23;
    border-color: #6b8e23;
    color: #fff;
    border-top-left-radius: 1rem;
    border-top-right-radius: 0.3rem;
}

.chat-form {
    display: flex;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}
.chat-input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: #faf8f5;
    color: #2a2622;
}
.chat-input:focus {
    outline: none;
    border-color: #6b8e23;
    background: #fff;
}
.chat-send {
    flex: 0 0 auto;
    font-weight: 700;
    color: #fff;
    background: #6b8e23;
    border: none;
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.chat-send:hover { background: #5d7e1c; }
.chat-send:active { transform: scale(0.97); }
.chat-send:disabled { opacity: 0.5; cursor: default; }

/* name picker overlay */
.name-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(42, 38, 34, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.name-modal[hidden] { display: none; }
.name-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}
.name-title {
    font-family: "Playfair Display", serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #2a2622;
    margin-bottom: 0.5rem;
}
.name-sub { color: #6b6258; margin-bottom: 1.25rem; }
.name-input {
    width: 100%;
    font-size: 1.1rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    color: #2a2622;
}
.name-input:focus { outline: none; border-color: #6b8e23; }
.name-save { width: 100%; }
