/* --- Streamlabs Compatibility Reset --- */
#log, .sl__chat__layout {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    position: absolute !important;
    inset: 0 !important;
    padding: 0 10px 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    font-family: 'Roboto', sans-serif !important;
}

#log > div, .chat-item {
    display: block !important;
    position: relative !important;
    margin-bottom: 15px !important;
    padding: 12px 16px 14px !important;
    width: fit-content !important; /* Automatic width */
    max-width: 90% !important; /* Prevents overflow */
    color: #f7fbff !important;
    background:
        linear-gradient(135deg, rgba(16, 20, 30, .92), rgba(37, 44, 62, .88)),
        rgba(16, 20, 30, .9) !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-left: 4px solid #34e7ff !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .35) !important;
    backdrop-filter: blur(14px) !important;
    animation: glass-entry 0.4s ease-out both !important;
}

/* Pseudo-element for the top accent bar */
#log > div::before, .chat-item::before {
    content: "" !important;
    position: absolute !important;
    left: 14px;
    top: -1px !important;
    width: 42px !important;
    max-width: calc(100% - 28px); /* Ensures it doesn't leak out of small boxes */
    height: 7px !important;
    background: #34e7ff !important;
    border-radius: 5px 5px 0 0 !important;
    transform: translateY(-100%) !important;
}

/* Platform Badges (YouTube/Twitch) */
#log .badge, .badge {
    width: 20px !important;
    height: 20px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 6px !important;
    object-fit: contain !important;
}

#log .meta, #log .message, .meta, .message {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Username Styling */
.username, .name {
    display: inline-block !important;
    font-size: 18px !important; /* Increased from 15px */
    font-weight: 800 !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45) !important;
    margin-bottom: 4px !important;
}

/* Message Text Styling */
.text, .message {
    display: block !important;
    color: #ffffff !important;
    font-size: 22px !important; /* Increased from 18px */
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .6) !important;
}

@keyframes glass-entry {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
