/* Identidade StormKnight: preto profundo, gelo, dourado e azul tempestade (ver chat.stormknight.com.br). */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  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: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  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; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-wght-normal.woff2) format("woff2");
  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: "Inter Tight"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-tight-latin-ext-wght-normal.woff2) format("woff2");
  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: #020203;
  --panel: #0b0c0f;
  --chat: #07080a;
  --raised: #121419;
  --hover: #16181e;
  --line: rgba(236, 236, 238, 0.08);
  --line-strong: rgba(236, 236, 238, 0.16);
  --ink: #ececee;
  --muted: #8a8f98;
  --subtle: #5d626b;
  --gold: #b89a4e;
  --gold-soft: rgba(184, 154, 78, 0.14);
  --storm: #9fb3ff;
  --storm-soft: rgba(159, 179, 255, 0.1);
  --ok: #5cc98f;
  --danger: #e5606f;
  --radius: 10px;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--gold-soft); color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }
* { scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }

/* Login */
/* Rola quando a janela é baixa; margin:auto no cartão centraliza quando cabe. */
.login { height: 100%; display: flex; overflow-y: auto; padding: 16px;
  background: radial-gradient(80% 50% at 50% -10%, rgba(159, 179, 255, 0.1), transparent 70%), var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; margin: auto; }
.brand { text-align: center; margin-bottom: 22px; }
.wordmark { display: inline-flex; flex-direction: column; align-items: flex-start; font-family: var(--display); line-height: 1; }
.wordmark .storm { font-weight: 600; font-size: 13px; letter-spacing: .55em; color: var(--muted); text-transform: uppercase; margin-left: 4px; }
/* Cor sólida: o gradiente recortado no texto desenhava uma caixa escura em máquinas sem aceleração de vídeo. */
.wordmark .knight { font-weight: 700; font-size: 76px; letter-spacing: -0.045em; margin: 4px 0 2px; color: #f1f1f3; }
.wordmark .wm-chat { align-self: flex-end; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13px; letter-spacing: .55em; color: var(--gold); text-transform: uppercase; }
.wordmark .wm-chat::before { content: ""; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.brand p { margin: 18px 0 0; font-size: 13px; }
.login-card form, .login-fields { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
input, textarea, select { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: rgba(184, 154, 78, .55); }
input:disabled { opacity: .5; }
.primary { background: var(--ink); color: #0a0a0c; border: 0; border-radius: var(--radius); padding: 10px 16px; font-weight: 600; transition: background .15s; }
.primary:hover { background: #fff; }
.secondary { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.secondary:hover { border-color: var(--line-strong); }
.danger { background: transparent; border: 1px solid rgba(229, 96, 111, .5); color: var(--danger); border-radius: var(--radius); padding: 8px 12px; }
.danger:hover { background: rgba(229, 96, 111, .1); }
.icon-btn { background: transparent; border: 0; color: var(--muted); padding: 4px 8px; border-radius: 6px; font-size: 15px; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

/* Layout */
/* Barra no topo e três colunas embaixo: chat | salas | amigos. */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 0px 252px; grid-template-rows: 60px minmax(0, 1fr);
  grid-template-areas: "top top top" "chat side salas"; height: 100%; transition: grid-template-columns .24s cubic-bezier(.2, .8, .2, 1); }
/* Membros: terceira coluna só quando a pessoa abre (fica salvo neste computador) */
.app.members-open { grid-template-columns: minmax(0, 1fr) 240px 252px; grid-template-areas: "top top top" "chat side salas"; }
/* Fechada, a coluna fica com largura 0 (sem sumir do grid): assim abrir e fechar desliza. */
.members-col { overflow: hidden; }
.members-col > * { min-width: 240px; }
.app:not(.members-open) .members-col, .app.no-server .members-col { border-left-color: transparent; }
.app:not(.members-open) .members-col > *, .app.no-server .members-col > * { opacity: 0; }
.members-col > * { transition: opacity .18s; }

.rail { background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0; overflow-y: auto; border-right: 1px solid var(--line); }
.rail-servers { display: flex; flex-direction: column; gap: 8px; }
.rail-btn { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .02em; display: grid; place-items: center; position: relative; transition: background .15s, border-color .15s; }
.rail-btn:hover { border-color: var(--line-strong); background: var(--raised); }
.rail-btn.active { background: var(--ink); color: #0a0a0c; border-color: var(--ink); }
.rail-btn.active::before { content: ""; position: absolute; left: -13px; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--gold); }
.rail-btn.add, .rail-btn.join { color: var(--gold); font-size: 20px; font-weight: 400; background: transparent; border-style: dashed; }
.rail-btn.add:hover, .rail-btn.join:hover { background: var(--gold-soft); border-color: var(--gold); }

.sidebar { background: var(--panel); display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.server-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--line); font-family: var(--display); font-weight: 600; letter-spacing: -.01em; position: relative; }
.server-header span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; top: 50px; right: 8px; left: 8px; background: var(--raised); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 6px; z-index: 10; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); font-family: "Inter", sans-serif; }
.menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 6px; font-weight: 500; font-size: 14px; }
.menu button:hover { background: var(--hover); }
.menu button.danger-item { color: var(--danger); }
.menu button.danger-item:hover { background: rgba(229, 96, 111, .1); }

.channel-list { flex: 1; overflow-y: auto; padding: 8px; }
.category { margin: 16px 0 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.channel { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 14.5px; }
.channel:hover { background: var(--hover); color: var(--ink); }
.channel.active { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.channel .glyph { width: 16px; text-align: center; color: var(--subtle); }
.channel.active .glyph { color: var(--gold); }
.channel .lock { margin-left: auto; font-size: 11px; opacity: .6; }

.voice-panel { margin: 8px; padding: 12px; background: var(--chat); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.voice-panel .grants { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); }
.chip.on { color: var(--ok); border-color: rgba(92, 201, 143, .3); }
.chip.off { color: var(--subtle); text-decoration: line-through; }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
.me-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--ink); flex: none; position: relative; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.conn.on { background: var(--ok); }
.conn.off { background: var(--danger); }

.chat { display: flex; flex-direction: column; min-width: 0; background: var(--chat); }
.chat-header { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.channel-title { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; }
.messages .empty { margin: auto; text-align: center; padding: 20px; }
.msg { display: grid; grid-template-columns: 38px 1fr auto; gap: 0 12px; padding: 5px 20px; position: relative; }
.msg:hover { background: rgba(236, 236, 238, .025); }
.msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.msg.grouped .avatar { visibility: hidden; height: 0; }
.msg .avatar { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.msg.pending .body { opacity: .5; }
.msg .meta { display: flex; gap: 8px; align-items: baseline; }
.msg .author { font-weight: 600; font-size: 14.5px; }
.msg .time { font-size: 11px; color: var(--subtle); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; color: #dcdde0; }
.msg .edited { font-size: 11px; color: var(--subtle); margin-left: 4px; }
.msg .actions { visibility: hidden; display: flex; gap: 2px; align-self: start; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.msg:hover .actions { visibility: visible; }
.msg .actions:empty { display: none; }
.msg .actions button { font-size: 13px; padding: 2px 6px; }
.history-note { text-align: center; font-size: 12px; color: var(--subtle); padding: 10px; letter-spacing: .04em; }

.composer { padding: 0 20px 20px; }
.composer textarea { width: 100%; resize: none; background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; max-height: 200px; line-height: 1.45; }

.members { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; }
.members h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); margin: 14px 8px 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 14px; }
.member:hover { background: var(--hover); }
.member.offline { opacity: .4; }
.member .dot { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: var(--subtle); }
.member .dot.on { background: var(--ok); }
.member .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .role-tag { font-size: 11px; color: var(--gold); }

/* Modal */
.modal { border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; background: var(--panel); color: var(--ink);
  width: min(660px, calc(100vw - 32px)); max-height: calc(100vh - 64px); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.modal::backdrop { background: rgba(2, 2, 3, .75); backdrop-filter: blur(3px); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 64px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 160px; }
.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 22px; background: var(--chat); border: 1px solid var(--line); color: var(--gold);
  padding: 12px 16px; border-radius: var(--radius); user-select: all; letter-spacing: .08em; text-align: center; }
.split { display: grid; grid-template-columns: 180px 1fr; gap: 16px; min-height: 320px; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list button { text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.list button:hover { background: var(--hover); }
.list button.active { background: var(--raised); box-shadow: inset 2px 0 0 var(--gold); }
.perm-grid { display: flex; flex-direction: column; gap: 2px; }
.perm { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13.5px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.perm:hover { background: var(--hover); }
.perm .desc { font-size: 12px; font-weight: 400; color: var(--muted); }
.perm input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
.tri { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.tri button { border: 0; background: transparent; width: 30px; height: 26px; color: var(--subtle); }
.tri button.sel[data-v=deny] { background: rgba(229, 96, 111, .85); color: #fff; }
.tri button.sel[data-v=inherit] { background: var(--raised); color: var(--ink); }
.tri button.sel[data-v=allow] { background: var(--ok); color: #0a0a0c; }
.audit { font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.audit div { padding: 8px 10px; background: var(--chat); border: 1px solid var(--line); border-radius: 8px; }
.assign { display: flex; flex-direction: column; gap: 4px; max-height: 160px; overflow-y: auto; }
.assign label { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 14px; font-weight: 400; display: flex; gap: 8px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--raised); border: 1px solid var(--line-strong);
  padding: 10px 16px; border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .6); z-index: 100; max-width: calc(100vw - 32px); font-size: 14px; }
.toast.err { border-color: rgba(229, 96, 111, .6); }

@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) 0px 224px; }
  .app.members-open { grid-template-columns: minmax(0, 1fr) 216px 224px; }
}
/* Janela estreita: a lista de membros passa a abrir por cima do chat, em vez de roubar uma coluna dele,
   e a coluna das salas encolhe. Assim o chat nunca fica espremido. */
@media (max-width: 900px) {
  .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 200px; }
  /* Com o grid posicionado, a área (de largura 0) vira a referência: right: 0 cola na coluna das salas. */
  .app { position: relative; }
  .app.members-open .members-col { position: absolute; top: 0; right: 0; bottom: 0; width: 240px; z-index: 20;
    box-shadow: -12px 0 30px rgba(0, 0, 0, .45); }
}
@media (max-width: 640px) {
  .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 172px; }
}
@media (max-width: 600px) {
  .split { grid-template-columns: 1fr; }
  .wordmark .knight { font-size: 60px; }
}

/* Voz: ocupantes na lista de canais */
.channel.connected .glyph { color: var(--ok); }
.voice-user { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 32px; font-size: 13px; color: var(--muted); }
.voice-user .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user.speaking .avatar { box-shadow: 0 0 0 2px var(--ok); }
.avatar.small { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }
.vs-icon { margin-left: auto; font-size: 11px; opacity: .7; }
.live { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; color: #0a0a0c; background: var(--gold); padding: 1px 6px; border-radius: 4px; }

/* Painel de voz conectada */
.voice-panel { display: flex; flex-direction: column; gap: 10px; }
.vp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.vp-info { min-width: 0; }
.vp-status { color: var(--ok); font-weight: 600; font-size: 12.5px; }
.vp-where { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; text-align: left; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-where:hover { color: var(--ink); text-decoration: underline; }
.hangup:hover { background: rgba(229, 96, 111, .15); color: var(--danger); }
.vp-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); font-size: 11px; color: var(--muted); }
.vbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.vbtn .vicon { font-size: 15px; }
.vbtn.off { color: var(--danger); border-color: rgba(229, 96, 111, .35); }
.vbtn.live { background: var(--gold); color: #0a0a0c; border-color: var(--gold); font-weight: 600; }
.quality { padding: 6px 8px; font-size: 12px; }

/* Palco: transmissões de tela */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: auto; }
.screen { position: relative; background: #000; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; }
.screen.big { flex: 1; min-height: 240px; cursor: default; }
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.screen:fullscreen { border: 0; border-radius: 0; }
.screen-label { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; align-items: center; background: rgba(2, 2, 3, .7); padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.screen-label .live { margin-left: 0; }
.screen .fs { position: absolute; right: 10px; bottom: 10px; background: rgba(2, 2, 3, .7); color: var(--ink); }
.thumbs { display: flex; gap: 10px; height: 110px; flex: none; }
.thumbs .screen { width: 196px; flex: none; }
.thumbs .screen:hover { border-color: var(--gold); }
.stage-empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 6px; min-height: 200px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.stage-empty-title { font-family: var(--display); font-size: 20px; font-weight: 600; }
.people { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 132px; padding: 12px 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
.person.speaking { border-color: var(--ok); }
.person.speaking .avatar { box-shadow: 0 0 0 2px var(--ok); }
.avatar.big { width: 52px; height: 52px; border-radius: 16px; font-size: 16px; }
.person-name { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol { width: 100%; padding: 0; accent-color: var(--gold); background: none; border: 0; }

/* ---------- Cara de aplicativo, não de site ---------- */
html, body { overflow: hidden; overscroll-behavior: none; }
body { display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; cursor: default; }
.login, .app { flex: 1; min-height: 0; height: auto; }
input, textarea, .msg .body, .code, .vp-where { user-select: text; -webkit-user-select: text; }
.msg .body { cursor: text; }
img, a, svg, video { -webkit-user-drag: none; }
.messages, .channel-list, .members, .stage, .modal-body { overscroll-behavior: contain; }
button:focus { outline: none; }
button:focus-visible, select:focus-visible, input[type=range]:focus-visible { outline: 2px solid rgba(184, 154, 78, .7); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--raised); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--hover); background-clip: padding-box; border: 3px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* Barra de título própria (só no app desktop) */
.titlebar { height: 32px; flex: none; display: flex; align-items: center; justify-content: space-between; background: var(--bg); border-bottom: 1px solid var(--line); }
.tb-brand { display: flex; align-items: baseline; gap: 8px; padding-left: 14px; height: 100%; align-items: center; flex: 1; }
.tb-storm { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: .32em; color: var(--muted); }
.tb-chat { font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: .32em; color: var(--gold); }
.tb-buttons { display: flex; height: 100%; }
.tb-btn { width: 46px; height: 100%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.tb-btn:hover { background: var(--hover); color: var(--ink); }
.tb-btn.close:hover { background: #c42b1c; color: #fff; }
.tb-btn .ic-restore { display: none; }
.titlebar.maximized .ic-max { display: none; }
.titlebar.maximized .ic-restore { display: block; }

/* Janela de transmissão */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice { text-align: left; background: var(--chat); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice.sel { border-color: var(--gold); background: var(--gold-soft); }
.choice-title { font-weight: 600; font-size: 14px; }
.choice-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
label.toggle { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--ink); margin-top: 4px; }
label.toggle input { width: 18px; height: 18px; accent-color: var(--gold); }
.row.end { justify-content: flex-end; margin-top: 6px; }

/* Logo do cavaleiro */
.tb-logo { width: 18px; height: 18px; border-radius: 5px; margin-right: 2px; }
.login-logo { display: block; width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(159, 179, 255, .08); }

/* Iframe do isolamento do Tauri: o Tauri o esconde com estilo inline, que a nossa CSP bloqueia.
   Escondido aqui ele continua funcionando (é só o canal seguro de IPC). */
iframe[src*="isolation-"] { display: none !important; }

/* Seletor de tela nativo */
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.picker-tabs { display: flex; gap: 6px; align-items: center; }
.ptab { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.ptab:hover { color: var(--ink); border-color: var(--line-strong); }
.ptab.sel { background: var(--ink); color: #0a0a0c; border-color: var(--ink); font-weight: 600; }
.picker-tabs .refresh { margin-left: auto; font-size: 18px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; min-height: 260px; align-content: start; }
.picker-loading { grid-column: 1 / -1; text-align: center; padding: 60px 0; }
.pick { text-align: left; background: var(--chat); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.pick:hover { border-color: var(--gold); transform: translateY(-1px); }
.pick-thumb { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.pick-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pick-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-sub { font-size: 11.5px; color: var(--muted); margin-top: -4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small { font-size: 12.5px; }

/* Link do instalador na tela de login (só no navegador) */
.download-app { display: block; text-align: center; font-size: 13px; color: var(--gold); text-decoration: none; padding-top: 4px; }
.download-app span { color: var(--subtle); }
.download-app:hover { text-decoration: underline; }

/* Aviso de atualização na barra de título */
.tb-update { margin-left: auto; margin-right: 8px; align-self: center; background: rgba(184, 154, 78, .14); color: var(--gold);
  border: 1px solid rgba(184, 154, 78, .45); border-radius: 99px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.tb-update:hover:not(:disabled) { background: rgba(184, 154, 78, .24); }
.tb-update:disabled { opacity: .7; cursor: default; }

/* Login: entrar / criar conta */
.auth-tabs { display: flex; gap: 6px; justify-content: center; margin: 4px 0 2px; }
.login-card.mode-login .register-only { display: none; }
.login-card:not(.mode-login) .login-only { display: none; }
.auth-step { display: flex; flex-direction: column; gap: inherit; }
.auth-step.hidden { display: none; }
.auth-step .link-btn { align-self: center; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 12px; margin: 2px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.google-btn { background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px; color: var(--ink); font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px; }
.google-btn:hover { border-color: var(--ink); }
#login-info:empty, #login-error:empty { display: none; }
/* Abertura: aviso quando o servidor não responde */
.sp-status { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

/* Botões do rodapé do usuário: ícones de traço, compactos, para o nome caber */
.me-btn { display: grid; place-items: center; padding: 6px; }
.me { gap: 6px; }

/* Janelas baixas: logo e nome menores para o formulário caber sem rolar */
@media (max-height: 820px) {
  .login-logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 10px; }
  .wordmark .knight { font-size: 54px; }
  .brand { margin-bottom: 12px; }
  .brand p { margin-top: 10px; }
}

/* Categorias recolhíveis */
.category { display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.cat-toggle { flex: 1; display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: inherit;
  font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cat-toggle:hover { color: var(--ink); }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Seta desenhada em CSS (o caractere ficava parecendo um traço em tamanho pequeno) */
.chev { flex: none; width: 5px; height: 5px; margin: 0 4px 2px 1px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.category.collapsed .chev { transform: rotate(-45deg); margin-bottom: 0; }
.cat-add { background: none; border: 0; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.category:hover .cat-add, .cat-add:focus-visible { opacity: 1; }
.cat-add:hover { color: var(--ink); background: var(--hover); }
.optional { text-transform: none; letter-spacing: 0; color: var(--subtle); font-weight: 400; }

/* Menu de botão direito */
.ctx-menu { position: fixed; z-index: 1000; min-width: 200px; padding: 6px; background: #111216; border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); display: flex; flex-direction: column; gap: 1px; }
.ctx-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%;
  background: none; border: 0; color: var(--ink); font-size: 13px; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: default; }
.ctx-item:hover, .ctx-item:focus-visible { background: rgba(159, 179, 255, .12); outline: none; }
.ctx-item.danger { color: #ff8a8a; }
.ctx-item.danger:hover { background: rgba(255, 90, 90, .14); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctx-arrow, .ctx-check { color: var(--muted); }
.ctx-check { color: var(--gold); }
.has-sub > .ctx-menu { display: none; position: absolute; left: calc(100% + 4px); top: -6px; }
.ctx-menu.flip .has-sub > .ctx-menu { left: auto; right: calc(100% + 4px); }
.has-sub:hover > .ctx-menu, .has-sub:focus-within > .ctx-menu { display: flex; }

/* Rodinha de atualização no rodapé */
.me-update { color: var(--gold); border-radius: 50%; padding: 3px; }
.me-update:hover { color: var(--gold); background: rgba(184, 154, 78, .14); }
.me-update .ring-bg { stroke: rgba(184, 154, 78, .28); }
.me-update .ring { stroke: var(--gold); transform: rotate(-90deg); transform-origin: 12px 12px; transition: stroke-dashoffset .25s; }
.me-update:not(.updating) { animation: skc-pulse-o 2.4s ease-in-out infinite; }
/* pulso só com opacidade: a placa não precisa redesenhar a sombra a cada quadro */
@keyframes skc-pulse-o { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.me-update.updating { cursor: progress; }
.me-update.updating .arrows { animation: skc-spin 1s linear infinite; transform-origin: 12px 12px; }
@keyframes skc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 154, 78, .35); } 50% { box-shadow: 0 0 0 5px rgba(184, 154, 78, 0); } }
@keyframes skc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .me-update, .me-update .arrows { animation: none !important; } }
.update-version { font-family: var(--display); font-size: 18px; font-weight: 700; margin: 0; }
.update-notes { margin: 0; line-height: 1.5; }

/* ===== Layout novo ===== */
.chat { grid-area: chat; position: relative; }
.salas { grid-area: salas; position: relative; border-right: 0; border-left: 1px solid var(--line); }
.side { grid-area: side; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow-y: auto; min-width: 0; }

/* Cabeçalho das salas */
.sh-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sh-label { font-family: "Inter", sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }

/* Salas como cartões */
.salas .channel { background: var(--chat); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; }
.salas .channel:hover { border-color: var(--line-strong); }
.salas .channel.active { border-color: rgba(184, 154, 78, .7); box-shadow: none; background: var(--raised); }
.salas .voice-user { margin: -2px 0 6px 18px; }

/* ===== Amigos ===== */
.friends-view { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 16px 20px; gap: 14px; place-items: initial; }
.fv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.fv-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ptab.attention:not(.sel) { color: var(--gold); border-color: rgba(184, 154, 78, .6); }
.fv-add { display: flex; gap: 8px; flex: 1; max-width: 420px; min-width: 260px; }
.fv-add input { flex: 1; }
.fv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.fv-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.fv-row:hover { border-color: var(--line-strong); }
.fv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fv-name { font-weight: 600; }
.fv-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-sub.in-voice { color: #3ee08a; }
.fv-actions { display: flex; gap: 6px; align-items: center; }
.fv-actions button { padding: 6px 12px; font-size: 13px; }
.fv-actions .icon-btn { padding: 4px 8px; }
.fv-empty { text-align: center; padding: 40px 0; }
.pdot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #5d626b; border: 2px solid var(--panel); }
.pdot.on { background: #3ee08a; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #0a0a0c; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; }
.side-friends { display: flex; flex-direction: column; gap: 2px; }
.sf { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 6px; border-radius: 10px; color: var(--ink); text-align: left; }
.sf:hover, .sf.active { background: var(--hover); }
.sf .avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 10px; }
.sf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sf-voice { color: #3ee08a; font-size: 12px; }

/* Ajustes */
.set-section { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-section:first-child { border-top: 0; padding-top: 0; }
.set-section h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.set-line { margin: 0; }
.danger-text { color: var(--danger); }

/* ===== Layout v3: barra do topo ===== */
.topbar { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 12px 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); min-width: 0; }
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-sep { width: 1px; height: 28px; background: var(--line-strong); flex: none; }
.servers { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.servers .muted { font-size: 12.5px; white-space: nowrap; }

/* Escudo de cavaleiro: SVG com borda arredondada; a cor vem das variáveis */
.shield { --sh-fill: transparent; --sh-line: var(--line-strong); --sh-ink: var(--muted);
  position: relative; flex: none; width: 38px; height: 42px; padding: 0; border: 0; background: none; display: grid; place-items: center;
  color: var(--sh-ink); transition: transform .12s; }
.shield .sh-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shield .sh-shape path { fill: var(--sh-fill); stroke: var(--sh-line); stroke-width: 1.6; transition: fill .15s, stroke .15s; }
.shield .sh-label, .shield .sh-icon { position: relative; margin-top: -4px; font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .01em; }
.shield:hover { --sh-line: var(--muted); --sh-ink: var(--ink); }
.shield:active { transform: translateY(1px); }
.shield:focus-visible { outline: none; --sh-line: var(--ink); }
.shield.active { --sh-line: var(--gold); --sh-ink: var(--gold); }
.shield.temp { opacity: .75; }
.shield.temp .sh-shape path { stroke-dasharray: 3 3; }
/* Casinha dourada do Início */
.home-btn { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px;
  background: none; color: var(--gold); transition: background .15s; }
.home-btn:hover, .home-btn.open, .home-btn:focus-visible { background: var(--gold-soft); outline: none; }
.home-dot { position: absolute; top: 5px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--panel); }
.shield .badge { position: absolute; top: -3px; right: -6px; height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; border: 2px solid var(--panel); box-sizing: content-box; }

/* Lista "Seus servidores" que o escudo do Início abre */
.srv-pop { position: fixed; z-index: 40; width: 290px; max-height: min(460px, calc(100vh - 90px)); overflow-y: auto; padding: 8px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 44px rgba(0, 0, 0, .6); }
.srv-pop-title { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--subtle); padding: 4px 8px 8px; }
.srv-pop-row { display: flex; align-items: center; gap: 4px; border-radius: 9px; padding: 2px 4px 2px 2px; }
.srv-pop-row:hover, .srv-pop-row.active { background: var(--hover); }
.srv-pop-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 5px 6px; background: none; border: 0; text-align: left; color: var(--ink); font-size: 14px; }
.srv-pop-open .shield { width: 26px; height: 29px; pointer-events: none; }
.srv-pop-open .shield .sh-label { font-size: 9.5px; margin-top: -3px; }
.srv-pop-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-pop-row .badge { flex: none; }
.srv-pop-btn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--subtle); }
.srv-pop-btn:hover { background: var(--panel); color: var(--ink); }
.srv-pop-btn.on { color: var(--gold); }
.srv-pop-btn.muted-on { color: var(--danger); }
.srv-pop-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.srv-pop-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 14px; text-align: left; }
.srv-pop-action:hover { background: var(--hover); color: var(--ink); }
.srv-pop-action.gold { color: var(--gold); }
.srv-pop-empty { padding: 6px 10px 10px; margin: 0; font-size: 13px; }

/* Perfil no canto direito do topo: nome, status clicável, avatar com o anel neon */
.profile { --neon: var(--gold); display: flex; align-items: center; gap: 10px; flex: none; }
.profile[data-status="online"] { --neon: #3ee08a; }
.profile[data-status="playing"] { --neon: #5aa9ff; }
.profile[data-status="idle"] { --neon: #f0b232; }
.profile[data-status="dnd"] { --neon: #ef5a6b; }
.profile[data-status="invisible"] { --neon: #8a8f98; }
.profile[data-status="off"] { --neon: #e5606f; }
.profile[data-status="connecting"] { --neon: var(--gold); }
.profile-text { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; gap: 1px; }
.profile .me-name { flex: none; font-family: var(--display); font-weight: 700; font-size: 14.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.me-status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--neon); margin-right: -6px; padding: 2px 6px; border: 0; border-radius: 6px;
  background: none; max-width: 240px; transition: background .15s; }
.me-status:hover, .me-status:focus-visible { background: var(--raised); }
.me-status #me-status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-status .conn { flex: none; background: var(--neon); box-shadow: 0 0 8px var(--neon); }
.me-status .chev { flex: none; opacity: .7; color: var(--muted); }
.pf-ring { flex: none; padding: 2px; border-radius: 50%; border: 2px solid var(--neon);
  box-shadow: 0 0 10px color-mix(in srgb, var(--neon) 45%, transparent); transition: border-color .3s, box-shadow .3s; }
.profile .pf-ring .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; }
/* Online e jogando pulsam devagar: o pulso quer dizer "estou ativo" */
.profile[data-status="online"] .pf-ring, .profile[data-status="playing"] .pf-ring { animation: skc-neon 2.6s ease-in-out infinite; }
@keyframes skc-neon {
  0%, 100% { box-shadow: 0 0 5px color-mix(in srgb, var(--neon) 40%, transparent), inset 0 0 3px color-mix(in srgb, var(--neon) 20%, transparent); }
  50% { box-shadow: 0 0 16px color-mix(in srgb, var(--neon) 75%, transparent), inset 0 0 7px color-mix(in srgb, var(--neon) 35%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .profile .pf-ring { animation: none !important; } }
.pf-gear { flex: none; display: grid; place-items: center; padding: 7px; border-radius: 10px; color: var(--muted); }
.pf-gear:hover, .pf-gear:focus-visible { color: var(--ink); background: var(--raised); }

/* Cabeçalhos das três colunas: mesma altura, alinhados como uma faixa só */
.col-head { height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.server-header { height: 48px; font-size: 15px; }
.server-header #server-name { flex: 1; min-width: 0; }
.menu { top: 44px; }

/* Salas */
.chat { grid-area: chat; position: relative; }
.salas { grid-area: salas; position: relative; border-right: 0; border-left: 1px solid var(--line); }
.channel.unread { color: var(--ink); font-weight: 600; }
.channel .ch-badge { margin-left: auto; }

/* Coluna da direita (membros) */
.side { grid-area: side; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.col-title { font-family: var(--display); font-weight: 600; font-size: 14px; white-space: nowrap; }
.col-title .count { color: var(--gold); margin-left: 4px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--gold); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.link-btn.active { text-decoration: underline; }
.members-col .members { flex: 1; overflow-y: auto; padding: 4px 8px 12px; background: none; border: 0; }
.member .who { min-width: 0; display: flex; flex-direction: column; }
.member .game { font-size: 11.5px; color: #5aa9ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.members h3 .role-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--gold); }
#btn-toggle-members[aria-pressed="true"] { color: var(--gold); }
.pdot.idle, .member .dot.idle { background: #f0b232; }
.pdot.dnd, .member .dot.dnd { background: #ef5a6b; }
.pdot.playing, .member .dot.playing { background: #5aa9ff; }
.fv-sub.playing { color: #5aa9ff; }

/* Painel do Início: amigos, servidores e criar/entrar */
.srv-pop-action .badge { margin-left: auto; }
.srv-pop-empty { line-height: 1.45; }
/* Sem servidor aberto (ou em amigos/conversa) a coluna dos membros não aparece, mesmo se estiver "aberta" */
.app.members-open.no-server { grid-template-columns: minmax(0, 1fr) 0px 252px; }


/* ===== 0.8: menus, respostas, reações, ajustes ===== */
.ctx-label { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.ctx-hint { font-size: 11.5px; color: var(--subtle); font-weight: 400; }
.ctx-grid { display: grid; grid-template-columns: repeat(6, 34px); gap: 2px; padding: 4px; }
.ctx-emoji { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; font-size: 19px; }
.ctx-emoji:hover { background: rgba(159, 179, 255, .12); }
.ctx-emoji.on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(184, 154, 78, .6); }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }

.msg .body { font-size: var(--chat-font, 15px); }
.msg.mention { background: rgba(184, 154, 78, .07); box-shadow: inset 2px 0 0 var(--gold); }
.msg.flash { animation: skc-flash 1.6s ease-out; }
@keyframes skc-flash { 0%, 30% { background: rgba(159, 179, 255, .16); } 100% { background: transparent; } }
.mention-tag { color: var(--storm); background: var(--storm-soft); border-radius: 4px; padding: 0 2px; }
.mention-tag.to-me { color: var(--gold); background: var(--gold-soft); }
.reply-quote { display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 2px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-align: left; }
.reply-quote:hover { color: var(--ink); }
.rq-arrow { color: var(--subtle); }
.rq-author { font-weight: 600; flex: none; }
.rq-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rq-text.gone { font-style: italic; color: var(--subtle); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--raised); font-size: 13px; }
.reaction:hover { border-color: var(--line-strong); }
.reaction.mine { border-color: rgba(184, 154, 78, .7); background: var(--gold-soft); }
.reaction .rc { font-size: 12px; color: var(--muted); font-weight: 600; }
.reaction.mine .rc { color: var(--gold); }
.reply-bar { display: flex; align-items: center; gap: 6px; margin: 0 20px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 12px 12px 0 0; background: var(--raised); font-size: 13px; }
.reply-bar .rb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); margin-left: 6px; }
.reply-bar:not(.hidden) + .composer textarea { border-top-left-radius: 0; border-top-right-radius: 0; }
.badge.mention { background: var(--danger); color: #fff; }
.member { cursor: pointer; }
.voice-user { cursor: default; }

/* Modo compacto */
.app.compact .msg { grid-template-columns: 1fr auto; padding-top: 2px; padding-bottom: 2px; }
.app.compact .msg > .avatar { display: none; }
.app.compact .msg.grouped { padding-top: 0; padding-bottom: 0; }

/* Acessibilidade */
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
:root.high-contrast { --muted: #b8bcc5; --subtle: #959aa4; --line: rgba(236, 236, 238, .18); --line-strong: rgba(236, 236, 238, .3); }

/* Ajustes com menu lateral */
.settings-modal .modal-body { padding: 0; }
.settings { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: min(560px, calc(100vh - 140px)); }
.set-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--bg); }
.set-nav-item { text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.set-nav-item:hover { background: var(--hover); color: var(--ink); }
.set-nav-item.sel { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.set-pane { padding: 18px 24px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.set-title { margin: 0 0 8px; font-family: var(--display); font-size: 19px; font-weight: 700; }
.set-pane select, .set-pane input[type="range"] { width: 100%; }
.set-pane .row input[type="range"] { flex: 1; accent-color: var(--gold); }
.mic-test { align-items: center; gap: 12px; margin-top: 6px; }
.mic-meter { flex: 1; height: 8px; border-radius: 4px; background: var(--raised); border: 1px solid var(--line); overflow: hidden; }
.mic-level { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3ee08a, #f0b232 75%, #ef5a6b); transition: width .06s linear; }
.sound-row { justify-content: space-between; align-items: center; }
.small-btn { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 640px) { .settings { grid-template-columns: 1fr; } .set-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } }

/* ===== Perfil: fotos, cartão e edição ===== */
.avatar.has-img { overflow: hidden; background: var(--raised) !important; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.msg .avatar, .msg .author, .member, .voice-user, .pf-ring { cursor: pointer; }
.msg .author:hover { text-decoration: underline; }

.pc-pop { position: fixed; z-index: 60; width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; border-radius: 16px; border: 1px solid var(--line-strong);
  background: var(--panel); box-shadow: 0 22px 60px rgba(0, 0, 0, .65); }
.pc { position: relative; }
.pc-banner { height: 72px; border-radius: 15px 15px 0 0; }
.pc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 14px; margin-top: -38px; }
.pc-ring { --neon: #5d626b; padding: 3px; border-radius: 50%; background: var(--panel); box-shadow: 0 0 0 3px var(--neon); flex: none; }
.pc-ring[data-status="online"] { --neon: #3ee08a; }
.pc-ring[data-status="playing"] { --neon: #5aa9ff; }
.pc-ring[data-status="idle"] { --neon: #f0b232; }
.pc-ring[data-status="dnd"] { --neon: #ef5a6b; }
.pc-avatar.avatar { width: 76px; height: 76px; border-radius: 50%; font-size: 24px; }
.pc-actions { display: flex; gap: 6px; align-items: center; padding-bottom: 4px; }
.pc-actions button { padding: 6px 12px; font-size: 13px; }
.pc-actions .icon-btn { padding: 4px 8px; }
.pc-body { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.pc-name { font-family: var(--display); font-weight: 700; font-size: 19px; overflow-wrap: anywhere; }
.pc-user { color: var(--muted); font-size: 13px; }
.pc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: #5d626b; }
.pc-status[data-status="online"] .pc-dot { background: #3ee08a; }
.pc-status[data-status="playing"] { color: #5aa9ff; }
.pc-status[data-status="playing"] .pc-dot { background: #5aa9ff; }
.pc-status[data-status="idle"] .pc-dot { background: #f0b232; }
.pc-status[data-status="dnd"] .pc-dot { background: #ef5a6b; }
.pc-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pc-section h4 { margin: 0 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.pc-bio { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.45; }
.pc-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-role { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); color: var(--ink); }
.pc-role.link:hover { border-color: var(--gold); color: var(--gold); }
.pc-dates { display: flex; gap: 18px; font-size: 13px; }

.profile-edit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.pe-preview { position: sticky; top: 0; }
.pe-preview h4 { margin: 0 0 6px; letter-spacing: .14em; }
.pc-preview { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.swatch.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel) inset; }
.set-pane input[type="color"] { width: 34px; height: 30px; padding: 0; border-radius: 8px; background: none; }
.set-pane textarea { width: 100%; resize: vertical; }
.crop { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop-frame { width: 240px; height: 240px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--gold); background: var(--raised); }
.crop-canvas { display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop input[type="range"] { width: 240px; accent-color: var(--gold); }
@media (max-width: 760px) { .profile-edit { grid-template-columns: 1fr; } }
.set-pane .row input[type="color"] { width: 34px; flex: 0 0 34px; padding: 0; border: 1px solid var(--line); }
.messages { overflow-x: hidden; }

/* ===== 0.8.1: servidor na direita, foto e banner ===== */
.server-header { height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0; gap: 0; border-bottom: 1px solid var(--line); }
.server-banner { height: 0; background: center / cover no-repeat var(--raised); }
.server-header.has-banner .server-banner { height: 92px; box-shadow: inset 0 -30px 30px -10px rgba(11, 12, 15, .85); }
.sh-row { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 6px 6px 6px 12px; }
.server-icon:empty { display: none; }
.server-icon .shield { width: 34px; height: 37px; cursor: default; }
.server-icon .shield .sh-label { font-size: 11px; }
.server-header.has-banner .server-icon { margin-top: -26px; }
.server-header.has-banner .server-icon .shield { width: 46px; height: 50px; }
.server-header.has-banner .server-icon .sh-shape path { stroke-width: 2; }
.server-name { flex: 1; min-width: 0; padding: 4px 6px; border: 0; border-radius: 8px; background: none; color: var(--ink); text-align: left;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-name:hover { background: var(--hover); }
.sh-shape.has-img path { fill: transparent; }
.shield.active .sh-shape.has-img path { stroke: var(--gold); }

/* Salas: lista simples (sem cartões) */
.salas .channel { background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; margin-bottom: 1px; box-shadow: none; }
.salas .channel:hover { background: var(--hover); color: var(--ink); border: 0; }
.salas .channel.active { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); border: 0; }
.salas .channel.active .glyph { color: var(--gold); }
.salas .voice-user { margin: 0 0 2px 26px; padding: 3px 6px; border-radius: 6px; }
.salas .voice-user:hover { background: var(--hover); }
.channel-list { padding: 8px 8px 12px; }

/* Janela de foto e banner do servidor */
.crop-frame.round { border-radius: 50%; }
.crop-frame { border-radius: 12px; }
.si-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.si-banner { height: 92px; background: center / cover no-repeat var(--raised); }
.si-row { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px; margin-top: -24px; }
.si-icon.shield { width: 46px; height: 50px; }
.si-row b { font-family: var(--display); font-size: 16px; margin-top: 22px; }
.server-name { white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
/* O próprio nome abre o menu: a setinha separada sai e o nome ganha espaço */
#btn-server-menu { display: none !important; }
.server-name { overflow-wrap: break-word; font-size: 15.5px; }

/* Descrição da sala no cabeçalho do chat */
.chat-header { justify-content: flex-start; gap: 10px; }
.chat-header #btn-toggle-members, .chat-header > :last-child:not(.channel-topic) { margin-left: auto; }
.channel-title { flex: none; }
.channel-topic { flex: 1; min-width: 0; padding: 4px 10px; border: 0; border-left: 1px solid var(--line-strong); border-radius: 0; background: none;
  color: var(--muted); font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-topic.editable { cursor: pointer; }
.channel-topic.editable:hover { color: var(--ink); }
.channel-topic.empty { color: var(--subtle); font-style: italic; }
.channel-topic:disabled { cursor: default; }
.channel-topic:focus, .channel-topic:focus-visible { outline: none; box-shadow: none; color: var(--ink); }

/* ===== Salas: tempo, status, ícone, novidade, sua sala ===== */
.salas .channel { position: relative; }
.channel .glyph { display: inline-grid; place-items: center; width: 18px; flex: none; }
.channel .glyph.emoji { font-size: 14px; }
.channel .ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.unread::before { content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--ink); }
.channel .lock { display: inline-grid; color: var(--subtle); margin-left: auto; }
.channel.occupied .glyph { color: var(--ok); }
.vc-timer { margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ok); }
.voice-room { border-radius: 10px; margin-bottom: 2px; }
/* A sala em que você está: o bloco inteiro ganha um brilho dourado que respira devagar. */
.voice-room.mine { position: relative; padding-bottom: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--srv, #c9a24a) 14%, transparent), color-mix(in srgb, var(--srv, #c9a24a) 3%, transparent) 70%), var(--raised);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--srv, #c9a24a) 16%, transparent); }
/* O neon em L respira devagar */
@keyframes skc-room-glow { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.voice-room.mine .channel .ch-name { color: var(--ink); font-weight: 600; }
.reduce-motion .voice-room.mine, .reduce-motion .voice-room.mine::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-room.mine, .voice-room.mine::before { animation: none; } }
/* Ícones de mic e fone antes da foto */
.vs-icons { display: inline-flex; gap: 2px; min-width: 0; }
.vs-icons:empty { display: none; }
/* Ao vivo: o nome brilha em vermelho, com uma luz passando, e um pontinho pulsando no fim */
.voice-user.is-live { cursor: pointer; }
.voice-user.is-live .name { font-weight: 600; color: #ff6b6b;
  background: linear-gradient(100deg, #ff4d5e 0%, #ff4d5e 40%, #ffd1d6 50%, #ff4d5e 60%, #ff4d5e 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: skc-live-shine 2.6s linear infinite; }
@keyframes skc-live-shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.voice-user.is-live:hover { background: rgba(255, 77, 94, .1); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #ff4d5e; box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: skc-live-dot 1.6s ease-out infinite; }
@keyframes skc-live-dot { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); } 100% { box-shadow: 0 0 0 7px rgba(255, 77, 94, 0); } }
.reduce-motion .voice-user.is-live .name, .reduce-motion .live-dot { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-user.is-live .name, .live-dot { animation: none; } }
.voice-room.mine .channel { background: transparent; box-shadow: none; }
.room-status { display: flex; align-items: center; gap: 6px; width: calc(100% - 26px); margin: -2px 0 4px 26px; padding: 0; border: 0; background: none; color: var(--muted);
  font-size: 12px; text-align: left; cursor: default; }
.room-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-room.mine .room-status { cursor: pointer; }
.voice-room.mine .room-status:hover { color: var(--ink); }
.room-status.empty { color: var(--subtle); font-style: italic; }
.voice-user { display: flex; align-items: center; gap: 8px; }
.voice-user .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.vs-icon { display: inline-grid; place-items: center; color: var(--muted); }
.vs-icon.off { color: var(--danger); }

/* Palco sem transmissão: quadros grandes com as fotos */
.call-grid { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-content: center; }
.call-grid.n1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
.call-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.call-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; }
.call-tile.speaking { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(92, 201, 143, .55); }
.call-avatar.avatar { width: clamp(64px, 28%, 120px); height: auto; aspect-ratio: 1; border-radius: 50%; font-size: clamp(20px, 3vw, 36px); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.call-tile.speaking .call-avatar { box-shadow: 0 0 0 3px var(--ok), 0 8px 24px rgba(0, 0, 0, .45); }
.call-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); padding: 3px 9px; border-radius: 8px;
  background: rgba(2, 2, 3, .62); font-size: 13px; font-weight: 600; }
.call-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-tile .vol { position: absolute; right: 10px; bottom: 12px; width: 90px; opacity: 0; transition: opacity .15s; accent-color: var(--gold); }
.call-tile:hover .vol { opacity: 1; }
.stage-hint { text-align: center; flex: none; }

/* Janela de convites */
.invite-opts { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.invite-opts label { margin: 0; }
.invite-result:empty { display: none; }
.invite-result { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--chat); }
.copy-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.copy-row .code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-list { display: flex; flex-direction: column; gap: 4px; }
.invite-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.invite-row:hover { background: var(--hover); }
.vanity-row { align-items: center; gap: 6px; flex-wrap: wrap; }
.vanity-row input { flex: 1; min-width: 140px; }

/* Página pública do convite */
.invite-page { display: flex; min-height: 100%; padding: 16px; background: radial-gradient(80% 50% at 50% -10%, rgba(159, 179, 255, .1), transparent 70%), var(--bg); }
.invite-card { width: min(440px, 100%); margin: auto; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); overflow: hidden; }
.inv-banner { height: 72px; background: linear-gradient(120deg, #1d2540, #4a3d1c 60%, #0b0c0f); background-size: cover; background-position: center; }
.inv-banner.has-img { height: 120px; }
.inv-body { padding: 0 24px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.inv-logo { width: 72px; height: 72px; margin-top: -36px; border-radius: 18px; background: var(--panel); border: 2px solid var(--gold); object-fit: cover; padding: 6px; }
.inv-kicker { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.inv-name { margin: 0; font-family: var(--display); font-size: 26px; letter-spacing: -.02em; }
.inv-steps { width: 100%; text-align: left; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.inv-steps ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.inv-code-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.inv-download { display: block; text-align: center; text-decoration: none; }
.copy-row .code, .invite-row .code, .inv-code-row .code { font-size: 13px; padding: 6px 10px; letter-spacing: .02em; text-align: left; margin: 0; }

/* ===== Cartão de perfil v2: cor no cartão inteiro, foto à direita ===== */
.pc { --pc-accent: var(--gold); position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 15px; overflow: hidden;
  background:
    radial-gradient(120% 70% at 100% 0%, color-mix(in srgb, var(--pc-accent) 70%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--pc-accent) 42%, var(--panel)) 0%, color-mix(in srgb, var(--pc-accent) 14%, var(--panel)) 55%, var(--panel) 100%); }
.pc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc-accent) 45%, transparent); pointer-events: none; }
.pc-banner, .pc-head { display: none; }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pc-id { min-width: 0; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.pc-name { font-size: 20px; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
.pc-user { color: color-mix(in srgb, var(--ink) 75%, transparent); }
.pc-status { margin-top: 6px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.pc-ring { background: transparent; box-shadow: 0 0 0 3px var(--neon), 0 10px 26px rgba(0, 0, 0, .45); }
.pc-avatar.avatar { width: 84px; height: 84px; }
.pc-section { margin: 0; padding: 10px 12px; border-top: 0; border-radius: 10px; background: rgba(2, 2, 3, .34); border: 1px solid rgba(255, 255, 255, .06); }
.pc > div:not(.pc-top):not(.pc-section):not(.pc-actions) { display: flex; flex-direction: column; gap: 10px; }
.pc-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0; }
.pc-preview { background: transparent; border: 0; }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(#ef5a6b, #f0b232, #3ee08a, #38bdf8, #9fb3ff, #c084fc, #ef5a6b); }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }

/* Logo transparente (cavaleiro branco, sem fundo) no login, na barra de título e na página do convite */
.login-logo { width: 96px; height: 96px; border-radius: 0; box-shadow: none; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(159, 179, 255, .18)); }
.tb-logo { border-radius: 0; object-fit: contain; }
.inv-logo { border: 0; padding: 0; background: none; border-radius: 0; object-fit: contain; width: 84px; height: 84px; margin-top: -42px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55)); }
.inv-logo.server-pic { border: 2px solid var(--gold); border-radius: 18px; background: var(--panel); object-fit: cover; width: 72px; height: 72px; margin-top: -36px; filter: none; }
@media (max-height: 760px) { .login-logo { width: 64px; height: 64px; } }

/* ===== 0.8.6: diagnóstico da transmissão e sensibilidade do microfone ===== */
.screen .stats-btn { position: absolute; top: 10px; right: 52px; z-index: 3; background: rgba(2, 2, 3, .6); border-radius: 8px; padding: 4px 8px; font-size: 14px; }
.screen .stats-btn.on { box-shadow: inset 0 0 0 1px var(--gold); }
.stats-box { position: absolute; top: 46px; right: 10px; z-index: 3; width: 230px; padding: 10px 12px; border-radius: 12px; background: rgba(2, 2, 3, .82);
  border: 1px solid var(--line-strong); font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.st-title { font-weight: 700; margin-bottom: 4px; color: var(--gold); }
.st-line { display: flex; justify-content: space-between; gap: 10px; }
.st-verdict { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); line-height: 1.4; }
.mic-meter { position: relative; }
.mic-level { transition: width .05s linear; }
.mic-level.below { opacity: .35; }
.mic-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--gold); border-radius: 1px; }
.warn { margin: 2px 0 0; color: #f0b232; line-height: 1.4; }
.screen .stats-btn { right: 10px; }

/* ===== 0.8.7: fotos redondas e configurações do servidor ===== */
.avatar, .avatar img, .msg .avatar, .sf .avatar, .member .avatar, .voice-user .avatar, .pc-avatar.avatar { border-radius: 50% !important; }
.roles-split { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.role-list { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.role-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); text-align: left; font-size: 14px; }
.role-item span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-item:hover { background: var(--hover); color: var(--ink); }
.role-item.sel { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--gold); }
.role-item.add { color: var(--gold); }
.role-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); flex: none; }
.role-editor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.perm-group { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.perm-group h4 { margin: 0 0 4px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.perm-toggle { margin-top: 2px; }
.assign { display: flex; flex-direction: column; gap: 4px; }
.assign .avatar { width: 24px; height: 24px; font-size: 10px; }
.access-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--chat); display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.access-head { display: flex; align-items: center; gap: 8px; }
.access-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-head select { width: auto; }
.access-roles { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-left: 26px; }
.access-chip { margin: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.member-row:hover { background: var(--hover); }
.mr-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-row { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.server-header #btn-server-settings { flex: none; }
@media (max-width: 760px) { .roles-split { grid-template-columns: 1fr; } }
.sh-row { gap: 4px; }
.sh-row .icon-btn { padding: 5px; }
.server-name { word-break: keep-all; overflow-wrap: normal; }

/* ===== 0.8.8: ícones próprios e acabamento ===== */
.ic { display: block; flex: none; }
.icon-btn { display: inline-grid; place-items: center; min-width: 30px; min-height: 30px; padding: 6px; border-radius: 9px; line-height: 0;
  transition: background .15s, color .15s, transform .08s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: 2px solid rgba(184, 154, 78, .7); outline-offset: 1px; }

/* Painel de voz */
.voice-panel { margin: 8px; padding: 10px; gap: 10px; border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 7%, var(--chat)), var(--chat)); border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--line)); }
.vp-head { align-items: center; gap: 8px; }
.vp-signal { color: var(--ok); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--ok) 12%, transparent); }
.vp-info { flex: 1; }
.vp-where { max-width: 100%; display: block; }
.vp-actions { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.vbtn { display: grid; place-items: center; height: 38px; padding: 0; border-radius: 11px; border: 1px solid var(--line); background: var(--raised); color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, transform .08s; }
.vbtn:hover { border-color: var(--line-strong); background: var(--hover); }
.vbtn:active { transform: scale(.95); }
.vbtn.off { color: #fff; background: color-mix(in srgb, var(--danger) 70%, var(--raised)); border-color: transparent; }
.vbtn.live { background: var(--gold); color: #0a0a0c; border-color: var(--gold); }
.vbtn.hangup { color: #fff; background: #c94152; border-color: transparent; }
.vbtn.hangup:hover { background: #d84b5d; }

/* Barra de ações da mensagem: pílula flutuante */
.msg .actions { gap: 0; padding: 2px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
.msg .actions .icon-btn { min-width: 30px; min-height: 28px; padding: 5px; border-radius: 8px; }
.rq-arrow { display: inline-grid; color: var(--subtle); }

/* Coroa do dono */
.crown { display: inline-grid; color: var(--gold); margin-left: 5px; vertical-align: -2px; }
.member .name, .mr-who b { display: inline-flex; align-items: center; min-width: 0; }
.member .name > span:first-child, .mr-who b > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Menu de contexto */
.ctx-arrow, .ctx-check { display: inline-grid; place-items: center; }
.ctx-menu { border-radius: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55); }
.ctx-item { border-radius: 8px; }

/* Salas */
.channel .glyph { color: var(--subtle); }
.channel.active .glyph { color: var(--gold); }
.cat-add { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 6px; }
.vs-icon .ic { display: block; }

/* Campo de mensagem */
.composer textarea { border-radius: 14px; padding: 13px 16px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
  transition: border-color .15s, box-shadow .15s; }
.composer textarea:focus { border-color: rgba(184, 154, 78, .6); box-shadow: 0 0 0 3px rgba(184, 154, 78, .12); }

/* Palco */
.screen .fs, .screen .stats-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen .fs:hover, .screen .stats-btn:hover { background: rgba(2, 2, 3, .82); }
.screen .stats-btn { right: 52px; top: auto; bottom: 10px; }
.stats-box { top: auto; bottom: 54px; }

/* Barras de rolagem discretas */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(236, 236, 238, .1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(236, 236, 238, .2); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Modal */
.modal { border-radius: 18px; }
.modal-close { min-width: 32px; min-height: 32px; }

/* ===== 0.9.0: cor do servidor e formato do escudo ===== */
.shield.active { --sh-line: var(--shield-accent, var(--gold)); --sh-ink: var(--shield-accent, var(--gold)); }
.shield.active .sh-shape.has-img path { stroke: var(--shield-accent, var(--gold)); }
.salas .channel.active { box-shadow: inset 2px 0 0 var(--srv, var(--gold)); }
.salas .channel.active .glyph, .channel.active .glyph { color: var(--srv, var(--gold)); }
.voice-room.mine { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--srv, var(--gold)) 35%, var(--line)); }
.server-header { background: linear-gradient(180deg, color-mix(in srgb, var(--srv, var(--gold)) 7%, transparent), transparent 70%); }
.category .cat-name { transition: color .15s; }
.category:hover .cat-name { color: color-mix(in srgb, var(--srv, var(--gold)) 70%, var(--ink)); }
.shape-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.shape-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--chat); color: var(--muted); font-size: 12.5px; }
.shape-choice:hover { border-color: var(--line-strong); color: var(--ink); }
.shape-choice.sel { border-color: var(--shield-accent, var(--gold)); color: var(--ink); background: var(--raised); }
.shape-choice .shield { width: 38px; height: 42px; pointer-events: none; }
.set-pane .swatches .swatch { width: 28px; height: 28px; }
.shield .sh-label { color: inherit; text-transform: none; letter-spacing: .01em; }
/* Logo do login: tracinho embaixo do "g" e o CHAT um pouco à direita (sem encostar no g) */
.wordmark .wm-chat { gap: .6em; margin-right: -2.15em; }
.wordmark .wm-chat::before { width: 1.7em; }

/* ===== 0.9.2: leve para a placa de vídeo =====
   Nada de desfoque por cima do vídeo (era recalculado a cada quadro da transmissão)
   e o pulso do status anima só a opacidade de uma camada pronta (feito pela placa sem redesenhar). */
.screen .fs, .screen .stats-btn { backdrop-filter: none; background: rgba(2, 2, 3, .78); }
.profile[data-status="online"] .pf-ring, .profile[data-status="playing"] .pf-ring { animation: none; position: relative;
  box-shadow: 0 0 6px color-mix(in srgb, var(--neon) 45%, transparent); }
.profile[data-status="online"] .pf-ring::after, .profile[data-status="playing"] .pf-ring::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 16px color-mix(in srgb, var(--neon) 75%, transparent);
  opacity: 0; animation: skc-glow 2.6s ease-in-out infinite; will-change: opacity; }
@keyframes skc-glow { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
/* O vídeo da transmissão fica numa camada própria: o resto da página mexer não obriga a recompor a imagem. */
.screen video { will-change: transform; transform: translateZ(0); }

/* Faixa de atualização: aparece no topo, com brilho dourado */
.update-banner { position: fixed; top: 44px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px;
  max-width: min(640px, calc(100vw - 24px)); padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--raised);
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 4px rgba(184, 154, 78, .08);
  animation: ub-in .35s cubic-bezier(.2, .8, .2, 1); }
.ub-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); flex: none; box-shadow: 0 0 10px var(--gold); animation: ub-blink 1.2s ease-in-out infinite; }
.ub-text { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; }
.ub-notes { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes ub-in { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ub-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* Painel de desempenho */
.perf-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.perf-cell { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--chat); border: 1px solid var(--line); }
.perf-cell b { font-size: 18px; font-variant-numeric: tabular-nums; }
.perf-hint { margin: 4px 0; }
@media (max-width: 760px) { .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Conversas recentes */
.dm-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-align: left; }
.dm-row:hover, .dm-row.active { background: var(--hover); }
.dm-row .avatar { width: 32px; height: 32px; font-size: 11px; }
.dm-row.wide { padding: 10px 12px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 6px; }
.dm-row.wide:hover { border-color: var(--line-strong); }
.dm-row.wide .avatar { width: 40px; height: 40px; }
.dm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dm-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-last { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row.unread .dm-name, .dm-row.unread .dm-last { color: var(--ink); }
.dm-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* Janela flutuante da transmissão */
.mini-player { position: fixed; z-index: 40; width: 320px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); cursor: pointer; touch-action: none; user-select: none; }
.mini-player video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: 12.5px; opacity: 0; transition: opacity .15s; }
.mini-player:hover .mini-bar { opacity: 1; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar .icon-btn { width: 24px; height: 24px; }

/* Caixa de texto: anexar, emotes, enviar e @menção */
.composer { position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px 6px; }
.composer-row:focus-within { border-color: rgba(184, 154, 78, .6); box-shadow: 0 0 0 3px rgba(184, 154, 78, .12); }
.composer .composer-row textarea { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 9px 4px; border-radius: 0; outline: none; }
.composer .composer-row textarea:focus { box-shadow: none; }
.cmp-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.cmp-btn:hover { background: var(--hover); color: var(--ink); }
.cmp-btn.send { color: var(--gold); }
.composer.drop .composer-row { border-color: var(--gold); border-style: dashed; }
.attach-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att-chip { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 6px 6px 6px 8px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); }
.att-chip img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.att-chip .att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.att-chip.loading { color: var(--muted); font-size: 13px; padding: 10px 14px; }
.att-ico { color: var(--muted); display: grid; }
.mention-pop { position: absolute; left: 20px; right: 20px; bottom: calc(100% - 14px); z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.mention-opt { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; }
.mention-opt.sel, .mention-opt:hover { background: var(--hover); }
.mention-opt .avatar { width: 26px; height: 26px; font-size: 11px; }
.mo-name { font-weight: 600; }

/* Markdown */
.body code.md-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--raised); border: 1px solid var(--line); }
.md-pre { position: relative; margin: 6px 0; border-radius: 10px; background: #0d0f14; border: 1px solid var(--line); max-width: 100%; }
.md-pre pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; line-height: 1.5; }
.md-lang { position: absolute; top: 6px; right: 40px; font-size: 11px; color: var(--subtle); text-transform: lowercase; }
.md-copy { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; opacity: 0; }
.md-pre:hover .md-copy { opacity: 1; }
.tk-kw { color: #c792ea; } .tk-str { color: #c3e88d; } .tk-num { color: #f78c6c; } .tk-com { color: #6b7280; font-style: italic; }
.md-h { font-family: var(--display); font-weight: 700; margin: 4px 0 2px; }
.md-h1 { font-size: 1.45em; } .md-h2 { font-size: 1.25em; } .md-h3 { font-size: 1.1em; }
.md-quote { border-left: 3px solid var(--line-strong); padding-left: 10px; color: var(--muted); margin: 2px 0; }
.md-spoiler { background: var(--line-strong); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 2px; }
.md-spoiler.show { background: var(--raised); color: inherit; cursor: auto; }
.md-link { color: var(--storm); text-decoration: none; } .md-link:hover { text-decoration: underline; }
/* Anexos */
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-media { position: relative; margin: 0; max-width: min(420px, 100%); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; cursor: zoom-in; }
.att-media img, .att-media video { display: block; max-width: 100%; max-height: 320px; }
.att-media video { cursor: auto; }
.att-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.att-media:hover .att-actions, .att-file:hover .att-actions { opacity: 1; }
.att-actions .icon-btn { width: 28px; height: 28px; background: rgba(0, 0, 0, .65); border-radius: 8px; display: grid; place-items: center; color: #fff; }
.att-file { position: relative; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 10px 12px; border-radius: 10px; background: var(--raised); border: 1px solid var(--line); }
.att-file .att-actions { position: static; opacity: 1; margin-left: auto; }
.att-file .att-actions .icon-btn { background: none; color: var(--muted); }
.att-meta { display: flex; flex-direction: column; min-width: 0; } .att-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14px; }
.att-full { max-width: 100%; max-height: 75vh; display: block; margin: 0 auto; border-radius: 8px; }
/* Ignorado */
.ignored-veil { filter: blur(6px); opacity: .6; cursor: pointer; user-select: none; }
.ignored-veil.show { filter: none; opacity: 1; cursor: auto; user-select: auto; }
/* Volume da transmissão no player */
.screen-vol-box { position: absolute; left: 12px; bottom: 44px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .15s; }
.screen.big:hover .screen-vol-box { opacity: 1; }
.screen-vol { width: 120px; accent-color: var(--gold); }
/* Janela flutuante: puxador de tamanho */
.mini-player { height: auto; }
.mini-grip { position: absolute; top: 0; left: 0; width: 18px; height: 18px; z-index: 2; cursor: nwse-resize;
  background: linear-gradient(135deg, rgba(255, 255, 255, .55) 0 2px, transparent 2px 5px, rgba(255, 255, 255, .55) 5px 7px, transparent 7px); opacity: 0; }
.mini-player:hover .mini-grip { opacity: 1; }

/* Sino e conversas */
#btn-bell, #btn-dms { position: relative; }
.bell-badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; }
.bell-pop { width: 330px; }
.bell-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.bell-tabs .ptab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bell-body { display: flex; flex-direction: column; gap: 2px; }
.note-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--ink); }
.note-row:hover { background: var(--hover); }
.note-row .avatar { width: 32px; height: 32px; font-size: 11px; flex: none; }
.note-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-text b { font-weight: 600; font-size: 13.5px; } .note-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-empty { padding: 14px 8px; text-align: center; }
.note-update { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.note-update p { margin: 0; }
.slider-line { display: flex; align-items: center; gap: 10px; } .slider-line input { flex: 1; accent-color: var(--gold); }

/* Tema claro */
:root[data-theme="light"] {
  --bg: #eceef2; --panel: #ffffff; --chat: #f7f8fa; --raised: #f0f2f5; --hover: #e6e9ee;
  --line: rgba(17, 19, 24, .10); --line-strong: rgba(17, 19, 24, .20);
  --ink: #16181d; --muted: #59606b; --subtle: #8b919a;
  --gold: #94752a; --gold-soft: rgba(148, 117, 42, .14); --storm: #3d5bd9; --storm-soft: rgba(61, 91, 217, .1);
  color-scheme: light;
}
:root[data-theme="light"] .md-pre { background: #f4f5f8; }
:root[data-theme="light"] .tk-kw { color: #8a3ab9; } :root[data-theme="light"] .tk-str { color: #3d7a12; }
:root[data-theme="light"] .tk-num { color: #b5501c; } :root[data-theme="light"] .tk-com { color: #8b919a; }
:root[data-theme="light"] .mention-pop, :root[data-theme="light"] .srv-pop { box-shadow: 0 10px 30px rgba(17, 19, 24, .15); }
:root[data-theme="light"] .msg .body, :root[data-theme="light"] .md-pre pre { color: var(--ink); }
:root[data-theme="light"] .wordmark .knight { color: var(--ink); }
:root[data-theme="light"] .ctx-item.danger { color: #c62f40; }

/* Atualização obrigatória: cobre tudo, acima de modais e faixas */
.mandatory-update { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 8, 12, .92); backdrop-filter: blur(6px); }
.mu-card { width: min(420px, 100%); text-align: center; display: grid; gap: 12px; justify-items: center;
  padding: 28px 24px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.mu-card h2, .mu-card p { margin: 0; }
.mu-logo { width: 56px; height: 56px; }
.mu-notes { white-space: pre-wrap; font-size: 14px; }

/* Editar a mensagem ali mesmo */
.edit-box { display: grid; gap: 6px; margin-top: 2px; }
.edit-box textarea { width: 100%; resize: none; min-height: 38px; max-height: 300px; padding: 8px 10px; border-radius: 8px;
  font: inherit; line-height: 1.4; color: var(--ink); background: var(--raised); border: 1px solid var(--line-strong); }
.edit-box textarea:focus { outline: none; border-color: var(--gold); }
.edit-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.edit-actions { display: flex; gap: 6px; }

/* Condecorações no perfil */
.honors { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.honors li { display: flex; align-items: center; gap: 10px; }
.honors li > .verified, .honors li > .knight-badge, .honors li > .ai-badge { margin: 0; }
.honor-text { display: grid; gap: 1px; font-size: 13px; }

/* Selo "IA": pílula com faísca, nas contas da Claude */
.ai-badge { display: inline-flex; align-items: center; gap: 2px; height: 15px; padding: 0 5px 0 3px; margin: 0 4px; border-radius: 4px;
  vertical-align: 1px; flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 1;
  color: #fff; background: linear-gradient(135deg, #d97757, #7c8cf0); }
.ai-badge svg { width: 10px; height: 10px; display: block; }
.ai-badge.big { height: 19px; font-size: 12px; padding: 0 6px 0 4px; margin-left: 6px; vertical-align: 2px; }
.ai-badge.big svg { width: 12px; height: 12px; }

/* Selo oficial: cavaleiro dourado com brilho passando de vez em quando */
.verified, .knight-badge { position: relative; display: inline-block; width: 17px; height: 17px; margin: 0 4px; vertical-align: -3px; flex: none; }
.verified { overflow: hidden; -webkit-mask: url(brand/knight-white.png) center / contain no-repeat; mask: url(brand/knight-white.png) center / contain no-repeat; }
.verified { background: linear-gradient(180deg, #f4dc8b, #c9a24a 55%, #8a6a24); }
.verified::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: skc-shine 4.5s ease-in-out infinite; }
@keyframes skc-shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }
.reduce-motion .verified::after { animation: none; display: none; }
.verified.big, .knight-badge.big { width: 23px; height: 23px; vertical-align: -4px; margin-left: 6px; }
/* Knight: espada azul com um brilho suave */
.knight-badge svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 2px rgba(91, 156, 255, .55)); }

/* Botão de destacar a transmissão numa janela (fica ao lado do tela cheia) */
.screen .pop-btn { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen.big .pop-btn { right: 52px; }
.screen .pop-btn:hover { background: rgba(2, 2, 3, .85); color: var(--gold); }

/* Confirmação com o visual do app (no lugar do confirm() do sistema) */
.confirm-box { width: min(420px, calc(100vw - 32px)); }
.confirm-box .modal-body { gap: 18px; padding: 22px 22px 18px; }
.confirm-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14.5px; }
.danger.solid { background: #d9434f; border-color: #d9434f; color: #fff; font-weight: 600; }
.danger.solid:hover { background: #e5525e; }

/* Ausência (AFK) na sala de voz: etiqueta dourada com o tempo */
.afk-tag { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 55%; padding: 1px 6px; border-radius: 6px; flex: none;
  font-size: 11px; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(201, 162, 74, .35); }
.afk-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afk-timer { font-variant-numeric: tabular-nums; opacity: .8; white-space: nowrap; }

/* Busca rápida (Ctrl+K) */
.quick-search { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.qs-box { display: flex; flex-direction: column; max-height: min(560px, 70vh); }
.qs-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.qs-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.qs-results { overflow-y: auto; padding: 6px; }
.qs-group { padding: 10px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.qs-item.sel { background: var(--raised); box-shadow: inset 2px 0 0 var(--gold); }
.qs-lead { display: grid; place-items: center; width: 28px; color: var(--muted); flex: none; }
.qs-av { width: 28px !important; height: 28px !important; flex: none; }
.qs-main { display: grid; min-width: 0; gap: 1px; }
.qs-title, .qs-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-empty { padding: 14px 10px; margin: 0; }
.qs-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }

/* Submenu: abre pelo JS (classe .open), com uma ponte invisível cobrindo a folga até ele */
.has-sub.open > .ctx-menu { display: flex; }
.has-sub > .ctx-menu::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; width: 10px; }
.ctx-menu.flip .has-sub > .ctx-menu::before { left: auto; right: -10px; }

/* Sala em que você está: neon em L (borda esquerda inteira e o topo até a metade), com brilho borrado */
/* Na cor do servidor (o vermelho do StormKnight), a mesma da marquinha do canal selecionado. */
.voice-room.mine { --neon: var(--srv, #ffd56a); }
.voice-room.mine::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 10px; pointer-events: none;
  background:
    linear-gradient(90deg, var(--neon), transparent 55%) top left / 100% 3px no-repeat,
    linear-gradient(180deg, var(--neon), color-mix(in srgb, var(--neon) 20%, transparent)) top left / 3px 100% no-repeat;
  animation: skc-room-glow 3.6s ease-in-out infinite;
  filter: drop-shadow(0 0 3px var(--neon)) drop-shadow(0 0 9px color-mix(in srgb, var(--neon) 55%, transparent)); }

/* Ainda não assistindo: cartão "Assistir" no lugar do vídeo */
.screen.watch-card { display: grid; place-items: center; cursor: pointer; aspect-ratio: 16 / 9;
  background: radial-gradient(circle at 50% 40%, rgba(255, 77, 94, .14), transparent 60%), #0b0b10; }
.watch-inner { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 12px; }
.watch-name { font-size: 16px; }
.screen.watch-card:not(.big) .watch-inner { gap: 6px; }
.screen.watch-card:not(.big) .watch-name { font-size: 13px; }
.screen.watch-card:hover { box-shadow: inset 0 0 0 1px rgba(255, 77, 94, .5); }
.screen .unwatch-btn { position: absolute; right: 94px; bottom: 10px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border-radius: 10px; background: rgba(2, 2, 3, .62); color: var(--ink); backdrop-filter: blur(4px); }
.screen.big:not(:has(.pop-btn)) .unwatch-btn { right: 52px; }

/* Ausência: texto longo desliza */
.afk-label.slide { max-width: 92px; -webkit-mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); }
.afk-track { display: inline-flex; gap: 24px; animation: skc-afk-slide 9s linear infinite; }
@keyframes skc-afk-slide { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 12px)); } }
.afk-tag:hover .afk-track { animation-play-state: paused; }
.reduce-motion .afk-track { animation: none; }
@media (prefers-reduced-motion: reduce) { .afk-track { animation: none; } }

/* Mutado / som desligado na sala: um chip só, com o desenho inteiro */
.vs-chip { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 6px;
  color: #ff7b86; background: rgba(229, 72, 89, .16); border: 1px solid rgba(229, 72, 89, .35); }
.vs-chip .ic { display: block; }

/* Sala em que você está: o L é uma borda só (esquerda + topo) que faz a curva no canto e some aos poucos,
   para a direita e para baixo. Sem a barrinha do canal selecionado por cima, que deixava um degrau. */
.voice-room.mine .channel, .salas .voice-room.mine .channel.active { box-shadow: none; background: transparent; }
.voice-room.mine::before { background: none; border-left: 3px solid var(--neon); border-top: 3px solid var(--neon); border-radius: 10px 0 0 0;
  -webkit-mask: linear-gradient(90deg, #000 30%, transparent 62%), linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 100%);
  -webkit-mask-composite: source-in; mask: linear-gradient(90deg, #000 30%, transparent 62%), linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .3) 100%);
  mask-composite: intersect; }

/* Sala em que você está, mas com um chat aberto: sem neon nem fundo, só o ícone verde de conectado.
   O destaque forte fica para quando você está vendo a sala (.viewing). */
.voice-room.mine:not(.viewing) { background: transparent; box-shadow: none; animation: none; }
.voice-room.mine:not(.viewing)::before { display: none; }
.voice-room.mine:not(.viewing) .channel .ch-name { font-weight: 500; }
/* O cinza do hover de cada pessoa fica dentro da caixa da sala, sem cobrir o contorno. */
.voice-room { overflow: hidden; }
.salas .voice-room .voice-user { margin-right: 6px; }

/* Atalhos de teclado nas configurações */
.hk-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hk-btn { min-width: 180px; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }
.hk-btn.empty { color: var(--muted); font-weight: 500; }
.hk-btn.listening { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* Atualização rápida (patch da interface) pronta, esperando a pessoa sair da call */
.update-banner.patch .ub-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(59, 201, 104, .2); }

/* ===== Patch p1 ===== */
/* Lateral direita (servidores e salas) um pouco mais larga: cabe mais informação */
.app { grid-template-columns: minmax(0, 1fr) 0px 284px; }
.app.members-open { grid-template-columns: minmax(0, 1fr) 240px 284px; }
.app.members-open.no-server { grid-template-columns: minmax(0, 1fr) 0px 284px; }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr) 0px 256px; }
  .app.members-open { grid-template-columns: minmax(0, 1fr) 216px 256px; }
}
@media (max-width: 900px) { .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 220px; } }
@media (max-width: 640px) { .app, .app.members-open { grid-template-columns: minmax(0, 1fr) 0px 180px; } }

/* Na sala: o que muda fica à direita, cinza, sem empurrar foto e nome */
.voice-user .name { flex: 1; min-width: 0; }
.vs-end { display: inline-grid; place-items: center; flex: none; color: var(--muted); opacity: .85; }
.vs-end .ic { display: block; }
/* Falando: o anel verde acende e apaga na hora */
.voice-user .avatar { transition: box-shadow 60ms linear; }
.voice-user.speaking .name { color: var(--ink); }

/* Ao vivo (Neto): nome vermelho vivo num fundo levemente avermelhado, com um brilho branco
   varrendo da esquerda para a direita, como um letreiro "AO VIVO" */
.voice-user.is-live { background: linear-gradient(90deg, rgba(255, 60, 80, .14), rgba(255, 60, 80, .04)); border-radius: 6px; }
.voice-user.is-live .name {
  background: linear-gradient(100deg, #ff3b4f 0%, #ff3b4f 42%, #ffffff 50%, #ff3b4f 58%, #ff3b4f 100%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: skc-live-sweep 2.4s ease-in-out infinite; }
@keyframes skc-live-sweep { 0% { background-position: 100% 0; } 70%, 100% { background-position: -60% 0; } }
.reduce-motion .voice-user.is-live .name { animation: none; }
@media (prefers-reduced-motion: reduce) { .voice-user.is-live .name { animation: none; } }

/* Escudo próprio ("Só a imagem"): sem moldura; aberto, ganha um brilho na cor do servidor */
.shield .sh-shape.free { overflow: visible; }
.shield.active .sh-shape.free { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--shield-accent, var(--gold)) 70%, transparent)); }
.shape-choices { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ===== Tela de carregamento: preta, cavaleiro em fade, névoa (identidade do stormknight.com.br) ===== */
.splash { position: fixed; inset: 0; z-index: 10000; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: #000; overflow: hidden; transition: opacity .7s ease; }
.splash.in { animation: sp-in .35s ease both; }
.splash.out { opacity: 0; pointer-events: none; }
.sp-knight { width: 112px; height: auto; opacity: 0; animation: sp-knight 2.4s ease-in-out .1s infinite; user-select: none; }
.sp-word { font-family: var(--display); font-weight: 600; font-size: 22px; letter-spacing: .55em; margin-right: -.55em; color: #d9d9d9;
  opacity: 0; animation: sp-rise .9s ease .25s forwards; }
.sp-tag { font-size: 10px; letter-spacing: .5em; margin-right: -.5em; color: #6f6f6f; opacity: 0; animation: sp-rise .9s ease .45s forwards; }
@keyframes sp-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-knight { 0% { opacity: .15; transform: scale(.98); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); }
  50% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 18px rgba(255,255,255,.25)); }
  100% { opacity: .15; transform: scale(.98); filter: drop-shadow(0 0 0 rgba(255,255,255,0)); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.reduce-motion .sp-knight, .reduce-motion .sp-word, .reduce-motion .sp-tag { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .sp-knight, .sp-word, .sp-tag { animation: none; opacity: 1; } }

/* Novidades no sino: o que cada atualização trouxe */
.bell-pop .bell-body { max-height: min(70vh, 520px); overflow-y: auto; }
.novidades { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.novidades h4 { margin: 0 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); }
.nov-item { padding: 8px 6px; border-radius: 8px; }
.nov-item.top { background: var(--hover); }
.nov-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.nov-item ul { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.nov-item li + li { margin-top: 2px; }

/* Novidades dentro dos ajustes: sem a linha de cima do sino */
.set-pane .novidades { margin-top: 4px; padding-top: 0; border-top: 0; }
.set-pane .nov-item { padding: 10px 12px; border: 1px solid var(--line); margin-bottom: 8px; }
.set-pane .nov-item ul { font-size: 13.5px; }

/* Botão "Parar transmissão": a regra genérica .live (selo AO VIVO) encolhia o botão e o empurrava para a direita */
.vbtn.live { margin-left: 0; padding: 0; border-radius: 11px; font-size: inherit; letter-spacing: normal; }

/* Mensagem de voz: botão gravando, contador e player no chat */
.cmp-btn.recording { color: #fff; background: #c94152; border-radius: 10px; animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { box-shadow: 0 0 0 4px rgba(201, 65, 82, .25); } }
.rec-label { align-self: center; font-size: 12px; font-weight: 600; color: #ff6b6b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.att-voice { display: flex; align-items: center; gap: 8px; max-width: min(420px, 100%); padding: 6px 8px 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.att-voice .av-ico { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--gold); color: #0a0a0c; }
.att-voice audio { flex: 1; min-width: 0; height: 34px; }
.att-voice .att-actions { position: static; opacity: 1; display: flex; gap: 2px; }
.reduce-motion .cmp-btn.recording { animation: none; }

/* Seletor com várias telas: marcadas ganham borda e o número da ordem */
.pick { position: relative; }
.pick.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft, rgba(184,154,78,.25)); }
.pick-n { position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #0a0a0c; font-weight: 700; font-size: 13px; }

/* ===== Privado encaixado no vão dos membros ===== */
.dm-dock { display: none; }
.app.dock-open .members-col > .col-head, .app.dock-open .members-col > .members { display: none; }
.app.dock-open .members-col > .dm-dock { display: flex; flex-direction: column; height: 100%; min-height: 0; opacity: 1; }
.app.members-open.dock-open, .app.members-open.dock-open.no-server { grid-template-columns: minmax(0, 1fr) 300px 284px; }
@media (max-width: 1100px) { .app.members-open.dock-open { grid-template-columns: minmax(0, 1fr) 270px 256px; } }
.dd-head { gap: 6px; padding: 0 6px 0 12px; }
.dd-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dd-who .avatar { width: 26px; height: 26px; flex: none; }
.dd-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-actions { display: flex; gap: 2px; flex: none; }
.dd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.dd-msg { display: flex; flex-direction: column; gap: 2px; max-width: 100%; }
.dd-meta { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.dd-msg.mine .dd-meta b { color: var(--gold); }
.dd-body { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.dd-msg .att-media, .dd-msg .att-voice, .dd-msg .att-file { max-width: 100%; }
.dd-empty { margin: auto; text-align: center; }
.dd-composer { display: flex; align-items: flex-end; gap: 4px; margin: 8px; padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); }
.dd-composer:focus-within { border-color: rgba(184, 154, 78, .6); }
.dd-composer textarea { flex: 1; min-height: 34px; max-height: 120px; resize: none; border: 0; background: transparent; box-shadow: none; padding: 7px 4px; outline: none; color: var(--ink); font: inherit; font-size: 13.5px; }
.dock-btn { position: relative; }
.dock-btn.on { color: var(--gold); }
.dock-btn .badge { position: absolute; top: -4px; right: -6px; height: 15px; min-width: 15px; font-size: 9.5px; padding: 0 4px; }

/* Seis formatos de escudo: grade de 3 por linha */
.shape-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Várias telas: ⚙ e ✕ no lugar do botão de transmitir, lista de telas e duas telas grandes lado a lado */
.vbtn-split { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.vbtn-split .vbtn { min-width: 0; }
.scr-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.scr-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--chat); }
.scr-row .pick-n { position: static; flex: none; }
.scr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.stage-duo > .screen.big { min-width: 0; }
.screen .side-btn, .screen .unfocus-btn { position: absolute; top: 6px; right: 6px; z-index: 2; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transition: opacity .15s; }
.screen:hover .side-btn, .screen:hover .unfocus-btn { opacity: 1; }
.screen .unfocus-btn { right: auto; left: 6px; }
.thumbs .screen-label span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ⚙ e ✕ do painel de voz: uma peça só, dividida ao meio. Engrenagem amarela, X vermelho;
   a metade com o mouse em cima cresce e a outra encolhe. */
.vbtn-split { display: flex; gap: 0; height: 38px; border-radius: 11px; overflow: hidden; }
.vbtn-split .vbtn, .vbtn-split .vbtn.live { flex: 1 1 0; min-width: 0; height: 100%; border: 0; border-radius: 0; transition: flex-grow .2s ease, filter .15s; }
.vbtn-split .vbtn:first-child { background: #e0b43a; color: #1a1408; }
.vbtn-split .vbtn:last-child { background: #e0303f; color: #fff; box-shadow: inset 1px 0 0 rgba(0, 0, 0, .35); }
.vbtn-split .vbtn:hover { flex-grow: 2.2; filter: brightness(1.08); }
.vbtn-split .vbtn .ic { transition: transform .2s ease; }
.vbtn-split .vbtn:hover .ic { transform: scale(1.15); }
.vbtn-split .vbtn:active { transform: none; filter: brightness(.95); }
.reduce-motion .vbtn-split .vbtn, .reduce-motion .vbtn-split .vbtn .ic { transition: none; }

/* Tela de atualização: a mesma da de carregamento, com a barra dourada de progresso */
.update-screen { z-index: 10001; }
.update-screen .sp-knight { animation-duration: 1.8s; }
.us-bar { width: min(320px, 70vw); height: 4px; margin-top: 18px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.us-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8a7238, #e0c070); box-shadow: 0 0 10px rgba(224, 192, 112, .5); transition: width .25s ease; }
.us-text { font-size: 12px; letter-spacing: .08em; color: #8a8a8a; font-variant-numeric: tabular-nums; }

/* "Sem escudo": sem contorno e sem a cor do servidor (iniciais em cinza; foto como é, sem brilho) */
.shield:has(.sh-shape.none), .shield.active:has(.sh-shape.none) { --sh-ink: var(--muted); color: var(--muted); }
.shield:has(.sh-shape.none):hover { --sh-ink: var(--ink); color: var(--ink); }
.shape-choices { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.shield.active .sh-shape.plain { filter: none; }

/* Arrastar salas: a que está sendo levada fica apagada; a linha dourada mostra onde vai cair */
.channel[draggable="true"], .category[draggable="true"] { -webkit-user-drag: element; }
.dragging { opacity: .45; }
.drop-before { box-shadow: inset 0 2px 0 var(--gold) !important; }
.drop-after { box-shadow: inset 0 -2px 0 var(--gold) !important; }
.drop-into { outline: 1px dashed var(--gold); outline-offset: -1px; border-radius: 6px; }
/* Ajustes › Aplicativo: versão em dia ou não */
.ver-check.ok { color: var(--ok); }
.ver-check.bad { color: #ff8a65; }

/* Condecorações embaixo da foto, na coluna da esquerda da mensagem */
.msg-side { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 38px; }
.msg-honors { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.msg-honors:empty { display: none; }
.msg-honors > * { margin: 0 !important; transform: scale(.9); }

/* Volume em barra dentro do menu do botão direito */
.ctx-slider { padding: 6px 10px 8px; min-width: 200px; }
.ctx-slider-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.ctx-slider-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.ctx-slider input[type="range"] { width: 100%; }

/* Interface invertida: servidor e salas à esquerda, chat à direita (a ordem das colunas vira) */
.app.mirrored { direction: rtl; }
.app.mirrored > * { direction: ltr; }
.app.mirrored .sidebar.salas { border-left: 0; border-right: 1px solid var(--line); }
.app.mirrored .members-col { border-left: 0; border-right: 1px solid var(--line); }
.mirror-btn { opacity: .45; width: 24px; height: 24px; }
.mirror-btn:hover, .app.mirrored .mirror-btn { opacity: 1; }
.crop .small-btn { margin-top: 6px; }

/* Webcam: botão no painel (5 botões agora) e o vídeo no lugar da foto, no palco */
.vp-actions { grid-template-columns: repeat(5, 1fr); }
.vbtn.cam-on { background: var(--ok); color: #06140b; border-color: transparent; }
.call-tile.has-cam { padding: 0; overflow: hidden; }
.cam-face { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; background: #000; }
.cam-face video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-face video.self-cam { transform: scaleX(-1); }
.call-tile.has-cam .call-name { position: absolute; left: 10px; bottom: 10px; z-index: 1; background: rgba(0, 0, 0, .55); padding: 3px 8px; border-radius: 8px; }
.call-tile.has-cam.speaking .cam-face { box-shadow: inset 0 0 0 3px var(--ok); }
.cam-face.small { position: relative; width: 88px; height: 88px; border-radius: 50%; }
.person.speaking .cam-face.small { box-shadow: 0 0 0 3px var(--ok); }

/* ===== Clãs (casinha): a interface dá lugar à página de servidores ===== */
.app.hub-open > :not(.topbar):not(#hub) { display: none !important; }
.hub { grid-column: 1 / -1; grid-row: 2; overflow-y: auto; background: var(--chat); }
.hub.hidden { display: none; }
.hub-inner { max-width: 1100px; margin: 0 auto; padding: 24px 28px 48px; }
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.hub-head h2 { margin: 0 0 4px; font-family: var(--display); font-size: 28px; letter-spacing: .02em; }
.hub-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-actions .badge { margin-left: 6px; }
.hub-decks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.hub-decks-label { text-transform: uppercase; letter-spacing: .14em; margin-right: 4px; }
.hub-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font-size: 13px; }
.hub-chip:hover { color: var(--ink); border-color: var(--muted); }
.hub-chip.on { background: var(--gold); border-color: var(--gold); color: #0a0a0c; font-weight: 600; }
.hub-deck-hint { margin: 0 0 6px; }
.hub-folder { margin-top: 18px; }
.hub-folder-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.hub-folder-head h3 { margin: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--subtle); }
.hub-fold { display: grid; place-items: center; width: 22px; height: 22px; border: 0; background: none; color: var(--muted); border-radius: 6px; transition: transform .15s; }
.hub-fold.closed { transform: rotate(-90deg); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hub-card { position: relative; display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); text-align: left; overflow: hidden; transition: transform .15s, border-color .15s; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.hub-card.current { border-color: var(--gold); }
.hc-banner { height: 76px; background-size: cover; background-position: center; }
.hc-body { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; margin-top: -20px; }
.hc-body .shield { width: 40px; height: 44px; flex: none; }
.hc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; padding-top: 18px; }
.hc-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-body .badge { align-self: flex-end; }
/* Selo de servidor oficial (cartão do clã e banner do servidor) */
.srv-official { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 5px; border-radius: 999px;
  background: linear-gradient(135deg, #f3d77a, #b8902e); color: #1a1408; font-size: 10px; font-weight: 800; letter-spacing: .12em; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.srv-official .so-knight { width: 14px; height: 14px; background: #1a1408; -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.server-banner { position: relative; }
.srv-official.big { top: 8px; right: 8px; }
/* Casinha vira setinha de voltar */
.home-btn .home-back { position: absolute; inset: 0; margin: auto; opacity: 0; transform: rotate(-90deg) scale(.6); transition: opacity .2s, transform .2s; }
.home-btn > svg:first-child { transition: opacity .2s, transform .2s; }
.home-btn.back > svg:first-child { opacity: 0; transform: scale(.4) rotate(45deg); }
.home-btn.back .home-back { opacity: 1; transform: none; }
.home-btn { position: relative; }

/* Setinha de inverter: uma abinha discreta no meio da borda interna da coluna de salas */
.salas .mirror-btn { position: absolute; top: 50%; left: 0; z-index: 3; width: 16px; height: 44px; margin-top: -22px; padding: 0;
  border-radius: 0 8px 8px 0; background: var(--panel); border: 1px solid var(--line); border-left: 0; opacity: .35; }
.salas .mirror-btn:hover { opacity: 1; }
.app.mirrored .salas .mirror-btn { left: auto; right: 0; border-radius: 8px 0 0 8px; border-left: 1px solid var(--line); border-right: 0; opacity: .6; }

/* Salas de voz ao contrário das de texto: nome e ícone à direita, tempo à esquerda (e as pessoas também) */
.salas .voice-room > .channel { flex-direction: row-reverse; }
.salas .voice-room > .channel .ch-name { text-align: right; }
.salas .voice-room > .channel .vc-timer { margin-left: 0; margin-right: auto; }
.salas .voice-room .voice-user { flex-direction: row-reverse; margin: 0 26px 2px 6px; }
.salas .voice-room .voice-user .name { text-align: right; }
.salas .voice-room .room-status { display: flex; justify-content: flex-end; text-align: right; }
/* Interface invertida: tudo vira, para o lado certo (texto à direita, voz à esquerda) */
.app.mirrored .salas .channel { flex-direction: row-reverse; }
.app.mirrored .salas .channel .ch-name { text-align: right; }
.app.mirrored .salas .voice-room > .channel { flex-direction: row; }
.app.mirrored .salas .voice-room > .channel .ch-name { text-align: left; }
.app.mirrored .salas .voice-room > .channel .vc-timer { margin-right: 0; margin-left: auto; }
.app.mirrored .salas .voice-room .voice-user { flex-direction: row; margin: 0 6px 2px 26px; }
.app.mirrored .salas .voice-room .voice-user .name { text-align: left; }
.app.mirrored .salas .voice-room .room-status { justify-content: flex-start; text-align: left; }

/* ===== Modo claro mais suave: cinza claro em vez de branco estourado ===== */
:root[data-theme="light"] {
  --bg: #d9dce2; --panel: #e6e8ec; --chat: #eceef1; --raised: #dfe2e7; --hover: #d3d7de;
  --line: rgba(17, 19, 24, .12); --line-strong: rgba(17, 19, 24, .22);
  --ink: #1b1d22; --muted: #555b65; --subtle: #7d838d;
}
:root[data-theme="light"] .md-pre { background: #e1e4e9; }
/* Cavaleiro do logo: branco no escuro, escuro no claro (a tela de carregamento é sempre preta) */
:root[data-theme="light"] .tb-logo, :root[data-theme="light"] .login-logo, :root[data-theme="light"] .mu-logo { filter: invert(1) brightness(.25); }
/* Emote :cavaleiro: (pega a cor do texto) */
.emo { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.28em; background: currentColor; }
.emo-knight { -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.ctx-emoji .emo { width: 22px; height: 22px; vertical-align: middle; color: var(--ink); }
/* No claro o fundo desses botões é escuro (cor do texto): o texto deles fica claro */
:root[data-theme="light"] .primary, :root[data-theme="light"] .ptab.sel, :root[data-theme="light"] .rail-btn.active { color: #f3f4f6; }

/* ===== A cara do StormKnight (material do site) ===== */
/* Login: vídeo do cavaleiro bem apagado, névoa correndo e o lema */
.login { position: relative; isolation: isolate; }
.login-motto { margin: 6px 0 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* Clãs: cabeçalho com cena */
.hub-head { position: relative; isolation: isolate; padding: 36px 24px 20px; margin: -24px -28px 14px; overflow: hidden; border-radius: 0 0 18px 18px; align-items: flex-end; }
.hub-kicker { display: block; font-size: 10.5px; letter-spacing: .3em; color: var(--gold); margin-bottom: 4px; }
.hub-title h2 { text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
/* Sobre a StormKnight */
.about-sk { display: block; }
.about-sk p { margin: 0 0 8px; line-height: 1.5; }
.about-sk-motto { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* Servidor oficial: cavaleiro no escudo (cor do tema) e brilho deslizando, como o selo do dono */
.shield .sh-knight { position: relative; width: 62%; height: 62%; margin-top: -3px; overflow: hidden; background: var(--ink);
  -webkit-mask: url(/brand/knight-white.png) center / contain no-repeat; mask: url(/brand/knight-white.png) center / contain no-repeat; }
.shield.active .sh-knight { background: linear-gradient(180deg, #f4dc8b, #c9a24a 55%, #8a6a24); }
.shield .sh-knight::after, .srv-official::after { content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); animation: skc-shine 4.5s ease-in-out infinite; }
.srv-official { overflow: hidden; }
.reduce-motion .shield .sh-knight::after, .reduce-motion .srv-official::after { animation: none; display: none; }

/* ===== Modo claro: sombras para dar relevo (antes ficava tudo chapado) ===== */
:root[data-theme="light"] .topbar { box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(20, 24, 32, .06); position: relative; z-index: 2; }
:root[data-theme="light"] .salas, :root[data-theme="light"] .members-col { box-shadow: -6px 0 18px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .app.mirrored .salas { box-shadow: 6px 0 18px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .salas .channel.active, :root[data-theme="light"] .voice-room.viewing { box-shadow: 0 1px 3px rgba(20, 24, 32, .12), inset 2px 0 0 var(--gold); }
:root[data-theme="light"] .composer-row { box-shadow: 0 2px 10px rgba(20, 24, 32, .08); }
:root[data-theme="light"] .msg:hover { background: rgba(20, 24, 32, .035); }
:root[data-theme="light"] .hub-card, :root[data-theme="light"] .call-tile, :root[data-theme="light"] .screen, :root[data-theme="light"] .set-section,
:root[data-theme="light"] .vbtn, :root[data-theme="light"] .att-file, :root[data-theme="light"] .att-voice { box-shadow: 0 1px 2px rgba(20, 24, 32, .08), 0 4px 14px rgba(20, 24, 32, .06); }
:root[data-theme="light"] .hub-card:hover { box-shadow: 0 6px 22px rgba(20, 24, 32, .14); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .ctx-menu, :root[data-theme="light"] .pc-pop, :root[data-theme="light"] .bell-pop { box-shadow: 0 18px 50px rgba(20, 24, 32, .22); }
:root[data-theme="light"] .ctx-menu { background: #eef0f3; }
:root[data-theme="light"] input, :root[data-theme="light"] textarea, :root[data-theme="light"] select { box-shadow: inset 0 1px 2px rgba(20, 24, 32, .08); }

/* Janelas respeitam o zoom da interface (--uiz): nada de encostar no topo e no fim da tela */
.modal { width: min(660px, calc(100vw / var(--uiz, 1) - 32px)); max-height: calc(100vh / var(--uiz, 1) - 48px); }
.modal.wide { width: min(980px, calc(100vw / var(--uiz, 1) - 32px)); }
.modal-inner { max-height: calc(100vh / var(--uiz, 1) - 48px); }
.srv-pop { max-height: min(460px, calc(100vh / var(--uiz, 1) - 90px)); }
.pc-pop { max-height: calc(100vh / var(--uiz, 1) - 16px); }
.confirm-box { width: min(420px, calc(100vw / var(--uiz, 1) - 32px)); }
.quick-search { width: min(620px, calc(100vw / var(--uiz, 1) - 32px)); }
/* Configurações: altura fixa dentro da tela; a lista da esquerda e o conteúdo rolam cada um por si (pedido do Mello) */
.settings { height: min(640px, calc(100vh / var(--uiz, 1) - 150px)); min-height: 0; }
.set-nav, .set-pane { min-height: 0; overflow-y: auto; }
/* Imagem aberta: clique amplia 2x onde clicou (cursor de lupa), mexer o mouse passeia */
.att-zoom { overflow: hidden; display: grid; place-items: center; border-radius: 10px; background: #000; cursor: zoom-in;
  max-height: calc(100vh / var(--uiz, 1) - 190px); }
.att-zoom .att-full { max-width: 100%; max-height: calc(100vh / var(--uiz, 1) - 190px); object-fit: contain; transition: transform .2s ease; user-select: none; }
.att-zoom.zoomed { cursor: zoom-out; }
.att-zoom.zoomed .att-full { transform: scale(2); }
.att-full-actions { margin-top: 10px; gap: 8px; align-items: center; }
.att-full-actions .muted { margin-right: auto; }
.att-full-actions .small-btn { display: inline-flex; align-items: center; gap: 6px; }
.reduce-motion .att-zoom .att-full { transition: none; }

/* Links de convite: abrem dentro do app */
.md-invite { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.md-invite svg { flex: none; }
.invite-open-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.invite-open-head .shield { width: 52px; height: 58px; flex: none; cursor: default; }
.invite-open-name { font-size: 17px; }
.invite-open-head p { margin: 2px 0 0; }

/* Mensagem de voz: caixinha "Permitir baixar" no anexo antes de enviar */
.att-dl-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.att-dl-opt input { margin: 0; width: auto; }

/* Arrastar arquivo: a barra de envio cresce e avisa onde soltar */
.composer-row { transition: min-height .18s ease, background-color .18s ease, border-color .18s ease; }
.composer.drop .composer-row { min-height: 112px; align-items: center; background: color-mix(in srgb, var(--gold) 9%, var(--panel)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 14%, transparent); }
.composer.drop .composer-row > * { opacity: .2; pointer-events: none; }
.composer.drop::after { content: 'Solte para anexar'; position: absolute; left: 20px; right: 20px; bottom: 20px; height: 112px; display: grid; place-items: center;
  color: var(--gold); font-weight: 600; font-size: 15px; letter-spacing: .02em; pointer-events: none; }
/* Música no chat */
.att-music { display: flex; align-items: center; gap: 10px; width: min(420px, 100%); padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); position: relative; }
.att-music .am-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }
.att-music .am-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.att-music .am-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-music audio { width: 100%; height: 32px; }
.att-music .att-actions { position: static; opacity: 1; display: flex; gap: 2px; align-self: flex-start; }
.att-chip:has(.att-dl-opt) { max-width: 380px; }
.att-chip .muted.small { white-space: nowrap; }

/* Logo StormKnight Chat no lugar do nome do servidor oficial */
.sn-wm { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; font-family: var(--display); padding: 2px 0; }
.sn-wm .storm { font-weight: 600; font-size: 8.5px; letter-spacing: .55em; color: var(--muted); text-transform: uppercase; margin-left: 2px; }
.sn-wm .knight { font-weight: 700; font-size: 24px; letter-spacing: -.045em; margin: 2px 0 1px; color: var(--ink); }
.sn-wm .wm-chat { align-self: flex-end; display: flex; align-items: center; gap: .6em; margin-right: -.55em; font-weight: 600; font-size: 8.5px; letter-spacing: .55em; color: var(--gold); text-transform: uppercase; }
.sn-wm .wm-chat::before { content: ""; width: 18px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }

/* ===== Fontes do nome do servidor (todas livres, licença OFL; ficam no app, nada vem de fora) ===== */
@font-face { font-family: "Cinzel"; font-weight: 700; font-display: swap; src: url(/fonts/cinzel-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Orbitron"; font-weight: 700; font-display: swap; src: url(/fonts/orbitron-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url(/fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Oxanium"; font-weight: 700; font-display: swap; src: url(/fonts/oxanium-latin-700-normal.woff2) format("woff2"); }
.server-name.nf-espacada { text-transform: uppercase; font-weight: 600; font-size: 12.5px; letter-spacing: .18em; }
.server-name.nf-cinzel { font-family: "Cinzel", serif; font-weight: 700; font-size: 16px; letter-spacing: .03em; }
.server-name.nf-orbitron { font-family: "Orbitron", sans-serif; font-weight: 700; font-size: 13.5px; letter-spacing: .06em; }
.server-name.nf-bebas { font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 21px; letter-spacing: .05em; }
.server-name.nf-oxanium { font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 16px; }
.sn-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Escolha da fonte nas configurações */
.font-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.font-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; min-width: 0; }
.font-choice:hover { border-color: var(--line-strong); }
.font-choice.sel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.font-choice .fc-sample { padding: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; }
.font-choice .fc-label { font-size: 11.5px; color: var(--muted); }
/* Servidor oficial: o brilho sai do cavaleiro e desliza pelas letras só quando o mouse entra */
.sh-row.sk-official .server-icon .sh-knight::after { animation: none; left: -60%; }
.sh-row.sk-official:hover .server-icon .sh-knight::after { animation: skc-hover-shine .55s ease-out 1 forwards; }
@keyframes skc-hover-shine { from { left: -60%; } to { left: 130%; } }
.sh-row.sk-official .sn-text, .sh-row.sk-official .sn-wm > span {
  background: linear-gradient(100deg, currentColor 0 42%, #fff3c9 50%, currentColor 58% 100%); background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sh-row.sk-official:hover .sn-text, .sh-row.sk-official:hover .sn-wm > span { background-position: 0 0; transition: background-position .75s ease-out .25s; }
:root[data-theme="light"] .sh-row.sk-official .sn-text, :root[data-theme="light"] .sh-row.sk-official .sn-wm > span { background-image: linear-gradient(100deg, currentColor 0 42%, #c9a24a 50%, currentColor 58% 100%); }
.reduce-motion .sh-row.sk-official:hover .server-icon .sh-knight::after { animation: none; }
.reduce-motion .sh-row.sk-official:hover .sn-text, .reduce-motion .sh-row.sk-official:hover .sn-wm > span { transition: none; background-position: 100% 0; }

/* Topo com banner: o banner desce até o fim e o escudo e o nome ficam na linha de baixo dele (sem faixa separada) */
.server-header.has-banner .server-banner { height: 104px; box-shadow: none; }
.server-header.has-banner .sh-row { position: relative; margin-top: -48px; min-height: 0; padding: 0 6px 8px 12px; align-items: flex-end;
  background: linear-gradient(180deg, transparent 0, color-mix(in srgb, var(--panel) 72%, transparent) 46%, var(--panel) 100%); }
.server-header.has-banner .server-icon { margin-top: 0; }
.server-header.has-banner .server-icon .shield { width: 40px; height: 44px; }
.server-header.has-banner .server-name { padding-bottom: 5px; }
.server-header.has-banner .sh-row .icon-btn { margin-bottom: 4px; }

/* ===== Layout do topo do servidor (aba Personalização) ===== */
/* Banner até a metade do ícone: o banner termina e o escudo fica metade em cima dele, com o nome ao lado */
.server-header.has-banner[data-banner="meio"] .server-banner { height: 92px; box-shadow: inset 0 -30px 30px -10px rgba(11, 12, 15, .85); }
.server-header.has-banner[data-banner="meio"] .sh-row { margin-top: 0; background: none; padding: 0 6px 6px 12px; align-items: flex-start; }
.server-header.has-banner[data-banner="meio"] .server-icon { margin-top: -24px; }
.server-header.has-banner[data-banner="meio"] .server-icon .shield { width: 46px; height: 50px; }
.server-header.has-banner[data-banner="meio"] .server-name { padding: 7px 6px 4px; }
.server-header.has-banner[data-banner="meio"] .sh-row .icon-btn { margin: 5px 0 0; }
/* Escudo no centro: o escudo no meio e o nome embaixo, centralizado; os botões vão para o canto */
.server-header[data-icon="centro"] .sh-row { position: relative; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 8px; }
.server-header.has-banner[data-icon="centro"] .sh-row { padding-top: 0; }
.server-header[data-icon="centro"] .server-name { width: 100%; text-align: center; padding: 2px 4px 0; }
.server-header[data-icon="centro"] .sn-wm { align-items: center; }
.server-header[data-icon="centro"] .sh-row > .icon-btn { position: absolute; top: 4px; right: 6px; margin: 0; }
.server-header[data-icon="centro"] .sh-row > .icon-btn + .icon-btn { right: 34px; }
.server-header[data-icon="centro"] .sh-row > .icon-btn + .icon-btn + .icon-btn { right: 62px; }
.server-header.has-banner[data-icon="centro"][data-banner="cheio"] .sh-row { margin-top: -62px; }
.server-header.has-banner[data-icon="centro"][data-banner="cheio"] .sh-row > .icon-btn { top: 6px; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .sh-row > .icon-btn { top: 6px; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .server-icon { margin-top: -26px; }
/* Miniatura */
.hp-stage { position: relative; width: 256px; max-width: 100%; margin: 6px 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--panel); user-select: none; }
.hp-header { border-bottom: 0; pointer-events: auto; }
.hp-header .server-name { cursor: default; }
.hp-header .server-name:hover { background: none; }
.hp-btn { pointer-events: none; opacity: .8; }
.hp-drag { cursor: grab; position: relative; z-index: 2; touch-action: none; }
.hp-drag:active { cursor: grabbing; }
.dragging-icon .hp-drag { opacity: .85; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .5)); transition: none; }
.hp-slots { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.dragging-icon .hp-slots { opacity: 1; }
.hp-slot { position: absolute; width: 46px; height: 50px; border: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 10px; }
.hp-slot.lado { left: 8px; bottom: 6px; }
.hp-slot.centro { left: calc(50% - 23px); bottom: 26px; }
.hp-slots[data-hot="lado"] .hp-slot.lado, .hp-slots[data-hot="centro"] .hp-slot.centro { border-style: solid; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.hp-edge { position: absolute; left: 0; right: 0; top: 0; height: 100%; pointer-events: none; }
.hp-edge span { position: absolute; left: 0; right: 0; height: 10px; cursor: ns-resize; pointer-events: auto; touch-action: none; }
.hp-edge span::before { content: ''; position: absolute; left: 32%; right: 32%; top: 4px; height: 2px; border-radius: 2px; background: var(--gold); opacity: .55; transition: opacity .15s, left .15s, right .15s; }
.hp-edge span:hover::before, .hp-edge span:active::before { opacity: 1; left: 8%; right: 8%; }
.hp-header[data-banner='cheio'] ~ .hp-edge span { bottom: 0; }
.hp-header[data-banner='meio'] ~ .hp-edge span { top: 87px; }
.hp-stage { width: 264px; }
.hp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hp-chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font-size: 12.5px; cursor: pointer; }
.hp-chip:hover { color: var(--ink); }
.hp-chip.sel { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 1px var(--gold) inset; }
/* Escudo no centro vale também com o banner até a metade (esta regra vem depois para ganhar da de cima) */
.server-header.has-banner[data-icon="centro"] .sh-row { align-items: center; flex-direction: column; }
.server-header.has-banner[data-icon="centro"][data-banner="meio"] .server-name { padding-top: 2px; }

/* Microfone + fone: com o som desligado os dois botões se fundem num só, metade cada um */
.vbtn-pair { grid-column: span 2; display: flex; gap: 6px; }
.vbtn-pair > .vbtn { flex: 1 1 0; min-width: 0; }
.vbtn-pair.fused { gap: 0; animation: vb-fuse .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn { background: color-mix(in srgb, var(--danger) 72%, var(--raised)); color: #fff; border-color: transparent; }
.vbtn-pair.fused > .vbtn:first-child { border-radius: 11px 0 0 11px; animation: vb-fuse-l .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn:last-child { border-radius: 0 11px 11px 0; position: relative; animation: vb-fuse-r .32s cubic-bezier(.3, .7, .2, 1); }
.vbtn-pair.fused > .vbtn:last-child::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: rgba(255, 255, 255, .45); }
.vbtn-pair.unfusing { animation: vb-unfuse .28s ease-out; }
@keyframes vb-fuse { from { gap: 6px; } to { gap: 0; } }
@keyframes vb-fuse-l { from { border-radius: 11px; } to { border-radius: 11px 0 0 11px; } }
@keyframes vb-fuse-r { from { border-radius: 11px; } to { border-radius: 0 11px 11px 0; } }
@keyframes vb-unfuse { from { gap: 0; } to { gap: 6px; } }
.reduce-motion .vbtn-pair, .reduce-motion .vbtn-pair > .vbtn { animation: none !important; }
/* Câmera ligada na lista da sala */
.voice-user .vs-cam { color: var(--gold); }

/* ===== Salas: tipo sempre visível, emoji, separador; modo editor ===== */
.channel .glyph.type-text, .channel .glyph.type-voice { width: 14px; opacity: .7; }
.channel .ch-emoji { flex: none; font-size: 14px; line-height: 1; }
.channel .ch-sep { flex: none; color: var(--subtle); opacity: .8; font-weight: 600; margin: 0 -1px; }
.channel .ch-edit { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.channel .ch-edit:hover { background: var(--hover); color: var(--ink); }
.channel-list.editing .channel .ch-name { cursor: text; border-bottom: 1px dashed transparent; }
.channel-list.editing .channel .ch-name:hover { border-bottom-color: var(--subtle); }
.ch-rename { flex: 1; min-width: 0; height: 24px; padding: 2px 6px; font: inherit; border-radius: 6px; border: 1px solid var(--gold); background: var(--bg); color: var(--ink); }
.editor-bar { display: grid; gap: 6px; margin: 4px 4px 10px; padding: 10px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 6%, var(--panel)); direction: ltr; }
.editor-bar .eb-head { display: flex; align-items: center; justify-content: space-between; }
.editor-bar .eb-title { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.editor-bar .eb-done { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--gold); background: var(--gold); color: #0a0a0c; font-size: 12px; font-weight: 600; cursor: pointer; }
.editor-bar .eb-hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.editor-bar select { width: 100%; height: auto; min-height: 30px; padding: 5px 8px; line-height: 1.3; font-size: 12.5px; }
.set-sub { margin: 18px 0 6px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
/* Todas as salas à esquerda (com a interface invertida, à direita) */
.salas .vs-left .voice-room > .channel { flex-direction: row; }
.salas .vs-left .voice-room > .channel .ch-name { text-align: left; }
.salas .vs-left .voice-room > .channel .vc-timer { margin-right: 0; margin-left: auto; }
.salas .vs-left .voice-room .voice-user { flex-direction: row; margin: 0 6px 2px 26px; }
.salas .vs-left .voice-room .voice-user .name { text-align: left; }
.salas .vs-left .voice-room .room-status { justify-content: flex-start; text-align: left; }
.app.mirrored .salas .vs-left .voice-room > .channel { flex-direction: row-reverse; }
.app.mirrored .salas .vs-left .voice-room > .channel .ch-name { text-align: right; }
.app.mirrored .salas .vs-left .voice-room > .channel .vc-timer { margin-left: 0; margin-right: auto; }
.app.mirrored .salas .vs-left .voice-room .voice-user { flex-direction: row-reverse; margin: 0 26px 2px 6px; }
.app.mirrored .salas .vs-left .voice-room .voice-user .name { text-align: right; }
.app.mirrored .salas .vs-left .voice-room .room-status { justify-content: flex-end; text-align: right; }
/* emoji, separador e nome bem juntinhos */
.channel .ch-emoji { margin-right: -4px; }
.channel .ch-sep { margin: 0 -4px 0 -1px; }
/* Licenças de terceiros */
.licenses-modal { width: min(760px, calc(92vw / var(--uiz, 1))); max-width: none; }
.licenses-modal .modal-inner { width: 100%; }
.licenses { margin: 0; max-height: calc(100vh / var(--uiz, 1) - 220px); overflow: auto; white-space: pre-wrap; word-break: break-word;
  font: 11.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }

/* Todas as salas à direita (com a interface invertida, à esquerda) */
.salas .vs-right .channel { flex-direction: row-reverse; }
.salas .vs-right .channel .ch-name { text-align: right; }
.salas .vs-right .channel.active { box-shadow: inset -2px 0 0 var(--srv, var(--gold)); }
.salas .vs-right .category, .salas .vs-right .cat-toggle { flex-direction: row-reverse; }
.salas .vs-right .category { margin-left: 0; margin-right: 8px; padding-right: 0; padding-left: 6px; }
.app.mirrored .salas .vs-right .channel { flex-direction: row; }
.app.mirrored .salas .vs-right .channel .ch-name { text-align: left; }
.app.mirrored .salas .vs-right .channel.active { box-shadow: inset 2px 0 0 var(--srv, var(--gold)); }
.app.mirrored .salas .vs-right .category, .app.mirrored .salas .vs-right .cat-toggle { flex-direction: row; }
.app.mirrored .salas .vs-right .category { margin-left: 8px; margin-right: 0; padding-left: 0; padding-right: 6px; }

/* Ícone do tipo da sala no cabeçalho do chat */
.channel-title { display: inline-flex; align-items: center; gap: 7px; }
.ct-glyph { display: inline-grid; place-items: center; color: var(--muted); }

/* Botões do topo do servidor */
.sh-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.server-header[data-icon="centro"] .sh-btns { position: absolute; top: 4px; right: 6px; }
.server-header.has-banner[data-icon="centro"] .sh-btns { top: 6px; }
.server-header[data-icon="centro"] .sh-btns .icon-btn { margin: 0; }

/* Barra rápida do administrador: faixa logo abaixo do nome, com um corte dourado separando */
.admin-bar { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 4px 6px; background: var(--panel); }
.admin-bar.hidden { display: none; }
.admin-bar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 18%, color-mix(in srgb, var(--srv, var(--gold)) 65%, transparent) 82%, transparent); }
.admin-bar.shut { padding: 0 6px; background: none; }
.admin-bar.shut::before { display: none; }
.ab-list { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 1px; }
.ab-tools { flex: none; display: flex; align-items: center; }
.admin-bar .ab-btn { width: 24px; height: 24px; min-width: 0; min-height: 0; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
.admin-bar .ab-btn:hover { color: var(--ink); }
.admin-bar .ab-btn.on { color: var(--srv, var(--gold)); background: var(--raised); }
.admin-bar .ab-tool { width: 20px; height: 20px; min-width: 0; min-height: 0; padding: 0; display: inline-grid; place-items: center; color: var(--subtle); }
.admin-bar .ab-tool:hover { color: var(--ink); }
.app.mirrored .admin-bar { flex-direction: row-reverse; }
.app.mirrored .ab-list { justify-content: flex-end; }
.ab-edit { display: grid; gap: 2px; min-width: 280px; }
.ab-edit-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; }
.ab-edit-row:hover { background: var(--hover); }
.ab-edit-row label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--ink); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.ab-edit-row .icon-btn:disabled { opacity: .3; cursor: default; }
/* Sem banner, o selo do servidor oficial cairia em cima dos botões do topo */
.server-header:not(.has-banner) .srv-official.big { display: none; }
