/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap');

/* Variables */
:root {
    /* Fonts */
    --font-size: 35px;
    --font-family-1: "Jost", sans-serif;

    /* Emotes */
    --emote-size: calc(var(--font-size) * 2);
    --emote-size-xl: calc(var(--font-size) * 3);
    --emote-size-xxl: calc(var(--font-size) * 8);

    /* Badges */
    --badge-size: 25px;

    /* Colors */
    --color-1: #ffffff;
}

/* Main styling */
* {
    box-sizing: border-box;
}

body {
    overflow: hidden;
}

content {
    display: block;
}

.font-1 {
    opacity: 0;
    font-family: var(--font-family-1);
}

.font-2 {
    opacity: 0;
    font-family: var(--font-family-2);
}

.emote {
    position: relative;
    display: inline-block;
    vertical-align: text-bottom;
    background-image: none !important;
}

.emote.emote-left {
    margin-left: -5.5px;
}

.emote.emote-right {
    margin-right: -5.5px;
}

.emote img {
    height: var(--emote-size);
}

.emote img.zero-width {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

[large-emotes="true"] .emote img {
    height: var(--emote-size-xl);
}

[gigaemote="true"] .emote img {
    height: var(--emote-size-xxl);
}

@keyframes appear {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes disappear {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(0);
    }
}

@keyframes deleted {
    to {
        transform: translateX(-200%);
        padding: 0;
        margin: 0;
        max-height: 0;
    }
}

#chatbox {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 100%;
    top: 0;
    left: 0;
    padding: 5px 5px 0 5px;
    font-size: var(--font-size);
    font-family: var(--font-family-1);
}

#chatbox message,
#chatbox event {
    max-height: var(--max-height);
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    word-break: break-word;
    transform-origin: top left;
    animation: appear 700ms ease-in-out forwards;
}

#chatbox[disappear="true"] message,
#chatbox[disappear="true"] event {
    animation:
        appear 700ms ease-in-out forwards,
        disappear 700ms linear 30s forwards;
}

#chatbox message[deleted="true"],
#chatbox event[deleted="true"] {
    animation: deleted 700ms ease-in-out forwards;
}

message {
    padding: 30px 15px 15px;
}

message top {
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
}

message top dot {
    aspect-ratio: 1;
    width: 7.5px;
    border-radius: 100%;
    margin-bottom: 10px;
    background-color: var(--color-1);
}

message top author {
    position: relative;
    color: var(--color-1);
    padding: 3px 30px;
    margin-inline: 7.5px;
    border-radius: 15px;
    font-weight: bolder;
    background-image: linear-gradient(to right, #39363B, #201E21);
}

message.vip top author {
    background-image: unset;
    background-color: #EC8E9B;
}

message.subscriber top author {
    background-image: -webkit-linear-gradient(#242424, #8A8A8A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

message.moderator top author {
    background-image: -webkit-linear-gradient(#FB9999, #8A8A8A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

message.subscriber top author::before,
message.moderator top author::before
{
    position: absolute;
    content: '';
    inset: 0;
    border-radius: inherit;
    background-color: var(--color-1);
    z-index: -1;
}

message.moderator top author::before {
    filter: drop-shadow(0 0 15px #FD7878);
}

message.vip top role,
message.subscriber top role,
message.moderator top role
{
    height: 50px;
    aspect-ratio: 1;
    margin-left: 7.5px;
    border-radius: 15px;
    border: 2px solid var(--color-1);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 70%;
}

message.vip top role {
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath fill='url(%23a)' d='M0 0h18v18H0z'/%3E%3Cdefs%3E%3Cpattern id='a' patternContentUnits='objectBoundingBox' width='1' height='1'%3E%3Cuse xlink:href='%23b' transform='scale(.00195)'/%3E%3C/pattern%3E%3Cimage id='b' width='512' height='512' xlink:href='data:image/png;base64,[encoded data, 9688 characters]'/%3E%3C/defs%3E%3C/svg%3E");
}

message.subscriber top role {
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath fill='url(%23a)' d='M.5.5h17v17H.5z'/%3E%3Cdefs%3E%3Cpattern id='a' patternContentUnits='objectBoundingBox' width='1' height='1'%3E%3Cuse xlink:href='%23b' transform='scale(.00195)'/%3E%3C/pattern%3E%3Cimage id='b' width='512' height='512' xlink:href='data:image/png;base64,[encoded data, 12688 characters]'/%3E%3C/defs%3E%3C/svg%3E");
}

message.moderator top role {
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cpath fill='url(%23a)' d='M0 0h18v18H0z'/%3E%3Cdefs%3E%3Cpattern id='a' patternContentUnits='objectBoundingBox' width='1' height='1'%3E%3Cuse xlink:href='%23b' transform='scale(.00195)'/%3E%3C/pattern%3E%3Cimage id='b' width='512' height='512' xlink:href='data:image/png;base64,[encoded data, 12760 characters]'/%3E%3C/defs%3E%3C/svg%3E");
}

message content {
    margin-top: 5px;
    color: var(--color-1);
}

event {
    width: fit-content;
    padding: 120px 150px 125px 25px;
    transform-origin: bottom center;
}

event main {
    position: relative;
    width: fit-content;
}

event main::after {
    position: absolute;
    content: '';
    background-size: contain;
    height: 300px;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
}

event.sub main::after,
event.gift main::after
{
    aspect-ratio: 153 / 167;
    background-image: url('data:image/png;base64,[encoded data, 28652 characters]');
}

event.raid main::after {
    aspect-ratio: 157 / 161;
    background-image: url('data:image/png;base64,[encoded data, 29792 characters]');
}

event content {
    position: relative;
    font-weight: bolder;
    border-radius: 35px;
    padding: 25px 135px 25px 80px;
    text-shadow: 0 0 10px #EC8E9B;
    color: var(--color-1);
    background-image: linear-gradient(to right, #1F1D20, #3A373B);
}

event content::before {
    position: absolute;
    content: '';
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    aspect-ratio: 2 / 71;
    height: 120%;
    background-size: contain;
    background-image: url("data:image/svg+xml,%3Csvg width='2' height='71' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.658.6v40.497m0 4.5v1.5M.64 51.4v19' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

event content::after {
    position: absolute;
    content: '';
    inset: -2px;
    border-radius: inherit;
    background-image: linear-gradient(to right, #FFFFFF, #EC8E9B);
    z-index: -1;
}
