/*
  CUSTOM TWITCH CHAT OVERLAY
  Edit the variables below to change the look.
*/

:root {
  --text: #ffffff;
  --muted: rgba(255,255,255,.68);
  --card: rgba(14, 14, 22, .82);
  --border: rgba(255,255,255,.12);
  --shadow: 0 12px 35px rgba(0,0,0,.35);
  --accent: #a970ff;
  --radius: 18px;
  --message-gap: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body {
  font-family: var(--font);
  color: var(--text);
}

#chat {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--message-gap);
  padding: 22px;
  pointer-events: none;
}

.message {
  width: fit-content;
  max-width: min(720px, 90vw);
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: messageIn .35s cubic-bezier(.2,.8,.2,1);
  transform-origin: bottom left;
}

.message.removing {
  animation: messageOut .35s ease forwards;
}

.header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
}

.badges {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.badge {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.name {
  color: var(--name-color, var(--accent));
  text-shadow: 0 1px 8px rgba(0,0,0,.25);
}

.text {
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.text img.emote {
  width: auto;
  height: 1.35em;
  vertical-align: -.3em;
  margin: 0 1px;
}

.reply {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

.system {
  opacity: .75;
  font-size: 13px;
  padding: 8px 12px;
  color: var(--muted);
}

.status {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.8);
  font: 11px/1 var(--font);
  opacity: .35;
  transition: opacity .2s;
}

.status:hover {
  opacity: 1;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e9b949;
}

.status.connected .dot {
  background: #35d07f;
}

.status.error .dot {
  background: #ff5f6d;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes messageOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(.96);
  }
}

/* Optional role styling */
.message.mod {
  border-color: rgba(255, 210, 80, .25);
}

.message.vip {
  border-color: rgba(255, 105, 180, .25);
}

.message.sub {
  border-color: rgba(167, 112, 255, .25);
}
