:root {
  --bg: #121212;
  --bar: #1b1b1b;
  --line: #262626;
  --text: #e0e0e0;
  --muted: #888888;
  --twitch: #a970ff;
  --youtube: #ff4e45;
  --tiktok: #25f4ee;
  --paid: #ffca28;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: #ffffff;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.bar h1 { font-size: 1rem; margin: 0; letter-spacing: .02em; }
.sources { display: flex; gap: 8px; flex-wrap: wrap; }
.source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.source .dot { width: 7px; height: 7px; border-radius: 50%; background: #555; }
.source.connected .dot { background: #3ddc84; }
.source.waiting .dot, .source.checking .dot, .source.connecting .dot { background: #f5a623; }
.source.error .dot, .source.reconnecting .dot { background: #ff5252; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  overflow-wrap: anywhere;
}
.empty { color: var(--muted); text-align: center; margin-top: 30vh; }

.row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  animation: in .15s ease-out;
}
.row:hover { background: #1a1a1a; }
.row.paid { background: #2a2410; border-left: 3px solid var(--paid); }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }

.timestamp {
  color: var(--muted);
  font: .8rem/1.8 ui-monospace, SFMono-Regular, Menlo, monospace;
  flex: none;
}
.platform-logo { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.body { min-width: 0; }
.username { font-weight: 700; margin-right: 6px; }
.twitch .username { color: var(--twitch); }
.youtube .username { color: var(--youtube); }
.tiktok .username { color: var(--tiktok); }
.amount {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  color: #1a1400;
  background: var(--paid);
  border-radius: 3px;
  padding: 0 5px;
  margin-right: 6px;
}
.message-text { color: var(--text); }
.emote { height: 1.6em; vertical-align: middle; margin: -0.3em 1px; }

.jump {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #2d2d2d;
  color: #fff;
  border: 1px solid #444;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}

/* ?overlay=1 — transparent background for an OBS browser source */
body.overlay { background: transparent; }
body.overlay .bar { display: none; }
body.overlay .chat { overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
body.overlay .row { background: rgba(0, 0, 0, .55); margin-bottom: 4px; }
body.overlay .empty, body.overlay .jump { display: none !important; }
