/* Combined chat for a 1024x600 beamsplitter prompter. True black glass, system fonts, no external resources. */
:root {
  --bg: #000000;
  --surface: #0b0d12;
  --border: #1e2430;
  --text: #ffffff;
  --muted: #98a2b3;
  --cue-bg: #1c1406;
  --cue-border: #f59e0b;
  --cue-text: #fde68a;
  --chat-font-size: 26px;
  --chat-line-height: 1.32;
}
body.theme-desk {
  --bg: #090c12;
  --surface: #111622;
  --border: #242d40;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[data-mirror="x"] .stage { transform: scaleX(-1); }
body[data-mirror="y"] .stage { transform: scaleY(-1); }
body[data-mirror="xy"] .stage { transform: scale(-1, -1); }
.stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg);
}
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  user-select: none;
}
body.chrome-clean .topbar { display: none; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #64748b; flex: none; }
.conn-dot.is-live { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.conn-dot.is-retry { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.conn-label { font-weight: 800; letter-spacing: 0.06em; color: #e2e8f0; font-size: 12px; }
.chapter {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ctl-btn {
  appearance: none;
  border: 1px solid #2c3548;
  background: #141a26;
  color: #e2e8f0;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.ctl-btn:hover { background: #1e2738; }
.ctl-btn.is-on { border-color: #e6833c; background: #2c1b0e; color: #fed7aa; }
.font-readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  min-width: 34px;
  text-align: center;
}
.story-cue {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--cue-bg);
  border-bottom: 2px solid var(--cue-border);
  font-size: max(16px, calc(var(--chat-font-size) * 0.72));
  line-height: 1.25;
}
.cue-tag {
  flex: none;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #0b0d12;
  background: #f59e0b;
  padding: 3px 7px;
  border-radius: 4px;
}
.cue-text {
  color: var(--cue-text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hidden { display: none !important; }
.feed-wrap {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 14px 18px;
  scrollbar-width: none;
  outline: none;
}
.feed-wrap::-webkit-scrollbar { display: none; }
.empty {
  margin: 0;
  padding: 24px 4px;
  color: #64748b;
  font-size: max(16px, calc(var(--chat-font-size) * 0.7));
  font-weight: 600;
  text-align: center;
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.msg-row {
  display: block;
  font-size: var(--chat-font-size);
  line-height: var(--chat-line-height);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid #334155;
  overflow-wrap: anywhere;
}
.msg-row.plat-twitch  { border-left-color: #9146ff; }
.msg-row.plat-youtube { border-left-color: #ff3b30; }
.msg-row.plat-x       { border-left-color: #e2e8f0; }
.msg-row.plat-kick    { border-left-color: #53fc18; }
.msg-row.plat-bluesky { border-left-color: #38a1ff; }
.msg-row.is-celebration {
  background: rgba(230, 131, 60, 0.14);
  border: 1px solid rgba(230, 131, 60, 0.45);
  border-left: 5px solid #f59e0b;
}
.plat-pill {
  display: inline-block;
  vertical-align: middle;
  font-size: 0.5em;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 5px;
  margin-right: 8px;
  line-height: 1.1;
}
.pill-twitch  { background: #9146ff; color: #ffffff; }
.pill-youtube { background: #ff2a2a; color: #ffffff; }
.pill-x       { background: #e7e9ea; color: #000000; }
.pill-kick    { background: #53fc18; color: #041302; }
.pill-bluesky { background: #1185fe; color: #ffffff; }
.pill-other   { background: #475569; color: #ffffff; }
.msg-ts {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.52em;
  color: #64748b;
  margin-right: 8px;
  vertical-align: middle;
}
.msg-actor { font-weight: 800; color: #f8fafc; margin-right: 8px; }
.msg-row.plat-twitch .msg-actor  { color: #d8b4fe; }
.msg-row.plat-youtube .msg-actor { color: #fca5a5; }
.msg-row.plat-kick .msg-actor    { color: #86efac; }
.msg-row.plat-bluesky .msg-actor { color: #7dd3fc; }
.msg-kind {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.56em;
  font-weight: 800;
  color: #0b0d12;
  background: #fbbf24;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}
.msg-text { color: var(--text); font-weight: 500; }
.pause-pill {
  position: sticky;
  bottom: 10px;
  display: block;
  margin: 8px auto 0;
  appearance: none;
  border: 2px solid #f59e0b;
  background: #1c1406;
  color: #fde68a;
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85);
}
@media (max-width: 820px) {
  .conn-label, .chapter { display: none; }
}
