/* Chat Dock: one column for an OBS custom browser dock. Dark, dense, and
   readable at 250px wide. Alerts get a coloured edge, the way Kick's own chat
   marks them. */

:root {
  --bg: #16141c;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --ink: #f5f5f7;
  --dim: #98989d;
  --mute: #636366;
  --accent: #7c5cff;
  --accent-ink: #ffffff;
  --flame: linear-gradient(90deg, #7c5cff, #22d3ee);
  --bad: #ff6b81;
  --size: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --c-sub: #7c5cff;
  --c-gift: #ff7ab2;
  --c-follow: #22d3ee;
  --c-kicks: #30d158;
  --c-reward: #ff9f0a;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(120% 60% at 0% 0%, rgba(124, 92, 255, 0.22), transparent 60%), var(--bg); color: var(--ink); font: var(--size)/1.4 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; padding: 6px; gap: 6px; }

.bar { display: flex; align-items: center; gap: 4px; padding-bottom: 6px; position: relative; }
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--flame); opacity: 0.85; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); flex: none; margin: 0 4px; }
.dot[data-state="on"] { background: #30d158; box-shadow: 0 0 8px rgba(48, 209, 88, 0.6); }
.dot[data-state="bad"] { background: var(--bad); }
.name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow { flex: 1 1 0; }
.ic { background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--dim); padding: 2px 8px; font-size: 12.5px; font-weight: 600; }
.ic:hover { background: var(--surface-2); color: var(--ink); }
:is(button, input, .feed):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.add { display: flex; gap: 6px; }
.add input { flex: 1 1 auto; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.add input:focus { border-color: var(--accent); outline: none; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 700; }
.btn:disabled { opacity: 0.5; cursor: default; }
.note { margin: 0; color: var(--bad); font-size: 12.5px; }
.label { margin: 2px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--mute); }
.hint { margin: 0; font-size: 12px; color: var(--mute); }
.hint b { color: var(--dim); }
.toggles { display: flex; flex-wrap: wrap; gap: 4px; }
.toggles button { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; color: var(--mute); }
.toggles button[aria-pressed="true"] { color: var(--ink); border-color: var(--c, var(--accent)); box-shadow: inset 0 0 0 1px var(--c, var(--accent)); }

.feed {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 8px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.empty { color: var(--dim); padding: 6px 0; }
.empty p { margin: 0 0 8px; }
.empty b { color: var(--ink); }

.msg { padding: 2px 0; }
.msg .badge { display: inline-block; font-size: 0.66em; font-weight: 800; padding: 0 4px; margin-right: 3px; border-radius: 4px; background: var(--surface-2); color: var(--dim); vertical-align: 1px; }
.msg .badge.host { background: #e9113c; color: #fff; }
.msg .badge.mod { background: #00c752; color: #04210f; }
.msg .badge.vip { background: #e5a3ff; color: #2b0b3a; }
.msg .badge.sub { background: #ffd23f; color: #3a2a00; }
.msg .badge.og { background: #3a86ff; color: #fff; }
.msg .who { font-weight: 700; }
.msg .colon { color: var(--mute); margin-right: 4px; }
.msg img.emote { height: 1.7em; width: auto; vertical-align: middle; margin: -2px 1px; }
.msg.gone .text { color: var(--mute); font-style: italic; }
.msg .rep { display: block; color: var(--mute); font-size: 0.85em; }

/* alerts */
.ev {
  --c: var(--accent);
  margin: 4px 0; padding: 5px 8px; border-radius: 10px; border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}
.ev[data-kind="sub"] { --c: var(--c-sub); }
.ev[data-kind="gift"] { --c: var(--c-gift); }
.ev[data-kind="follow"] { --c: var(--c-follow); }
.ev[data-kind="kicks"] { --c: var(--c-kicks); }
.ev[data-kind="reward"] { --c: var(--c-reward); }
.ev .head { font-size: 0.78em; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--c); }
.ev .line b { font-weight: 700; }
.ev .extra { color: var(--dim); font-size: 0.9em; }
.ev .said { margin-top: 2px; color: var(--ink); }
.dbg { color: var(--mute); font: 11px/1.3 ui-monospace, Consolas, monospace; padding: 3px 0; }

.jump {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* sending and moderating (only while the CAI app on this PC allows it) */
.send { display: flex; gap: 6px; }
.send input { flex: 1 1 auto; min-width: 0; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.send input:focus { border-color: var(--accent); outline: none; }
.allow { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.sendmsg { margin: 0; font-size: 12px; color: var(--dim); }
.sendmsg.bad { color: var(--bad); }
.msg .who.click { cursor: pointer; }
.msg .who.click:hover { text-decoration: underline; }
.ucard { position: fixed; z-index: 20; width: 236px; background: #221f2b; border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; gap: 6px; }
.uhead { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.uhead .badge { display: inline-block; font-size: 0.66em; font-weight: 800; padding: 0 4px; border-radius: 4px; background: var(--surface-2); color: var(--dim); }
.uname { font-weight: 800; font-size: 1.05em; margin-right: 2px; }
.uclose { margin-left: auto; background: none; border: 0; color: var(--mute); font-size: 18px; line-height: 1; padding: 0 4px; }
.uclose:hover { color: var(--ink); }
.uinfo { color: var(--dim); font-size: 0.9em; }
.ulabel { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--mute); margin-top: 2px; }
.urow { display: flex; flex-wrap: wrap; gap: 5px; }
.ubtn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; padding: 3px 10px; text-decoration: none; cursor: pointer; }
.ubtn:hover { border-color: var(--accent); }
.ubtn.danger { color: #fff; background: rgba(255, 69, 58, 0.25); border-color: rgba(255, 69, 58, 0.6); }

.ic.wide { background: var(--surface-2); border-color: var(--line); color: var(--ink); padding: 6px 10px; }
