:root{
  --bg:#111;
  --stroke:#222;
  --stroke2:#333;
  --text:#eee;
  --muted:rgba(255,255,255,.70);
  --yellow:#ffd400;

  --zebraA: rgba(0,0,0,0.0);
  --zebraB: rgba(255,255,255,0.035);

  --hl_bg:#3a0d0d;
  --hl_border:#a00000;
}

html,body{
  margin:0;
  height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui, Segoe UI, Arial, sans-serif;
}

/* ----- top bar: clean + compact ----- */
#topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px solid var(--stroke);
  background:var(--bg);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  margin-right:auto;
}

.brand .dot{
  width:10px;height:10px;border-radius:999px;
  background:var(--yellow);
}

.hint{
  opacity:.7;
  font-size:12px;
  font-weight:700;
}

#btnHi{
  background:var(--yellow);
  color:#111;
  border:1px solid #000;
  padding:7px 10px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08);
}

#btnHi:hover{ filter:brightness(.95); }

#status{
  margin-left:8px;
  font-size:12px;
  opacity:.75;
}

/* ----- feed: end-to-end rows (no pill cards) ----- */
#chat{
  padding:0;
  margin:0;
}

.msg{
  /* end-to-end strip */
  width:100%;
  box-sizing:border-box;
  padding: 4px 10px;

  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;

  border:none;
  border-radius:0;
  background:var(--zebraA);
}

.msg.alt{ background:var(--zebraB); }

/* highlight overrides zebra */
.msg.highlight{
  background:var(--hl_bg) !important;
  outline:1px solid var(--hl_border);
  outline-offset:-1px;
}

.msg.stale{ opacity:.55; }
.msg.deleted{ opacity:.32; filter:grayscale(1); }

.meta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;   /* <-- key */
  white-space: nowrap; /* keeps badges/name together */
  flex: 0 0 auto;
}

/* platform icon (png) */
.platform{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.platform img{
  width:18px;
  height:18px;
  opacity:.85;
  display:block;
}

/* badges */
.badges{
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.badge-img{
  width:18px;
  height:18px;
  object-fit:contain;
  display:block;
}
/* fallback badge (youtube etc.) */
.badge{
  font-size:11px;
  padding:1px 6px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background:rgba(0,0,0,.25);
  opacity:.9;
}

.name{
  font-size:14px;
  font-weight:900;
  line-height:1;
}

.name.highlighted{
  color:#fff;
  font-weight:900;
}

/* message body tight */
.body{
  display: inline;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;   /* <-- key */
  min-width: 0;
  flex: 1 1 auto;      /* body takes remaining space */
}

.part-text{
  display: inline;
  white-space: pre-wrap;
}

.emote{
  height:24px;
  width:auto;
  vertical-align:middle;
  margin: 0 3px;   /* spacing around emotes only */
}
