.bbg-chat-fab {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 100001;
    padding: 12px 18px;
    border: 2px solid rgba(255, 215, 0, 0.65);
    border-radius: 999px;
    background: linear-gradient(135deg, #2a2200 0%, #1a1a1a 100%);
    color: #FFD700;
    font-family: 'Mouse Memoirs', sans-serif;
    font-size: 20px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bbg-chat-badge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.bbg-chat-fab.has-unread {
    animation: bbg-chat-pulse 1.4s ease-in-out infinite;
}

@keyframes bbg-chat-pulse {
    0%, 100% { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45); }
    50% { box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.35), 0 4px 18px rgba(0, 0, 0, 0.45); }
}

.bbg-chat-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 215, 0, 0.25);
}

.bbg-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
}

.bbg-chat-overlay.active {
    display: flex;
}

.bbg-chat-modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #1f1f1f;
    border-radius: 12px;
    padding: 16px 16px 12px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 215, 0, 0.35);
    overflow: hidden;
    box-sizing: border-box;
}

.bbg-chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.bbg-chat-footer {
    flex-shrink: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.bbg-chat-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.bbg-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bbg-chat-title {
    font-size: 24px;
    color: #FFD700;
    text-align: center;
    margin: 0 0 4px;
    font-family: 'Henny Penny', cursive;
}

.bbg-chat-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    margin: 0 0 10px;
    line-height: 1.3;
}

.bbg-chat-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.bbg-chat-label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    margin-bottom: 4px;
}

.bbg-chat-input,
.bbg-chat-textarea {
    width: 100%;
    box-sizing: border-box;
    background: #141414;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-family: 'Mouse Memoirs', sans-serif;
    font-size: 15px;
    padding: 8px 10px;
    margin-bottom: 0;
}

.bbg-chat-input:focus,
.bbg-chat-textarea:focus {
    border-color: rgba(255, 215, 0, 0.55);
    outline: none;
}

.bbg-chat-name-row {
    margin-bottom: 0;
    min-width: 0;
}

.bbg-chat-thread {
    min-height: 90px;
    max-height: 160px;
    overflow-y: auto;
    background: #141414;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bbg-chat-empty {
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    font-size: 15px;
    padding: 16px 8px;
}

.bbg-chat-bubble {
    max-width: 88%;
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1.35;
}

.bbg-chat-bubble.user {
    align-self: flex-end;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.35);
}

.bbg-chat-bubble.admin {
    align-self: flex-start;
    background: rgba(76, 175, 80, 0.18);
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.bbg-chat-bubble-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 3px;
}

.bbg-chat-bubble-text {
    font-size: 15px;
    color: #fff;
    white-space: pre-wrap;
    word-break: break-word;
}

.bbg-chat-compose {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbg-chat-required {
    color: #fca5a5;
}

.bbg-chat-compose .bbg-chat-textarea {
    min-height: 44px;
    max-height: 64px;
    resize: vertical;
}

.bbg-chat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bbg-chat-btn {
    padding: 8px 18px;
    border: none;
    border-radius: 8px;
    font-family: 'Mouse Memoirs', sans-serif;
    font-size: 17px;
    cursor: pointer;
}

.bbg-chat-btn.primary {
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
    color: #111;
    font-weight: bold;
}

.bbg-chat-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bbg-chat-status {
    min-height: 18px;
    text-align: center;
    font-size: 14px;
}

.bbg-chat-status.err {
    color: #fca5a5;
}

.bbg-chat-status.ok {
    color: #86efac;
}

@media (max-width: 520px) {
    .bbg-chat-fields {
        grid-template-columns: 1fr;
    }
}
