/* Same dark theme as the desktop app. */
:root {
  --bg: #141417; --card: #1f1f24; --border: #2f2f37; --hover: #2a2a31;
  --text: #e6e6ea; --muted: #8b8b96; --accent: #9146FF; --accent-soft: #2a1f47; --accent-text: #c9a7ff;
  --mention: #4a2129; --system: #2c2445; --amber: #e0a030; --green: #3aa55d;
  --font: 13px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: var(--font)/1.45 "Segoe UI", system-ui, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; border-radius: 6px; padding: 3px 6px; }
button:hover { background: var(--hover); }
input { font: inherit; color: var(--text); background: #19191d; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; }
a { color: #a970ff; }
.icon { width: 15px; height: 15px; vertical-align: -3px; }
.muted { color: var(--muted); }

/* Login and room picker */
.screen { display: grid; place-items: center; height: 100%; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 360px; text-align: center; }
.login-card h1 img { width: 26px; height: 26px; vertical-align: -4px; }
button.twitch { background: var(--accent); color: white; font-weight: 600; padding: 8px 18px; margin: 8px 0; }
button.twitch:hover { background: #a970ff; }
.join-row { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.join-row input { width: 140px; text-transform: uppercase; }
.join-row button { border: 1px solid var(--border); }

/* App frame */
#app { display: flex; flex-direction: column; height: 100%; }
#top { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; }
#top .spacer { flex: 1; }
.pill { background: var(--accent-soft); color: var(--accent-text); padding: 4px 10px; display: inline-flex; gap: 8px; align-items: center; }
.pill:hover { background: #352659; }
.top-button { border: 1px solid var(--border); padding: 4px 10px; display: inline-flex; gap: 6px; align-items: center; }
.top-button.on { background: var(--accent-soft); color: var(--accent-text); border-color: #4b3780; }
.who { position: relative; cursor: default; padding: 3px 6px; border-radius: 6px; }
.who:hover { background: var(--hover); }
.dropdown { display: none; position: absolute; top: 100%; left: 0; z-index: 20; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; white-space: nowrap; margin-top: 4px; }
.who:hover .dropdown { display: block; }
.dot { font-size: 11px; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 30; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; min-width: 220px; }
.menu button { display: flex; width: 100%; text-align: left; padding: 5px 12px; gap: 8px; }
.menu button:hover { background: var(--accent-soft); color: var(--accent-text); }
.menu .sep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu .label { color: var(--muted); font-size: 11px; padding: 4px 12px 0; }
.status { color: var(--muted); padding: 2px 10px 4px; min-height: 20px; font-size: 12px; }

/* Panels: three columns of rounded cards */
#grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; padding: 4px 8px; }
.column { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column;
  min-height: 0; flex: 1; overflow: hidden; }
.panel.stream { flex: 0 0 auto; }
.panel-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--border); font-weight: 600; }
.panel-head .note { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.panel-head .note a { color: var(--accent-text); text-decoration: none; cursor: pointer; margin-left: 6px; }
.panel-head .close { display: none; }
.editing .panel-head { cursor: grab; background: #26262c; }
.editing .panel-head .close { display: inline-block; }
.panel.drop-target { outline: 2px dashed var(--accent); }
.panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; display: block; }

/* Chat lines */
.lines { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 0; }
.line { position: relative; padding: 2px 8px; word-wrap: break-word; }
.line:hover { background: rgba(255, 255, 255, 0.03); }
.line.mention { background: var(--mention); }
.line.system { background: var(--system); }
.line .name { font-weight: 600; cursor: pointer; }
.line .badge { width: 18px; height: 18px; vertical-align: -4px; margin-right: 3px; }
.line .tlabel { font-weight: 700; font-size: 11px; margin-right: 4px; }
.line .emote { vertical-align: middle; max-height: 32px; }
.line .reply { color: var(--muted); font-size: 11px; }
.line .sys { color: #b38bff; font-weight: 600; }
.line .bits { color: #c9a0ff; font-weight: 600; margin-right: 4px; }
.line .deleted { color: var(--muted); }
.line .time { color: var(--muted); font-size: 11px; margin-right: 4px; }
.notice { color: var(--muted); font-style: italic; padding: 2px 8px; }
.actions { display: none; position: absolute; right: 4px; top: -2px; background: var(--hover); border: 1px solid #3a3a44; border-radius: 6px; padding: 1px 2px; z-index: 5; }
.line:hover .actions { display: flex; }
.actions button { padding: 2px 4px; }
.more { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: var(--accent); color: white; padding: 4px 12px; z-index: 6; }
.more:hover { background: #a970ff; }

/* Highlights */
.hl-card { border-left: 3px solid var(--amber); margin: 4px 6px; padding: 3px 8px; }
.hl-card .by { color: var(--muted); font-size: 11px; }
.hl-card .by button { color: var(--muted); font-size: 11px; padding: 0 4px; }

/* Input rows */
.input-row { border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; padding: 4px 6px; }
.input-row input { flex: 1; background: transparent; border: none; padding: 5px 4px; outline: none; }
.send { background: var(--accent); color: white; display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; }
.send:hover { background: #a970ff; }
.context { color: var(--muted); font-size: 11px; padding: 4px 10px 0; }
.context button { color: #a970ff; font-size: 11px; padding: 0 4px; }

/* Mod chat */
.mc-img { display: block; max-width: 240px; max-height: 160px; border-radius: 4px; margin-top: 2px; cursor: zoom-in; }
.dropzone { outline: 2px dashed var(--accent); outline-offset: -4px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; z-index: 100; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #3a3a44; border-radius: 4px; }

/* Invites window */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; z-index: 90; }
.invite-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; margin: 8px 0; }
.invite-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; }
.invite-row + .invite-row { border-top: 1px solid var(--border); }

.code { font: 600 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 4px; color: var(--accent-text); margin: 10px 0; }
.twitch-link { display: inline-block; background: var(--accent); color: white; padding: 8px 18px; border-radius: 6px; text-decoration: none; font-weight: 600; }
