:root {
  --font-size: 20px;
  --font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --emote-size: 1.6em;
  --gap: 6px;
  --outline-color: rgba(0, 0, 0, 0.8);
  --text-color: #ffffff;
  --bg-color: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  overflow: hidden;
}

body.preview {
  background: repeating-conic-gradient(#2b2b2b 0% 25%, #1c1c1c 0% 50%) 50% / 24px 24px;
}

.chat-root {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  width: 100%;
  padding: 8px;
  gap: var(--gap);
  font-family: var(--font-family);
  font-size: var(--font-size);
  line-height: 1.35;
  color: var(--text-color);
}

.chat-root.align-top {
  justify-content: flex-start;
}

.msg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3em;
  width: fit-content;
  max-width: 100%;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  animation: msg-in 160ms ease-out;
  word-break: break-word;
}

.msg.fading {
  animation: msg-out 400ms ease-in forwards;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes msg-out {
  to {
    opacity: 0;
  }
}

.msg.event {
  background: linear-gradient(90deg, rgba(145, 71, 255, 0.55), rgba(145, 71, 255, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 100%;
}

.msg.event .event-text {
  font-weight: 700;
  text-shadow: 0 1px 3px var(--outline-color), 0 0 6px var(--outline-color);
}

.msg .platform-icon {
  width: 1em;
  height: 1em;
  flex: none;
  display: inline-flex;
}
.msg .platform-icon svg {
  width: 100%;
  height: 100%;
}

.msg .avatar {
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
}

.msg .badges {
  display: inline-flex;
  gap: 0.2em;
  flex: none;
}
.msg .badges img {
  width: 1.15em;
  height: 1.15em;
  vertical-align: middle;
}

.msg .name {
  font-weight: 700;
  text-shadow: 0 1px 3px var(--outline-color), 0 0 6px var(--outline-color);
  white-space: nowrap;
}

.msg .colon {
  opacity: 0.85;
  margin-right: -0.1em;
}

.msg .content {
  text-shadow: 0 1px 3px var(--outline-color);
}

img.emoji {
  height: 1.2em;
  width: 1.2em;
  vertical-align: -0.2em;
  margin: 0 0.05em;
}

.chat-gif {
  display: block;
  max-width: 200px;
  max-height: 150px;
  width: auto;
  height: auto;
  border-radius: 6px;
  margin-top: 4px;
}

.emote-stack {
  position: relative;
  display: inline-block;
  height: var(--emote-size);
  vertical-align: middle;
}
.emote-stack img {
  height: var(--emote-size);
  width: auto;
  display: block;
}
.emote-stack .overlay {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.status-dot {
  position: fixed;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #888;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  z-index: 999;
}
.status-dot.ok {
  background: #3cd23c;
}
.status-dot.bad {
  background: #d23c3c;
}
