/* Broad-coverage fallback fonts so uncommon symbols / rare-script characters in
   display names render for EVERYONE, not just devices that happen to have them.
   unicode-range means each file downloads ONLY when a matching character appears. */
@font-face{font-family:'NameFallback';font-display:swap;src:url('/fonts/notosym1.woff2') format('woff2');
  unicode-range:U+2000-27BF,U+2B00-2BFF}
@font-face{font-family:'NameFallback';font-display:swap;src:url('/fonts/notosym2.woff2') format('woff2');
  unicode-range:U+2700-27BF,U+2900-2BFF,U+2E00-2E7F,U+1F300-1FAFF}
@font-face{font-family:'NameFallback';font-display:swap;src:url('/fonts/notocalb.woff2') format('woff2');
  unicode-range:U+10530-1056F}

/* ---------- Chat panel ---------- */
.chat{display:flex;flex-direction:column;width:100%;height:100%;min-height:460px;
  background:var(--panel);border:1px solid #232830;border-radius:14px;overflow:hidden;position:relative}
/* Viewer-chosen chat background (settings → Background), like the playspace.
   TRANSPARENT only takes effect in FULLSCREEN (where the chat overlaps the video
   — see the .stage:fullscreen rule in index.html). In WINDOWED it stays the solid
   panel: the chat is a side column over the stage's black backing, so transparent
   there just showed black (the Captain doesn't want that). */
.chat.chat-bg-trans{background:var(--panel);border-color:rgba(42,47,54,.35)}
.chat.chat-bg-img{background:linear-gradient(rgba(11,13,16,.74),rgba(11,13,16,.74)),
  var(--chatbg) center/cover no-repeat;border-color:rgba(42,47,54,.5)}
/* Names/messages fall back to the broad-coverage fonts for unusual characters */
.chat .nm,.chat .uname,.msg,.hl-item,.pin-banner,.modmenu .pc-name,.mentionpop button{
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,'NameFallback',sans-serif}

.chat-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #232830;
  background:#0f1319}
.chat-title{font-weight:700;font-size:15px}
.chat-online{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}
.chat-online::before{content:"";width:7px;height:7px;border-radius:50%;background:#39d353;box-shadow:0 0 6px #39d353}
.chat-head .grow{flex:1}
.chat-gear{background:transparent;border:0;color:var(--muted);cursor:pointer;font-size:18px;
  width:34px;height:34px;border-radius:8px}
.chat-gear:hover{background:rgba(255,255,255,.1);color:var(--text)}
.chat-gear.on{color:var(--accent2)}
.chat.is-mod .chat-title::after{content:"MOD";font-size:9px;background:var(--accent);color:#fff;
  border-radius:4px;padding:1px 5px;margin-left:7px;vertical-align:middle;font-weight:800}

/* Highlighted-messages section at the top of the chat (all highlights stacked) */
.pin-banner{display:none;flex-direction:column;gap:0;position:relative;flex:0 0 auto;
  max-height:40%;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;
  border-bottom:2px solid var(--accent2)}
.pin-banner::-webkit-scrollbar{display:none;width:0;height:0}
.pin-banner.show{display:flex}
/* One highlighted message (shared by the top-of-chat section and the banner cycler) */
.hl-item{display:flex;align-items:flex-start;gap:8px;padding:8px 12px;background:rgba(59,130,246,.13)}
.hl-item + .hl-item{border-top:1px solid rgba(255,255,255,.06)}
.hl-item .pin-ic{flex:0 0 auto;font-size:14px;line-height:1.4}
.hl-item .pin-body,.hl-item .hl-body{min-width:0;flex:1;font-size:13px;line-height:1.4;
  word-wrap:break-word;overflow-wrap:anywhere;display:flex;flex-direction:column;align-items:flex-start}
.hl-item .nm{font-weight:700;margin-right:6px}
/* Highlighted quote: the nameplate is SIGNED at the bottom-right, not on top */
.hl-item .nm.hl-name{align-self:flex-end;margin-right:0;margin-top:3px}
.hl-item .pin-gif{max-height:56px;border-radius:6px;display:block;margin-top:3px}
.hl-item .pin-x{flex:0 0 auto;background:transparent;border:0;color:var(--muted);
  cursor:pointer;font-size:16px;width:22px;height:22px;border-radius:6px;line-height:1;padding:0;
  display:inline-flex;align-items:center;justify-content:center}
.hl-item .pin-x:hover{background:rgba(255,255,255,.1);color:var(--text)}

.chat-body{flex:1;display:flex;flex-direction:column;min-height:0}
.chat-msgs{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:9px}
.chat-msgs::-webkit-scrollbar{width:8px}
.chat-msgs::-webkit-scrollbar-thumb{background:#2a2f36;border-radius:4px}

/* Twemoji images: inline, text-sized, never steal clicks from their button */
img.emoji{width:1.25em;height:1.25em;vertical-align:-0.25em;display:inline-block}
.emoji-grid img.emoji,.reactpop img.emoji{width:20px;height:20px;vertical-align:middle;pointer-events:none}
/* Custom emojis (uploaded): emoji-sized inline in messages, bigger in the picker */
img.cust-emoji{height:1.5em;width:auto;max-width:2.4em;vertical-align:-0.35em;display:inline-block;object-fit:contain}
.cust-emoji-btn{background:transparent;border:0;cursor:pointer;padding:3px;border-radius:6px;line-height:0}
.cust-emoji-btn:hover{background:rgba(255,255,255,.12)}
.cust-emoji-btn img.cust-emoji{height:24px;max-width:30px;vertical-align:middle}
/* Custom emoji inside a NAME (chat header, highlight, profile, @mention) — sized
   to sit inline with the name text rather than the bigger in-message size. */
.nm img.cust-emoji,.nm-ink img.cust-emoji,.mention img.cust-emoji,.rq-nm img.cust-emoji,
.sqr-chip img.cust-emoji,.bc-nm img.cust-emoji{height:1.15em;max-width:1.6em;vertical-align:-0.2em;margin:0 1px}
.cust-em-list{display:flex;flex-direction:column;gap:5px;margin-top:6px}
.cust-em-row{display:flex;align-items:center;gap:8px}
.cust-em-row img.cust-emoji{height:24px;max-width:30px;vertical-align:middle}
.cust-em-code{flex:1 1 auto;font-size:12px;color:#9fb0c0;font-family:ui-monospace,monospace}
.cust-em-name{flex:1 1 auto;min-width:0;background:#0e1217;border:1px solid #2a313c;color:#e8eaed;
  border-radius:7px;padding:4px 8px;font-size:13px}
#custEmBatch{display:flex;flex-direction:column;gap:5px;margin-top:6px}
.rchip img.emoji{pointer-events:none}

.msg{display:flex;gap:8px;align-items:flex-start;font-size:14px;line-height:1.35;position:relative}
/* ---- Purchase celebration ---- */
/* Base buycard look (green gradient + border + shine) applies EVERYWHERE it's used
   — chat AND the highlight overlay (a pinned purchase renders the same card). */
.buycard{display:flex;align-items:center;gap:9px;padding:9px 13px;border-radius:12px;
  background:linear-gradient(100deg,#123a26,#0f2c3d 60%,#2a1740);border:1px solid #2f7d4a;
  box-shadow:0 6px 22px rgba(0,0,0,.4);position:relative;overflow:hidden}
.buycard::after{content:"";position:absolute;top:0;left:-60%;width:45%;height:100%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.22),transparent);
  animation:buyshine 2.2s ease-in-out 1 .3s}
.msg-buy .buycard{margin-top:5px;animation:buypop .5s cubic-bezier(.2,1.3,.4,1) both}
@keyframes buypop{0%{transform:scale(.85);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes buyshine{to{left:120%}}
.buycard .bc-ic{font-size:20px;flex:0 0 auto}
.buycard .bc-tx{color:#eafff2;font-size:13px;line-height:1.4}
.buycard .bc-tx b{color:#fff}
.buycard .bc-price{margin-left:4px;font-weight:800;color:#7de8a8}
/* Buyer's optional message (tips/pay-what-you-want) — wraps to its own line */
.buycard.has-note{flex-wrap:wrap}
.buycard .bc-note{flex-basis:100%;width:100%;color:#d4f3e4;font-size:12px;font-style:italic;
  margin-top:3px;padding-left:29px;opacity:.95;word-break:break-word;line-height:1.35}
.sc-notein{width:100%;margin-top:6px;background:#0e1217;border:1px solid #2a313c;color:#e8eaed;
  border-radius:8px;padding:5px 9px;font-size:13px;box-sizing:border-box}
.sc-notein::placeholder{color:#6b7480}
/* Buyer's name inside the card, in their own chat style (gradient/plate) */
.buycard .bc-nm{font-weight:800;display:inline-flex;align-items:center;vertical-align:middle}
.buycard .bc-nm.nm-plate{padding:1px 7px;border-radius:6px}
.confetti-host{position:fixed;inset:0;pointer-events:none;z-index:100001;overflow:hidden}
.fw-canvas{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:100001}
/* Chat translation toggle (per message). Hidden until hover; always shown once translated. */
.msg .tr-ctl{display:none;margin:3px 0 0;padding:0;border:0;background:none;color:#9aa0a6;font:inherit;font-size:11.5px;cursor:pointer;line-height:1.3;text-align:left}
.msg:hover .tr-ctl,.msg.tr-on .tr-ctl{display:inline-block}
.msg.tr-on .tr-ctl{color:#5aa9ff}
.msg .tr-ctl:hover{color:#cdd6df;text-decoration:underline}
.msg.tr-on .tr-ctl:hover{color:#8cc6ff}
.tr-ctl .tr-ic{font-size:11px;margin-right:2px}
.tr-ctl .tr-sm{opacity:.7}
@media (hover:none){ .msg .tr-ctl{display:inline-block;opacity:.5} .msg.tr-on .tr-ctl{opacity:1} }
.confetti-p{position:absolute;top:-24px;border-radius:2px;opacity:.95;
  animation-name:conffall;animation-timing-function:cubic-bezier(.35,.15,.6,1);animation-fill-mode:forwards}
@keyframes conffall{to{transform:translateY(108vh) rotate(var(--rot));opacity:.85}}
/* Emoji-based purchase animations (hearts/coins/stars/music/tech/fireworks) */
.anim-emoji{position:absolute;top:-30px;line-height:1;pointer-events:none;will-change:transform,opacity;
  animation-timing-function:linear;animation-fill-mode:forwards;animation-name:animfall}
.anim-emoji.rise{top:auto;bottom:-30px;animation-name:animrise;animation-timing-function:ease-out}
.anim-emoji.burst{top:30%;animation-name:animburst;animation-timing-function:ease-out}
@keyframes animfall{to{transform:translateY(114vh) rotate(var(--rot,20deg));opacity:.75}}
@keyframes animrise{to{transform:translateY(-114vh) translateX(var(--drift,0));opacity:0}}
@keyframes animburst{0%{transform:scale(.25);opacity:0}25%{opacity:1}100%{transform:scale(1.5) translateY(-38px);opacity:0}}
.buyburst{position:fixed;inset:0;z-index:100002;display:flex;align-items:center;justify-content:center;
  pointer-events:none;opacity:0;transition:opacity .3s ease}
.buyburst.show{opacity:1}
.buyburst .bb-in{background:linear-gradient(135deg,#123a26,#1a1140);border:1px solid #2f7d4a;
  border-radius:18px;padding:22px 34px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.55);
  transform:scale(.7);transition:transform .4s cubic-bezier(.2,1.4,.4,1)}
.buyburst.show .bb-in{transform:scale(1)}
.buyburst .bb-emoji{font-size:46px;animation:bbwiggle .6s ease infinite alternate}
@keyframes bbwiggle{to{transform:rotate(12deg) scale(1.08)}}
.buyburst .bb-h{font-size:24px;font-weight:800;color:#fff;margin-top:4px}
.buyburst .bb-s{font-size:15px;color:#cfe9d8;margin-top:2px}
.buyburst .bb-s b{color:#7de8a8}
.chat-sm .msg{font-size:12px}
.chat-lg .msg{font-size:17px}
.chat-sm .msg .av{width:24px;height:24px;font-size:12px}
.chat-lg .msg .av{width:32px;height:32px;font-size:16px}
/* Moderator per-message controls (hover, mods only) — subtle, theme-matched */
.msg-del{display:none;position:absolute;top:0;right:0;background:transparent;border:0;color:var(--muted);
  cursor:pointer;font-size:16px;width:20px;height:20px;border-radius:6px;line-height:1;padding:0;transition:background .12s,color .12s}
.msg-del:hover{background:rgba(255,255,255,.1);color:var(--accent)}
.chat.is-mod .msg:hover .msg-del{display:inline-flex;align-items:center;justify-content:center}
.msg-reply{display:none;position:absolute;top:0;right:48px;background:transparent;border:0;color:var(--muted);
  cursor:pointer;font-size:14px;width:20px;height:20px;border-radius:6px;line-height:1;padding:0;transition:background .12s,color .12s}
.msg-reply:hover{background:rgba(255,255,255,.1);color:var(--accent2)}
.msg:hover .msg-reply{display:inline-flex;align-items:center;justify-content:center}
/* Quoted preview of the replied-to message, above the reply text */
.msg .reply-quote{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);
  margin-bottom:2px;cursor:pointer;max-width:100%;overflow:hidden}
.msg .reply-quote:hover .rq-tx{color:var(--text)}
.msg .reply-quote .rq-ic{flex:0 0 auto;opacity:.7}
.msg .reply-quote .rq-nm{font-weight:700;flex:0 0 auto}
.msg .reply-quote .rq-tx{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.85}
/* Reply-compose bar above the input */
.reply-bar{display:none;align-items:center;gap:7px;padding:7px 12px;background:#0f1319;
  border-top:1px solid #232830;font-size:12px;color:var(--muted)}
.chat.replying .reply-bar{display:flex}
.reply-bar .rb-ic{flex:0 0 auto;color:var(--accent2)}
.reply-bar .rb-text{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.reply-bar .rb-x{flex:0 0 auto;background:transparent;border:0;color:var(--muted);cursor:pointer;
  font-size:16px;width:22px;height:22px;border-radius:6px;line-height:1;padding:0}
.reply-bar .rb-x:hover{background:rgba(255,255,255,.1);color:var(--text)}
/* Flash when jumping to a replied-to message */
.msg.flash{animation:msgflash 1.2s ease}
@keyframes msgflash{0%,60%{background:rgba(59,130,246,.22);border-radius:8px}100%{background:transparent}}

.msg-approve{display:none;position:absolute;top:0;right:72px;background:transparent;border:0;color:#39d353;
  cursor:pointer;font-size:13px;font-weight:800;height:20px;min-width:20px;border-radius:6px;line-height:1;padding:0 5px}
.msg-approve:hover{background:rgba(57,211,83,.16)}
.chat.is-mod .msg:hover .msg-approve{display:inline-flex;align-items:center;justify-content:center}
/* Clickable links + pending (awaiting approval) links */
.msg .tx a.chatlink{color:var(--accent2);text-decoration:none;word-break:break-all}
.msg .tx a.chatlink:hover{text-decoration:underline}
.msg .tx .chatlink.pending{color:var(--muted);text-decoration:line-through}
.link-pending-tag{font-size:11px;color:var(--muted);font-style:italic;margin-left:4px;white-space:nowrap}
.msg .av{width:28px;height:28px;border-radius:50%;flex:0 0 auto;object-fit:cover;background:#2a2f36;
  display:inline-flex;align-items:center;justify-content:center;font-size:14px;overflow:hidden;color:#fff}
.msg .body{min-width:0;flex:1}
.msg .nm{font-weight:700;margin-right:6px;cursor:pointer}
/* No underline on hover — just a subtle fade cue (cursor already shows it's clickable) */
.msg .nm:hover{opacity:.82}
/* Names carry NO underline or bottom-border (removed at the Captain's request).
   .nm-mod is kept as a hook but adds no line decoration. */
.msg .nm,.msg .nm.nm-mod,.nmprev,.nmprev.nm-mod{text-decoration:none;border-bottom:0}
/* Username backplate (opt-in, per-viewer): a solid color on the OUTER .nm, with
   the colored/gradient text on an inner .nm-ink — so the plate sits behind the
   name (even gradient names, whose text is painted via the element background). */
.msg .nm.nm-plate,.nmprev.nm-plate{padding:0 6px;border-radius:6px}
/* MOBILE FIX: force the PLATE's background to fill its box. On mobile WebKit the
   inner gradient name's `-webkit-background-clip:text` can leak up and clip the
   OUTER plate background to the glyphs → the backplate vanished on phones (works
   on desktop). Pinning the plate to border-box keeps it a solid box everywhere. */
.nm.nm-plate{-webkit-background-clip:border-box!important;background-clip:border-box!important}
/* Nameplate shown in the PROFILE card + drawer highlight (base padding rule above
   is .msg-scoped; the plate should hug the name here too) */
.modmenu .pc-name.nm-plate{display:inline-block;padding:3px 13px;border-radius:10px;text-shadow:none;max-width:none}
/* Saved name-look presets (Profile settings): tap a chip to switch instantly */
.plate-presets{display:flex;flex-wrap:wrap;gap:7px;margin-top:2px}
.plate-chip{position:relative;display:inline-flex;align-items:center;background:#1a212b;border:1px solid #2a313c;
  border-radius:9px;padding:5px 23px 5px 8px;cursor:pointer;transition:border-color .15s}
.plate-chip:hover{border-color:#3d7dff}
.plate-chip .nm{font-weight:700;font-size:13px;pointer-events:none}
.plate-chip .nm.nm-plate{padding:1px 7px;border-radius:6px}
.plate-chip-x{position:absolute;right:3px;top:50%;transform:translateY(-50%);background:transparent;border:0;
  color:#8a94a0;font-size:14px;cursor:pointer;line-height:1;width:18px;height:18px;border-radius:4px}
.plate-chip-x:hover{background:rgba(255,90,90,.2);color:#ff8a8a}
.hl-drawer .hl-item .nm.nm-plate{padding:1px 8px;border-radius:6px}
.nm-ink{background-clip:inherit}
/* Per-viewer text-brightness boost (readability for dark names/messages) */
/* Per-USER brightness: --ub is set on each .msg row from that person's saved
   setting; brightens/dims just their nameplate + text (readability, capped ±30%). */
.chat-msgs .msg .nm,.chat-msgs .msg .tx{filter:brightness(var(--ub,1))}
/* Timestamp — hidden until the message is clicked (setting-gated) */
.msg-ts{display:none;margin-left:8px;font-size:10px;color:#7e8792;font-weight:600;
  vertical-align:baseline;white-space:nowrap}
.msg.show-ts .msg-ts{display:inline}
/* Inline delete confirm — a small "Delete this message? y n" right on the row */
.msg-delc{display:inline-flex;align-items:center;gap:5px;margin-left:8px;
  font-size:12px;font-weight:600;color:#ffb4a8;vertical-align:middle;white-space:nowrap}
.msg-delc .dc-q{opacity:.95}
.msg-delc button{border:0;border-radius:5px;width:20px;height:20px;line-height:1;
  font-size:12px;font-weight:800;cursor:pointer;padding:0}
.msg-delc .dc-y{background:#b0343a;color:#fff}
.msg-delc .dc-n{background:#2a3038;color:#c9d2dc}
/* Hide the × (and approve tick) while its inline confirm is up */
.msg.delc-on .msg-del,.msg.delc-on .msg-approve{display:none!important}
/* Grouped: consecutive posts from the same author drop the avatar + name and
   tuck up under the previous message (the avatar keeps its width so the body
   stays aligned). */
.msg.grouped{margin-top:-3px}
.msg.grouped>.av{visibility:hidden;height:0;min-height:0}
.msg.grouped>.body>.nm{display:none}
.msg .tx{word-wrap:break-word;overflow-wrap:anywhere}
/* @mentions: tag chips; the tagged person's whole message lights up for them */
/* Mention chips composite their wash over the PANEL colour (like nameplates do)
   so they read identically over the video in transparent fullscreen — a bare
   8%/16% wash all but vanished there and looked dim. */
.mention{color:#8ab4f8;font-weight:700;border-radius:5px;padding:0 4px;
  background:linear-gradient(0deg,rgba(59,130,246,.16),rgba(59,130,246,.16)),var(--panel,#12161c)}
.mention.self{color:#fff;background:var(--accent2)}
/* Mention rendered in the target's own color scheme (gradient via inner ink) */
.mention.mention-styled{background:linear-gradient(0deg,rgba(255,255,255,.08),rgba(255,255,255,.08)),var(--panel,#12161c)}
.mention-ink{font-weight:700}
.msg.mentioned{background:rgba(59,130,246,.13);border-radius:9px;padding:3px 6px;margin:0 -6px}
.msg .gif{max-width:100%;max-height:220px;border-radius:8px;margin-top:5px;display:block}
/* Frozen GIF (out of view, or older than 2 min and not hovered): shows the still frame */
.msg .gif.gif-frozen{cursor:pointer}
.msg.sys{color:var(--muted);font-style:italic;font-size:13px;padding-left:2px}

.chat-note{padding:6px 12px;font-size:12px;color:var(--muted);background:#0f1319;border-top:1px solid #232830;
  display:none}
.chat-note.show{display:block}

/* Input bar (position toggled top/bottom) */
.chat-inputbar{display:flex;align-items:center;gap:6px;padding:8px;border-top:1px solid #232830;background:#0f1319}
.chat-body.input-top .chat-inputbar{order:-1;border-top:0;border-bottom:1px solid #232830}
.chat-inputbar input[type=text],.chat-inputbar input[type=search]{flex:1;min-width:0;background:#1b2129;border:1px solid #2a2f36;color:var(--text);
  border-radius:9px;padding:10px 11px;font-size:14px;outline:none}
.chat-inputbar input[type=text]:focus,.chat-inputbar input[type=search]:focus{border-color:#3b82f6}
/* type=search is only for autofill semantics — hide the browser's search chrome */
.chat-inputbar input[type=search]{-webkit-appearance:none;appearance:none}
.chat-inputbar input[type=search]::-webkit-search-cancel-button,
.chat-inputbar input[type=search]::-webkit-search-decoration{-webkit-appearance:none;display:none}
.cbtn{background:#1b2129;border:1px solid #2a2f36;color:var(--text);cursor:pointer;border-radius:9px;
  height:40px;min-width:40px;padding:0 10px;font-size:16px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.cbtn:hover{background:#232b34}
.cbtn.send{background:var(--accent2);border-color:var(--accent2);color:#fff;font-size:18px}
.cbtn.gif{font-size:12px;font-weight:800;letter-spacing:.5px}
/* Input-bar settings gear: only shown in mobile fullscreen (chat header hidden there) */
#chatGear2{display:none}

/* Popups (emoji / gif / mod menu) */
.pop{position:absolute;left:8px;right:8px;bottom:60px;z-index:30;background:#12171d;border:1px solid #2a2f36;
  border-radius:12px;box-shadow:0 12px 30px rgba(0,0,0,.5);padding:10px;display:none;max-height:280px;
  overflow-x:hidden;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}
.pop::-webkit-scrollbar{display:none;width:0;height:0}
.chat-body.input-top .pop{bottom:auto;top:60px}
.pop.show{display:block}
/* @-mention autocomplete */
.mentionpop{position:absolute;left:8px;right:8px;bottom:60px;z-index:35;background:#12171d;border:1px solid #2a2f36;
  border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.5);padding:4px;display:none;max-height:200px;overflow:auto;
  scrollbar-width:none;-ms-overflow-style:none}
.mentionpop::-webkit-scrollbar{display:none;width:0;height:0}
.chat-body.input-top .mentionpop{bottom:auto;top:60px}
.mentionpop.show{display:block}
.mentionpop button{display:block;width:100%;text-align:left;background:transparent;border:0;color:var(--text);
  padding:7px 10px;border-radius:7px;cursor:pointer;font-size:14px}
.mentionpop button.sel,.mentionpop button:hover{background:rgba(59,130,246,.35)}
/* Slash-command rows: /queue <args>  description */
.mentionpop button b{color:#8ab4ff;font-weight:700}
.mentionpop .cmda{color:#8a929c;font-size:12px}
.mentionpop .cmdd{display:block;color:#7e8792;font-size:11px;margin-top:1px}
/* iOS auto-zooms any focused input with font-size < 16px — keep chat inputs
   at 16px on phones so the page never zooms while typing/searching */
@media (max-width: 640px){
  .chat-inputbar input[type=text],.chat-inputbar input[type=search],.gif-search input,.emoji-search input,
  .fld input[type=text],.fld input[type=password]{font-size:16px!important}
}
.emoji-search{margin-bottom:8px}
.emoji-search input{width:100%;box-sizing:border-box;background:#1b2129;border:1px solid #2a2f36;
  color:var(--text);border-radius:8px;padding:8px;font-size:13px;outline:none}
.emoji-search input:focus{border-color:#3b82f6}
.emoji-subhead{font-size:10px;color:var(--muted);font-weight:800;text-transform:uppercase;
  letter-spacing:.5px;margin:4px 2px}
.emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}
.emoji-grid button{min-width:0;overflow:hidden}
.emoji-grid button{background:transparent;border:0;font-size:20px;cursor:pointer;border-radius:6px;padding:4px}
.emoji-grid button:hover{background:rgba(255,255,255,.12)}
.gif-search{display:flex;gap:6px;margin-bottom:8px}
.gif-search input{flex:1;background:#1b2129;border:1px solid #2a2f36;color:var(--text);border-radius:8px;padding:8px}
.gif-results{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}
.gif-results img{width:100%;height:80px;object-fit:cover;border-radius:6px;cursor:pointer}
/* Each GIF is a cell so a small 🔍 zoom/preview button can sit in its corner —
   click the GIF to POST, click the 🔍 to preview it big without posting. */
.gif-cell{position:relative;display:block}
.gif-cell img{display:block}
.gif-zoom{position:absolute;top:3px;right:3px;width:22px;height:22px;padding:0;border:0;
  border-radius:6px;background:rgba(0,0,0,.55);color:#fff;font-size:12px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;opacity:.82}
.gif-cell:hover .gif-zoom,.gif-zoom:hover{opacity:1;background:rgba(0,0,0,.85)}
.gif-hint{font-size:12px;color:var(--muted);margin:4px 2px}
.nmprev{font-weight:800;margin-left:8px;background-size:100%;-webkit-background-clip:text;
  text-transform:none;letter-spacing:normal}

/* Link preview cards (Discord-style unfurl) */
.linkcard{display:flex;gap:10px;align-items:flex-start;margin-top:6px;padding:9px 11px;
  background:#12171d;border-left:3px solid var(--accent2);border-radius:6px;
  text-decoration:none;color:var(--text);max-width:380px}
.linkcard:hover{background:#171d25}
.linkcard .lc-body{min-width:0;flex:1}
.linkcard .lc-site{font-size:11px;color:var(--muted);margin-bottom:2px}
.linkcard .lc-title{font-size:13px;font-weight:700;color:#8ab4f8;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.linkcard .lc-desc{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.linkcard .lc-img{flex:0 0 auto;width:64px;height:64px;border-radius:6px;object-fit:cover}

/* Reactions — no borders, no visible scrollbar */
.reactions{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.reactions:empty{display:none}
/* Reaction chips are CLEAR (Captain: transparent emojis must float free, no
   pill behind them) — only the count carries a shadow so it reads over GIFs. */
.rchip{display:inline-flex;align-items:center;gap:3px;background:transparent;border:0;
  border-radius:12px;padding:2px 4px;font-size:14px;line-height:1.5;cursor:pointer;color:var(--text)}
.rchip:hover{background:rgba(255,255,255,.1)}
.rchip .rc{font-size:11px;color:#cdd6df;font-weight:700;text-shadow:0 1px 3px rgba(0,0,0,.9)}
.reactpop{position:fixed;z-index:10000;background:#12171d;border:0;border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.5);padding:6px;display:none;width:236px;max-height:240px;
  overflow-x:hidden;overflow-y:auto;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px;
  scrollbar-width:none;-ms-overflow-style:none}
.reactpop::-webkit-scrollbar{display:none;width:0;height:0}
.reactpop.show{display:grid}
.reactpop button{background:transparent;border:0;font-size:19px;cursor:pointer;border-radius:6px;padding:3px 0;
  min-width:0;overflow:hidden}
.reactpop button:hover{background:rgba(255,255,255,.14)}
/* CUSTOM emojis lead the reaction picker (owner/mod uploads) */
.reactpop .rp-custrow{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:2px;
  padding-bottom:4px;margin-bottom:3px;border-bottom:1px solid #2a2f36}
/* Recently-used emojis next */
.reactpop button.rec{background:rgba(59,130,246,.12)}
.reactpop button.rec:hover{background:rgba(59,130,246,.3)}
/* Message actions: a single horizontal row of icon buttons above the emoji grid */
.reactpop .pin-actions{grid-column:1/-1;display:flex;gap:2px;justify-content:flex-start;
  padding-bottom:4px;margin-bottom:3px;border-bottom:1px solid #2a2f36}
.reactpop .pin-ic{flex:0 0 auto;font-size:17px;line-height:1;width:30px;height:30px;
  display:inline-flex;align-items:center;justify-content:center;border-radius:7px;background:transparent}
.reactpop .pin-ic:hover{background:rgba(255,255,255,.14)}
.reactpop .pin-ic img.emoji{width:17px;height:17px}

/* Image viewer (pasted screenshots): fills the window, drag to pan when big */
.imgbox{position:fixed;inset:0;z-index:100001;background:rgba(0,0,0,.88);display:flex;
  overflow:auto;cursor:zoom-out;overscroll-behavior:contain;
  scrollbar-width:none;-ms-overflow-style:none}
.imgbox::-webkit-scrollbar{display:none;width:0;height:0}
.imgbox img{display:block;margin:auto;max-width:none;max-height:none;cursor:grab;
  touch-action:none;user-select:none;-webkit-user-drag:none}
.imgbox img:active{cursor:grabbing}
/* Fit-to-screen mode (GIFs): enlarge small gifs to fill the screen; tap to zoom in */
.imgbox-fit{align-items:center;justify-content:center}
.imgbox-fit img{width:94vw;height:88vh;max-width:none;max-height:none;object-fit:contain;cursor:zoom-in}
.imgbox-fit.zoomed img{width:185vw;height:180vh;object-fit:contain;cursor:grab}
.imgbox-x{position:fixed;top:14px;right:16px;z-index:100002;width:40px;height:40px;border-radius:50%;
  border:0;background:rgba(20,24,29,.72);color:#fff;font-size:17px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.imgbox-x:hover{background:rgba(46,52,60,.92)}

/* Moderator user list */
.user-item{padding:7px 0;border-bottom:1px solid #1b2129}
.urow{display:flex;align-items:center;gap:6px;margin-bottom:5px}
.uname{font-weight:600;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.ubadge{font-size:9px;font-weight:800;background:var(--accent);color:#fff;border-radius:4px;padding:1px 5px;flex:0 0 auto}
.utag{font-size:10px;color:var(--muted);border:1px solid #2a2f36;border-radius:10px;padding:0 6px;flex:0 0 auto}
.uacts{display:flex;flex-wrap:wrap;gap:4px}
.uacts button{background:#1b2129;border:1px solid #2a2f36;color:var(--text);border-radius:7px;padding:4px 8px;font-size:12px;cursor:pointer}
.uacts button:hover{background:#232b34}
.uacts button.danger{border-color:#5b2320;color:#ff6b60}
.uacts button.danger:hover{background:rgba(255,59,48,.14)}

/* Mod action menu */
.modmenu{position:fixed;z-index:9999;background:#12171d;border:1px solid #2a2f36;border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.5);padding:6px;display:none;min-width:130px;
  /* Tall cards near the bottom scroll instead of clipping — no visible scrollbar */
  max-height:calc(100vh - 16px);overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  scrollbar-width:none;-ms-overflow-style:none}
.modmenu::-webkit-scrollbar{display:none;width:0;height:0}
.modmenu.show{display:block}
.modmenu button{display:block;width:100%;text-align:left;background:transparent;border:0;color:var(--text);
  padding:8px 10px;border-radius:7px;cursor:pointer;font-size:13px}
.modmenu button:hover{background:rgba(255,255,255,.1)}
.modmenu .danger:hover{background:rgba(255,59,48,.25)}
.modmenu .who{font-size:11px;color:var(--muted);padding:4px 10px 6px}
/* Profile card header (click a name): large avatar + name in detail */
.modmenu .pc-head{display:flex;flex-direction:column;align-items:center;gap:9px;
  padding:14px 22px 12px;border-bottom:1px solid #1b2129;margin-bottom:4px}
.modmenu .pc-av{width:76px;height:76px;border-radius:50%;object-fit:cover;background:#2a2f36;
  display:inline-flex;align-items:center;justify-content:center;font-size:36px;color:#fff;overflow:hidden}
.modmenu .pc-name{font-weight:800;font-size:17px;max-width:220px;text-align:center;word-break:break-word;
  text-shadow:0 0 8px rgba(255,255,255,.4),0 1px 2px rgba(0,0,0,.75)}
/* Friend status + actions in the profile card */
.modmenu .pc-friend{font-size:12px;color:var(--muted);text-align:center;padding:2px 10px 6px}
.modmenu .pc-friend.is-friends{color:#7de8a8;font-weight:700}
.modmenu .pc-frow{display:flex;gap:6px;padding:0 8px 8px}
.modmenu .pc-frow button{flex:1 1 auto;text-align:center;background:#1a212b;border-radius:8px;
  padding:7px 8px;font-size:12px}
.modmenu .pc-frow button:disabled{opacity:.5}
.modmenu .pc-bright{padding:2px 12px 9px;border-bottom:1px solid rgba(255,255,255,.07);margin-bottom:4px}
.modmenu .pc-bright-lbl{font-size:12px;color:#9fb0c0;margin-bottom:4px}
.modmenu .pc-bright-lbl b{color:#7de8a8;font-weight:800}
.modmenu .pc-bright-row{display:flex;align-items:center;gap:7px}
.modmenu .pc-bright-row span{font-size:12px;opacity:.8}
.modmenu .pc-bright-row input[type=range]{flex:1 1 auto;min-width:0}

/* Ship's Computer AI messages in public chat */
.msg.msg-ai{background:linear-gradient(90deg,rgba(124,196,255,.12),rgba(124,196,255,0));
  border-left:2px solid #7cc4ff;border-radius:8px;padding:4px 8px;margin:0 -2px}
.msg.msg-ai .nm{color:#7cc4ff!important}

/* AI panel (Ship's Computer) — slides over the chat like settings */
.ai-panel{position:absolute;inset:0;z-index:41;background:var(--panel);display:none;flex-direction:column}
.ai-panel.show{display:flex}
.ai-log{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:10px;
  scrollbar-width:none;-ms-overflow-style:none}
.ai-log::-webkit-scrollbar{display:none;width:0;height:0}
.ai-msg{display:flex;gap:8px;align-items:flex-start;font-size:14px;line-height:1.4}
.ai-msg .ai-who{flex:0 0 auto;font-weight:700;font-size:12px;color:var(--muted);min-width:30px}
.ai-msg.ai-ai .ai-who{color:#7cc4ff}
.ai-msg .ai-tx{white-space:pre-wrap;word-break:break-word;min-width:0}
.ai-msg.ai-ai{background:rgba(124,196,255,.08);border-radius:9px;padding:7px 9px}
.ai-setup{display:none;flex-direction:column;gap:12px;padding:14px;border-top:1px solid #232830;
  background:#0f1319;max-height:60%;overflow:auto;scrollbar-width:none}
.ai-setup::-webkit-scrollbar{display:none;width:0;height:0}
.ai-setup.show{display:flex}
.ai-inputbar{display:flex;align-items:center;gap:6px;padding:8px;border-top:1px solid #232830;background:#0f1319}
.ai-inputbar input{flex:1;min-width:0;background:#1b2129;border:1px solid #2a2f36;color:var(--text);
  border-radius:9px;padding:10px 11px;font-size:16px;outline:none}
.ai-inputbar input:focus{border-color:#3b82f6}
.chat-gear.on{color:var(--accent2)}

/* Onboarding gate — name + avatar required before chatting */
.onboard{position:absolute;inset:0;z-index:60;background:var(--panel);display:none;
  flex-direction:column;align-items:center;justify-content:center;padding:20px;overflow:auto}
.chat.onboarding .onboard{display:flex}
.onboard-box{width:100%;max-width:340px;display:flex;flex-direction:column;gap:10px}
.onboard-title{font-size:20px;font-weight:800;text-align:center}
.onboard-sub{font-size:13px;color:var(--muted);text-align:center;margin-bottom:4px}
.onboard input[type=text]{background:#1b2129;border:1px solid #2a2f36;color:var(--text);
  border-radius:9px;padding:11px;font-size:16px;outline:none}
.onboard input[type=text]:focus{border-color:#3b82f6}
.onboard-label{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;
  letter-spacing:.4px;margin-top:4px}
.onboard-avs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ob-av{padding:0;border:2px solid transparent;border-radius:50%;background:transparent;
  cursor:pointer;overflow:hidden;aspect-ratio:1}
.ob-av img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}
.ob-av.sel{border-color:var(--accent2)}
.onboard .save-primary:disabled{opacity:.45;cursor:not-allowed}

/* Settings panel (slides over the chat) */
.settings{position:absolute;inset:0;z-index:40;background:var(--panel);display:none;flex-direction:column}
.settings.show{display:flex}
.settings-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #232830;background:#0f1319}
.settings-head .grow{flex:1;font-weight:700}
.settings-body{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:16px;
  scrollbar-width:none;-ms-overflow-style:none}
.settings-body::-webkit-scrollbar{display:none;width:0;height:0}
/* Settings tabs/pages — one group at a time (Profile / Chat / Sync / Mod) */
.set-tabs{display:flex;gap:5px;flex-wrap:wrap}
.set-tab{flex:1 1 0;min-width:62px;background:#171c24;border:1px solid #2a3038;color:#aeb6c0;
  border-radius:9px;padding:8px 6px;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap}
.set-tab.on{background:#1f6feb;border-color:#1f6feb;color:#fff}
.settings-page{display:none}
.settings-page.on{display:flex;flex-direction:column;gap:16px}
.fld{display:flex;flex-direction:column;gap:6px}
.fld label{font-size:12px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.4px}
.fld input[type=text],.fld input[type=password]{background:#1b2129;border:1px solid #2a2f36;color:var(--text);
  border-radius:9px;padding:10px;font-size:14px;outline:none}
/* Masked like a password, but type=text so browsers never offer to save it */
.pw-mask{-webkit-text-security:disc;text-security:disc}
.fld input:focus{border-color:#3b82f6}
.seg{display:flex;background:#1b2129;border:1px solid #2a2f36;border-radius:9px;overflow:hidden}
.seg button{flex:1;background:transparent;border:0;color:var(--muted);padding:9px;cursor:pointer;font-size:13px;font-weight:600}
.seg button.on{background:var(--accent2);color:#fff}
.avrow{display:flex;align-items:center;gap:12px}
.avprev{width:52px;height:52px;flex:0 0 52px;min-width:52px;border-radius:50%;background:#2a2f36;
  object-fit:cover;display:inline-flex;
  align-items:center;justify-content:center;font-size:22px;color:#fff;overflow:hidden}
.linkbtn{background:transparent;border:0;color:var(--accent2);cursor:pointer;font-size:13px;padding:0;text-align:left}
/* Small clickable color swatch next to a hex field (shows the actual color, opens native picker) */
.cswatch{-webkit-appearance:none;appearance:none;width:34px;height:34px;flex:0 0 auto;padding:0;
  border:1px solid rgba(255,255,255,.22);border-radius:8px;background:transparent;cursor:pointer}
.cswatch::-webkit-color-swatch-wrapper{padding:0}
.cswatch::-webkit-color-swatch{border:0;border-radius:7px}
.cswatch::-moz-color-swatch{border:0;border-radius:7px}
.save-primary{background:var(--accent2);border:0;color:#fff;border-radius:9px;padding:11px;font-weight:700;cursor:pointer;font-size:14px}
.modtools{border-top:1px solid #232830;padding-top:14px}
.list-item{display:flex;align-items:center;gap:8px;font-size:13px;padding:6px 0;border-bottom:1px solid #1b2129}
.list-item .ip{flex:1;font-family:ui-monospace,monospace;color:var(--text)}
.list-item button{background:#1b2129;border:1px solid #2a2f36;color:var(--text);border-radius:7px;padding:5px 9px;cursor:pointer;font-size:12px}
.list-item button:hover{background:#232b34}
.mod-only{display:none}
.chat.is-mod .mod-only{display:block}
/* Streamer login: hidden from regular viewers — appointed mods don't need it
   (auto-modded by IP) and only the owner knows how to reveal it (/mod in chat) */
.mod-login{display:none}
.chat.show-modlogin .mod-login{display:flex}
.owner-only{display:none}
.chat.is-owner .owner-only{display:block}
.subhead{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px}

/* Pop-out chat (Document Picture-in-Picture) — a minimal, movable overlay that
   fills the window at any size (drag its edges/corners to resize). */
.chat-pip-body{margin:0;width:100%;height:100vh;height:100dvh;background:#0b0d10;overflow:hidden}
.chat.chat-pip{width:100%;height:100vh;height:100dvh;min-height:0;background:transparent;border:0;border-radius:0}
.chat.chat-pip .chat-body,.chat.chat-pip .chat-msgs{background:transparent}
/* No visible scrollbar in the pop-out window (still scrolls with the wheel) */
.chat-pip-body,.chat.chat-pip .chat-msgs{scrollbar-width:none;-ms-overflow-style:none}
.chat-pip-body::-webkit-scrollbar,.chat.chat-pip .chat-msgs::-webkit-scrollbar{display:none;width:0;height:0}
.chat.chat-pip .msg{text-shadow:0 1px 3px rgba(0,0,0,.95)}
/* Input field stays visible as part of the overlay */
.chat.chat-pip .chat-inputbar{background:rgba(15,19,25,.5);border-top:1px solid rgba(255,255,255,.12)}

/* Interactive poll card embedded in a chat message (shared from the Playspace) */
.chat-poll{margin-top:6px;background:#141922;border:1px solid #2a2f36;border-radius:12px;
  padding:10px 11px;display:flex;flex-direction:column;gap:6px;max-width:340px}
.chat-poll .cp-q{font-size:13.5px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
.chat-poll .cp-closed{font-size:9px;font-weight:800;letter-spacing:.06em;color:#ff9c9c;
  border:1px solid #b0343a;border-radius:999px;padding:1px 7px;white-space:nowrap;
  display:inline-block;vertical-align:middle;margin-left:2px}
.chat-poll .cp-opt{position:relative;overflow:hidden;text-align:left;display:flex;align-items:center;
  gap:8px;background:#1b2129;border:1px solid #2a313c;color:var(--text);border-radius:9px;
  padding:8px 11px;font-size:13px;cursor:pointer;width:100%}
.chat-poll .cp-opt:hover:not(:disabled){border-color:#3b82f6}
.chat-poll .cp-opt.mine{border-color:#5cc4ff}
.chat-poll .cp-opt:disabled{cursor:default;opacity:.85}
.chat-poll .cp-bar{position:absolute;left:0;top:0;bottom:0;background:#1f6feb33;transition:width .4s ease}
.chat-poll .cp-txt{position:relative;flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-poll .cp-pct{position:relative;flex:0 0 auto;font-size:11px;color:#aeb6c0}
.chat-poll .cp-foot{font-size:11px;color:#7e8792}

/* Trivia card in chat: correct/wrong highlight after reveal */
.chat-trivia .cp-opt.cp-correct{border-color:#3fb950;background:#12351f}
.chat-trivia .cp-opt.cp-correct .cp-bar{background:#3fb95033}
.chat-trivia .cp-opt.cp-wrong{border-color:#b0343a;background:#2a1416}
.chat-trivia .cp-opt.cp-wrong .cp-bar{background:#b0343a33}
.chat-trivia .cp-target{font-size:11px;font-weight:700;color:#ffcf5c;background:#2a230f;
  border-radius:7px;padding:4px 8px;display:inline-block}

/* Ship's Computer "researching" indicator — a subtle scanning AI pill */
.msg.research{display:flex;align-items:center;gap:8px;font-size:12.5px;color:#cfe9ff;
  background:linear-gradient(90deg,rgba(92,196,255,.16),rgba(92,196,255,.04));
  border:1px solid rgba(92,196,255,.32);border-radius:11px;padding:8px 12px;
  position:relative;overflow:hidden}
.msg.research::after{content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(124,196,255,.22),transparent);
  transform:translateX(-100%);animation:rsscan 1.7s linear infinite}
.msg.research .rs-ic{font-size:15px;filter:drop-shadow(0 0 5px #5cc4ff);flex:0 0 auto}
.msg.research .rs-tx{flex:1 1 auto;min-width:0;font-style:normal}
.msg.research .rs-dots{display:inline-flex;gap:3px;flex:0 0 auto}
.msg.research .rs-dots i{width:5px;height:5px;border-radius:50%;background:#5cc4ff;animation:rsdot 1s infinite}
.msg.research .rs-dots i:nth-child(2){animation-delay:.18s}
.msg.research .rs-dots i:nth-child(3){animation-delay:.36s}
.msg.research.rs-done{opacity:0;transition:opacity .55s ease}
@keyframes rsscan{to{transform:translateX(100%)}}
@keyframes rsdot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-2px)}}
.chat-trivia.cp-ended{opacity:.6}

/* Timed-trivia countdown on the in-chat card */
.cp-timer{display:inline-block;margin-left:6px;font-size:11px;font-weight:700;color:#9bf6ff;
  background:#0e2a33;border:1px solid #1c4b57;border-radius:6px;padding:1px 6px;vertical-align:middle}
.cp-timer-lo{color:#ffd6a5;background:#33240e;border-color:#5a4113;animation:cppulse 1s infinite}
@keyframes cppulse{50%{opacity:.5}}
.cp-write{display:flex;gap:6px;margin-top:6px}
.cp-writein{flex:1 1 auto;min-width:0;background:#0f141a;border:1px solid #2a3038;border-radius:7px;
  color:#e7ecf2;padding:5px 9px;font-size:12px}
.cp-writeadd{flex:0 0 auto;background:#1f6feb;border:0;color:#fff;font-weight:700;border-radius:7px;
  padding:5px 12px;font-size:12px;cursor:pointer}
/* Private buyer download card */
.msg.dlcard{padding:2px 0}
.dl-box{width:100%;background:linear-gradient(120deg,#123a26,#0f2c3d);border:1px solid #2f7d4a;
  border-radius:12px;padding:12px 14px;box-shadow:0 6px 22px rgba(0,0,0,.4)}
.dl-title{font-size:13px;font-weight:800;color:#7de8a8;letter-spacing:.02em}
.dl-name{font-size:15px;font-weight:700;color:#fff;margin:2px 0 9px;word-break:break-word}
.dl-btn{display:inline-block;background:#1f6feb;color:#fff;font-weight:800;text-decoration:none;
  border-radius:9px;padding:8px 18px;font-size:14px}
.dl-btn:hover{background:#3b82f6}
.dl-hint{font-size:11px;color:#9aa4b0;margin-top:8px}
.cp-qn{display:inline-block;margin-left:6px;font-size:10px;font-weight:800;color:#cfe9ff;
  background:#1f6feb33;border:1px solid #5cc4ff66;border-radius:6px;padding:1px 6px;vertical-align:middle;letter-spacing:.03em}

/* Personalized trivia reveal badge in chat (CORRECT/INCORRECT for you) */
.cp-badge{font-size:9px;font-weight:800;letter-spacing:.06em;border-radius:999px;
  padding:1px 7px;white-space:nowrap;vertical-align:middle;display:inline-block;margin-left:4px}
.cp-b-ok{color:#7de8a8;border:1px solid #2f7d4a;background:#12351f}
.cp-b-no{color:#ff9c9c;border:1px solid #b0343a;background:#2a1416}
.cp-b-rev{color:#aeb6c0;border:1px solid #444c57}

/* Preserve line breaks + spacing in chat messages (Ship's Computer diagnostics
   are multi-line; without this every newline collapsed into one dense blob). */
.msg .tx{white-space:pre-wrap;overflow-wrap:anywhere}

/* Owner-only right-click menu for queueing song links to Spotify */
.music-menu{position:fixed;z-index:100000;min-width:210px;background:#12161c;
  border:1px solid #2a313c;border-radius:10px;padding:5px;
  box-shadow:0 10px 34px rgba(0,0,0,.55);display:flex;flex-direction:column;gap:2px}
.music-menu button{background:transparent;border:0;color:#e8eaed;text-align:left;
  font:600 13px/1.3 inherit;padding:8px 10px;border-radius:7px;cursor:pointer;white-space:nowrap}
.music-menu button:hover{background:#1f6feb22}
.music-menu button:first-child:hover{background:#12351f;color:#b7f5c6}
.music-menu button.mm-disabled,.music-menu button:disabled{color:#6b7280;cursor:default}
.music-menu button.mm-disabled:hover,.music-menu button:disabled:hover{background:transparent}

/* "(edited)" marker after an edited message */
.edited-tag{font-size:10px;color:var(--muted);margin-left:3px;opacity:.7}
/* Queued-song card in chat ("NAME queued [card]") */
.songq{display:flex;align-items:center;gap:10px;margin-top:4px;max-width:340px;
  background:#12161c;border:1px solid #2a313c;border-radius:12px;padding:8px 12px 8px 8px}
.sq-art{width:44px;height:44px;border-radius:8px;flex:0 0 auto;background:#1a2029 center/cover no-repeat;
  display:flex;align-items:center;justify-content:center;font-size:20px}
.sq-meta{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.sq-meta b{color:#fff;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sq-meta span{color:#9aa4b0;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sq-tag{flex:0 0 auto;font-size:10px;font-weight:800;letter-spacing:.04em;color:#7de8a8;
  border:1px solid #2f7d4a;background:#12351f;border-radius:999px;padding:2px 8px}
/* Clickable shared-song card (opens the track) */
a.songq-link{text-decoration:none;cursor:pointer;transition:border-color .15s,background .15s}
a.songq-link:hover{border-color:#3d7dff;background:#151b24}
/* Rich queue-style card: album art background + requester nameplate chip inside */
.msg.msg-songcard .body{margin-left:0}
.songq-rich{position:relative;display:block;max-width:360px;min-height:74px;margin-top:2px;
  background:#141922 center/cover no-repeat;border:1px solid #222831;border-radius:12px;
  padding:10px 12px 12px}
.songq-rich.has-art{border-color:#2b3442}
.songq-rich .sqr-main{display:flex;flex-direction:column;gap:1px;padding-right:92px}
.songq-rich .sqr-title{color:#fff;font-size:16px;font-weight:800;line-height:1.2;
  overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  text-shadow:0 1px 3px rgba(0,0,0,.85)}
.songq-rich .sqr-artist{color:#d5dde5;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  text-shadow:0 1px 3px rgba(0,0,0,.85)}
.songq-rich .sqr-badge{align-self:flex-start;margin-top:6px;font-size:10px;font-weight:800;letter-spacing:.04em;
  color:#7de8a8;border:1px solid #2f7d4a;background:#12351f;border-radius:999px;padding:2px 9px}
.songq-rich .sqr-chip{position:absolute;right:8px;bottom:8px;display:inline-flex;align-items:center;gap:6px;
  max-width:62%;background:rgba(9,12,16,.62);border:1px solid rgba(70,80,94,.45);border-radius:999px;
  padding:2px 9px 2px 3px;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.songq-rich .sqr-av{width:22px;height:22px;font-size:13px;flex:0 0 auto}
.songq-rich .sqr-nm{font-size:12px;font-weight:700;max-width:150px;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;cursor:default}
.songq-rich .sqr-nm.nm-plate{padding:1px 7px;border-radius:6px}
/* Store item card shared into chat (with a live Buy button) */
.storecard{display:flex;gap:10px;margin-top:4px;max-width:min(360px,100%);background:#12161c;
  border:1px solid #2a313c;border-radius:12px;padding:9px}
.sc-art{width:56px;height:56px;flex:0 0 auto;border-radius:9px;background:#1a2029 center/cover no-repeat;
  display:flex;align-items:center;justify-content:center;font-size:24px}
.sc-meta{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.sc-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.sc-top>b{color:#fff;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sc-price{flex:0 0 auto;font-weight:800;color:#7de8a8;font-size:14px}
.sc-desc{font-size:12px;color:#9aa4b0;line-height:1.35;overflow:hidden;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.sc-foot{display:flex;align-items:center;gap:8px;margin-top:2px;flex-wrap:wrap;row-gap:6px}
.sc-ship{font-size:10px;font-weight:800;color:#aeb6c0;border:1px solid #444c57;border-radius:999px;padding:1px 7px}
.sc-buy{margin-left:auto;background:#1f6feb;border:0;color:#fff;font-weight:800;border-radius:8px;
  padding:5px 18px;cursor:pointer;font-size:13px}
.sc-buy:disabled{opacity:.4;cursor:default}
.sc-buy.soldout{background:#3a2126;color:#ffb4a8}
.sc-animsel{background:#0e1217;border:1px solid #2a313c;color:#cdd6df;border-radius:7px;padding:4px 6px;font-size:11px;flex:0 1 auto;min-width:0;max-width:120px}
.sc-paypal{background:#ffc439;color:#003087;margin-left:6px}
.sc-paypal:disabled{opacity:.4}
.sc-pwywin{flex:0 1 100px;min-width:64px;width:auto;background:#0e1217;border:1px solid #2a313c;color:#e8eaed;
  border-radius:8px;padding:5px 8px;font-size:13px;-moz-appearance:textfield;appearance:textfield}
.sc-pwywin::-webkit-outer-spin-button,.sc-pwywin::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.sc-pwywin+.sc-buy{margin-left:6px}
.sc-stock{font-size:10px;font-weight:800;border-radius:999px;padding:1px 7px;color:#7de8a8;border:1px solid #2f7d4a;background:#12351f}
.sc-stock.low{color:#ffd6a5;border-color:#5a4113;background:#33240e}
.sc-stock.out{color:#ffb4a8;border-color:#8a3a30;background:#331512}
.storecard.out{opacity:.72}
.storecard.out .sc-art{filter:grayscale(.6)}

/* Fullscreen mention/slash popup: FIXED inside the fullscreen stage (JS sets
   left/width/bottom from the input's rect) — the drawer-flavored absolute
   positioning above doesn't apply out here. */
.fs-mentionpop{position:fixed;left:auto;right:auto;top:auto;bottom:auto;
  z-index:100005;max-width:480px;max-height:40vh;overflow:auto}

/* Stream clipboard (super mods + owner) */
.clips-list{display:flex;flex-direction:column;gap:5px;margin-top:6px}
.clip-row{display:flex;align-items:center;gap:6px}
.clip-btn{flex:1 1 auto;min-width:0;text-align:left;background:#1b2129;border:1px solid #2a2f36;
  color:var(--text);border-radius:8px;padding:6px 10px;font-size:13px;cursor:pointer;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.clip-btn:hover{background:#242c37;border-color:#3b82f6}
.ubadge.sup{background:#7c3aed;color:#fff}

/* Ctrl-select emoji combos */
.grp-chip{grid-column:1/-1;width:100%;background:rgba(255,211,107,.14);border:1px solid #ffd36b55;
  color:#ffd36b;border-radius:8px;padding:5px 9px;font-size:12px;font-weight:700;margin-bottom:6px}
#emojiPop button.grp-on,#fsEmojiPop button.grp-on,.reactpop button.grp-on{outline:2px solid #ffd36b;outline-offset:-2px;background:rgba(255,211,107,.18);border-radius:6px}
/* A reaction chip glows when its react lands — combos glow in sequence */
.rchip.rx-light{animation:emojiLight 1.1s ease 1 both;position:relative;z-index:2}
/* …then the whole group glows TOGETHER as a finale */
.rchip.rx-finale{animation:emojiFinale 1.15s ease 1 both;position:relative;z-index:2}
@keyframes emojiFinale{
  0%,100%{filter:none;transform:scale(1)}
  25%{filter:drop-shadow(0 0 14px #ffd36b) brightness(1.7);transform:scale(1.3)}
  70%{filter:drop-shadow(0 0 6px #ffd36b) brightness(1.2);transform:scale(1.1)}}
/* Collective render: bigger emojis that light up one after another */
.tx.emoji-collective img.emoji{width:2em;height:2em;vertical-align:-0.5em;
  animation:emojiLight 1.1s ease 2 both}
.tx.emoji-collective img.cust-emoji{height:2em;max-width:2.6em;vertical-align:-0.5em;
  animation:emojiLight 1.1s ease 2 both}
@keyframes emojiLight{
  0%,100%{filter:none;transform:scale(1)}
  12%{filter:drop-shadow(0 0 10px #ffd36b) brightness(1.55);transform:scale(1.35)}
  30%{filter:none;transform:scale(1)}}


/* search bar inside the right-click react picker spans the full grid row */
.reactpop .emoji-search{grid-column:1/-1;margin:2px 0 4px}
.reactpop .emoji-search input{font-size:12px;padding:5px 8px}

/* Saved Multimoji stacks (wombos) — Tab with picks saves one */
.wombo-row{margin:2px 0 6px}
.reactpop .wombo-row{grid-column:1/-1}
.wombo-grid{display:flex;flex-wrap:wrap;gap:4px}
.wombo-btn{background:#1a212b;border:1px solid #2a3340;border-radius:8px;padding:3px 8px;
  cursor:pointer;font-size:15px;color:#dbe4ee;line-height:1.4}
.wombo-btn:hover{border-color:#ffd36b;background:rgba(255,211,107,.12)}
.wombo-btn img.emoji{width:18px;height:18px;vertical-align:-4px}
.wombo-btn img.cust-emoji{height:18px;max-width:24px;vertical-align:-4px}
/* very big wombos render a touch smaller so they still fit nicely */
.tx.emoji-collective.many img.emoji{width:1.5em;height:1.5em;vertical-align:-0.35em}
.tx.emoji-collective.many img.cust-emoji{height:1.5em;max-width:2em;vertical-align:-0.35em}
.clip-btn img.clip-ico{width:17px;height:17px;border-radius:4px;object-fit:cover;vertical-align:-3px;margin-right:6px}
/* Cheatsheet inline row editor (gear menu) */
.clip-row .clip-ein{background:#1b2129;border:1px solid #2a2f36;color:#e8eaed;border-radius:6px;
  padding:4px 7px;font-size:12px;min-width:0;flex:0 0 30%}
.clip-row .clip-ein.wide{flex:1}
.clip-row .clip-ein:focus{border-color:#3b82f6;outline:none}
/* Cheatsheet right-click menu (gear list) */
.clip-menu{position:fixed;z-index:10001;background:#12171d;border:1px solid #2a3340;border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.55);padding:4px;display:flex;flex-direction:column;min-width:172px}
.clip-mi{background:transparent;border:0;color:#dbe4ee;text-align:left;padding:7px 10px;
  border-radius:7px;cursor:pointer;font-size:12.5px;white-space:nowrap}
.clip-mi:hover{background:rgba(59,130,246,.22)}
.clip-mi.danger{color:#ff9b9b}
.clip-mi.danger:hover{background:rgba(176,52,58,.3)}

/* REPLY CHAIN — a staircase: the EARLIEST comment sits furthest left, each
   reply steps right, the direct parent (bottom) is clearest, older links fade.
   More than 3 links and the stack scrolls like a rolodex. */
.msg .reply-chain{display:flex;flex-direction:column;gap:1px;margin-bottom:3px}
/* the chain occupies its own full-width line so the avatar stays level
   with the sender's NAME and TEXT, not with the top of the quote stack */
.msg.has-chain{flex-wrap:wrap}
.msg.has-chain > .reply-chain{flex:0 0 100%;width:100%}
/* links keep their natural height, so a long chain SCROLLS instead of
   flex-shrinking every quote into an unreadable sliver */
.msg .reply-chain > .reply-quote{flex:0 0 auto}
.msg .reply-chain.rq-roll{max-height:62px;overflow-y:auto;overflow-x:hidden;
  scrollbar-width:none;-ms-overflow-style:none;
  /* The JS wheel handler owns the boundary (it only claims the wheel while the
     chain still has room), so DON'T also 'contain' — containment made the edge
     feel stuck instead of handing off to the chat. Momentum on touch. */
  -webkit-overflow-scrolling:touch;
  padding-right:2px;cursor:ns-resize;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 10px);
  mask-image:linear-gradient(to bottom,transparent 0,#000 10px)}
/* a hair of breathing room makes the small stack much easier to hit */
.msg .reply-chain.rq-roll > .reply-quote{padding-top:1px;padding-bottom:1px}
.msg .reply-chain.rq-roll::-webkit-scrollbar{display:none;width:0;height:0}
.msg .reply-quote.rq-up{font-size:10.5px;padding-left:8px;line-height:1.35;
  border-left:2px solid rgba(255,255,255,.13)}
.msg .reply-quote.rq-up .rq-ic{opacity:.55;font-size:9.5px}
.msg .reply-quote.rq-up .rq-nm{font-weight:600}
.msg .reply-quote.rq-up:hover{opacity:.9!important}
.msg .reply-quote.rq-up img.emoji{width:11px;height:11px}
.msg .reply-quote.rq-up img.cust-emoji{height:11px;max-width:15px}

/* A direct image/GIF link renders as the picture itself, not a title-less card */
.msg .linkcard.lc-imgonly{display:block;background:none;border:0;padding:0;max-width:100%}
.msg .linkcard.lc-imgonly img.gif{max-width:100%;border-radius:10px;cursor:zoom-in;display:block}

/* /spoiler — the TEXT is blurred behind its own layer; the "spoiler" label
   sits on a SEPARATE overlay so the parent's blur can't smear it away (a
   pseudo-element child would get blurred with the text — that hid the word). */
.msg .tx.spoiler-wrap{position:relative;display:inline-block;
  min-width:min(210px,100%);max-width:100%;box-sizing:border-box;
  border-radius:5px;overflow:hidden;cursor:pointer;user-select:none;vertical-align:bottom;
  background:#22272e}
/* the blurred text fills the whole bar (min-width) so there's always a visible
   frosted smear, even for a short message */
.msg .tx.spoiler-wrap .spoiler-blur{filter:blur(5px);opacity:.85;pointer-events:none;
  display:block;min-width:100%;box-sizing:border-box;padding:0 8px;white-space:nowrap;
  overflow:hidden;text-overflow:clip}
/* label rides the RIGHT side over a soft fade — leaves the blurred text visible
   on the left instead of a scrim hiding the whole thing */
.msg .tx.spoiler-wrap .spoiler-label{position:absolute;inset:0;display:flex;
  align-items:center;justify-content:flex-end;gap:6px;padding-right:9px;
  background:linear-gradient(90deg,transparent 0%,rgba(22,26,32,.15) 35%,rgba(22,26,32,.82) 72%);
  color:#e8eaed;font-size:.85em;font-weight:700;letter-spacing:.02em;white-space:nowrap;
  text-shadow:0 1px 3px rgba(0,0,0,.7)}
.msg .tx.spoiler-wrap .spoiler-label::before{content:"";width:16px;height:16px;flex:0 0 auto;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23e8eaed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center/contain no-repeat}
.msg .tx.spoiler-wrap:hover .spoiler-label{background:linear-gradient(90deg,transparent 0%,rgba(30,36,44,.2) 35%,rgba(30,36,44,.85) 72%)}
.msg .tx.spoiler-shown{animation:spoilerReveal .25s ease both}
@keyframes spoilerReveal{from{filter:blur(4px);opacity:.4}to{filter:blur(0);opacity:1}}

/* a long-pressed reaction chip (mobile react-all) pulses to confirm the hold */
.rchip.rx-held{animation:emojiFinale .9s ease 1 both}

/* ---- Single-row scrollable reactions (opt-in: .chat.rx-1row) ---- */
.chat.rx-1row .reactions{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;
  scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none;
  scroll-padding:0 22px;position:relative}
.chat.rx-1row .reactions::-webkit-scrollbar{display:none;width:0;height:0}
.chat.rx-1row .reactions .rchip{flex:0 0 auto}
/* sticky ‹ › bookends — pinned at the row edges while chips scroll between them */
.reactions .rx-arrow{display:none;flex:0 0 auto;position:sticky;z-index:3;
  width:18px;height:22px;align-items:center;justify-content:center;
  background:rgba(18,23,30,.92);color:#cdd6df;border:0;border-radius:6px;
  cursor:pointer;font-size:15px;line-height:1;padding:0;
  box-shadow:0 0 8px 4px rgba(18,23,30,.92)}
.reactions .rx-arrow.show{display:inline-flex}
.reactions .rx-arrow-left{left:0}
.reactions .rx-arrow-right{right:0}
.reactions .rx-arrow:hover{background:rgba(59,130,246,.6);color:#fff}
/* arrows only ever show in single-row mode */
.chat:not(.rx-1row) .reactions .rx-arrow{display:none!important}

/* ---------- voice messages ---------- */
.cbtn.mic{font-size:16px}
body.vrec-on .cbtn.mic,.fs-emoji.vrec-on{color:#ff5b5b}
/* the inline voice-note player in a chat message */
.voicenote{display:inline-flex;align-items:center;gap:8px;background:rgba(59,130,246,.14);
  border:1px solid #2a3340;border-radius:999px;padding:4px 10px 4px 4px;max-width:240px}
.voicenote .vn-play{flex:0 0 auto;width:28px;height:28px;border-radius:50%;border:0;cursor:pointer;
  background:#3b82f6;color:#fff;font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center}
.voicenote .vn-play:disabled{background:#3a4250;cursor:default}
.voicenote .vn-bar{flex:1 1 auto;height:5px;min-width:80px;border-radius:3px;background:rgba(255,255,255,.18);
  position:relative;cursor:pointer}
.voicenote .vn-fill{position:absolute;left:0;top:0;bottom:0;width:0;border-radius:3px;background:#7db1ff}
.voicenote .vn-time{flex:0 0 auto;font-size:11px;color:#c9d2dc;font-variant-numeric:tabular-nums}
.voicenote.vn-gone{opacity:.6;background:rgba(255,255,255,.06)}
/* the recording strip that floats above whichever input bar started it */
.vrec-bar{position:fixed;z-index:10002;display:none;align-items:center;gap:9px;box-sizing:border-box;
  background:#12171d;border:1px solid #3a4250;border-radius:12px;padding:8px 10px;
  box-shadow:0 10px 30px rgba(0,0,0,.5)}
.vrec-bar.show{display:flex}
.vrec-dot{width:11px;height:11px;border-radius:50%;background:#ff4b4b;flex:0 0 auto;animation:vrecpulse 1s ease-in-out infinite}
@keyframes vrecpulse{0%,100%{opacity:1}50%{opacity:.25}}
.vrec-time{font-size:13px;font-weight:700;color:#fff;font-variant-numeric:tabular-nums}
.vrec-hint{font-size:11px;color:#9aa0a6;flex:1 1 auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vrec-bar button{border:0;border-radius:8px;padding:6px 11px;font-size:12.5px;font-weight:700;cursor:pointer}
.vrec-cancel{background:transparent;color:#ff8b8b}
.vrec-send{background:#3b82f6;color:#fff}
