/* ============================================================
   TAVERNA — identidade visual "Arcano"
   Fundo tinta-violeta, painéis flutuantes, gradiente violeta→menta
   ============================================================ */
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0a0910;
  --panel: #12101b;
  --elev: #191624;
  --elev-2: #211d30;
  --hover: #262238;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .1);
  --text: #ece9f7;
  --muted: #9a94b3;
  --faint: #6c6786;
  --violet: #8f7bff;
  --blue: #5aa8ff;
  --mint: #43e5c0;
  --grad: linear-gradient(135deg, #8f7bff 0%, #5aa8ff 55%, #43e5c0 100%);
  --grad-soft: linear-gradient(135deg, rgba(143, 123, 255, .18), rgba(67, 229, 192, .12));
  --mine: linear-gradient(135deg, #6c58f0 0%, #4a78ee 100%);
  --danger: #ff5577;
  --warn: #ffb547;
  --ok: #43e5c0;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --rail-w: 272px;
  --presence-w: 248px;
  --gap: 10px;
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(143, 123, 255, .10), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(67, 229, 192, .07), transparent 60%);
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2540; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(143, 123, 255, .4); }

/* ---------- botões ---------- */
.btn { border: 0; border-radius: 12px; padding: 10px 18px; background: var(--elev-2); color: var(--text); font-weight: 700; transition: transform .08s, filter .15s, background .15s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #0b0a14; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(255, 85, 119, .14); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--elev); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.round-btn { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; flex: none; transition: background .15s, color .15s; }
.round-btn:hover { background: var(--hover); color: var(--text); }
.round-btn.danger { background: rgba(255, 85, 119, .14); color: var(--danger); }
.round-btn.danger:hover { background: var(--danger); color: #fff; }
.round-btn .off, .dock-btn .off { display: none; }
.round-btn.toggled .on, .dock-btn.toggled .on { display: none; }
.round-btn.toggled .off, .dock-btn.toggled .off { display: block; }
.round-btn.toggled { color: var(--danger); background: rgba(255, 85, 119, .12); }
.mini-btn { border: 0; background: transparent; color: var(--faint); width: 22px; height: 22px; border-radius: 7px; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.mini-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- entrada ---------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 5; overflow: hidden; }
.auth-glow { position: absolute; width: 900px; height: 900px; border-radius: 50%; background: conic-gradient(from 90deg, rgba(143, 123, 255, .25), rgba(90, 168, 255, .12), rgba(67, 229, 192, .22), rgba(143, 123, 255, .25)); filter: blur(120px); animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-card { position: relative; width: 100%; max-width: 420px; background: rgba(18, 16, 27, .82); backdrop-filter: blur(24px); border: 1px solid var(--line-2); border-radius: 26px; padding: 36px 32px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); text-align: center; }
.auth-logo { width: 64px; height: 64px; }
.auth-card h1 { margin: 14px 0 4px; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.auth-card form { text-align: left; margin-top: 22px; display: grid; gap: 14px; }
.auth-card .switch { margin: 16px 0 0; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.auth-card input, .modal input[type=text], .modal input[type=password], .modal input:not([type]), .modal select {
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; outline: none; font-weight: 500; font-size: 15px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.auth-card input:focus, .modal input:focus, .modal select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(143, 123, 255, .2); }
.auth:not(.register) .reg-only { display: none; }

/* ---------- layout em painéis flutuantes ---------- */
.app { position: relative; z-index: 1; display: flex; gap: var(--gap); padding: var(--gap); height: 100vh; height: 100dvh; }
.rail, .main, .presence { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.rail { width: var(--rail-w); display: flex; flex-direction: column; flex: none; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.presence { width: var(--presence-w); flex: none; overflow-y: auto; padding: 14px 10px; }

/* marca */
.brand { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.brand:hover .brand-more { color: var(--text); }
.brand-logo { width: 38px; height: 38px; }
.brand-text { flex: 1; min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.brand-sub::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.brand-more { color: var(--faint); }

.rail-scroll { flex: 1; overflow-y: auto; padding: 6px 10px 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 6px 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }

/* salas de voz (cards) */
.rooms { display: grid; gap: 8px; }
.room { background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 10px 8px; cursor: pointer; transition: background .15s, border-color .15s; }
.room:hover { background: var(--elev-2); }
.room.active { border-color: rgba(143, 123, 255, .5); background: linear-gradient(var(--elev), var(--elev)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.room.live { box-shadow: inset 0 0 0 1px rgba(67, 229, 192, .12); }
.room-head { display: flex; align-items: center; gap: 9px; }
.room-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--violet); }
.room-ico svg { width: 17px; height: 17px; }
.room.live .room-ico { color: var(--mint); }
.room-name { flex: 1; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-count { font-size: 11px; font-weight: 800; color: var(--muted); background: var(--bg); border-radius: 20px; padding: 2px 8px; }
.room.live .room-count { color: var(--mint); }
.room-people { margin-top: 8px; display: grid; gap: 2px; }
.person { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 9px; font-size: 13px; color: var(--text); }
.person:hover { background: rgba(255, 255, 255, .03); }
.person .avatar { width: 24px; height: 24px; font-size: 11px; }
.person .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .flags { display: flex; gap: 4px; align-items: center; color: var(--faint); }
.person .flags svg { width: 14px; height: 14px; }
.person .flags .red { color: var(--danger); }
.tag-live { background: var(--danger); color: #fff; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 6px; letter-spacing: .04em; }

/* chats */
.chats { display: grid; gap: 2px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; position: relative; }
.chat-item:hover { background: var(--elev); color: var(--text); }
.chat-item.active { background: var(--elev-2); color: var(--text); }
.chat-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.chat-item svg { width: 17px; height: 17px; opacity: .7; }
.chat-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .badge { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); display: none; }
.chat-item.unread { color: var(--text); }
.chat-item.unread .badge { display: block; }

/* cartão da chamada */
.call-card { margin: 0 10px 8px; padding: 10px 10px 9px 12px; border-radius: var(--r-md); background: var(--grad-soft); border: 1px solid rgba(67, 229, 192, .2); }
.call-top { display: flex; align-items: center; gap: 10px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(67, 229, 192, .6); animation: pulse 2s infinite; flex: none; }
.call-card.bad .live-dot { background: var(--warn); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(67, 229, 192, .55); } 70% { box-shadow: 0 0 0 8px rgba(67, 229, 192, 0); } 100% { box-shadow: 0 0 0 0 rgba(67, 229, 192, 0); } }
.call-info { flex: 1; min-width: 0; }
.call-status { font-weight: 800; font-size: 13px; color: var(--mint); }
.call-card.bad .call-status { color: var(--warn); }
.call-room { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-meta { margin-top: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.signal { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.signal i { width: 4px; border-radius: 2px; background: rgba(255, 255, 255, .15); }
.signal i:nth-child(1) { height: 5px; } .signal i:nth-child(2) { height: 9px; } .signal i:nth-child(3) { height: 14px; }
.signal.q3 i { background: var(--ok); }
.signal.q2 i:nth-child(-n+2) { background: var(--warn); }
.signal.q1 i:nth-child(1) { background: var(--danger); }

/* cartão do usuário */
.me-card { display: flex; align-items: center; gap: 6px; padding: 10px; margin: 0 10px 10px; border-radius: var(--r-md); background: var(--elev); }
.me-avatar { position: relative; }
.me-avatar .avatar { width: 36px; height: 36px; }
.me-names { flex: 1; min-width: 0; padding-left: 4px; }
.me-name { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .round-btn { width: 34px; height: 34px; border-radius: 10px; }

/* avatar */
.avatar { width: 32px; height: 32px; border-radius: 30%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; background-size: cover; background-position: center; font-size: 14px; position: relative; transition: box-shadow .12s; }
.speaking .avatar, .avatar.speaking { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--mint); }
.dot-on { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 3px solid var(--panel); }

/* ---------- topo ---------- */
.topbar { height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.topbar-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--violet); }
.topbar-icon svg { width: 19px; height: 19px; }
.topbar-title { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.topbar-sub { font-size: 12px; color: var(--muted); }
.topbar-text { min-width: 0; }

/* ---------- chat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.messages { flex: 1; overflow-y: auto; padding: 18px 22px 8px; }
.load-more { text-align: center; padding: 8px; }
.chat-hello { text-align: center; padding: 30px 10px 24px; color: var(--muted); }
.chat-hello .hello-ico { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 18px; background: var(--grad-soft); display: grid; place-items: center; color: var(--violet); }
.chat-hello .hello-ico svg { width: 28px; height: 28px; }
.chat-hello h2 { color: var(--text); margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 8px; color: var(--faint); font-size: 12px; font-weight: 700; }
.day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.msg { display: flex; gap: 10px; align-items: flex-end; margin-top: 3px; position: relative; }
.msg.head { margin-top: 14px; }
.msg .av-slot { width: 34px; flex: none; }
.msg .avatar { width: 34px; height: 34px; }
.msg .col { display: flex; flex-direction: column; align-items: flex-start; max-width: min(680px, 78%); min-width: 0; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; margin: 0 4px 4px; font-size: 12px; }
.msg .author { font-weight: 800; font-size: 13px; }
.msg .time { color: var(--faint); font-size: 11px; }
.bubble { background: var(--elev-2); border: 1px solid var(--line); padding: 8px 13px; border-radius: 6px 16px 16px 6px; min-width: 0; max-width: 100%; }
.msg.head .bubble { border-top-left-radius: 16px; }
.msg.last .bubble { border-bottom-left-radius: 16px; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .col { align-items: flex-end; }
.msg.mine .bubble { background: var(--mine); border-color: transparent; color: #fff; border-radius: 16px 6px 6px 16px; }
.msg.mine.head .bubble { border-top-right-radius: 16px; }
.msg.mine.last .bubble { border-bottom-right-radius: 16px; }
.msg.mine .meta { flex-direction: row-reverse; }
.msg.mention .bubble { box-shadow: 0 0 0 2px var(--mint); }
.bubble .text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble .edited { font-size: 11px; opacity: .6; }
.bubble.media-only { background: transparent; border: 0; padding: 0; }
.msg .actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; align-self: center; }
.msg:hover .actions { opacity: 1; }
.msg .actions button { border: 0; background: var(--elev); color: var(--muted); width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.msg .actions button:hover { color: var(--text); background: var(--hover); }
.msg .actions svg { width: 15px; height: 15px; }
.text code { background: rgba(0, 0, 0, .3); padding: 1px 5px; border-radius: 6px; font-family: 'Cascadia Code', Consolas, monospace; font-size: 13.5px; }
.text pre { background: rgba(0, 0, 0, .35); padding: 10px; border-radius: 10px; overflow-x: auto; margin: 4px 0; white-space: pre-wrap; }
.text pre code { background: none; padding: 0; }
.text blockquote { margin: 2px 0; padding-left: 10px; border-left: 3px solid rgba(255, 255, 255, .25); }
.text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg:not(.mine) .text a { color: var(--blue); }
.mention-tag { background: rgba(67, 229, 192, .18); color: var(--mint); padding: 0 4px; border-radius: 6px; font-weight: 700; }
.msg.mine .mention-tag { background: rgba(255, 255, 255, .2); color: #fff; }
.spoiler { background: #000; color: transparent; border-radius: 5px; cursor: pointer; padding: 0 3px; transition: background .2s; }
.spoiler.shown { background: rgba(255, 255, 255, .1); color: inherit; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.bubble.media-only .attachments { margin-top: 0; }
.attachments img, .attachments video { max-width: min(420px, 100%); max-height: 320px; border-radius: 14px; display: block; cursor: zoom-in; border: 1px solid var(--line); }
.attachments audio { max-width: 100%; }
.file-card { display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 10px 12px; max-width: 360px; }
.file-card .fi { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-soft); display: grid; place-items: center; color: var(--violet); }
.file-card .fs { font-size: 12px; opacity: .7; }
.file-card a { color: inherit; font-weight: 700; word-break: break-all; }

.typing { height: 22px; padding: 0 24px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--violet); animation: blink 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.typing b { color: var(--text); }
.composer-wrap { padding: 0 16px 16px; }
.composer { display: flex; align-items: flex-end; gap: 6px; background: var(--elev); border: 1px solid var(--line-2); border-radius: 18px; padding: 6px; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: rgba(143, 123, 255, .5); box-shadow: 0 0 0 3px rgba(143, 123, 255, .12); }
.composer textarea { flex: 1; background: transparent; border: 0; outline: none; resize: none; padding: 8px 4px; max-height: 40vh; line-height: 1.45; font-size: 15px; }
.send-btn { border: 0; width: 38px; height: 38px; border-radius: 13px; background: var(--grad); color: #0b0a14; display: grid; place-items: center; flex: none; transition: filter .15s, transform .08s, opacity .15s; }
.send-btn:hover { filter: brightness(1.1); }
.send-btn:active { transform: scale(.94); }
.send-btn.idle { opacity: .35; }
.pending-files { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; }
.pending-files:empty { display: none; }
.pf { background: var(--elev); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; max-width: 240px; }
.pf img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.pf .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.pf button { border: 0; background: transparent; color: var(--danger); font-size: 16px; }
.drop-hint { position: absolute; inset: 10px; border-radius: var(--r-lg); background: rgba(143, 123, 255, .1); border: 2px dashed var(--violet); display: grid; place-items: center; font-size: 20px; font-weight: 800; z-index: 30; pointer-events: none; }

/* ---------- presença ---------- */
.presence .p-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); padding: 6px 8px 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; }
.member:hover { background: var(--elev); }
.member.offline { opacity: .38; }
.member .aw { position: relative; }
.member .nm { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .st { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.member .st svg { width: 12px; height: 12px; color: var(--mint); }
.member .role { font-size: 10px; font-weight: 800; color: var(--violet); background: rgba(143, 123, 255, .14); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

/* ---------- sala de voz ---------- */
.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; background: radial-gradient(800px 400px at 50% 0%, rgba(143, 123, 255, .08), transparent 70%), #0c0b13; }
.stage-grid { flex: 1; display: grid; gap: 10px; padding: 14px 14px 0; align-content: center; justify-content: center; overflow: auto; min-height: 0;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.stage-grid.has-focus { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; align-content: stretch; }
.tile { position: relative; background: var(--elev); border-radius: 18px; overflow: hidden; aspect-ratio: 16/9; display: grid; place-items: center; min-height: 0; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .12s; cursor: pointer; }
.tile.speaking { box-shadow: inset 0 0 0 3px var(--mint), 0 0 24px rgba(67, 229, 192, .25); }
.tile video { width: 100%; height: 100%; object-fit: contain; background: #000; position: absolute; inset: 0; }
.tile.cam video { object-fit: cover; }
.tile.mirror video { transform: scaleX(-1); }
.tile .tile-avatar { display: grid; place-items: center; gap: 10px; }
.tile .tile-avatar .avatar { width: 84px; height: 84px; font-size: 34px; border-radius: 28px; }
.tile.speaking .tile-avatar .avatar { box-shadow: 0 0 0 4px var(--elev), 0 0 0 7px var(--mint); }
.tile .label { position: absolute; left: 10px; bottom: 10px; background: rgba(10, 9, 16, .72); backdrop-filter: blur(10px); padding: 5px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; max-width: calc(100% - 20px); }
.tile .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .label svg { width: 15px; height: 15px; color: var(--danger); }
.tile .badges { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; align-items: center; }
.tile .res { background: rgba(10, 9, 16, .72); padding: 3px 7px; border-radius: 8px; font-size: 11px; font-weight: 800; color: var(--mint); }
.tile .sig { background: rgba(10, 9, 16, .72); padding: 5px 7px; border-radius: 8px; display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .tools { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.tile:hover .tools { opacity: 1; }
.tile .tools button { border: 0; background: rgba(10, 9, 16, .72); color: #fff; border-radius: 9px; height: 30px; padding: 0 9px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.tile .tools button:hover { background: rgba(10, 9, 16, .9); }
.tile .tools input { width: 80px; accent-color: var(--mint); }
.tile .tools svg { width: 15px; height: 15px; }
.focus-main { min-height: 0; display: grid; }
.focus-main .tile { aspect-ratio: auto; height: 100%; }
.focus-strip { display: flex; gap: 10px; overflow-x: auto; justify-content: center; padding-bottom: 2px; }
.focus-strip .tile { width: 190px; flex: none; }
.focus-strip .tile .tile-avatar .avatar { width: 44px; height: 44px; font-size: 18px; border-radius: 15px; }
.focus-strip .tile .tools, .focus-strip .tile .sig { display: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 4px; z-index: 2; }
.empty-orb { width: 86px; height: 86px; border-radius: 30px; background: var(--grad); display: grid; place-items: center; color: #0b0a14; margin-bottom: 10px; box-shadow: 0 20px 60px rgba(143, 123, 255, .35); }
.empty-orb svg { width: 38px; height: 38px; }
.stage-empty h2 { margin: 0; font-size: 22px; font-weight: 800; }
.stage-empty .btn { margin-top: 14px; padding: 12px 26px; }

.dock { position: relative; display: flex; justify-content: center; align-items: center; gap: 8px; margin: 12px auto 14px; padding: 8px; border-radius: 22px; background: rgba(25, 22, 36, .85); backdrop-filter: blur(16px); border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.dock-btn { border: 0; background: transparent; color: var(--text); min-width: 76px; padding: 8px 10px 6px; border-radius: 15px; display: grid; justify-items: center; gap: 3px; transition: background .15s; }
.dock-btn:hover { background: var(--hover); }
.dock-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--elev-2); transition: background .15s, color .15s; }
.dock-ico svg { width: 21px; height: 21px; }
.dock-label { font-size: 11px; font-weight: 700; color: var(--muted); }
.dock-btn.on .dock-ico { background: var(--grad); color: #0b0a14; }
.dock-btn.on .dock-label { color: var(--text); }
.dock-btn.toggled .dock-ico { background: rgba(255, 85, 119, .16); color: var(--danger); }
.dock-btn.leave .dock-ico { background: var(--danger); color: #fff; }
.ptt-chip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 20px; background: var(--elev-2); border: 1px solid var(--line-2); color: var(--muted); }
.ptt-chip.live { background: var(--mint); color: #0b0a14; border-color: transparent; }

/* ---------- modal / menus ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 4, 10, .7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 24px; width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.modal-head { padding: 20px 22px 10px; display: flex; align-items: center; }
.modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; }
.modal-body { padding: 10px 22px 18px; display: grid; gap: 16px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.tabs { display: flex; gap: 4px; padding: 0 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; color: var(--muted); font-weight: 700; border-radius: 10px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); background: var(--elev-2); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-preview { display: flex; align-items: center; gap: 14px; background: var(--grad-soft); border: 1px solid var(--line); padding: 16px; border-radius: 16px; }
.profile-preview .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 22px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 30px; height: 30px; border-radius: 10px; border: 2px solid transparent; }
.colors button.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--panel) inset; }
.meter { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--grad); transition: width .06s; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.seg button.sel { background: var(--elev-2); color: var(--text); }
.keycap { display: inline-block; min-width: 40px; text-align: center; background: var(--bg); border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: 9px; padding: 6px 10px; font-weight: 800; }
.keycap.listening { border-color: var(--mint); color: var(--mint); }
.hint { font-size: 12px; color: var(--muted); font-weight: 500; }
.invite-box { display: flex; gap: 8px; }
.invite-box input { flex: 1; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--elev); }
.member-row .nm { flex: 1; min-width: 0; font-weight: 700; }
.member-row .nm small { color: var(--muted); display: block; font-weight: 500; }
.ctx-menu { position: fixed; z-index: 60; background: var(--elev); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; min-width: 200px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.ctx-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 9px; font-size: 14px; font-weight: 600; }
.ctx-menu button:hover { background: var(--hover); }
.ctx-menu button.danger { color: var(--danger); }
.ctx-menu button.danger:hover { background: rgba(255, 85, 119, .14); }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--elev-2); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 14px; z-index: 70; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); max-width: 90vw; font-weight: 600; font-size: 14px; }
.lightbox { position: fixed; inset: 0; background: rgba(5, 4, 10, .92); z-index: 80; display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 10px; }
.edit-box { width: 100%; }
.edit-box textarea { width: 100%; min-width: 260px; background: rgba(0, 0, 0, .25); border: 0; border-radius: 10px; padding: 8px; resize: vertical; outline: none; color: inherit; }
.edit-box .hint { color: inherit; opacity: .7; margin-top: 4px; }

.mobile-only { display: none; }
@media (max-width: 1180px) { .presence { display: none; } .presence.force { display: block; } }
@media (max-width: 760px) {
  :root { --gap: 0px; }
  .app { padding: 0; }
  .main { border-radius: 0; border: 0; }
  .mobile-only { display: inline-grid; }
  .rail { position: fixed; left: 8px; top: 8px; bottom: 8px; z-index: 40; transform: translateX(-110%); transition: transform .22s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, .6); }
  .rail.open { transform: none; }
  .presence.force { position: fixed; right: 8px; top: 70px; bottom: 8px; z-index: 35; box-shadow: -10px 0 40px rgba(0, 0, 0, .6); }
  .stage-grid { --cols: 1 !important; }
  .msg .col { max-width: 86%; }
  .msg .actions { opacity: 1; }
  .dock-btn { min-width: 60px; }
}

/* ---------- nivelador de sensibilidade ---------- */
.section-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin-top: 4px; }
.sens { background: var(--elev); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.sens-top { display: flex; justify-content: space-between; align-items: baseline; }
.sens-db { font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.sens-bar { position: relative; height: 14px; border-radius: 8px; background: var(--bg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.sens-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #4a4566, #8a84a8); transition: width .06s linear; }
.sens-bar.open .sens-fill { background: var(--grad); }
.sens-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(10, 9, 16, .6); }
.sens-range { width: 100%; accent-color: var(--violet); margin: 0; }
.sens-foot { display: flex; align-items: center; }
.sens-state { font-size: 12px; font-weight: 700; color: var(--muted); }
.sens-state.on { color: var(--mint); }

/* ---------- mensagens privadas ---------- */
.dm-item { padding: 6px 10px; }
.dm-item .aw { position: relative; }
.dm-item .avatar { width: 26px; height: 26px; font-size: 12px; }
.dm-item .dot-on { width: 10px; height: 10px; border-width: 2px; right: -2px; bottom: -2px; border-color: var(--panel); }
.dm-empty { font-size: 12px; color: var(--faint); padding: 4px 10px 6px; line-height: 1.4; }
.member.clickable { cursor: pointer; }
.topbar-icon.private { background: rgba(67, 229, 192, .14); color: var(--mint); }
.composer.private { border-color: rgba(67, 229, 192, .35); }
.composer.private:focus-within { border-color: rgba(67, 229, 192, .6); box-shadow: 0 0 0 3px rgba(67, 229, 192, .12); }
.chat-hello.private .hello-av { display: grid; place-items: center; margin-bottom: 10px; }
.chat-hello.private .hello-av .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 22px; }
.chat-hello.private svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--mint); }
.pick-list { display: grid; gap: 6px; }
.pick { display: flex; align-items: center; gap: 12px; border: 0; background: var(--elev); padding: 10px 12px; border-radius: 14px; text-align: left; }
.pick:hover { background: var(--hover); }
.pick .aw { position: relative; }
.pick .dot-on { border-color: var(--elev); }
.pick-nm { flex: 1; font-weight: 700; }
.pick-nm small { display: block; font-weight: 500; color: var(--muted); }
.pick svg { color: var(--faint); width: 16px; height: 16px; }
.modal-head, .tabs, .modal-foot { flex: none; }
.tabs { padding-bottom: 6px; }

/* ---------- cargos e cartão de usuário ---------- */
.role-mod { color: var(--mint); background: rgba(67, 229, 192, .14); }
.round-btn.modlock { color: var(--danger); background: rgba(255, 85, 119, .12); }
.me-names { cursor: pointer; border-radius: 8px; }
.me-names:hover .me-name { text-decoration: underline; text-underline-offset: 3px; }
.user-card { position: fixed; z-index: 65; width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--elev); border: 1px solid var(--line-2); border-radius: 18px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55); }
.uc-head { display: flex; gap: 12px; align-items: center; }
.uc-head .aw { position: relative; }
.uc-head .avatar { width: 52px; height: 52px; font-size: 22px; border-radius: 18px; }
.uc-head .dot-on { border-color: var(--elev); }
.uc-names { min-width: 0; }
.uc-name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 4px; }
.uc-sub { font-size: 12px; color: var(--muted); }
.uc-warn { font-size: 12px; color: var(--danger); font-weight: 700; display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.uc-warn svg { width: 14px; height: 14px; }
.uc-sec { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.uc-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.uc-label svg { width: 15px; height: 15px; }
.uc-pct { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.uc-sec input[type=range] { width: 100%; accent-color: var(--mint); }
.uc-row { display: flex; gap: 6px; }
.uc-row input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; outline: none; }
.uc-row input:focus { border-color: var(--violet); }
.uc-row .btn { padding: 8px 12px; }
.user-card > .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
.user-card .btn svg { width: 16px; height: 16px; }
.uc-mod { background: rgba(255, 85, 119, .05); margin: 0 -14px -14px; padding: 12px 14px 14px; border-radius: 0 0 18px 18px; }
.uc-moves { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line-2); background: var(--elev-2); border-radius: 20px; padding: 5px 11px; font-size: 12px; font-weight: 700; }
.chip:hover { background: var(--violet); color: #0b0a14; border-color: transparent; }
.seg-sm button { padding: 5px 9px; font-size: 12px; }
.person { cursor: pointer; }

/* ---------- Bardo (música) ---------- */
.main { position: relative; }
.bardo { position: absolute; top: 72px; right: 12px; width: 336px; max-height: calc(100% - 84px); z-index: 20; display: flex; flex-direction: column; background: rgba(25, 22, 36, .96); backdrop-filter: blur(18px); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.main.bardo-on .messages { padding-right: 372px; }
.main.bardo-on .typing, .main.bardo-on .composer-wrap { padding-right: 368px; }
.main.bardo-on .stage-grid { padding-right: 362px; }
.bd-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 8px 12px; flex: none; }
.bd-logo { width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #0b0a14; display: grid; place-items: center; }
.bd-logo svg { width: 17px; height: 17px; }
.bardo.playing .bd-logo { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-2px) rotate(-6deg); } }
.bd-titles { flex: 1; min-width: 0; line-height: 1.2; }
.bd-titles b { display: block; font-size: 14px; }
.bd-titles span { font-size: 11px; color: var(--muted); }
.bd-head .round-btn { width: 30px; height: 30px; }
.bardo.collapsed #bd-collapse svg { transform: rotate(180deg); }
.bd-stage { position: relative; margin: 0 10px; border-radius: 14px; overflow: hidden; background: #000; flex: none; }
.bd-player { width: 100%; }
.bd-player:empty { display: none; }
.bd-player[data-kind="youtube"], .bd-player[data-kind="youtube-list"] { height: 200px; }
.bd-player[data-kind="spotify"] { height: 152px; background: transparent; }
.bd-player[data-kind="soundcloud"] { height: 166px; }
.bd-player[data-kind="audio"] { height: 96px; }
.bd-player iframe, .bd-player > div:not(.bd-cover) { width: 100% !important; height: 100% !important; border: 0; display: block; }
.bd-cover { height: 100%; display: grid; place-items: center; background: var(--grad); color: #0b0a14; }
.bd-cover svg { width: 40px; height: 40px; }
.bardo.playing .bd-cover svg { animation: bob 1.2s ease-in-out infinite; }
.bd-empty { padding: 26px 12px; text-align: center; font-size: 13px; color: var(--muted); background: var(--elev); }
.bd-unlock { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 9, 16, .75); }
.bd-now { padding: 10px 14px 4px; flex: none; }
.bd-title { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-hint { font-size: 11px; color: var(--warn); margin-top: 4px; line-height: 1.35; }
.bd-progress { display: flex; align-items: center; gap: 8px; padding: 4px 14px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bd-progress input { flex: 1; accent-color: var(--mint); }
.bd-ctrls { display: flex; align-items: center; gap: 4px; padding: 2px 10px 10px; flex: none; }
.bd-ctrls .round-btn:disabled, .bd-play:disabled { opacity: .35; cursor: default; }
.bd-play { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--grad); color: #0b0a14; display: grid; place-items: center; }
.bd-play .i-pause, .bardo.playing .bd-play .i-play { display: none; }
.bardo.playing .bd-play .i-pause { display: block; }
#bd-loop { position: relative; }
#bd-loop.on { color: var(--mint); }
.bd-loop-one { display: none; position: absolute; right: 3px; bottom: 3px; font-size: 9px; font-style: normal; font-weight: 800; }
#bd-loop.one .bd-loop-one { display: block; }
.bd-vol-ico { width: 18px; height: 18px; color: var(--muted); }
#bd-vol { width: 90px; accent-color: var(--violet); }
.bd-body { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.bardo.collapsed .bd-body { display: none; }
.bd-add { display: flex; gap: 6px; flex: none; }
.bd-add input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; outline: none; font-size: 13px; }
.bd-add input:focus { border-color: var(--violet); }
.bd-queue { overflow-y: auto; display: grid; gap: 2px; align-content: start; min-height: 0; max-height: 260px; }
.bd-q { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; cursor: pointer; }
.bd-q:hover { background: var(--hover); }
.bd-q.now { background: var(--grad-soft); }
.bd-q.done { opacity: .5; }
.bd-q-n { width: 18px; text-align: center; font-size: 11px; color: var(--faint); font-weight: 800; }
.bd-q.now .bd-q-n { color: var(--mint); }
.bd-q img, .bd-q-ico { width: 40px; height: 30px; border-radius: 6px; object-fit: cover; flex: none; background: var(--elev-2); display: grid; place-items: center; color: var(--violet); }
.bd-q-ico svg { width: 16px; height: 16px; }
.bd-q-txt { flex: 1; min-width: 0; }
.bd-q-t { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-q-m { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-q-x { border: 0; background: transparent; color: var(--faint); width: 26px; height: 26px; border-radius: 8px; opacity: 0; }
.bd-q:hover .bd-q-x { opacity: 1; }
.bd-q-x:hover { background: rgba(255, 85, 119, .15); color: var(--danger); }
.bd-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; flex: none; }
.bd-foot:empty { display: none; }
.bd-foot .btn { padding: 6px 10px; font-size: 12px; }
.check.small { font-size: 12px; }
.room-music { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 8px; border-radius: 9px; background: rgba(67, 229, 192, .08); color: var(--mint); font-size: 12px; font-weight: 700; }
.room-music svg { width: 14px; height: 14px; flex: none; }
.room-music .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vp-music.on, #ctrl-music.on .dock-ico { color: var(--mint); }
@media (max-width: 1100px) {
  .main.bardo-on .messages, .main.bardo-on .typing, .main.bardo-on .composer-wrap, .main.bardo-on .stage-grid { padding-right: 14px; }
  .bardo:not(.collapsed) { box-shadow: 0 20px 80px rgba(0, 0, 0, .8); }
}
@media (max-width: 760px) { .bardo { left: 8px; right: 8px; width: auto; top: 70px; } }
