/* Readability/accessibility hardening: preserves existing theme and user color choices. */
.player_option.selected {
    border-color: var(--theme-color, #03add8) !important;
}

/* Keep custom solid username/message colors recognizable while adding edge separation
   against both light and dark chat backgrounds. */
.username[class*="bcolor"],
.chat_message[class*="bcolor"] {
    text-shadow: 0 1px 1px rgba(0,0,0,.40), 0 0 1px rgba(255,255,255,.34);
}

/* Gradient/neon/effect text keeps its original fill/glow; only the glyph edge gets
   a theme-aware outline. Light themes override --boom-special-outline below. */
.username[class*="bgrad"], .chat_message[class*="bgrad"],
.username[class*="bneon"], .chat_message[class*="bneon"],
.username[class*="bmetal"], .chat_message[class*="bmetal"],
.username[class*="bfire"], .chat_message[class*="bfire"],
.username[class*="bice"], .chat_message[class*="bice"],
.username[class*="bcandy"], .chat_message[class*="bcandy"],
.username[class*="bholo"], .chat_message[class*="bholo"] {
    -webkit-text-stroke: .24px var(--boom-special-outline, rgba(255,255,255,.30));
    paint-order: stroke fill;
}

/* If text background clipping is unsupported, never leave a username/message transparent. */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
    .username[class*="bgrad"], .chat_message[class*="bgrad"],
    .username[class*="bmetal"], .chat_message[class*="bmetal"],
    .username[class*="bfire"], .chat_message[class*="bfire"],
    .username[class*="bice"], .chat_message[class*="bice"],
    .username[class*="bcandy"], .chat_message[class*="bcandy"],
    .username[class*="bholo"], .chat_message[class*="bholo"] {
        color: inherit !important;
        background: none !important;
        -webkit-text-fill-color: currentColor !important;
    }
}

/* Decorative fonts need a little more optical size than the base UI font. */
.username[class*="bnfont"] {
    font-size: 15px !important;
    line-height: 21px !important;
}
.chat_message[class*="bfont"] {
    font-size: 15px !important;
    line-height: 21px !important;
}

/* Offline state remains visibly muted without making custom username colors disappear. */
.offline {
    opacity: .72 !important;
}

/* Warning buttons use yellow/orange backgrounds throughout the theme set; dark text
   is consistently more readable on those surfaces. */
.warn_btn {
    color: #211600 !important;
    text-shadow: none !important;
}

/* Honor OS/browser reduced-motion preference for decorative text effects. */
@media (prefers-reduced-motion: reduce) {
    [class*="bfire"], [class*="bholo"], [class*="bcandy"], [class*="bmetal"] {
        animation: none !important;
        background-position: 50% center !important;
    }
}
