body {
    margin: 0;
    overflow: hidden;
    height: 100vh;
    position: relative;
    flex-direction: column;
    background: transparent;
    font-family: var(--chat-font);
}

:root {
    --chat-scale: 1;
    --chat-font: 'Open Sans', sans-serif;
    --chat-bg: transparent;
    --text-color: rgb(255, 255, 255);
    --shadow-offset-x: 2px;
    --shadow-offset-y: 2px;
    --shadow-blur: 8px;
    --shadow-color: black;
    --chat-weight: 900;
    --gif-scale: 1;
    --stroke-shadow: 0 0 0 transparent;
    --shadow-filter: drop-shadow(var(--shadow-offset-x) var(--shadow-offset-y) var(--shadow-blur) var(--shadow-color));
    --ffz-effect-filter: ;
}

.message {
    display: block;
    width: auto;
    max-width: 98%;
    box-sizing: border-box;
    margin: 0 0 3px 0;
    padding: 2px 12px 7px 12px;
    line-height: normal;
    flex-shrink: 0;
    border-radius: 14px;
    background: transparent;
    border-left: none;
    box-shadow: none;
    animation: messageIn 0.25s ease-out forwards;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message.wrap-message {
    width: auto;
    max-width: 98%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message.wrap-message .text {
    display: inline;
    width: auto;
    max-width: none;
    min-width: 0;
    flex: none;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.pixel-font .message {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.pixel-font .text {
    font-weight: 400;
    line-height: 1.36;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message.redeem-message {
    background: transparent;
    box-shadow: none;
}

body.has-background .message.redeem-message {
    background: linear-gradient(
        90deg,
        rgba(20, 80, 180, 0.92),
        rgba(35, 105, 220, 0.78)
    );
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 0 20px rgba(70, 150, 255, 0.18),
        0 0 12px rgba(40, 120, 255, 0.18);
}

body.has-background .message.redeem-message:hover {
    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(70, 150, 255, 0.22),
        0 0 18px rgba(40, 120, 255, 0.25);
}

#chat {
    width: 100%;
    box-sizing: border-box;
    padding: 18px;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    background: var(--chat-bg, transparent);
    color: var(--text-color);
    font-weight: 900;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    zoom: var(--chat-scale);
    filter: var(--shadow-filter, );
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateX(-15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes messageFadeOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }

    to {
        opacity: 0;
        transform: translateX(15px) scale(0.96);
        filter: blur(3px);
    }
}

.badges {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 3px;
    margin-right: 6px;
    position: relative;
}

.badge {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    max-width: 45px;
    max-height: 45px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}

.badges.no-badges {
    display: none;
}

.username {
    font-family: var(--chat-font);
    font-style: normal;
    font-size: 50px;
    font-weight: 900;
    margin-right: 5px;
    display: inline;
    position: relative;
    line-height: 1.36;
    vertical-align: middle;
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    color: #FF0000;
    text-shadow: var(--stroke-shadow);
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

.text {
    color: var(--text-color);
    font-family: var(--chat-font);
    font-style: normal;
    font-size: 50px;
    font-weight: 900;
    letter-spacing: 0.2px;
    display: inline;
    line-height: 1.36;
    vertical-align: middle;
    width: auto;
    max-width: none;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    text-shadow: var(--stroke-shadow);
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

.emote {
    height: calc(1.3em * var(--gif-scale, 1));
    width: auto;
    object-fit: contain;
    vertical-align: middle;
    margin: 0 3px;
    flex: 0 0 auto;
    filter: var(--ffz-effect-filter, );
    transition: transform 0.15s ease;
}

.twemoji {
    height: 1.2em !important;
    width: 1.2em !important;
    display: inline-block !important;
    object-fit: contain;
    vertical-align: middle !important;
    margin: 0 0.05em !important;
    flex: 0 0 auto;
}

.emote.ffz-effect-transform {
    transform:
        translateX(var(--ffz-tx, 0))
        translateY(var(--ffz-ty, 0))
        rotate(var(--ffz-rotate, 0deg))
        scaleX(var(--ffz-scale-x, 1))
        scaleY(var(--ffz-scale-y, 1));
}

.emote.bttv-effect-zero {
    margin-left: 0;
}

.emote.bttv-effect-cursed,
.emote.ffz-effect-cursed {
    --ffz-effect-filter: grayscale(1) brightness(0.7) contrast(2.5);
}

.emote.bttv-effect-party {
    animation: bttvParty 1s linear infinite;
}

.emote.bttv-effect-shake {
    position: relative;
    animation: bttvShake 0.15s linear infinite;
}

.emote.bttv-effect-party.bttv-effect-shake {
    animation:
        bttvParty 1s linear infinite,
        bttvShake 0.15s linear infinite;
}

@keyframes bttvParty {
    from {
        filter: var(--ffz-effect-filter, ) hue-rotate(0deg);
    }

    to {
        filter: var(--ffz-effect-filter, ) hue-rotate(360deg);
    }
}

@keyframes bttvShake {
    0% {
        left: 0;
        top: 0;
    }

    25% {
        left: -3px;
        top: 2px;
    }

    50% {
        left: 3px;
        top: -2px;
    }

    75% {
        left: -2px;
        top: -3px;
    }

    100% {
        left: 0;
        top: 0;
    }
}

.external-badges {
    margin-left: 2px;
}

.twitch-badges {
    margin-right: 5px;
}

.reply-to {
    opacity: 0.65;
    margin-right: 4px;
    font-size: 0.9em;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.shadow-disabled .username,
body.shadow-disabled .text {
    text-shadow: var(--stroke-shadow);
}

body.shadow-disabled {
    --shadow-filter: ;
}

.username,
.text {
    -webkit-text-stroke: calc(var(--stroke-width) * 2) var(--stroke-color);
    paint-order: stroke fill;
}

body.stroke-shadow-mode .username,
body.stroke-shadow-mode .text {
    -webkit-text-stroke: 0;
    paint-order: normal;
}

body.stroke-shadow-mode [style*="background-clip"] {
    text-shadow: none;
}

body.uppercase #chat,
body.uppercase .username,
body.uppercase .text,
body.uppercase .reply-to {
    text-transform: uppercase;
}