/* Shared chat look (lib/chat-ui.js): the territory rooms and the Void. */
:root { --cu-bg: #05070c; --cu-panel: rgba(9,13,22,.86); --cu-line: rgba(190,210,255,.12); --cu-ink: #e8eef7; --cu-muted: #8e97a9; --cu-ice: #a8e6ff; --cu-hue: #a8e6ff; }

/* the app: rail · chat · info, filling the window under the site header */
.cu-app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 14px; height: calc(100vh - 150px); min-height: 560px; margin: 8px 0 24px; }
.cu-app.no-info { grid-template-columns: 300px minmax(0, 1fr); }
.cu-pane { min-height: 0; border: 1px solid var(--cu-line); border-radius: 16px; background: var(--cu-panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; flex-direction: column; overflow: hidden; }

/* rail */
.cu-rail-h { padding: 12px 12px 8px; border-bottom: 1px solid var(--cu-line); display: flex; flex-direction: column; gap: 8px; }
.cu-find { width: 100%; box-sizing: border-box; background: #0b1222; color: var(--cu-ink); border: 1px solid rgba(190,210,255,.18); border-radius: 10px; padding: 9px 11px; font: 13.5px var(--df-sans, system-ui); }
.cu-find:focus { outline: none; border-color: var(--cu-ice); }
.cu-sorts { display: flex; gap: 4px; }
.cu-sort { flex: 1; background: none; border: 1px solid transparent; color: var(--cu-muted); border-radius: 8px; padding: 5px 6px; font: 600 11.5px var(--df-sans, system-ui); cursor: pointer; }
.cu-sort[aria-pressed="true"] { color: var(--cu-ink); border-color: rgba(168,230,255,.35); background: rgba(168,230,255,.07); }
.cu-list { flex: 1; overflow-y: auto; padding: 6px; }
.cu-sec { font: 600 10.5px var(--df-mono, monospace); letter-spacing: .16em; text-transform: uppercase; color: var(--cu-muted); padding: 10px 8px 4px; }
.cu-ri { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 1px solid transparent; border-radius: 12px; padding: 7px 8px; color: var(--cu-ink); cursor: pointer; font: 13.5px var(--df-sans, system-ui); }
.cu-ri:hover { background: rgba(168,230,255,.05); }
.cu-ri.on { background: linear-gradient(90deg, rgba(168,230,255,.13), rgba(168,230,255,.03)); border-color: rgba(168,230,255,.3); }
.cu-ri img, .cu-ri .cu-lobby-i { width: 40px; height: 40px; border-radius: 12px; background: #0b1222; object-fit: cover; }
.cu-lobby-i { display: grid; place-items: center; font-size: 19px; background: radial-gradient(circle at 30% 30%, #2a3b66, #0b1222) !important; box-shadow: 0 0 14px rgba(168,230,255,.25); }
.cu-ri b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-ri small { display: block; color: var(--cu-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-ri .cu-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font: 11px var(--df-mono, monospace); color: var(--cu-muted); }
.cu-ri .cu-n { background: rgba(168,230,255,.12); color: var(--cu-ice); border-radius: 999px; padding: 1px 7px; }
.cu-dot { width: 8px; height: 8px; border-radius: 50%; background: #64e3a8; box-shadow: 0 0 8px #64e3a8; display: inline-block; }

/* chat */
.cu-chat { position: relative; }
.cu-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--cu-line); background: linear-gradient(90deg, color-mix(in srgb, var(--cu-hue) 14%, transparent), transparent 70%); }
.cu-top-art { width: 44px; height: 44px; border-radius: 13px; flex: none; background: #0b1222; box-shadow: 0 0 18px color-mix(in srgb, var(--cu-hue) 45%, transparent); }
.cu-top h2 { margin: 0; font: 650 17px/1.2 var(--df-sans, system-ui); color: var(--cu-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-top p { margin: 2px 0 0; font: 12px var(--df-mono, monospace); color: var(--cu-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-top-t { min-width: 0; flex: 1; }
.cu-live { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--df-mono, monospace); letter-spacing: .14em; color: #8fe6c4; border: 1px solid rgba(100,227,168,.35); border-radius: 999px; padding: 3px 9px; }
.cu-live i { width: 7px; height: 7px; border-radius: 50%; background: #64e3a8; animation: cu-pulse 1.8s ease-in-out infinite; }
@keyframes cu-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(100,227,168,.6); } 50% { box-shadow: 0 0 0 6px rgba(100,227,168,0); } }
.cu-tb { display: flex; gap: 6px; }
.cu-ib { background: rgba(4,7,14,.6); border: 1px solid var(--cu-line); color: #d6e9f5; border-radius: 9px; padding: 7px 10px; font: 500 12.5px var(--df-sans, system-ui); cursor: pointer; white-space: nowrap; }
.cu-ib:hover, .cu-ib[aria-pressed="true"] { border-color: var(--cu-ice); color: #fff; }
.cu-search { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--cu-line); background: rgba(0,0,0,.2); }
.cu-search[hidden] { display: none; }
.cu-search input { flex: 1 1 140px; min-width: 0; background: #0b1222; color: var(--cu-ink); border: 1px solid rgba(190,210,255,.18); border-radius: 8px; padding: 7px 9px; font: 13px var(--df-sans, system-ui); }
.cu-search input[type="date"] { flex: 0 1 140px; color-scheme: dark; }
.cu-status { padding: 6px 16px; font-size: 12.5px; color: var(--cu-muted); border-bottom: 1px solid var(--cu-line); }
.cu-status[hidden] { display: none; }
.cu-status a { color: var(--cu-ice); text-decoration: none; border-bottom: 1px solid rgba(168,230,255,.35); }
.cu-status a:hover { border-bottom-color: var(--cu-ice); }
.cu-status b { color: var(--cu-ink); }
.cu-pager { display: flex; justify-content: center; gap: 8px; padding: 8px 0 2px; }
.cu-pager[hidden] { display: none; }
.cu-pager button { background: none; border: 1px solid var(--cu-line); color: var(--cu-muted); border-radius: 999px; padding: 4px 12px; font: 12px var(--df-sans, system-ui); cursor: pointer; }
.cu-pager button:hover { color: var(--cu-ink); border-color: var(--cu-ice); }
.cu-stream { flex: 1; overflow-y: auto; padding: 8px 6px 14px; scroll-behavior: auto; }
/* the Void: the stream sits in a scroll area whose top row holds the history controls */
.cu-scroll { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto auto 1fr; grid-template-rows: auto minmax(0, 1fr); column-gap: 8px; }
.cu-scroll > .cu-stream { grid-column: 1 / -1; grid-row: 2; min-height: 0; }
.cu-scroll > #olderBtn { grid-column: 2; grid-row: 1; }
.cu-scroll > #oldestBtn { grid-column: 3; grid-row: 1; }
.cu-hist { margin: 8px 0 2px; background: rgba(6,9,16,.6); border: 1px solid var(--cu-line); color: var(--cu-muted); border-radius: 999px; padding: 5px 13px; font: 500 12px var(--df-sans, system-ui); cursor: pointer; white-space: nowrap; }
.cu-hist:hover:not(:disabled) { color: var(--cu-ink); border-color: var(--cu-ice); }
.cu-hist:disabled { cursor: default; opacity: .7; }
.cu-hist[hidden] { display: none; }
.cu-notice { margin: 8px 10px 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255,210,122,.35); background: rgba(40,30,8,.45); color: #ffe2a8; font-size: 13px; line-height: 1.55; text-align: center; }
.cu-msg.near { border-color: rgba(255,176,112,.6); }
.cu-day { display: flex; align-items: center; gap: 10px; margin: 16px 10px 8px; color: var(--cu-muted); font: 600 11px var(--df-mono, monospace); letter-spacing: .08em; }
.cu-day::before, .cu-day::after { content: ''; flex: 1; height: 1px; background: var(--cu-line); }
.cu-day span { border: 1px solid var(--cu-line); border-radius: 999px; padding: 2px 10px; background: rgba(4,7,14,.7); }
.cu-grp { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 6px 10px; border-radius: 12px; }
.cu-grp:hover { background: rgba(168,230,255,.03); }
.cu-av img { width: 42px; height: 42px; border-radius: 14px; background: #0b1222; display: block; box-shadow: 0 0 0 1px rgba(190,210,255,.1); }
.cu-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.cu-name { font: 650 14.5px var(--df-sans, system-ui); text-decoration: none; }
.cu-name:hover { text-decoration: underline; }
.cu-when { font-size: 11.5px; color: #6f7a8e; }
.cu-og { font: 600 10px var(--df-mono, monospace); color: #8fe6c4; border: 1px solid rgba(100,227,168,.35); border-radius: 5px; padding: 0 5px; }
.cu-imp { font: 600 10px var(--df-mono, monospace); color: #ffb4a0; border: 1px solid rgba(255,140,120,.4); border-radius: 5px; padding: 0 5px; }
.cu-room { display: inline-flex; align-items: center; gap: 5px; background: rgba(168,230,255,.07); border: 1px solid rgba(168,230,255,.22); color: var(--cu-ice); border-radius: 999px; padding: 1px 8px 1px 2px; font: 600 11.5px var(--df-sans, system-ui); cursor: pointer; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-room img { width: 18px; height: 18px; border-radius: 50%; background: #0b1222; }
.cu-room:hover { border-color: var(--cu-ice); }
.cu-lines { display: flex; flex-direction: column; }
.cu-line { position: relative; padding: 2px 0; }
.cu-line.pending { opacity: .55; }
.cu-txt { font-size: 14.5px; line-height: 1.5; color: var(--cu-ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.cu-txt a { color: var(--cu-ice); }
.cu-txt mark { background: rgba(255,210,122,.3); color: #fff; border-radius: 3px; }
.cu-x { display: inline-block; margin-left: 6px; font: 600 11px var(--df-mono, monospace); color: #f7a8e0; background: rgba(247,168,224,.1); border: 1px solid rgba(247,168,224,.3); border-radius: 999px; padding: 0 7px; vertical-align: 2px; }
.cu-txt { display: inline; }
.cu-x[hidden] { display: none; }
.cu-people a { color: var(--cu-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cu-people a:hover { color: var(--cu-ice); }
.cu-quote { font-size: 12.5px; color: var(--cu-muted); border-left: 2px solid rgba(168,230,255,.35); padding-left: 8px; margin: 2px 0 3px; }
.cu-acts { position: absolute; right: 0; top: -12px; display: none; gap: 2px; background: #0b1222; border: 1px solid var(--cu-line); border-radius: 8px; padding: 2px; z-index: 2; }
.cu-line:hover .cu-acts, .cu-line:focus-within .cu-acts { display: flex; }
.cu-acts a, .cu-acts button, .cu-acts span { background: none; border: 0; color: var(--cu-muted); font: 11.5px var(--df-sans, system-ui); padding: 3px 7px; cursor: pointer; text-decoration: none; border-radius: 6px; }
.cu-acts a:hover, .cu-acts button:hover { color: var(--cu-ink); background: rgba(168,230,255,.08); }
.cu-media { display: inline-block; margin: 4px 0; }
.cu-img { max-width: 220px; max-height: 220px; border-radius: 10px; border: 1px solid var(--cu-line); image-rendering: pixelated; min-width: 96px; background: #0b1222; transition: max-width .2s, max-height .2s; }
.cu-media.big .cu-img { max-width: min(520px, 100%); max-height: 520px; }
.cu-aud { display: block; height: 36px; margin: 4px 0 2px; max-width: 100%; }
.cu-aud-l, .cu-raw { font-size: 11.5px; color: var(--cu-muted); }
.cu-empty { margin: 40px auto; max-width: 420px; text-align: center; color: var(--cu-muted); line-height: 1.6; }
.cu-jump { position: absolute; right: 18px; bottom: 92px; z-index: 3; background: var(--cu-ice); color: #04121a; border: 0; border-radius: 999px; padding: 7px 14px; font: 650 12.5px var(--df-sans, system-ui); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.cu-jump[hidden] { display: none; }

/* composer */
.cu-comp { border-top: 1px solid var(--cu-line); padding: 10px 12px 12px; background: rgba(0,0,0,.25); }
.cu-reply { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--cu-muted); margin: 0 0 6px; }
.cu-reply[hidden] { display: none; }
.cu-reply button { background: none; border: 0; color: var(--cu-muted); cursor: pointer; }
.cu-to { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12.5px; color: var(--cu-muted); }
.cu-to[hidden] { display: none; }
.cu-to input { flex: 1; min-width: 0; background: #0b1222; color: var(--cu-ink); border: 1px solid rgba(190,210,255,.18); border-radius: 8px; padding: 5px 8px; font: 12.5px var(--df-sans, system-ui); }
.cu-row { display: flex; gap: 8px; align-items: flex-end; }
.cu-msg { flex: 1; min-width: 0; resize: none; max-height: 140px; background: #0b1222; color: var(--cu-ink); border: 1px solid rgba(190,210,255,.2); border-radius: 12px; padding: 10px 12px; font: 14.5px/1.4 var(--df-sans, system-ui); }
.cu-msg:focus { outline: none; border-color: var(--cu-ice); box-shadow: 0 0 0 3px rgba(168,230,255,.12); }
.cu-send { background: var(--cu-ice); color: #04121a; border: 0; border-radius: 12px; padding: 10px 16px; font: 650 14px var(--df-sans, system-ui); cursor: pointer; }
.cu-send:disabled { opacity: .5; cursor: default; }
.cu-note { min-height: 1em; margin: 6px 2px 0; font-size: 12px; color: var(--cu-muted); }
.cu-note .bad { color: #ffb4a0; } .cu-note .ok { color: #8fe6c4; }

/* info panel */
.cu-info { overflow-y: auto; padding: 16px; gap: 14px; }
.cu-info-art { width: 100%; aspect-ratio: 1; border-radius: 16px; background: #0b1222; box-shadow: 0 0 40px color-mix(in srgb, var(--cu-hue) 30%, transparent); }
.cu-info h3 { margin: 0; font: 650 18px var(--df-sans, system-ui); color: var(--cu-ink); overflow-wrap: anywhere; }
.cu-info .cu-sub { margin: 2px 0 0; font: 12px var(--df-mono, monospace); color: var(--cu-muted); }
.cu-tier { display: inline-block; font: 600 10.5px var(--df-mono, monospace); letter-spacing: .14em; text-transform: uppercase; border: 1px solid currentColor; border-radius: 6px; padding: 1px 7px; color: #aeb7c8; }
.cu-tier.t-rare { color: #a8e6ff; } .cu-tier.t-epic { color: #c8a8ff; } .cu-tier.t-legendary { color: #ffd27a; } .cu-tier.t-mythic { color: #f7a8e0; }
.cu-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cu-stat { border: 1px solid var(--cu-line); border-radius: 10px; padding: 8px 10px; }
.cu-stat b { display: block; font: 650 16px var(--df-sans, system-ui); color: var(--cu-ink); overflow-wrap: anywhere; }
.cu-stat span { font: 10.5px var(--df-mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--cu-muted); }
.cu-h4 { margin: 4px 0 0; font: 600 10.5px var(--df-mono, monospace); letter-spacing: .16em; text-transform: uppercase; color: var(--cu-ice); }
.cu-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cu-people li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cu-ink); }
.cu-people img { width: 26px; height: 26px; border-radius: 8px; background: #0b1222; }
.cu-people span { margin-left: auto; font: 11.5px var(--df-mono, monospace); color: var(--cu-muted); }
.cu-links { display: flex; flex-direction: column; gap: 6px; }
.cu-links a { display: block; border: 1px solid var(--cu-line); border-radius: 10px; padding: 8px 10px; color: var(--cu-ink); text-decoration: none; font-size: 13px; }
.cu-links a:hover { border-color: var(--cu-ice); }
.cu-links small { display: block; color: var(--cu-muted); font-size: 11.5px; }

/* phone and tablet: the rail and info become sheets */
.cu-mob { display: none; }
@media (max-width: 1200px) { .cu-app { grid-template-columns: 280px minmax(0, 1fr); } .cu-app > .cu-info { display: none; } .cu-app.show-info > .cu-info { display: flex; position: fixed; z-index: 60; top: 70px; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); box-shadow: -10px 0 40px rgba(0,0,0,.6); } }
@media (max-width: 820px) {
  .cu-app { grid-template-columns: minmax(0, 1fr); height: calc(100svh - 250px); min-height: 440px; gap: 0; margin-bottom: 84px; }   /* clears the phone navigation bar */
  .cu-live { padding: 3px 6px; font-size: 0; gap: 0; }
  .cu-top-art { width: 36px; height: 36px; border-radius: 11px; }
  .cu-top h2 { font-size: 15px; }
  .cu-jump { bottom: 110px; }
  .cu-app > .cu-rail { display: none; }
  .cu-app.show-rail > .cu-rail { display: flex; position: fixed; z-index: 60; top: 64px; left: 8px; bottom: 8px; width: min(340px, calc(100% - 16px)); box-shadow: 10px 0 40px rgba(0,0,0,.6); }
  .cu-mob { display: inline-flex; }
  .cu-top { padding: 10px 12px; }
  .cu-grp { grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 5px 6px; }
  .cu-av img { width: 34px; height: 34px; border-radius: 11px; }
  .cu-txt { font-size: 14px; }
  .cu-acts { position: static; display: none; background: none; border: 0; padding: 0; }
  .cu-line:hover .cu-acts { display: none; }
  .cu-line.sel .cu-acts { display: flex; }
  .cu-acts button, .cu-acts a, .cu-acts span { padding: 2px 6px 2px 0; font-size: 11px; }
  .cu-tb .cu-ib-t { display: none; }
}
