﻿/* ================================================================ temas */
:root,
[data-theme="discordia"] {
  --bg-0: #111214;
  --bg-1: #18191c;
  --bg-2: #1f2024;
  --bg-3: #2a2c31;
  --bg-4: #34363d;
  --stage: #0b0c0e;
  --border: #ffffff0f;
  --text: #e3e5e8;
  --text-dim: #9097a1;
  --accent: #6d3bff;
  --accent-2: #8f6bff;
  --highlight: #ffd166;
  --on-accent: #fff;
  --green: #23a55a;
  --red: #ef4444;
  --shadow: 0 10px 30px #0007;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ease-fast: .12s ease;
  --ease-normal: .2s ease;
  --ease-slow: .3s ease;
  --font-xs: 12px;
  --font-sm: 13px;
  --font-md: 15px;
  --font-lg: 18px;
  color-scheme: dark;
}
[data-theme="meia-noite"] {
  --bg-0: #000;
  --bg-1: #08080a;
  --bg-2: #0e0e11;
  --bg-3: #1a1a1f;
  --bg-4: #24242b;
  --stage: #000;
  --border: #ffffff12;
  --text: #ededf0;
  --text-dim: #8b8b95;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
}
[data-theme="claro"] {
  --bg-0: #e4e6ea;
  --bg-1: #f1f2f4;
  --bg-2: #ffffff;
  --bg-3: #e9eaee;
  --bg-4: #dcdee3;
  --stage: #eceef2;
  --border: #0000000f;
  --text: #1d2026;
  --text-dim: #5d6470;
  --accent: #6d3bff;
  --accent-2: #8f6bff;
  --shadow: 0 10px 30px #0002;
  color-scheme: light;
}
[data-theme="synthwave"] {
  --bg-0: #0f0820;
  --bg-1: #160d2c;
  --bg-2: #1d1238;
  --bg-3: #2a1b4f;
  --bg-4: #372562;
  --stage: #0a0517;
  --border: #ff2bd61a;
  --text: #f4eaff;
  --text-dim: #a996c9;
  --accent: #ff2bd6;
  --accent-2: #22d3ee;
}
[data-theme="floresta"] {
  --bg-0: #0c1510;
  --bg-1: #111d16;
  --bg-2: #16251c;
  --bg-3: #1f3327;
  --bg-4: #294233;
  --stage: #08100b;
  --border: #ffffff0f;
  --text: #e3f1e7;
  --text-dim: #8fa898;
  --accent: #22c55e;
  --accent-2: #a3e635;
  --on-accent: #052e14;
}
[data-theme="por-do-sol"] {
  --bg-0: #170e0c;
  --bg-1: #1f1411;
  --bg-2: #271916;
  --bg-3: #36231e;
  --bg-4: #452e27;
  --stage: #100907;
  --border: #ffffff0f;
  --text: #f8ebe6;
  --text-dim: #b39a92;
  --accent: #f97316;
  --accent-2: #f43f5e;
}
[data-theme="neon-toquio"] {
  --bg-0: #07060d; --bg-1: #0d0b17; --bg-2: #13101f; --bg-3: #1e1930; --bg-4: #2a2342; --stage: #05040a;
  --border: #ff3dbb1f; --text: #f5f0ff; --text-dim: #a79fc2; --accent: #ff3dbb; --accent-2: #00e5ff;
}
[data-theme="galaxia"] {
  --bg-0: #070512; --bg-1: #0d0a1f; --bg-2: #130f2b; --bg-3: #1d173f; --bg-4: #282052; --stage: #05030e;
  --border: #ffffff10; --text: #ece8ff; --text-dim: #9a92c4; --accent: #8b5cf6; --accent-2: #38bdf8;
}
[data-theme="matrix"] {
  --bg-0: #020603; --bg-1: #050c07; --bg-2: #08120b; --bg-3: #0f1f14; --bg-4: #16301e; --stage: #010402;
  --border: #22ff6618; --text: #c8ffd6; --text-dim: #5fae78; --accent: #22ff66; --accent-2: #00c853; --on-accent: #002b0f;
}
[data-theme="vaporwave"] {
  --bg-0: #1a1033; --bg-1: #221544; --bg-2: #2a1a52; --bg-3: #3a2569; --bg-4: #4a3180; --stage: #150c2b;
  --border: #ff9de21c; --text: #fff0fb; --text-dim: #c4a8e0; --accent: #ff71ce; --accent-2: #01cdfe;
}
[data-theme="sakura"] {
  --bg-0: #f6e4ea; --bg-1: #fbeef2; --bg-2: #fff8fa; --bg-3: #f6e1e8; --bg-4: #edd0da; --stage: #fcf1f4;
  --border: #8a2c4a14; --text: #3d1f2b; --text-dim: #8a6472; --accent: #e5578a; --accent-2: #f59fbf;
  --shadow: 0 10px 30px #8a2c4a22; color-scheme: light;
}
[data-theme="lava"] {
  --bg-0: #0d0605; --bg-1: #150908; --bg-2: #1c0c0a; --bg-3: #2b1310; --bg-4: #3b1a15; --stage: #090403;
  --border: #ff57221a; --text: #ffece5; --text-dim: #c0938a; --accent: #ff5722; --accent-2: #ffb300;
}
[data-theme="halloween"] {
  --bg-0: #0d0714; --bg-1: #140c1d; --bg-2: #1a1024; --bg-3: #281a36; --bg-4: #372449; --stage: #090510;
  --border: #ff7a181f; --text: #fbeee0; --text-dim: #a892b0; --accent: #ff7a18; --accent-2: #a855f7;
}
[data-theme="oceano"] {
  --bg-0: #04121a; --bg-1: #071a24; --bg-2: #0a222f; --bg-3: #10313f; --bg-4: #164152; --stage: #030d13;
  --border: #4dd0e11a; --text: #e0f7fa; --text-dim: #84aeb8; --accent: #14b8a6; --accent-2: #38bdf8;
}
[data-theme="ouro"] {
  --bg-0: #0b0a07; --bg-1: #12100b; --bg-2: #18150e; --bg-3: #241f14; --bg-4: #30291a; --stage: #070604;
  --border: #d4af3720; --text: #f7efd9; --text-dim: #b3a582; --accent: #d4af37; --accent-2: #f5d77a; --on-accent: #241a00;
}
[data-theme="cafe"] {
  --bg-0: #1a120d; --bg-1: #211812; --bg-2: #291e17; --bg-3: #372820; --bg-4: #46342a; --stage: #140e0a;
  --border: #ffffff10; --text: #f3e6d8; --text-dim: #b39a86; --accent: #c8875a; --accent-2: #e3b98f; --on-accent: #2a160a;
}
[data-theme="artico"] {
  --bg-0: #dfe9f1; --bg-1: #ebf2f8; --bg-2: #f8fbfe; --bg-3: #e3edf5; --bg-4: #d4e2ee; --stage: #eef4f9;
  --border: #0b3b5c14; --text: #10283a; --text-dim: #557089; --accent: #0ea5e9; --accent-2: #6366f1;
  --shadow: 0 10px 30px #0b3b5c22; color-scheme: light;
}
[data-theme="alto-contraste"] {
  --bg-0: #000; --bg-1: #000; --bg-2: #0a0a0a; --bg-3: #1a1a1a; --bg-4: #2a2a2a; --stage: #000;
  --border: #ffffff55; --text: #fff; --text-dim: #e6e6e6; --accent: #ffd400; --accent-2: #00e5ff; --on-accent: #000;
}

/* ================================================================ base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-0);
  color: var(--text);
  font: 15px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.muted { color: var(--text-dim); }
.small { font-size: 13px; }
.error { color: var(--red); margin: 0; font-size: 14px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

svg.i { width: 20px; height: 20px; flex: none; display: block; }
.sm svg.i, svg.i.sm { width: 16px; height: 16px; }

.wordmark {
  font-weight: 800; letter-spacing: .08em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

input, select {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field { display: grid; gap: 6px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.field input, .field select { font-size: 15px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.btn {
  border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer;
  background: var(--bg-3); font-weight: 600; position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,.25) 0%, transparent 60%);
  opacity: 0; transform: scale(0); transition: opacity .3s, transform .4s;
  pointer-events: none;
}
.btn:active::after { opacity: 1; transform: scale(2.5); transition: opacity 0s, transform 0s; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btn.big { padding: 13px 18px; font-size: 16px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--radius-md); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-tile { aspect-ratio: 16/10; border-radius: 20px; }
.skeleton-line { height: 14px; margin: 6px 0; }
.skeleton-line.short { width: 60%; }

/* Scroll-to-bottom indicator */
.scroll-bottom-btn {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 20px;
  padding: 6px 14px; font-size: 13px; color: var(--text-dim); cursor: pointer;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 10;
  display: flex; align-items: center; gap: 6px;
}
.scroll-bottom-btn.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.scroll-bottom-btn:hover { color: var(--text); background: var(--bg-4); }

/* Floating label para campos .field */
.field { position: relative; }
.field > input, .field > textarea, .field > select { padding-top: 18px; padding-bottom: 6px; }
.field > span:first-child, .field::before {
  content: attr(data-label); position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim);
  pointer-events: none; transition: top .15s ease, font-size .15s ease, color .15s ease;
}
.field:focus-within > span:first-child, .field:focus-within::before,
.field.has-value > span:first-child, .field.has-value::before {
  top: 8px; transform: none; font-size: 10px; color: var(--accent);
}
.btn.sm svg.i { width: 16px; height: 16px; }
textarea {
  font: inherit; color: var(--text); background: var(--bg-0); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; outline: none; resize: vertical;
  font-size: 15px; font-weight: 400; text-transform: none; letter-spacing: 0;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border-radius: 8px; cursor: pointer; }
.clickable { cursor: pointer; }
.tile, .channel, .channel-members li, .me-info, .brand { user-select: none; }

.icon-btn {
  border: 0; background: none; cursor: pointer; border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-dim);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn.sm { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.off { color: var(--red); }

/* ================================================================ login */
.login {
  min-height: 100%;
  display: grid; place-items: center; padding: 16px;
  background: var(--bg-0);
  position: relative; overflow: hidden;
}
/* Orbs animados no fundo */
.login::before, .login::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5;
  animation: orb-float 8s ease-in-out infinite alternate;
}
.login::before {
  width: 500px; height: 500px; top: -15%; left: -10%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%);
}
.login::after {
  width: 400px; height: 400px; bottom: -10%; right: -8%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent 70%);
  animation-delay: -4s; animation-direction: alternate-reverse;
}
@keyframes orb-float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -20px) scale(1.08); }
}
/* Grid pattern sutil no fundo */
.login-bg-grid {
  position: absolute; inset: 0; opacity: .03;
  background-image:
    linear-gradient(var(--text) 1px, transparent 1px),
    linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.login-card {
  width: min(420px, 100%);
  background: color-mix(in srgb, var(--bg-1) 75%, transparent);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  padding: 44px 36px 36px;
  border-radius: 28px;
  display: grid; gap: 18px; text-align: center;
  box-shadow:
    0 8px 32px rgba(0,0,0,.4),
    0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  position: relative; z-index: 1;
  animation: card-enter .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes card-enter {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to { opacity: 1; transform: none; }
}
/* Brilho no topo do card */
.login-card::before {
  content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 50%, transparent), transparent);
}
.login-logo {
  width: 88px; height: 88px; margin: 0 auto;
  filter: drop-shadow(0 8px 32px color-mix(in srgb, var(--accent) 50%, transparent));
  animation: logo-enter .7s cubic-bezier(.16,1,.3,1) .1s both;
}
@keyframes logo-enter {
  from { opacity: 0; transform: scale(.7) rotate(-8deg); }
  to { opacity: 1; transform: none; }
}
.login-card h1 {
  margin: 0; font-size: 32px; letter-spacing: .1em;
  animation: text-enter .5s ease-out .2s both;
}
.login-card > p {
  margin: -8px 0 6px;
  animation: text-enter .5s ease-out .3s both;
}
.login-card .field {
  animation: text-enter .5s ease-out .35s both;
}
.login-card .btn {
  animation: text-enter .5s ease-out .4s both;
}
@keyframes text-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* Botão Entrar com glow */
.login-card .btn.primary {
  padding: 14px 24px; font-size: 16px; border-radius: 14px;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: filter .15s, transform .1s, box-shadow .2s;
}
.login-card .btn.primary:hover {
  box-shadow: 0 6px 28px color-mix(in srgb, var(--accent) 50%, transparent);
  transform: translateY(-1px);
}
.login-card .btn.primary:active { transform: translateY(1px); box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 30%, transparent); }

/* ================================================================ layout */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 72px 240px 1fr 320px;
}
.app.chat-hidden { grid-template-columns: 72px 240px 1fr 0; }
.app.chat-hidden .chat { display: none; }

/* ---------- sidebar */
.sidebar { background: var(--bg-1); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.brand {
  height: 56px; flex: none; padding: 0 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.brand img { width: 30px; height: 30px; }
.brand .wordmark { font-size: 16px; }
.beta {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 12px 6px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
}
.channels { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.channel {
  display: flex; align-items: center; gap: 8px; width: 100%; position: relative;
  padding: 8px 8px 8px 10px; border: 0; background: none; border-radius: 10px;
  color: var(--text-dim); cursor: pointer; text-align: left; font-weight: 500;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.channel:hover { background: var(--bg-3); color: var(--text); transform: translateX(2px); }
.channel.active { background: color-mix(in srgb, var(--accent) 16%, var(--bg-3)); color: var(--text); font-weight: 600; }
.channel.active::before {
  content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: channel-indicator .3s ease-out both;
}
@keyframes channel-indicator { from { height: 0; top: 50%; bottom: 50%; opacity: 0; } to { height: auto; top: 6px; bottom: 6px; opacity: 1; } }
.channel .ch-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel .ch-count {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--bg-4); color: var(--text);
}
.channel-members { list-style: none; margin: 2px 0 6px; padding: 0 0 0 22px; }
.channel-members li {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px;
  font-size: 14px; color: var(--text-dim);
}
.channel-members li:hover { background: var(--bg-3); color: var(--text); }
.channel-members li span.nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flags { margin-left: auto; display: flex; gap: 4px; align-items: center; color: var(--text-dim); flex: none; }
.flags svg.i { width: 15px; height: 15px; }
.live-badge {
  background: var(--highlight, var(--red)); color: #1a1300; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px;
  letter-spacing: .04em; white-space: nowrap; flex: none; line-height: 1.5;
}
/* Na lista lateral o selo é compacto, para não espremer o nome. */
.flags .live-badge { font-size: 9px; padding: 0 5px; }

.avatar {
  --size: 88px;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-weight: 700; color: #fff; font-size: calc(var(--size) * 0.4);
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .12s;
  text-shadow: 0 1px 2px #0003;
}
.avatar.photo { background-size: cover !important; background-position: center !important; color: transparent; text-shadow: none; }
.avatar.sm { --size: 34px; }
.avatar.xs { --size: 22px; font-size: 11px; }
.avatar.speaking { box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 4px var(--green); }

.me-panel {
  margin: 8px; padding: 8px; border-radius: 14px; background: var(--bg-0);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.me-info {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  border: 0; background: none; padding: 2px 4px; border-radius: 10px; cursor: pointer; text-align: left;
}
.me-info:hover { background: var(--bg-3); }
.me-text { min-width: 0; }
.me-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-status.on { color: var(--green); }
.me-actions { display: flex; }

/* ---------- main */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); }
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 18px; border-bottom: 1px solid var(--border);
}
.topbar-icon { color: var(--text-dim); }
.room-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-count { font-size: 12px; color: var(--text-dim); background: var(--bg-3); padding: 2px 8px; border-radius: 10px; }
.topbar-actions { margin-left: auto; display: flex; gap: 2px; }

.stage {
  flex: 1; overflow-y: auto; position: relative;
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
  background:
    radial-gradient(80% 60% at 50% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent),
    var(--stage);
}
.empty { margin: auto; text-align: center; color: var(--text-dim); display: grid; justify-items: center; gap: 8px; padding-bottom: 40px; animation: empty-enter .5s ease-out both; }
@keyframes empty-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.empty-art { position: relative; }
.empty-art img { width: 100px; height: 100px; opacity: .95; filter: drop-shadow(0 16px 40px color-mix(in srgb, var(--accent) 40%, transparent)); animation: empty-logo-float 4s ease-in-out infinite alternate; }
@keyframes empty-logo-float { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
.empty-art::after { content: ''; position: absolute; inset: -20px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%); z-index: -1; animation: empty-glow 3s ease-in-out infinite alternate; }
@keyframes empty-glow { 0% { opacity: .5; transform: scale(.9); } 100% { opacity: 1; transform: scale(1.1); } }
.empty h2 { margin: 16px 0 0; color: var(--text); font-size: 24px; font-weight: 800; letter-spacing: .02em; }
.empty p { margin: 0 0 16px; font-size: 15px; max-width: 280px; line-height: 1.5; }
.empty .btn { animation: empty-enter .5s ease-out .15s both; }

.screens { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); }
.screens:empty { display: none; }
.screen {
  position: relative; background: #000; border-radius: 16px; overflow: hidden;
  aspect-ratio: 16 / 9; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.screen video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.screen .label {
  position: absolute; left: 10px; bottom: 10px; background: #000b; backdrop-filter: blur(8px); color: #fff;
  padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.screen .screen-actions { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.screen:hover .screen-actions { opacity: 1; }
.screen .screen-actions button {
  background: #000b; backdrop-filter: blur(8px); color: #fff; border: 0; border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
}
.screen .screen-actions button:hover { background: #000e; }

/* Cards da call: preenchem o palco, com o fundo na cor da pessoa. */
.tiles {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tile {
  --tint: var(--accent);
  position: relative; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden;
  width: 100%; max-width: 520px; justify-self: center;
  display: grid; place-items: center;
  background:
    radial-gradient(90% 80% at 50% 35%, color-mix(in srgb, var(--tint) 26%, var(--bg-2)), var(--bg-1) 78%);
  border: 1px solid color-mix(in srgb, var(--tint) 20%, var(--border));
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.tile:hover { border-color: color-mix(in srgb, var(--tint) 50%, var(--border)); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.3); }
.tile .avatar { --size: 84px; box-shadow: 0 10px 30px #0005; margin-bottom: 14px; }
.tile.speaking {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 0 28px color-mix(in srgb, var(--green) 35%, transparent);
  animation: tile-speaking-glow 2s ease-in-out infinite alternate;
}
@keyframes tile-speaking-glow {
  0% { box-shadow: 0 0 0 1px var(--green), 0 0 20px color-mix(in srgb, var(--green) 25%, transparent); }
  100% { box-shadow: 0 0 0 2px var(--green), 0 0 36px color-mix(in srgb, var(--green) 45%, transparent); }
}
.tile.speaking .avatar {
  box-shadow: 0 0 0 4px var(--bg-1), 0 0 0 7px var(--green), 0 10px 30px #0005;
  transition: box-shadow .2s ease;
  animation: avatar-speaking-pulse 2s ease-in-out infinite alternate;
}
@keyframes avatar-speaking-pulse {
  0% { box-shadow: 0 0 0 4px var(--bg-1), 0 0 0 7px var(--green), 0 10px 30px #0005; }
  100% { box-shadow: 0 0 0 4px var(--bg-1), 0 0 0 9px var(--green), 0 0 20px color-mix(in srgb, var(--green) 30%, transparent), 0 10px 30px #0005; }
}
.msg-enter { animation: msg-slide-in .2s ease-out both; }
@keyframes msg-slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tile .name {
  position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px);
  display: flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 10px;
  background: #000a; backdrop-filter: blur(8px); color: #fff; font-weight: 600; font-size: 13px;
}
.tile .name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .name svg.i { width: 15px; height: 15px; color: #ff6b6b; flex: none; }
.tile .net { position: absolute; left: 10px; top: 10px; }
.tile .tile-vol {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; color: #fff;
  background: #000a; padding: 2px 8px; border-radius: 8px;
}

/* Indicador de conexão (barrinhas de sinal). */
.net { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 7px; background: #000a; }
.net svg.i { width: 15px; height: 15px; stroke-width: 3; }
.net.good { color: #3ddc84; }
.net.ok { color: #f5b942; }
.net.bad { color: #ff5c5c; }
.net:empty { display: none; }

/* Com tela compartilhada, os cards viram uma faixa compacta. */
.stage.has-screen .tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stage.has-screen .tile { aspect-ratio: auto; height: 64px; display: flex; justify-content: flex-start; padding: 0 12px; gap: 10px; }
.stage.has-screen .tile .avatar { --size: 38px; box-shadow: none; }
.stage.has-screen .tile .name { position: static; background: none; backdrop-filter: none; padding: 0; color: var(--text); flex: 1; min-width: 0; }
.stage.has-screen .tile .net { position: static; order: 3; }
.stage.has-screen .tile .tile-vol, .stage.has-screen .tile .live-badge { display: none; }

.controls {
  position: sticky; bottom: 0; margin: auto auto 0; z-index: 5;
  display: flex; align-items: center; gap: 8px; padding: 10px; flex-wrap: wrap; justify-content: center;
  background: color-mix(in srgb, var(--bg-1) 85%, transparent); backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
  animation: controls-enter .4s ease-out both;
}
@keyframes controls-enter { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.ctl {
  border: 0; border-radius: 16px; width: 50px; height: 50px; cursor: pointer;
  background: var(--bg-3); color: var(--text); display: grid; place-items: center;
  position: relative; overflow: hidden;
  transition: background .2s ease, transform .15s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, color .15s ease;
}
.ctl::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--text) 8%, transparent), transparent 60%);
  opacity: 0; transition: opacity .2s ease;
}
.ctl:hover::before { opacity: 1; }
.ctl svg.i { width: 22px; height: 22px; position: relative; z-index: 1; transition: transform .15s ease; }
.ctl:hover { background: var(--bg-4); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.ctl:hover svg.i { transform: scale(1.1); }
.ctl:active { transform: scale(.92) translateY(0); transition-duration: .05s; }
.ctl.off { background: color-mix(in srgb, var(--red) 22%, var(--bg-3)); color: var(--red); }
.ctl.off:hover { background: color-mix(in srgb, var(--red) 32%, var(--bg-3)); }
.ctl.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.ctl.active:hover { box-shadow: 0 6px 28px color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-3px); }
.ctl.danger { background: var(--red); color: #fff; width: 64px; }
.ctl.danger:hover { background: color-mix(in srgb, var(--red) 85%, #fff); box-shadow: 0 4px 20px color-mix(in srgb, var(--red) 40%, transparent); }
.ctl-select { height: 50px; border-radius: 16px; padding: 0 12px; background: var(--bg-3); border: 0; font-weight: 600; font-size: 14px; }
.ctl-sep { width: 1px; height: 28px; background: var(--border); margin: 0 4px; }

/* ---------- chat */
.chat { background: var(--bg-1); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  font-weight: 700; border-bottom: 1px solid var(--border);
}
.chat-head svg.i { color: var(--text-dim); }
.messages { flex: 1; overflow-y: auto; padding: 14px 14px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 6px 6px; border-radius: 10px; }
.msg:hover { background: var(--bg-2); }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg.cont .msg-head { display: none; }
.msg-body { min-width: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-author { font-weight: 700; font-size: 14px; }
.msg-time { font-size: 11px; color: var(--text-dim); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.msg-text a { color: var(--accent); }
.msg.system { color: var(--text-dim); font-size: 13px; justify-content: center; text-align: center; padding: 8px; }
.msg.system:hover { background: none; }
.chat-form { margin: 12px; display: flex; align-items: center; gap: 4px; background: var(--bg-3); border-radius: 14px; padding: 4px 4px 4px 0; }
.chat-form input { flex: 1; min-width: 0; background: none; border: 0; box-shadow: none; padding: 10px 12px; }
.chat-form input:focus { box-shadow: none; }

/* ================================================================ dialogs */
.dialog {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border); border-radius: 20px;
  padding: 26px; width: min(420px, 92vw); box-shadow: var(--shadow);
  opacity: 0; transform: scale(.95) translateY(10px);
  transition: opacity .2s ease-out, transform .2s ease-out, display .2s allow-discrete;
}
.dialog[open] { opacity: 1; transform: none; }
@starting-style { .dialog[open] { opacity: 0; transform: scale(.95) translateY(10px); } }
.tile-entering { animation: tile-in .25s cubic-bezier(.34,1.56,.64,1) both; }
.tile-exiting { animation: tile-out .15s ease-in both; pointer-events: none; }
@keyframes tile-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@keyframes tile-out { to { opacity: 0; transform: scale(.8); } }
.dialog.wide { width: min(700px, 94vw); }
.dialog::backdrop { background: #000a; backdrop-filter: blur(3px); transition: opacity .2s ease-out, display .2s allow-discrete; opacity: 0; }
.dialog[open]::backdrop { opacity: 1; }
@starting-style { .dialog[open]::backdrop { opacity: 0; } }
.dialog form { display: grid; gap: 14px; }
.dialog h2 { margin: 0; font-size: 20px; }
.dialog h3 { margin: 8px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.dialog p { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme {
  border: 2px solid var(--border); border-radius: 14px; padding: 8px; cursor: pointer; background: none;
  display: grid; gap: 8px; text-align: left; font-weight: 600; font-size: 13px;
}
.theme.sel { border-color: var(--accent); }
.theme-preview { height: 54px; border-radius: 9px; display: grid; grid-template-columns: 26% 1fr; overflow: hidden; }
.theme-preview .tp-side { display: grid; align-content: start; gap: 4px; padding: 6px 5px; }
.theme-preview .tp-side i { height: 5px; border-radius: 3px; opacity: .5; }
.theme-preview .tp-main { display: grid; place-items: center; }
.theme-preview .tp-dot { width: 22px; height: 22px; border-radius: 50%; }

/* ================================================================ toasts */
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; z-index: 50; }
.toast {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 10px 14px; border-radius: 12px; font-size: 14px; max-width: 340px;
  animation: toast-in .2s ease-out forwards;
}
.toast.error { border-color: var(--red); }
.toast.exiting { animation: toast-out .2s ease-in forwards; pointer-events: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ================================================================ aviso de versão nova */
.update-chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin-right: 6px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); white-space: nowrap;
}

/* ================================================================ menu do botão direito */
.ctx-menu {
  position: fixed; z-index: 60; min-width: 200px; max-width: 260px; padding: 6px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  animation: pop-in .1s ease-out;
}
.ctx-menu .ctx-head { padding: 6px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.ctx-menu .ctx-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.ctx-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 14px; font-weight: 500; color: var(--text);
}
.ctx-menu button svg.i { width: 17px; height: 17px; color: var(--text-dim); }
.ctx-menu button:hover { background: var(--accent); color: var(--on-accent); }
.ctx-menu button:hover svg.i { color: inherit; }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu button.danger:hover { background: var(--red); color: #fff; }
.ctx-menu .ctx-slider { display: grid; gap: 6px; padding: 8px 10px; }
.ctx-menu .ctx-slider-top { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.ctx-menu .ctx-slider-top svg.i { width: 17px; height: 17px; color: var(--text-dim); }
.ctx-menu .ctx-slider-top b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-dim); font-weight: 600; }
.ctx-menu .ctx-slider input { width: 100%; accent-color: var(--accent); padding: 0; border: 0; background: none; box-shadow: none; }
.ctx-menu .role-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.ctx-menu .ctx-check { margin-left: auto; width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--text-dim); display: grid; place-items: center; }
.ctx-menu .ctx-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ctx-menu .ctx-check svg.i { width: 12px; height: 12px; color: inherit; }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } }

/* ================================================================ cartão de perfil */
.profile-card {
  position: fixed; z-index: 55; width: 300px; overflow: hidden;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  animation: pop-in .12s ease-out;
}
.profile-card.static { position: static; animation: none; box-shadow: none; }
.pc-banner { height: 92px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.pc-avatar-wrap { margin: -44px 0 0 16px; width: fit-content; border-radius: 50%; padding: 6px; background: var(--bg-0); position: relative; }
.pc-avatar-wrap .avatar { --size: 80px; }
.pc-dot { position: absolute; right: 6px; bottom: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--green); border: 4px solid var(--bg-0); }
.pc-body { padding: 8px 16px 16px; display: grid; gap: 10px; }
.pc-name { font-size: 20px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.pc-status { font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.pc-section { background: var(--bg-2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.pc-section h4 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.pc-bio { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pc-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-role { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--bg-3); }
.pc-role i { width: 10px; height: 10px; border-radius: 50%; }
.pc-call { font-size: 13px; color: var(--green); display: flex; align-items: center; gap: 6px; }
.pc-call svg.i { width: 15px; height: 15px; }
.pc-edit { justify-self: start; }

.profile-editor-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.profile-editor-fields { display: grid; gap: 14px; }
.pf-row { display: flex; gap: 8px; align-items: center; }
.file-btn { cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--text); }
.profile-editor-grid > div { min-width: 0; }

/* ================================================================ abas e cargos */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  border: 0; background: none; cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--text); border-color: var(--accent); }
.tab-panel { display: grid; gap: 14px; min-height: 220px; align-content: start; }

.roles-layout { display: grid; grid-template-columns: 180px 1fr; gap: 16px; }
.roles-list-wrap { display: grid; gap: 8px; align-content: start; }
.roles-list { display: grid; gap: 2px; }
.role-item {
  display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; text-align: left;
  padding: 7px 10px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.role-item:hover { background: var(--bg-3); }
.role-item.sel { background: color-mix(in srgb, var(--accent) 18%, var(--bg-3)); }
.role-item i { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--text-dim); }
.role-editor { display: grid; gap: 12px; align-content: start; background: var(--bg-1); border-radius: 12px; padding: 14px; }
.role-editor .perm { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.role-editor .perm:last-of-type { border-bottom: 0; }
.role-editor .perm input { width: 18px; height: 18px; accent-color: var(--accent); }
.role-editor .perm.locked { opacity: .5; }

/* ================================================================ canais de texto */
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.sidebar-scroll .channels { flex: none; overflow: visible; padding-bottom: 4px; }
.channel.text .hash { width: 20px; text-align: center; font-size: 18px; font-weight: 600; color: var(--text-dim); line-height: 1; }
.channel.text.unread { color: var(--text); font-weight: 700; }
.channel.text.unread::after {
  content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px;
  border-radius: 0 4px 4px 0; background: var(--text);
}
.mention-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--highlight, var(--red)); color: #1a1300;
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.guild-btn .mention-badge { position: absolute; right: -4px; bottom: -4px; border: 3px solid var(--bg-0); height: 22px; min-width: 22px; border-radius: 11px; }
.guild-btn.unread::before { height: 8px; }

.voice-bar {
  margin: 0 8px; padding: 8px 8px 8px 12px; border-radius: 14px 14px 0 0; background: var(--bg-0);
  display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border);
}
.voice-bar + .me-panel { margin-top: 0; border-radius: 0 0 14px 14px; }
.voice-bar-info { flex: 1; min-width: 0; border: 0; background: none; text-align: left; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.voice-bar-info:hover { background: var(--bg-3); }
.voice-bar-status { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; font-size: 13px; }
.voice-bar-status svg.i { width: 16px; height: 16px; }
.voice-bar-name { display: block; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-bar .icon-btn { color: var(--red); }

.text-view { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--bg-2); }
.text-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 8px; }
.text-start { padding: 24px 6px 16px; }
.text-start .big-hash {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 700;
  background: var(--bg-3); margin-bottom: 10px;
}
.text-start h2 { margin: 0 0 4px; font-size: 24px; }
.text-start p { margin: 0; color: var(--text-dim); }
.text-messages { display: flex; flex-direction: column; gap: 2px; }
.text-messages .msg { position: relative; padding: 6px 10px; }
.text-messages .msg:hover { background: var(--bg-1); }
.text-messages .msg-text { font-size: 15px; }
.msg-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.msg-images img {
  max-width: min(360px, 100%); max-height: 320px; border-radius: 12px; cursor: zoom-in; display: block;
  border: 1px solid var(--border); background: var(--bg-3);
}
.msg-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.reaction {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 9px; cursor: pointer;
  background: var(--bg-3); border: 1px solid transparent; font-size: 14px; color: var(--text);
}
.reaction b { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg-3)); }
.reaction.mine b { color: var(--accent); }
.msg-tools {
  position: absolute; right: 12px; top: -14px; display: none; gap: 2px; padding: 3px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  animation: pop-in .1s ease-out;
}
.text-messages .msg:hover .msg-tools { display: flex; }
.msg-tools button { width: 30px; height: 28px; border: 0; background: none; border-radius: 7px; cursor: pointer; font-size: 16px; color: var(--text-dim); display: grid; place-items: center; transition: background .1s, transform .1s; }
.msg-tools button:hover { background: var(--bg-3); color: var(--text); transform: scale(1.15); }
.msg-tools button.danger:hover { color: var(--red); }
.quick-reactions { display: flex; gap: 1px; }
.quick-reactions button { font-size: 14px; width: 26px; height: 26px; }
.quick-reactions button:hover { transform: scale(1.25); }
.load-more { text-align: center; color: var(--text-dim); font-size: 13px; padding: 8px; }

.text-search-bar { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--bg-1); }
.text-search-bar input { flex: 1; min-width: 0; background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 14px; color: var(--text); outline: none; transition: border-color .15s; }
.text-search-bar input:focus { border-color: var(--accent); }
.text-search-bar .icon-btn.sm { width: 28px; height: 28px; font-size: 14px; }
.msg.search-hidden { display: none; }
.msg mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); border-radius: 3px; padding: 0 2px; }
/* Soundboard */
.soundboard-panel {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent); border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 16px; z-index: 100; width: min(340px, 90vw);
  animation: soundboard-enter .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes soundboard-enter {
  from { opacity: 0; transform: translateX(-50%) translateY(16px) scale(.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.soundboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.soundboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.soundboard-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 14px; background: var(--bg-3); border: 1px solid transparent;
  cursor: pointer; position: relative; overflow: hidden;
  transition: background .15s ease, transform .15s cubic-bezier(.34,1.56,.64,1), border-color .15s ease, box-shadow .15s ease;
}
.soundboard-btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
  opacity: 0; transition: opacity .2s ease;
}
.soundboard-btn:hover { background: var(--bg-4); border-color: color-mix(in srgb, var(--accent) 40%, transparent); transform: translateY(-3px) scale(1.04); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.soundboard-btn:hover::after { opacity: 1; }
.soundboard-btn:active { transform: scale(.92); transition-duration: .05s; }
.soundboard-btn.playing { animation: sb-pulse .4s ease-out; }
@keyframes sb-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.soundboard-btn .sb-emoji { font-size: 26px; transition: transform .15s ease; position: relative; z-index: 1; }
.soundboard-btn:hover .sb-emoji { transform: scale(1.2) rotate(-5deg); }
.soundboard-btn:active .sb-emoji { transform: scale(.85); }
.soundboard-btn .sb-name { font-size: 11px; color: var(--text-dim); position: relative; z-index: 1; transition: color .15s ease; }
.soundboard-btn:hover .sb-name { color: var(--text); }
/* Status presets */
.status-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 8px; }
.status-preset-btn {
  padding: 4px 10px; border-radius: 20px; font-size: 12px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  transition: background .1s, border-color .1s, transform .1s;
}
.status-preset-btn:hover { background: var(--bg-4); border-color: var(--accent); transform: translateY(-1px); }
.status-preset-btn.add { color: var(--accent); border-style: dashed; }
.text-composer { position: relative; margin: 0 20px 18px; background: var(--bg-3); border-radius: 14px; }
.typing-indicator { font-size: 12px; color: var(--text-dim); padding: 4px 12px 0; min-height: 18px; display: flex; align-items: center; gap: 6px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); animation: typing-bounce 1.4s infinite ease-in-out both; }
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
.text-input-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px; }
.text-input-row textarea {
  flex: 1; min-width: 0; resize: none; max-height: 200px; border: 0; background: none; box-shadow: none;
  padding: 8px 4px; font-size: 15px; line-height: 1.4;
}
.text-input-row textarea:focus { box-shadow: none; }
.text-attachments { display: flex; gap: 8px; padding: 10px 10px 0; flex-wrap: wrap; }
.attach-chip { position: relative; }
.attach-chip img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
.attach-chip button {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; display: grid; place-items: center;
}
.attach-chip button svg.i { width: 13px; height: 13px; }
.mention-box {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); max-height: 260px; overflow-y: auto; padding: 6px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 5;
}
.mention-box .mention-head { padding: 4px 8px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.mention-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.mention-opt .avatar { --size: 26px; font-size: 12px; }
.mention-opt small { margin-left: auto; color: var(--text-dim); }
.mention-opt.sel, .mention-opt:hover { background: var(--bg-3); }
.drop-hint {
  position: absolute; inset: 12px; border: 3px dashed var(--accent); border-radius: 18px; z-index: 6;
  display: grid; place-items: center; font-size: 20px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--bg-2) 85%, transparent); pointer-events: none;
}

.lightbox { position: fixed; inset: 0; z-index: 70; background: #000d; display: grid; place-items: center; cursor: zoom-out; padding: 24px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow); transform-origin: center; }
.emoji-picker {
  position: fixed; z-index: 65; display: grid; grid-template-columns: repeat(6, 36px); gap: 2px; padding: 6px;
  background: var(--bg-0); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.emoji-picker button { width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; font-size: 20px; cursor: pointer; }
.emoji-picker button:hover { background: var(--bg-3); }

.sfx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ================================================================ painel da direita (chat / membros) */
.side-tabs { height: 56px; flex: none; display: flex; align-items: stretch; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.side-tab {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 0; background: none; cursor: pointer;
  font-weight: 700; color: var(--text-dim); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.side-tab svg.i { width: 18px; height: 18px; }
.side-tab:hover { color: var(--text); }
.side-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.side-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--bg-4); color: var(--text); }
.side-count:empty { display: none; }
.side-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.members { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.members-group { padding: 14px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.member {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left;
}
.member:hover { background: var(--bg-3); }
.member.offline { opacity: .45; }
.member.offline:hover { opacity: .8; }
.member-av { position: relative; flex: none; }
.member-av .avatar { --size: 34px; font-size: 14px; }
.member-av .dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); border: 3px solid var(--bg-1); }
.member-text { min-width: 0; flex: 1; }
.member-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.member-sub svg.i { width: 13px; height: 13px; color: var(--green); }

/* Mensagem que me menciona. */
.msg.mention { background: color-mix(in srgb, #f5b942 12%, transparent); box-shadow: inset 3px 0 0 #f5b942; }
.mention-tag { color: var(--accent); font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; padding: 0 3px; }

/* ================================================================ som pausado pelo navegador */
.sound-blocked {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 14px; border: 0; border-radius: 16px; cursor: pointer; font-weight: 700; font-size: 15px;
  color: #fff; background: var(--red); animation: pulse-red 1.6s ease-in-out infinite;
}
@keyframes pulse-red { 50% { filter: brightness(1.2); } }

/* ================================================================ ao vivo ("Ver tela") */
.live-cards { display: grid; gap: 10px; }
.live-cards:empty { display: none; }
.live-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--bg-1); border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border));
}
.live-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; flex-wrap: wrap; }

/* ================================================================ volume individual */
.tile-vol { position: absolute; top: 10px; right: 12px; font-size: 11px; font-weight: 700; color: var(--text-dim); }
.tile-vol:empty { display: none; }
.vol-slider { display: grid; gap: 6px; }
.vol-slider-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.vol-slider-top svg.i { width: 16px; height: 16px; color: var(--text-dim); }
.vol-slider-top b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.vol-slider input { width: 100%; accent-color: var(--accent); padding: 0; border: 0; background: none; box-shadow: none; }
.pc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pc-avatar-edit { cursor: pointer; }
.pc-avatar-edit::after {
  content: "Trocar"; position: absolute; inset: 6px; border-radius: 50%; display: grid; place-items: center;
  background: #0009; color: #fff; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .15s;
}
.pc-avatar-edit:hover::after { opacity: 1; }
.btn.sm.on { border-color: var(--accent); color: var(--accent); }
#pf-preview .pc-avatar-wrap { cursor: pointer; }

/* ================================================================ teste de microfone */
.mic-test { display: grid; gap: 10px; background: var(--bg-1); border-radius: 12px; padding: 12px; }
.mic-meter { position: relative; height: 10px; border-radius: 6px; background: var(--bg-4); overflow: hidden; }
.mic-meter div { height: 100%; width: 0; background: var(--text-dim); transition: width .06s linear; }
.mic-meter div.live { background: var(--green); }
.mic-meter span { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); opacity: .6; }
.btn.ghost.sm.on { border-color: var(--accent); color: var(--accent); }

/* ================================================================ servidores */
.guild-rail {
  background: var(--bg-0); display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 0; overflow-y: auto; border-right: 1px solid var(--border);
}
.rail-logo { width: 44px; height: 44px; }
.rail-sep { width: 32px; height: 2px; border-radius: 2px; background: var(--bg-3); flex: none; }
.guilds { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.guild-btn {
  --guild: var(--accent);
  position: relative; width: 48px; height: 48px; flex: none; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--bg-2); color: var(--text); font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
  transition: border-radius .2s cubic-bezier(.34,1.56,.64,1), transform .15s ease, filter .15s ease, background .15s, color .15s;
}
.guild-btn:hover { transform: scale(1.08); filter: brightness(1.1); }
.guild-btn:active { transform: scale(.95); }
.guild-btn:hover, .guild-btn.active { border-radius: 16px; background: var(--guild); color: #fff; }
.guild-btn::before {
  content: ""; position: absolute; left: -12px; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--text); transition: height .15s;
}
.guild-btn:hover::before { height: 18px; }
.guild-btn.active::before { height: 36px; }
.guild-btn.in-call::after {
  content: ""; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 3px solid var(--bg-0);
}
.guild-btn.main { background: none; padding: 0; overflow: hidden; }
.guild-btn.main img { width: 48px; height: 48px; display: block; }
.guild-btn.main:hover, .guild-btn.main.active { background: none; }
.guilds .guild-btn.main { margin-bottom: 4px; }
.guild-btn.add { color: var(--green); background: var(--bg-2); }
.guild-btn.add:hover { background: var(--green); color: #fff; }

.guild-header {
  height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border: 0; border-bottom: 1px solid var(--border); background: none; cursor: pointer; text-align: left;
  font-weight: 800; font-size: 15px;
}
.guild-header:hover { background: var(--bg-3); }
.guild-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev svg.i { width: 18px; height: 18px; color: var(--text-dim); }
.no-calls { padding: 4px 16px 16px; color: var(--text-dim); font-size: 14px; display: grid; gap: 10px; justify-items: start; }
.no-calls p { margin: 0; }

.guild-choice { display: grid; gap: 14px; }
.guild-choice h2 { margin: 0; }
.guild-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.guild-choice-card { background: var(--bg-1); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.guild-choice-card h3 { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.guild-choice-card p { margin: 0; }
.invite-code { font-family: Consolas, monospace; font-size: 16px; font-weight: 700; letter-spacing: .1em; background: var(--bg-0); padding: 6px 10px; border-radius: 8px; }

/* Entrando sozinho: esconde o formulário para não piscar. */
.login-card.auto label, .login-card.auto button { visibility: hidden; }
.login-card.auto::after { content: "Entrando…"; color: var(--text-dim); }

/* ================================================================ música */
.music-panel {
  position: absolute; top: 16px; right: 16px; z-index: 6; width: min(360px, calc(100% - 32px));
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px; display: grid; gap: 10px; animation: pop-in .12s ease-out;
}
.music-head { display: flex; align-items: center; gap: 8px; }
.music-head svg.i { color: var(--accent); }
.music-head strong { flex: 1; }
.music-form { display: flex; gap: 6px; }
.music-form input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 14px; }
.music-panel p { margin: 0; }
.music-now { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.music-now img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--bg-3); }
.music-info { min-width: 0; display: grid; gap: 4px; }
.music-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-progress { height: 4px; border-radius: 4px; background: var(--bg-4); overflow: hidden; }
.music-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s linear; }
.music-ctl { display: flex; align-items: center; gap: 2px; }
.music-vol { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.music-vol input { width: 100px; accent-color: var(--accent); padding: 0; border: 0; background: none; box-shadow: none; }
.music-panel .ctx-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.music-queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 160px; overflow-y: auto; }
.music-queue li { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.music-queue li:hover { background: var(--bg-3); }
.music-queue li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl.playing { box-shadow: 0 0 0 2px var(--accent); }

/* ================================================================ celular */
/* ================================================================ animações extras
   Complementam as animações acima (login, cards, mensagens, controles).
   Nomes com "dx-" para não colidir com elas. */

@keyframes dx-fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes dx-scale-in { from { opacity: 0; transform: scale(.92); } }
@keyframes dx-live-dot { 50% { opacity: .35; transform: scale(.6); } }
@keyframes dx-pop { 40% { transform: scale(1.3); } }
@keyframes dx-flash { from { background: color-mix(in srgb, #f5b942 38%, transparent); } }
@keyframes dx-icon-swap { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
@keyframes dx-eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
@keyframes dx-drift { 50% { background-position: 70% 20%, 30% 80%, 0 0; } }

/* Palco: brilho de fundo que se mexe bem devagar. */
.stage {
  background:
    radial-gradient(60% 50% at 30% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent),
    radial-gradient(50% 50% at 80% 100%, color-mix(in srgb, var(--accent-2) 6%, transparent), transparent),
    var(--stage);
  background-size: 180% 180%, 180% 180%, auto;
  background-position: 20% 0%, 80% 100%, 0 0;
  animation: dx-drift 26s ease-in-out infinite;
}

/* "AO VIVO" com bolinha piscando. */
.live-badge { display: inline-flex; align-items: center; gap: 4px; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; animation: dx-live-dot 1.2s ease-in-out infinite; }
.flags .live-badge::before { width: 5px; height: 5px; }

/* Ícone gira ao trocar (mutar, ensurdecer, transmitir). */
.icon-swap > svg.i { animation: dx-icon-swap .28s cubic-bezier(.34, 1.56, .64, 1); }

/* Tela compartilhada, cartão "ao vivo", imagem em tela cheia e emojis. */
.screen { animation: dx-scale-in .3s cubic-bezier(.16, 1, .3, 1); }
.live-card { animation: dx-fade-up .3s cubic-bezier(.16, 1, .3, 1); }
.lightbox:not([hidden]) img { animation: dx-scale-in .25s cubic-bezier(.16, 1, .3, 1); }
.emoji-picker:not([hidden]), .mention-box:not([hidden]) { animation: pop-in .14s ease-out; }
.emoji-picker button { transition: transform .12s cubic-bezier(.34, 1.56, .64, 1); }
.emoji-picker button:hover { transform: scale(1.25); }
.msg-images img { transition: transform .2s ease, box-shadow .2s ease; }
.msg-images img:hover { transform: scale(1.02); box-shadow: var(--shadow); }

/* Menção piscando em amarelo ao chegar; reação dando "pop". */
.msg.mention.msg-enter { animation: msg-slide-in .2s ease-out both, dx-flash 1.8s ease-out; }
.msg.reacted .reaction { animation: dx-pop .3s cubic-bezier(.34, 1.56, .64, 1); }
.reaction { transition: transform .12s ease, border-color .15s, background .15s; }
.reaction:hover { transform: translateY(-1px); }

/* Equalizador quando tem música tocando (no painel e no botão da call). */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: bottom; animation: dx-eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
.music-panel:not(.playing) .eq { display: none; }
.ctl .eq { position: absolute; right: 7px; top: 7px; height: 10px; z-index: 2; }
.ctl .eq i { width: 2px; background: var(--accent-2); }
.ctl:not(.playing) .eq { display: none; }

/* Troca de tema suave (só durante a troca). */
html.theme-fade, html.theme-fade * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }

/* Quem pediu "reduzir movimento" no sistema não vê animações. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================ design "ilhas"
   Camada final: o app vira ilhas de vidro flutuando sobre uma aurora na cor do
   tema. Nomes com "gx-" para não colidir com as outras camadas. */

@keyframes gx-aurora {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(-4%, 3%, 0) rotate(7deg) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) rotate(-5deg) scale(1.02); }
}
@keyframes gx-spin { to { rotate: 1turn; } }
@keyframes gx-breathe { 50% { scale: 1.08; opacity: .55; } }
@keyframes gx-tip-in { from { opacity: 0; transform: var(--tip-from); } }
@keyframes gx-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }

:root {
  --island-r: 18px;
  --edge: color-mix(in srgb, var(--text) 8%, transparent);
  --edge-hi: color-mix(in srgb, var(--text) 13%, transparent);
  --glass: color-mix(in srgb, var(--bg-1) 84%, transparent);
  --glass-2: color-mix(in srgb, var(--bg-2) 74%, transparent);
}

/* Aurora + grão de fundo (atrás de tudo, só transform = leve na GPU). */
.app { position: relative; isolation: isolate; padding: 10px; gap: 10px; }
.app.chat-hidden { grid-template-columns: 72px 240px 1fr; }
.app::before {
  content: ""; position: fixed; inset: -25%; z-index: -2; pointer-events: none; will-change: transform;
  background:
    radial-gradient(30% 34% at 18% 22%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    radial-gradient(26% 30% at 84% 16%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 70%),
    radial-gradient(34% 34% at 70% 88%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(26% 26% at 24% 84%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
  animation: gx-aurora 45s ease-in-out infinite alternate;
}
.app::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* As ilhas. */
.sidebar, .main, .chat {
  border-radius: var(--island-r); overflow: hidden; border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 24px 60px -28px #000c;
}
.sidebar, .chat { background: var(--glass); }
.main { background: var(--glass-2); }
.text-view { background: transparent; }
.stage { background-color: color-mix(in srgb, var(--stage) 62%, transparent); }

/* Barra de servidores solta no fundo. */
.guild-rail { background: transparent; border-right: 0; padding: 4px 0; }
.guild-btn { box-shadow: inset 0 0 0 1px var(--edge); }
.guild-btn::before { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.guild-btn.active {
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px color-mix(in srgb, var(--guild) 75%, transparent),
    0 10px 26px -6px color-mix(in srgb, var(--guild) 70%, transparent);
}
.guild-btn.main { box-shadow: none; }
.guild-btn.main.active { box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.guild-btn.add { background: color-mix(in srgb, var(--green) 12%, var(--bg-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent); }
.rail-sep { background: var(--edge-hi); }

/* Cabeçalhos com um leve degradê e o ícone da sala num "chip". */
.guild-header, .topbar, .side-tabs { background: linear-gradient(180deg, color-mix(in srgb, var(--text) 3%, transparent), transparent); }
.guild-name {
  background: linear-gradient(90deg, var(--text) 55%, color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-icon {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; color: var(--text);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), 0 6px 18px -8px var(--accent);
}
.topbar-icon svg.i { width: 18px; height: 18px; }
.room-count {
  background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 30%, transparent);
}

/* Canais: ativo com degradê e contorno, brilho que segue o mouse. */
.channel:hover {
  background-color: color-mix(in srgb, var(--text) 6%, transparent);
  background-image: radial-gradient(120px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
}
.channel.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent) 5%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}
.section-head { letter-spacing: .1em; font-size: 11px; }
.me-panel { background: color-mix(in srgb, var(--bg-0) 70%, transparent); border: 1px solid var(--edge); }
.voice-bar { border: 1px solid var(--edge); border-bottom: 0; }

/* ---------- cards da call */
.tile {
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--tint) 34%, transparent), transparent 62%),
    radial-gradient(90% 70% at 50% 115%, color-mix(in srgb, var(--tint) 16%, transparent), transparent 70%),
    color-mix(in srgb, var(--bg-1) 90%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 24%, var(--edge));
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 22px 44px -26px #000;
}
/* Holofote que acompanha o mouse. */
.tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tint) 24%, transparent), transparent 65%);
}
.tile:hover::before { opacity: 1; }
.tile:hover { border-color: color-mix(in srgb, var(--tint) 55%, var(--edge)); }

/* Falando: anel girando em volta da foto + halo respirando (no lugar do pulso antigo). */
.tile .avatar { position: relative; }
.tile .avatar::before, .tile .avatar::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; opacity: 0;
  transition: opacity .25s ease, scale .35s cubic-bezier(.34, 1.56, .64, 1); scale: .8;
}
.tile .avatar::before {
  inset: -22px; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--green) 38%, transparent), transparent 68%);
}
.tile .avatar::after {
  inset: -9px;
  background: conic-gradient(var(--green), transparent 28%, #7dffb0 50%, transparent 78%, var(--green));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: gx-spin 2.2s linear infinite;
}
.tile.speaking { animation: none; border-color: color-mix(in srgb, var(--green) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent), 0 0 46px -10px color-mix(in srgb, var(--green) 55%, transparent), inset 0 1px 0 var(--edge-hi); }
.tile.speaking .avatar { animation: none; box-shadow: 0 10px 30px #0005; }
.tile.speaking .avatar::before { opacity: 1; scale: 1; animation: gx-breathe 1.6s ease-in-out infinite; }
.tile.speaking .avatar::after { opacity: 1; scale: 1; }
.stage.has-screen .tile .avatar { margin: 0; }
.stage.has-screen .tile .name { box-shadow: none; }
.stage.has-screen .tile .avatar::after { inset: -5px; }
.stage.has-screen .tile .avatar::before { inset: -10px; }
.tile .name { background: color-mix(in srgb, #000 55%, transparent); box-shadow: inset 0 0 0 1px #ffffff14; }
/* Reconectando: card apagado, com selo e rodinha girando. */
.tile-status {
  position: absolute; top: 10px; left: 50%; translate: -50% 0; z-index: 2; display: none; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #ffd27a; white-space: nowrap;
  background: color-mix(in srgb, #000 60%, transparent); box-shadow: inset 0 0 0 1px #f5b94255;
}
.tile-status i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #f5b94244; border-top-color: #f5b942; animation: gx-spin .8s linear infinite; }
.tile.reconnecting .tile-status { display: inline-flex; animation: dx-fade-up .25s ease; }
.tile.reconnecting .avatar { filter: grayscale(.8) brightness(.7); transition: filter .3s; }
.tile.reconnecting { border-color: #f5b94255; }
.tile.reconnecting .net { display: none; }
.stage.has-screen .tile-status { position: static; translate: none; order: 4; padding: 2px 8px; font-size: 11px; }
/* Sem tela compartilhada, os cards ficam no meio do palco (e não grudados no topo). */
.stage:not(.has-screen) > .tiles { margin-block: auto; }

/* ---------- dock de controles */
.controls {
  padding: 8px; gap: 6px; border-radius: 22px;
  background: color-mix(in srgb, var(--bg-1) 72%, transparent); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 26px 60px -18px #000d;
}
.ctl { background: color-mix(in srgb, var(--bg-3) 80%, transparent); box-shadow: inset 0 0 0 1px var(--edge); }
.ctl::before { background: radial-gradient(70px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--text) 18%, transparent), transparent 70%); }
.ctl.danger { background: linear-gradient(135deg, #ff5f5f, var(--red) 55%, #c81e4a); box-shadow: 0 6px 20px -6px var(--red); }
.ctl.active { box-shadow: 0 6px 22px -6px var(--accent), inset 0 1px 0 #ffffff40; }
.ctl-select { background: color-mix(in srgb, var(--bg-3) 80%, transparent); box-shadow: inset 0 0 0 1px var(--edge); }

/* ---------- chat e canais de texto */
.text-messages .msg, .messages .msg { transition: background .15s ease, box-shadow .15s ease; }
.text-messages .msg:hover, .messages .msg:not(.system):hover {
  background: color-mix(in srgb, var(--text) 4%, transparent);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
}
.text-composer, .chat-form {
  background: color-mix(in srgb, var(--bg-3) 75%, transparent); border: 1px solid var(--edge);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.text-composer:focus-within, .chat-form:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 12px 32px -14px var(--accent);
}
.side-tab.active { border-image: linear-gradient(90deg, var(--accent), var(--accent-2)) 1; }
.member { transition: background .15s ease, transform .15s ease; }
.member:hover { background: color-mix(in srgb, var(--text) 6%, transparent); transform: translateX(2px); }

/* ---------- painéis flutuantes */
.music-panel, .profile-card, .ctx-menu, .emoji-picker, .mention-box {
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--edge-hi);
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 24px 60px -16px #000c;
}
.dialog {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--bg-2)), var(--bg-2) 40%);
  border: 1px solid var(--edge-hi); box-shadow: inset 0 1px 0 var(--edge-hi), 0 30px 80px -20px #000d;
}
/* Botão principal com reflexo passando. */
.btn.primary {
  background-image: linear-gradient(110deg, transparent 35%, #ffffff30 50%, transparent 65%), linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 250% 100%, 100% 100%; background-position: 200% 0, 0 0;
}
.btn.primary:hover { animation: gx-shine 1s ease; }

/* ---------- transmissão de tela */
@keyframes gx-live-border { to { --gx-angle: 360deg; } }
@property --gx-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.screens { gap: 14px; }
.stage.multi-screen .screens { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }
.screen {
  border-radius: 18px; border: 1px solid var(--edge-hi); background: #000;
  box-shadow: 0 0 0 1px #0006, 0 30px 70px -30px #000, 0 0 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}
.screen video { border-radius: inherit; }
.screen .label, .screen .screen-actions { transition: opacity .25s ease, transform .25s ease; }
/* Barra de cima com degradê, quem transmite e "AO VIVO". */
.screen .label {
  left: 0; right: 0; top: 0; bottom: auto; border-radius: 0; padding: 12px 14px 26px; gap: 8px; font-size: 14px;
  background: linear-gradient(180deg, #000c, #0000); backdrop-filter: none;
}
.screen .label .avatar { box-shadow: 0 0 0 2px #fff3; }
.screen-who { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen .screen-viewers { margin-left: auto; font-size: 12px; font-weight: 600; color: #fffb; }
/* Controles embaixo, com degradê. */
.screen .screen-actions {
  left: 0; right: 0; top: auto; bottom: 0; padding: 26px 12px 12px; gap: 6px; align-items: center;
  background: linear-gradient(0deg, #000c, #0000); opacity: 0; transform: translateY(6px);
}
.screen .screen-actions > span { flex: 1; }
.screen:hover .screen-actions, .screen:focus-within .screen-actions { opacity: 1; transform: none; }
.screen .screen-actions button {
  width: 38px; height: 38px; border-radius: 11px; background: #ffffff1a; backdrop-filter: blur(10px);
  transition: background .15s, transform .15s;
}
.screen .screen-actions button:hover { background: #ffffff33; transform: translateY(-1px); }
.screen .screen-actions .screen-close:hover { background: var(--red); }
.screen-vol { display: flex; align-items: center; gap: 4px; padding-right: 10px; border-radius: 12px; background: #ffffff12; }
.screen-vol input { width: 0; opacity: 0; accent-color: #fff; transition: width .25s ease, opacity .2s ease; padding: 0; border: 0; background: none; box-shadow: none; }
.screen-vol:hover input, .screen-vol:focus-within input { width: 110px; opacity: 1; }
.screen-vol .screen-audio-btn { background: none !important; }
.screen[data-audio-off="1"] .screen-audio-btn { color: #ff8a8a; }
/* Tela cheia: mouse parado esconde tudo. */
.screen:fullscreen { border-radius: 0; border: 0; }
.screen.idle .label, .screen.idle .screen-actions { opacity: 0; }
.screen.idle { cursor: none; }

/* Palco com tela: a tela ocupa o espaço (sem rolar) e os cards viram uma faixa. */
.stage.has-screen { overflow: hidden; }
.stage.has-screen .screens { flex: 1 1 auto; min-height: 220px; }
.stage.has-screen:not(.multi-screen) .screens { display: flex; }
.stage.has-screen:not(.multi-screen) .screen { flex: 1; aspect-ratio: auto; min-height: 0; }
.stage.has-screen .tiles { display: flex; gap: 8px; overflow-x: auto; flex: none; padding-bottom: 2px; scrollbar-width: thin; }
.stage.has-screen .tile { flex: none; width: 190px; max-width: none; }
/* Várias telas: destaque à esquerda, miniaturas à direita. */
.stage.multi-screen .screens { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 10px; align-content: stretch; }
.stage.multi-screen .screen.focus { grid-column: 1; grid-row: 1 / -1; aspect-ratio: auto; min-height: 0; }
.stage.multi-screen .screen:not(.focus) { grid-column: 2; aspect-ratio: 16 / 9; cursor: pointer; border-radius: 12px; transition: transform .2s ease, box-shadow .2s ease; }
.stage.multi-screen .screen:not(.focus):hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent), 0 16px 30px -16px #000; }
.stage.multi-screen .screen:not(.focus) .screen-actions,
.stage.multi-screen .screen:not(.focus) .live-badge,
.stage.multi-screen .screen:not(.focus) .screen-viewers { display: none; }
.stage.multi-screen .screen:not(.focus) .label { padding: 7px 9px 16px; font-size: 12px; }
.stage.multi-screen .screen:not(.focus)::after {
  content: "Clique para destacar"; position: absolute; inset: auto 0 0; padding: 14px 8px 6px; text-align: center;
  font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(0deg, #000b, #0000); opacity: 0; transition: opacity .2s;
}
.stage.multi-screen .screen:not(.focus):hover::after { opacity: 1; }
/* Palco estreito (janela pequena, chat aberto, celular): miniaturas embaixo do destaque. */
.stage { container-type: inline-size; }
@container (max-width: 820px) {
  .stage.multi-screen .screens { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-template-rows: none !important; align-content: start; }
  .stage.multi-screen .screen.focus { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 9; }
  .stage.multi-screen .screen:not(.focus) { grid-column: auto; }
}

/* Quem está vendo (fotinhas na barra da tela) e "vendo Fulano" nos cards. */
.screen .screen-viewers { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 7px; border-radius: 999px; background: #0007; }
.screen .screen-viewers[hidden] { display: none; }
.screen-viewers svg.i { width: 14px; height: 14px; }
.av-stack { display: inline-flex; }
.av-stack .avatar { box-shadow: 0 0 0 2px #000a; }
.av-stack .avatar + .avatar { margin-left: -6px; }
.tile-watch {
  position: absolute; right: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; max-width: 55%;
  padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff;
  background: color-mix(in srgb, var(--accent) 55%, #000); box-shadow: inset 0 0 0 1px #ffffff22, 0 6px 14px -8px var(--accent);
  animation: dx-fade-up .25s ease;
}
.tile-watch[hidden] { display: none; }
.tile-watch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-watch svg.i { width: 13px; height: 13px; flex: none; }
.stage.has-screen .tile-watch { position: static; order: 5; padding: 3px 6px; max-width: none; }
.stage.has-screen .tile-watch span { display: none; }

/* Painel da minha transmissão (clique no botão de tela durante a live). */
.share-panel {
  position: fixed; z-index: 100; width: min(340px, 92vw); padding: 16px; border-radius: 20px; display: grid; gap: 10px;
  background: color-mix(in srgb, var(--bg-1) 90%, transparent); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--edge-hi); box-shadow: inset 0 1px 0 var(--edge-hi), 0 30px 70px -20px #000d;
  animation: dx-fade-up .25s cubic-bezier(.16, 1, .3, 1);
}
.sp-head { display: flex; align-items: center; gap: 8px; }
.sp-head b { font-size: 15px; }
.sp-time { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.sp-viewers { margin: -4px 0 0; font-size: 13px; color: var(--text-dim); }
.sp-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-top: 4px; }
.sp-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-quality button {
  display: grid; gap: 1px; justify-items: start; padding: 9px 11px; border-radius: 12px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent); border: 1px solid var(--edge); color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
}
.sp-quality button:hover { border-color: var(--edge-hi); transform: translateY(-1px); }
.sp-quality button b { font-size: 14px; }
.sp-quality button small { font-size: 11px; color: var(--text-dim); }
.sp-quality button.sel {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent));
}
.sp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.sp-actions .btn, .sp-stop { justify-content: center; white-space: nowrap; }
.sp-stop { width: 100%; }

/* Faixa "Fulano está ao vivo" (em cima dos cards). */
@keyframes gx-live-sheen { from { background-position: -150% 0, 0 0; } to { background-position: 250% 0, 0 0; } }
@keyframes gx-cta-pulse { 0% { box-shadow: 0 0 0 0 #ef444480, 0 10px 24px -10px #ef4444; } 100% { box-shadow: 0 0 0 12px #ef444400, 0 10px 24px -10px #ef4444; } }
.live-cards { gap: 10px; }
.live-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 18px; border-radius: 18px; border: 0;
  background:
    linear-gradient(100deg, transparent 30%, #ffffff0d 45%, transparent 60%),
    linear-gradient(90deg, color-mix(in srgb, var(--red) 16%, var(--bg-1)), color-mix(in srgb, var(--bg-1) 88%, transparent) 55%);
  background-size: 250% 100%, 100% 100%;
  animation: dx-fade-up .3s cubic-bezier(.16, 1, .3, 1), gx-live-sheen 5s linear infinite;
  box-shadow: inset 0 1px 0 var(--edge-hi), 0 18px 40px -24px #000, 0 0 40px -20px var(--red);
}
/* Borda girando em vermelho/destaque, como uma live. */
.live-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--gx-angle), var(--red), var(--accent-2), var(--accent), var(--red));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: gx-live-border 4s linear infinite;
}
/* Barrinha vermelha na esquerda. */
.live-card::after {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #ff6b6b, var(--red)); box-shadow: 0 0 12px var(--red);
}
.live-av { position: relative; flex: none; }
.live-av .avatar { --size: 44px; }
.live-av::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--red);
  animation: gx-breathe 1.6s ease-in-out infinite;
}
.live-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.live-text strong { display: flex; align-items: center; gap: 8px; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-text small { color: var(--text-dim); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card .btn { flex: none; padding: 9px 16px; border-radius: 12px; font-weight: 700; }
/* "Ver tela" bem chamativo: vermelho com pulso. */
.live-card:not(.mine):not(.connecting) .btn.primary {
  background: linear-gradient(135deg, #ff5a5a, var(--red) 55%, #f97316); color: #fff;
  animation: gx-cta-pulse 1.8s ease-out infinite;
}
.live-card .btn.primary:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.08); }
.live-card.mine .btn.primary { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px var(--edge-hi); }
.live-card.connecting .live-text small::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: -1px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: gx-spin .8s linear infinite;
}
@media (max-width: 600px) {
  .live-card { flex-wrap: wrap; }
  .live-text { flex-basis: calc(100% - 60px); }
  .live-card .btn { flex: 1; justify-content: center; }
}


/* ---------- adicionar servidor */
@keyframes gx-orbit { to { rotate: 1turn; } }
@keyframes gx-counter { to { rotate: -1turn; } }
.dialog.guild-dialog { width: min(460px, 94vw); padding: 26px 24px 22px; overflow: hidden; }
.guild-dialog::before {
  content: ""; position: absolute; inset: -30% -20% auto; height: 60%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
}
.gd-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.gd-step { display: grid; gap: 12px; animation: dx-fade-up .3s cubic-bezier(.16, 1, .3, 1); }
.gd-step h2 { margin: 0; font-size: 22px; }
.gd-step > p { margin: 0; }
.gd-hero { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 8px; }
.gd-hero p { max-width: 330px; margin: 0; }
/* Logo com três "servidores" girando em volta. */
.gd-orbit { position: relative; width: 120px; height: 120px; display: grid; place-items: center; margin-bottom: 4px; animation: gx-orbit 18s linear infinite; }
.gd-orbit img { width: 64px; height: 64px; animation: gx-counter 18s linear infinite; filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--accent) 55%, transparent)); }
.gd-orbit span { position: absolute; width: 26px; height: 26px; border-radius: 9px; box-shadow: 0 6px 16px -6px #000; }
.gd-orbit span:nth-child(1) { top: 0; left: 47px; background: linear-gradient(135deg, #ec4899, #a855f7); }
.gd-orbit span:nth-child(2) { bottom: 10px; left: 4px; background: linear-gradient(135deg, #22c55e, #06b6d4); }
.gd-orbit span:nth-child(3) { bottom: 10px; right: 4px; background: linear-gradient(135deg, #f97316, #eab308); }

.gd-option {
  display: grid; grid-template-columns: 46px 1fr 20px; align-items: center; gap: 14px; width: 100%;
  padding: 14px; border-radius: 16px; cursor: pointer; text-align: left;
  background: color-mix(in srgb, var(--bg-1) 75%, transparent); border: 1px solid var(--edge);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), border-color .15s ease, box-shadow .2s ease, background .15s ease;
}
.gd-option:hover {
  transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--edge));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-1)); box-shadow: 0 14px 30px -16px var(--accent);
}
.gd-option:hover .gd-chev { transform: translateX(3px); color: var(--text); }
.gd-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.gd-ic svg.i { width: 22px; height: 22px; }
.gd-ic.create { background: linear-gradient(135deg, var(--green), #10b981); box-shadow: 0 8px 20px -8px var(--green); }
.gd-ic.join { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 20px -8px var(--accent); }
.gd-opt-text { display: grid; gap: 2px; min-width: 0; }
.gd-opt-text b { font-size: 15px; }
.gd-opt-text small { color: var(--text-dim); font-size: 13px; }
.gd-chev { color: var(--text-dim); transition: transform .2s ease, color .15s; }
.gd-chev svg.i { width: 20px; height: 20px; }

.gd-back {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 2px; margin: -6px 0 2px;
  border: 0; background: none; cursor: pointer; color: var(--text-dim); font-weight: 600; border-radius: 8px;
}
.gd-back:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.gd-back svg.i { width: 18px; height: 18px; }

/* Prévia de como o servidor vai aparecer na barra. */
.gd-preview {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--bg-0) 60%, transparent); border: 1px solid var(--edge);
}
.gd-icon {
  --guild: var(--accent);
  width: 60px; height: 60px; flex: none; border-radius: 18px; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff; text-shadow: 0 1px 2px #0004;
  background: linear-gradient(135deg, var(--guild), color-mix(in srgb, var(--guild) 60%, #000));
  box-shadow: 0 10px 26px -10px var(--guild), inset 0 1px 0 #ffffff33;
  transition: background .25s ease, box-shadow .25s ease;
}
/* Ícone com imagem: clicável para trocar. */
.gd-icon.pick { border: 0; padding: 0; width: 60px; min-width: 60px; cursor: pointer; position: relative; overflow: hidden; font-family: inherit; }
.gd-icon.pick::after {
  content: "Trocar"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: #0009; opacity: 0; transition: opacity .15s;
}
.gd-icon.pick:hover::after { opacity: 1; }
.gd-icon.has-img { background: var(--bg-2); }
.gd-icon img, .guild-btn.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guild-btn.has-img { padding: 0; overflow: hidden; background: var(--bg-2); }
.guild-btn.has-img.spy { overflow: visible; }
.guild-btn.has-img.spy img { border-radius: inherit; }
.guild-btn .spy-badge {
  position: absolute; left: -4px; top: -4px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; background: var(--bg-0); box-shadow: 0 0 0 2px var(--bg-0);
}
.gd-icon-row { display: flex; align-items: center; gap: 14px; }
.gd-icon-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.gd-icon-actions .btn svg.i { width: 15px; height: 15px; margin-right: 4px; }
.gd-icon-color { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.gd-icon-color input { width: 34px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.gd-preview-text { display: grid; gap: 2px; min-width: 0; }
.gd-preview-text b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-preview-text small { color: var(--text-dim); }
.gd-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-suggest button {
  border: 1px solid var(--edge); background: color-mix(in srgb, var(--bg-3) 60%, transparent); color: var(--text-dim);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s, transform .15s;
}
.gd-suggest button:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--edge)); transform: translateY(-1px); }
.gd-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.gd-colors button {
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c);
  box-shadow: inset 0 0 0 2px #ffffff22; transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), box-shadow .15s;
}
.gd-colors button:hover { transform: scale(1.12); }
.gd-colors button.sel { box-shadow: 0 0 0 3px var(--bg-2), 0 0 0 5px var(--c); transform: scale(1.05); }
.gd-submit { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 4px; }

.gd-join-art {
  justify-self: center; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 30px -10px var(--accent);
}
.gd-join-art svg.i { width: 30px; height: 30px; }
[data-step="join"] h2, [data-step="join"] > p { text-align: center; }
.gd-code {
  text-align: center; font: 700 24px/1 Consolas, monospace; letter-spacing: .25em; text-transform: uppercase; padding: 14px;
}
.gd-code::placeholder { letter-spacing: .25em; opacity: .35; }
.gd-hint { text-align: center; }
.gd-error { text-align: center; margin-top: 10px; }

/* ---------- atualização obrigatória */
.dialog.update-dialog { width: min(400px, 92vw); padding: 30px 26px 22px; text-align: center; overflow: hidden; }
.update-dialog[open] { display: grid; justify-items: center; gap: 10px; }
.update-dialog::backdrop { background: #000c; backdrop-filter: blur(8px); }
.update-dialog::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 70%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 35%, transparent), transparent);
}
.update-dialog h2 { margin: 6px 0 0; font-size: 22px; }
.update-dialog p { margin: 0; max-width: 320px; }
.update-art { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.update-art img { width: 72px; height: 72px; filter: drop-shadow(0 12px 30px color-mix(in srgb, var(--accent) 55%, transparent)); animation: empty-logo-float 3s ease-in-out infinite alternate; }
.update-art::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(var(--accent), transparent 35%, var(--accent-2) 60%, transparent 85%, var(--accent));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  animation: gx-spin 3s linear infinite;
}
.update-btn { width: 100%; justify-content: center; padding: 13px 18px; font-size: 15px; margin-top: 8px; }
.update-manual { font-size: 12px; color: var(--text-dim); }

/* Câmera no card: o vídeo cobre o card e a foto some. */
.tile-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: none; background: #000; }
.tile-cam.mirror { transform: scaleX(-1); }
.tile.has-cam .tile-cam { display: block; animation: dx-fade-up .3s ease; }
.tile.has-cam > .avatar { visibility: hidden; }
.tile.has-cam::before { z-index: 1; }
.tile.has-cam .name, .tile.has-cam .net, .tile.has-cam .tile-vol, .tile.has-cam .tile-watch, .tile.has-cam .tile-status { z-index: 2; }
/* Falando com a câmera ligada: borda verde por dentro (o anel da foto não aparece). */
.tile.has-cam.speaking { box-shadow: inset 0 0 0 3px var(--green), 0 0 46px -10px color-mix(in srgb, var(--green) 55%, transparent); }
.stage.has-screen .tile.has-cam > .avatar { visibility: visible; }
.stage.has-screen .tile.has-cam .tile-cam { display: none; }

/* Ausente. */
.afk-badge {
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px; white-space: nowrap; flex: none;
  background: color-mix(in srgb, #f5b942 25%, transparent); color: #ffd27a; letter-spacing: .02em;
}

/* Agenda na lateral. */
.events { display: grid; gap: 8px; padding: 0 8px 6px; }
.events-empty {
  border: 1px dashed var(--edge-hi); background: none; color: var(--text-dim); border-radius: 10px; padding: 9px 10px;
  font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; transition: color .15s, border-color .15s;
}
.events-empty:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--edge-hi)); }
.event-card {
  position: relative; display: grid; gap: 4px; padding: 10px 10px 10px 14px; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 8%, color-mix(in srgb, var(--bg-2) 80%, transparent)); border: 1px solid var(--edge);
  animation: dx-fade-up .3s ease;
}
.event-card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.event-card.now::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.event-title { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-when { font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.event-card.now .event-when { color: var(--green); }
.event-who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.event-who .avatar { --size: 18px; font-size: 8px; }
.event-rsvp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 2px; }
.event-rsvp button {
  padding: 4px 0; border-radius: 8px; border: 1px solid var(--edge); background: color-mix(in srgb, var(--bg-3) 50%, transparent);
  color: var(--text-dim); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s;
}
.event-rsvp button:hover { color: var(--text); border-color: var(--edge-hi); }
.event-rsvp button.sel { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.dialog.event-dialog { width: min(440px, 94vw); }
.event-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.event-quick button {
  border: 1px solid var(--edge); background: color-mix(in srgb, var(--bg-3) 60%, transparent); color: var(--text-dim);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.event-quick button:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--edge)); }

/* Som de entrada: botões com ▶. */
.join-sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.join-sound {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px;
  color: var(--text); background: color-mix(in srgb, var(--bg-3) 55%, transparent); border: 1px solid var(--edge); transition: border-color .15s, transform .15s;
}
.join-sound svg.i { width: 14px; height: 14px; color: var(--accent); flex: none; }
.join-sound:hover { border-color: var(--edge-hi); transform: translateY(-1px); }
.join-sound.sel { border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 10%, transparent)); }

/* "Bora jogar?": cartões no canto da tela. */
@keyframes gx-summon-in { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes gx-shake { 10%, 30% { rotate: -8deg; } 20%, 40% { rotate: 8deg; } 50% { rotate: 0deg; } }
.summons { position: fixed; right: 18px; top: 72px; z-index: 120; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.summon-card {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 16px; background: color-mix(in srgb, var(--bg-1) 92%, transparent); backdrop-filter: blur(18px);
  border: 1px solid var(--edge-hi); box-shadow: 0 24px 60px -18px #000d, 0 0 40px -18px var(--accent);
  animation: gx-summon-in .35s cubic-bezier(.16, 1, .3, 1);
}
.summon-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: -1; pointer-events: none;
  background: conic-gradient(from var(--gx-angle), var(--accent), var(--accent-2), var(--green), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: gx-live-border 3s linear infinite;
}
.summon-card.leaving { opacity: 0; transform: translateX(30px); transition: opacity .25s, transform .25s; }
.summon-av { flex: none; animation: gx-shake 1.2s ease .3s 2; }
.summon-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.summon-text b { font-size: 14px; }
.summon-text small { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summon-card .btn { flex: none; padding: 8px 14px; }
@media (max-width: 900px) { .summons { top: calc(64px + env(safe-area-inset-top)); right: 12px; } }

/* Mensagem de voz. */
.voice-msg {
  display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 8px 12px 8px 8px; width: min(340px, 100%);
  border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--bg-1)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--edge));
}
.voice-play {
  width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px -8px var(--accent); transition: transform .15s;
}
.voice-play:hover { transform: scale(1.08); }
.voice-play svg.i { width: 16px; height: 16px; fill: currentColor; }
.voice-wave { flex: 1; height: 28px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--text) 25%, transparent); transition: background .15s; }
.voice-wave i.on { background: var(--accent); }
.voice-msg.playing .voice-wave i.on:last-of-type { background: var(--accent-2); }
.voice-time { font-size: 12px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* Gravando mensagem de voz (no lugar da caixa de texto). */
.voice-rec { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 6px; animation: dx-fade-up .2s ease; }
.voice-rec[hidden] { display: none; }
.voice-rec .icon-btn { color: var(--red); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: dx-live-dot 1s ease-in-out infinite; }
.rec-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 38px; }
.rec-level { display: flex; align-items: center; gap: 3px; height: 26px; width: 90px; }
.rec-level i { flex: 1; height: 15%; border-radius: 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); transition: height .08s; }
.rec-hint { flex: 1; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Enquete. */
.poll-card {
  display: grid; gap: 6px; margin-top: 4px; padding: 12px; width: min(420px, 100%); border-radius: 14px;
  background: color-mix(in srgb, var(--bg-1) 80%, transparent); border: 1px solid var(--edge-hi);
}
.poll-q { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.poll-q svg.i { width: 18px; height: 18px; color: var(--accent); flex: none; }
.poll-opt {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); font: inherit; font-size: 14px;
  background: color-mix(in srgb, var(--bg-3) 60%, transparent); border: 1px solid var(--edge); isolation: isolate;
  transition: border-color .15s, transform .15s;
}
.poll-opt::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); z-index: -1;
  background: color-mix(in srgb, var(--accent) 22%, transparent); transition: width .5s cubic-bezier(.16, 1, .3, 1);
}
.poll-opt.leading::before { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.poll-opt:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--edge)); transform: translateX(2px); }
.poll-opt.mine { border-color: var(--accent); }
.poll-opt.mine .poll-label::after { content: " ✓"; color: var(--accent); font-weight: 800; }
.poll-label { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-val { font-size: 12px; font-weight: 700; color: var(--text-dim); flex: none; font-variant-numeric: tabular-nums; }
.poll-foot { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.dialog.poll-dialog { width: min(440px, 94vw); }
.poll-options-edit { display: grid; gap: 6px; }
.poll-opt-edit { display: flex; gap: 6px; align-items: center; }
.poll-opt-edit input { flex: 1; min-width: 0; }

/* Resumo da call. */
@keyframes gx-bar { from { width: 0; } }
.dialog.summary-dialog { width: min(460px, 94vw); padding: 24px 22px 18px; display: none; }
.summary-dialog[open] { display: grid; gap: 12px; }
.sum-head { display: flex; align-items: center; gap: 12px; }
.sum-head h2 { margin: 0; font-size: 20px; }
.sum-head p { margin: 2px 0 0; }
.sum-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px -10px var(--accent);
}
.sum-list { display: grid; gap: 6px; }
.sum-row {
  display: grid; grid-template-columns: 26px 22px minmax(0, 150px) 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 10px; animation: dx-fade-up .3s ease both; animation-delay: var(--d);
}
.sum-row.me { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sum-pos { font-size: 15px; text-align: center; font-weight: 700; color: var(--text-dim); }
.sum-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-bar { height: 8px; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); position: relative; overflow: hidden; }
.sum-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: gx-bar .8s cubic-bezier(.16, 1, .3, 1) both; animation-delay: var(--d);
}
.sum-val { font-size: 12px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.sum-awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum-awards[hidden] { display: none; }
.sum-award {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg-1) 70%, transparent); border: 1px solid var(--edge);
}
.sum-emoji { font-size: 24px; animation: dx-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
.sum-award span:last-child { display: grid; min-width: 0; }
.sum-award b { font-size: 13px; }
.sum-award small { font-size: 11px; color: var(--text-dim); }
@media (max-width: 520px) { .sum-awards { grid-template-columns: 1fr; } }

/* Responder e editar mensagens. */
.text-messages .msg.has-reply { flex-wrap: wrap; }
.text-messages .msg.has-reply .msg-body { flex: 1; }
.msg-reply {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 0 2px 18px; padding: 0 0 0 26px;
  position: relative; border: 0; background: none; cursor: pointer; font-size: 12.5px; color: var(--text-dim); text-align: left;
}
/* O "cotovelo" ligando a resposta à mensagem original. */
.msg-reply::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 22px; height: 12px;
  border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); border-right: 0; border-bottom: 0; border-top-left-radius: 8px;
}
.msg-reply .avatar { --size: 16px; font-size: 8px; }
.msg-reply b { font-weight: 700; flex: none; }
.msg-reply span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg-reply:hover span { color: var(--text); }
@keyframes gx-flash { from { background: color-mix(in srgb, var(--accent) 30%, transparent); } }
.text-messages .msg.flash { animation: gx-flash 1.6s ease-out; }
.msg-edited { font-size: 11px; color: var(--text-dim); }
.msg-edit { display: grid; gap: 4px; margin-top: 2px; }
.msg-edit textarea {
  width: 100%; resize: vertical; min-height: 40px; padding: 8px 10px; border-radius: 10px; font: inherit; color: var(--text);
  background: color-mix(in srgb, var(--bg-3) 80%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); outline: none;
}
.msg-edit small { font-size: 11px; color: var(--text-dim); }
.msg-edit small b { color: var(--accent); font-weight: 600; }
.reply-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; font-size: 13px; color: var(--text-dim);
  border-bottom: 1px solid var(--edge); border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--accent) 10%, transparent); animation: dx-fade-up .2s ease;
}
.reply-bar[hidden] { display: none; }
.reply-bar > span:first-child svg.i { width: 16px; height: 16px; color: var(--accent); }
.reply-bar-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar-text b { color: var(--text); }

/* Jogando agora (lista de membros e barra lateral). */
.member-sub.playing { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.member-sub.playing svg.i { color: currentColor; }
.flag-game { display: inline-grid; place-items: center; color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
.update-manual:hover { color: var(--accent); }

/* Mapa de conexão. */
.dialog.net-dialog { width: min(620px, 96vw); padding: 24px 22px 18px; display: none; }
.net-dialog[open] { display: grid; gap: 12px; }
.net-verdict { padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--text) 6%, transparent); }
.net-verdict.good { background: color-mix(in srgb, var(--green) 14%, transparent); color: color-mix(in srgb, var(--green) 70%, var(--text)); }
.net-verdict.bad { background: color-mix(in srgb, var(--red) 13%, transparent); color: color-mix(in srgb, var(--red) 60%, var(--text)); }
.net-matrix { display: grid; grid-template-columns: minmax(110px, 160px) repeat(var(--n), minmax(52px, 1fr)); gap: 4px; align-items: center; overflow-x: auto; }
.net-col { display: grid; place-items: center; padding-bottom: 2px; }
.net-row { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.net-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-cell {
  display: grid; place-items: center; height: 34px; border-radius: 8px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text-dim);
}
.net-cell.self { background: repeating-linear-gradient(45deg, transparent 0 6px, color-mix(in srgb, var(--text) 5%, transparent) 6px 12px); }
.net-cell.good { background: color-mix(in srgb, var(--green) 22%, transparent); color: color-mix(in srgb, var(--green) 60%, var(--text)); }
.net-cell.ok { background: color-mix(in srgb, #f5b942 22%, transparent); color: #ffd27a; }
.net-cell.bad { background: color-mix(in srgb, var(--red) 24%, transparent); color: #ff9b9b; }

/* Ponteiro laser na tela transmitida. */
@keyframes gx-laser { 50% { scale: 1.35; } }
.laser-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; border-radius: inherit; }
.laser-dot { position: absolute; transition: left .06s linear, top .06s linear, opacity .4s ease; }
.laser-dot.fading { opacity: 0; }
.laser-dot i {
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 22%, var(--c) 30% 60%, transparent 72%);
  box-shadow: 0 0 14px 4px var(--c), 0 0 32px 10px color-mix(in srgb, var(--c) 45%, transparent);
  animation: gx-laser .8s ease-in-out infinite;
}
.laser-dot span {
  position: absolute; left: 12px; top: 8px; white-space: nowrap; font-size: 11px; font-weight: 800; color: #fff;
  padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 75%, #000); box-shadow: 0 4px 12px #0008;
}
.screen.focus video, .stage:not(.multi-screen) .screen video { cursor: crosshair; }
.screen.aiming .label, .screen.aiming .screen-actions { opacity: 0 !important; }

/* ---------- configurações: menu lateral + conteúdo em grupos */
@keyframes gx-capture { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); } }
.dialog.settings-dialog { width: min(940px, 96vw); height: min(680px, 92vh); padding: 0; overflow: hidden; }
.dialog.settings-dialog .settings-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; height: 100%; }
.set-group, .set-group .field { min-width: 0; }
.set-group select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.settings-nav {
  flex-direction: column; align-items: stretch; gap: 2px; border-bottom: 0; padding: 18px 10px; overflow-y: auto;
  background: color-mix(in srgb, var(--bg-0) 55%, transparent); border-right: 1px solid var(--edge);
}
.settings-nav-title {
  font-weight: 800; font-size: 18px; padding: 4px 10px 6px;
  background: linear-gradient(90deg, var(--text), color-mix(in srgb, var(--accent) 70%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.settings-nav-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); padding: 14px 10px 6px; }
.settings-nav .tab {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; border: 0; margin: 0; text-align: left;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.settings-nav .tab .tab-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-nav .tab svg.i { width: 18px; height: 18px; flex: none; }
.settings-nav .tab:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); transform: translateX(2px); }
.settings-nav .tab.active {
  color: var(--text);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent) 6%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.settings-nav .tab.active svg.i { color: var(--accent); }
.settings-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 14px; border-bottom: 1px solid var(--edge); }
.settings-head h2 { margin: 0; font-size: 20px; }
.settings-scroll { flex: 1; overflow-y: auto; padding: 18px 22px 24px; }
.settings-scroll .tab-panel { gap: 14px; min-height: 0; animation: dx-fade-up .25s cubic-bezier(.16, 1, .3, 1); }
.set-group {
  display: grid; gap: 12px; padding: 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg-1) 70%, transparent); border: 1px solid var(--edge);
}
.dialog .set-group h3 { margin: 0; font-size: 12px; letter-spacing: .08em; }
.set-group > p { margin: 0; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.set-grid select { width: 100%; }

.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-card {
  position: relative; display: grid; gap: 4px; justify-items: start; align-content: start; padding: 14px; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--bg-3) 55%, transparent); border: 1px solid var(--edge);
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .2s ease;
}
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card > span svg.i { width: 20px; height: 20px; color: var(--text-dim); margin-bottom: 4px; }
.mode-card b { font-size: 14px; }
.mode-card small { color: var(--text-dim); font-size: 12px; line-height: 1.35; }
.mode-card:hover { border-color: var(--edge-hi); transform: translateY(-1px); }
.mode-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent));
  box-shadow: 0 10px 26px -14px var(--accent);
}
.mode-card:has(input:checked) > span svg.i { color: var(--accent); }
.mode-card:has(input:checked)::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--accent); color: var(--on-accent);
  animation: dx-pop .3s cubic-bezier(.34, 1.56, .64, 1);
}

.settings-dialog .mic-test { background: none; padding: 0; }
.pf-row.wrap { flex-wrap: wrap; }
.rec-btn { position: relative; overflow: hidden; }
.rec-btn::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: #fff; opacity: .9; }
.rec-btn.recording { background: linear-gradient(135deg, #ff6b6b, var(--red)); }
.rec-btn.recording svg.i { animation: dx-live-dot 1s ease-in-out infinite; }
kbd {
  font: 700 12px/1 Consolas, monospace; padding: 3px 7px; border-radius: 6px; color: var(--text);
  background: var(--bg-3); border: 1px solid var(--edge-hi); border-bottom-width: 2px;
}

.hotkeys { display: grid; gap: 8px; }
.hotkey-row {
  display: grid; grid-template-columns: 1fr auto 32px; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg-3) 45%, transparent); font-weight: 600;
}
.hotkey-key {
  min-width: 160px; padding: 9px 14px; border-radius: 10px; cursor: pointer; text-align: center;
  font: 700 13px/1 Consolas, monospace; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--edge-hi); border-bottom-width: 3px; transition: border-color .15s, transform .1s, color .15s;
}
.hotkey-key:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--edge-hi)); }
.hotkey-key:active { transform: translateY(1px); }
.hotkey-key.empty { font-family: inherit; font-weight: 600; color: var(--text-dim); border-style: dashed; border-bottom-width: 1px; }
.hotkey-key.capturing { font-family: inherit; color: var(--accent); border-color: var(--accent); border-style: solid; animation: gx-capture 1.2s ease-in-out infinite; }

/* Escolha do canto da janelinha: um "monitor" com 4 cantos clicáveis. */
.ov-corners {
  position: relative; width: 168px; aspect-ratio: 16 / 10; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr;
  gap: 6px; padding: 8px; background: color-mix(in srgb, var(--bg-0) 70%, transparent); border: 2px solid var(--edge-hi);
}
.ov-corners::after { content: ""; position: absolute; left: 50%; bottom: -10px; translate: -50% 0; width: 40px; height: 6px; border-radius: 0 0 6px 6px; background: var(--edge-hi); }
.ov-corners button {
  border: 1px dashed var(--edge-hi); border-radius: 6px; background: none; cursor: pointer; position: relative;
  transition: background .15s, border-color .15s;
}
.ov-corners button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ov-corners button.sel { border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ov-corners button.sel::after {
  content: ""; position: absolute; width: 34%; height: 46%; border-radius: 4px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px -2px var(--accent);
}
.ov-corners [data-corner$="left"].sel::after { left: 5px; }
.ov-corners [data-corner$="right"].sel::after { right: 5px; }
.ov-corners [data-corner^="top"].sel::after { top: 5px; }
.ov-corners [data-corner^="bottom"].sel::after { bottom: 5px; }
.ov-corners.disabled { opacity: .45; pointer-events: none; }

.about-card { grid-template-columns: 64px 1fr; align-items: center; }
.about-card img { width: 64px; height: 64px; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent)); }
.about-card strong { display: block; font-size: 20px; }

/* Dica flutuante (no lugar do "title" nativo nos ícones). */
.gx-tip {
  position: fixed; z-index: 1000; pointer-events: none; max-width: 260px;
  padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; line-height: 1.35;
  background: var(--bg-0); color: var(--text); border: 1px solid var(--edge-hi); box-shadow: var(--shadow);
  animation: gx-tip-in .16s cubic-bezier(.16, 1, .3, 1);
}
.gx-tip[data-side="right"] { --tip-from: translateX(-6px) scale(.96); }
.gx-tip[data-side="top"] { --tip-from: translateY(6px) scale(.96); }
.gx-tip[data-side="bottom"] { --tip-from: translateY(-6px) scale(.96); }

/* Celular: sem ilhas (a tela é pequena); gavetas opacas com cantos arredondados. */
@media (max-width: 900px) {
  /* Sem "isolation": as gavetas (z 30) precisam ficar acima do fundo escuro (z 25). */
  .app { padding: 0; gap: 0; isolation: auto; }
  .main { border-radius: 0; border: 0; box-shadow: none; }
  .guild-rail { background: var(--bg-0); }
  .sidebar { border-radius: 0 var(--island-r) var(--island-r) 0; background: var(--bg-1); border-left: 0; }
  .chat { border-radius: var(--island-r) 0 0 var(--island-r); background: var(--bg-1); border-right: 0; }
  .gx-tip { display: none; }
  .stage.has-screen { overflow-y: auto; }
  .stage.has-screen .screens { flex: none; min-height: 0; }
  .stage.has-screen:not(.multi-screen) .screen { aspect-ratio: 16 / 9; }
  .stage.has-screen .tile { width: 150px; }

  /* Configurações em tela cheia, com as abas numa faixa no topo. */
  .dialog.settings-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; padding: 0; }
  .dialog.settings-dialog .settings-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .settings-nav {
    flex-direction: row; overflow-x: auto; padding: 8px; padding-top: calc(8px + env(safe-area-inset-top));
    border-right: 0; border-bottom: 1px solid var(--edge);
  }
  .settings-nav-title, .settings-nav-group { display: none; }
  .settings-nav .tab { flex: none; }
  .settings-nav .tab:hover { transform: none; }
  .settings-head { padding: 12px 14px 10px; }
  .settings-scroll { padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); }
  .set-grid, .mode-cards { grid-template-columns: 1fr; }
  .hotkey-row { grid-template-columns: 1fr 32px; }
  .hotkey-row > span { grid-column: 1 / -1; }
  .hotkey-key { min-width: 0; }
}

/* ================================================================ perfil: molduras, nomes e status */

/* ---------- molduras (anel animado em volta da foto) */
@keyframes fr-spin { to { rotate: 1turn; } }
@keyframes fr-flicker { 0%, 100% { opacity: 1; scale: 1; } 30% { opacity: .85; scale: 1.03; } 60% { opacity: .95; scale: .99; } }
@keyframes fr-glow { 50% { filter: drop-shadow(0 0 7px var(--fr-c)) drop-shadow(0 0 14px var(--fr-c)); } }
@keyframes fr-float { 50% { translate: 0 -3px; } }
.avatar { position: relative; }
.av-frame {
  --ring: 3px; --fr-c: var(--accent);
  position: absolute; inset: -12%; border-radius: 50%; pointer-events: none; z-index: 1;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring) - .5px), #000 calc(100% - var(--ring)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring) - .5px), #000 calc(100% - var(--ring)));
}
.avatar.xs .av-frame { --ring: 2px; inset: -14%; }
.av-frame::before, .av-frame::after { content: ""; position: absolute; }
.fr-chamas {
  --ring: 5px; --fr-c: #ff6a00; inset: -16%;
  background: conic-gradient(from 0deg, #ff3d00, #ffb300, #ff6a00, #ffd54f, #ff3d00, #ff9100, #ff3d00);
  filter: drop-shadow(0 0 6px #ff6a00); animation: fr-spin 3s linear infinite, fr-flicker .35s ease-in-out infinite;
}
.fr-neon { background: var(--accent); --fr-c: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); animation: fr-glow 1.8s ease-in-out infinite; }
.fr-aura {
  --ring: 7px; inset: -20%; --fr-c: var(--accent-2);
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--accent) 80%, transparent), transparent 40%, color-mix(in srgb, var(--accent-2) 80%, transparent), transparent 80%);
  filter: blur(2px) drop-shadow(0 0 8px var(--accent-2)); animation: fr-spin 5s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent 62%, #000 72%); mask: radial-gradient(farthest-side, transparent 62%, #000 72%);
}
.fr-galaxia {
  --ring: 4px; background: conic-gradient(#7c3aed, #38bdf8, #c084fc, #1e1b4b, #7c3aed);
  filter: drop-shadow(0 0 5px #8b5cf6); animation: fr-spin 4s linear infinite;
}
.fr-arco-iris { background: conic-gradient(#ff5f6d, #ffc371, #a8ff78, #78ffd6, #6a82fb, #fc5c7d, #ff5f6d); animation: fr-spin 3s linear infinite; }
.fr-gelo { --ring: 4px; background: conic-gradient(#e0f7ff, #7dd3fc, #ffffff, #38bdf8, #e0f7ff); filter: drop-shadow(0 0 5px #7dd3fc); animation: fr-spin 8s linear infinite; }
.fr-raios {
  --ring: 3px; --fr-c: #facc15;
  background: repeating-conic-gradient(#facc15 0 10deg, transparent 10deg 22deg);
  animation: fr-spin 1.2s linear infinite, fr-glow .6s steps(2) infinite;
}
.fr-ouro { --ring: 4px; background: conic-gradient(#bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c, #bf953f); filter: drop-shadow(0 0 4px #d4af37aa); animation: fr-spin 6s linear infinite; }
/* Coroa e corações: enfeites por fora (sem anel). */
.fr-coroa, .fr-corações { -webkit-mask: none; mask: none; inset: -30%; }
.fr-coroa::before {
  content: "👑"; left: 50%; top: -2%; translate: -50% 0; rotate: -12deg; font-size: calc(var(--size, 40px) * .42);
  filter: drop-shadow(0 2px 3px #0008); animation: fr-float 2.2s ease-in-out infinite;
}
.fr-corações::before, .fr-corações::after { content: "💗"; font-size: calc(var(--size, 40px) * .26); animation: fr-float 1.8s ease-in-out infinite; }
.fr-corações::before { right: 6%; top: 4%; }
.fr-corações::after { left: 4%; bottom: 8%; animation-delay: -.9s; }

/* ---------- nome com efeito */
@keyframes nfx-flow { to { background-position: 200% center; } }
@keyframes nfx-glow { 50% { text-shadow: 0 0 6px var(--accent), 0 0 14px var(--accent), 0 0 22px var(--accent-2); } }
@keyframes nfx-glitch { 0%, 92%, 100% { text-shadow: 1px 0 #ff2bd6, -1px 0 #22d3ee; translate: 0; } 94% { text-shadow: 3px 0 #ff2bd6, -3px 0 #22d3ee; translate: 1px 0; } 96% { text-shadow: -2px 0 #ff2bd6, 2px 0 #22d3ee; translate: -1px 0; } }
.nfx { background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; animation: nfx-flow 4s linear infinite; }
.nfx-arco-iris { background-image: linear-gradient(90deg, #ff5f6d, #ffc371, #a8ff78, #78ffd6, #6a82fb, #fc5c7d, #ff5f6d); }
.nfx-fogo { background-image: linear-gradient(90deg, #ff512f, #f09819, #ffd200, #f09819, #ff512f); filter: drop-shadow(0 0 4px #ff6a0066); }
.nfx-oceano { background-image: linear-gradient(90deg, #00c6ff, #0072ff, #00f2fe, #0072ff, #00c6ff); }
.nfx-ouro { background-image: linear-gradient(90deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c, #bf953f); animation-duration: 5s; }
.nfx-galaxia { background-image: linear-gradient(90deg, #a18cd1, #fbc2eb, #8ec5fc, #e0c3fc, #a18cd1); }
.nfx-neon { background: none; color: #fff !important; -webkit-text-fill-color: #fff; text-shadow: 0 0 4px var(--accent), 0 0 10px var(--accent); animation: nfx-glow 1.8s ease-in-out infinite; }
.nfx-glitch { background: none; color: var(--text) !important; -webkit-text-fill-color: currentColor; animation: nfx-glitch 3s steps(1) infinite; }

/* ---------- status (bolinha) */
.pres-online { background: var(--green) !important; }
.pres-idle { background: #f5b942 !important; -webkit-mask: radial-gradient(circle at 30% 30%, transparent 32%, #000 34%); mask: radial-gradient(circle at 30% 30%, transparent 32%, #000 34%); }
.pres-dnd { background: linear-gradient(transparent 40%, #fff 40% 60%, transparent 60%) center / 60% 100% no-repeat, var(--red) !important; }
.pres-invisible { background: transparent !important; box-shadow: inset 0 0 0 3px #80848e; }
.me-pres { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg-0); z-index: 2; }
.me-pres.pres-idle, .dot.pres-idle, .pc-dot.pres-idle { border: 0; }
.pres-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pc-presence { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pres-opt {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text); background: color-mix(in srgb, var(--bg-3) 60%, transparent); border: 1px solid var(--edge);
}
.pres-opt:hover { border-color: var(--edge-hi); }
.pres-opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* ---------- cartão de perfil caprichado */
.profile-card .pc-banner { height: 110px; position: relative; }
.pc-banner.has-image { background-size: cover !important; background-position: center !important; }
.pc-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--bg-0) 70%, transparent)); }
.pc-avatar-wrap { margin-top: -48px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--pc-accent, var(--accent)) 60%, transparent); }
.profile-card { border-color: color-mix(in srgb, var(--pc-accent, var(--accent)) 35%, var(--edge-hi)) !important; }
.pc-name { font-size: 21px; letter-spacing: -.01em; }

/* ---------- escolha de moldura / efeito no editor de perfil */
.pf-frames, .pf-namefx { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; text-transform: none; letter-spacing: 0; }
.pf-namefx { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.decor-opt {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px 8px; border-radius: 12px; cursor: pointer; font: inherit;
  color: var(--text); background: color-mix(in srgb, var(--bg-3) 50%, transparent); border: 1px solid var(--edge); transition: border-color .15s, transform .15s;
}
.decor-opt:hover { border-color: var(--edge-hi); transform: translateY(-1px); }
.decor-opt.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.decor-opt small { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.decor-opt.name b { font-size: 15px; font-weight: 800; padding-top: 4px; }
html.lite .av-frame, html.lite .av-frame::before, html.lite .av-frame::after, html.lite .nfx { animation: none !important; }

/* ================================================================ início: amigos e conversas privadas */
.guild-btn.home { background: color-mix(in srgb, var(--accent) 18%, var(--bg-2)); color: var(--text); }
.guild-btn.home svg.i { width: 22px; height: 22px; }
.guild-btn.home.active, .guild-btn.home:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: 16px; }
.home-side { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.home-side[hidden] { display: none; }
.home-head { height: 56px; flex: none; display: flex; align-items: center; padding: 0 16px; font-weight: 800; font-size: 15px; border-bottom: 1px solid var(--border); }
.home-side .sidebar-scroll { padding-top: 8px; }
.home-item { margin: 0 8px; width: calc(100% - 16px); font-weight: 600; }
.home-item svg.i { width: 20px; height: 20px; }
.dm-row { gap: 10px; padding: 6px 8px; }
.dm-row .avatar { --size: 32px; font-size: 13px; }
.dm-row.unread .ch-name { color: var(--text); font-weight: 800; }
.dm-incall { margin-left: auto; color: var(--green); display: grid; }
.dm-incall svg.i { width: 16px; height: 16px; }
.dm-empty { padding: 8px 16px; font-size: 12.5px; color: var(--text-dim); margin: 0; }
.dm-start-av { --size: 80px !important; margin-bottom: 6px; }
.btn-dm-call, .icon-btn.dm-call { color: var(--green); }

.friends-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.friends-view[hidden] { display: none; }
.fr-tabs { display: flex; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fr-tab {
  border: 0; background: none; color: var(--text-dim); font: inherit; font-weight: 700; font-size: 14px; padding: 6px 12px;
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.fr-tab:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.fr-tab.active { color: var(--text); background: color-mix(in srgb, var(--accent) 20%, transparent); }
.fr-tab.add { background: var(--green); color: #fff; margin-left: 4px; }
.fr-tab.add.active { background: none; color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.friends-body { flex: 1; overflow-y: auto; padding: 12px 20px 24px; }
.fr-head { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); padding: 10px 4px 8px; }
.fr-empty { color: var(--text-dim); font-size: 13px; padding: 4px; margin: 0 0 8px; }
.fr-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 12px; border-top: 1px solid var(--edge);
  cursor: pointer; transition: background .15s;
}
.fr-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.fr-row .avatar { --size: 40px; font-size: 16px; }
.fr-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-text small { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-actions { display: flex; gap: 6px; }
.fr-actions .icon-btn { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--bg-3) 80%, transparent); }
.fr-actions .icon-btn:hover { color: var(--text); background: var(--bg-4); }
.fr-actions .icon-btn.ok:hover { color: var(--green); }
.fr-actions .icon-btn.danger:hover { color: var(--red); }
.fr-add { max-width: 620px; display: grid; gap: 8px; padding: 8px 4px; }
.fr-add h3 { margin: 0; font-size: 16px; }
.fr-add p { margin: 0; }
.fr-add-row { display: flex; gap: 8px; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--bg-0) 60%, transparent); border: 1px solid var(--edge-hi); }
.fr-add-row input { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; font-size: 15px; }
.fr-add-msg { font-size: 13px; min-height: 18px; }
.fr-add-msg.okmsg { color: var(--green); }
@keyframes gx-ring { 0%, 100% { rotate: 0deg; } 10%, 30% { rotate: -14deg; } 20%, 40% { rotate: 14deg; } 50% { rotate: 0deg; } }
.summon-card.ringing .summon-av { animation: gx-ring 1.2s ease infinite; }
.summon-card.ringing .btn.primary { background: linear-gradient(135deg, var(--green), #10b981); }
@media (max-width: 900px) { .fr-tabs, .friends-body { padding-left: 12px; padding-right: 12px; } }

/* ================================================================ boas-vindas (conta sem servidor) */
.welcome { margin: auto; width: min(620px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; padding: 20px 8px 40px; animation: dx-fade-up .5s cubic-bezier(.16, 1, .3, 1) both; }
.welcome[hidden] { display: none; }
.wl-art img { width: 96px; height: 96px; filter: drop-shadow(0 16px 40px color-mix(in srgb, var(--accent) 50%, transparent)); animation: empty-logo-float 4s ease-in-out infinite alternate; }
.welcome h2 { margin: 6px 0 0; font-size: 28px; font-weight: 800; }
.welcome > p { margin: 0; max-width: 440px; color: var(--text-dim); font-size: 15px; line-height: 1.5; }
.wl-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-top: 14px; }
.wl-opt {
  display: grid; justify-items: center; gap: 8px; padding: 22px 16px; border-radius: 18px; cursor: pointer; font: inherit; color: var(--text);
  background: color-mix(in srgb, var(--bg-1) 80%, transparent); border: 1px solid var(--edge-hi);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), border-color .15s, box-shadow .2s, background .15s;
}
.wl-opt:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--edge-hi)); box-shadow: 0 18px 40px -18px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-1)); }
.wl-opt .gd-ic { width: 54px; height: 54px; border-radius: 16px; }
.wl-opt .gd-ic svg.i { width: 26px; height: 26px; }
.wl-opt b { font-size: 16px; }
.wl-opt small { font-size: 13px; color: var(--text-dim); }
.wl-tip { margin: 8px 0 0 !important; font-size: 12.5px !important; }
@media (max-width: 600px) { .wl-options { grid-template-columns: 1fr; } }
html.lite .wl-art img { animation: none; }

/* ================================================================ prévia de links */
.link-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 6px; width: min(460px, 100%); padding: 12px 14px;
  border-radius: 12px; background: color-mix(in srgb, var(--bg-1) 85%, transparent); border: 1px solid var(--edge);
  border-left: 4px solid var(--accent); animation: dx-fade-up .25s ease;
}
.link-card.loading { display: none; }
.lc-text { display: grid; gap: 4px; min-width: 0; align-content: start; }
.lc-site { font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.lc-title { font-weight: 700; color: var(--accent); text-decoration: none; font-size: 14.5px; line-height: 1.3; }
.lc-title:hover { text-decoration: underline; }
.lc-desc { margin: 0; font-size: 13px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lc-img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.link-card.yt { grid-template-columns: 1fr; border-left-color: #ff0033; width: min(480px, 100%); }
.lc-head { display: grid; gap: 3px; }
.yt-site { color: #ff4d6d; }
.yt-thumb {
  position: relative; aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 10px; cursor: pointer; padding: 0;
  background: #000 center / cover no-repeat; overflow: hidden;
}
.yt-thumb::after { content: ""; position: absolute; inset: 0; background: #0003; transition: background .2s; }
.yt-thumb:hover::after { background: #0000; }
.yt-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1; width: 68px; height: 48px; border-radius: 14px;
  background: #ff0033; box-shadow: 0 8px 24px #0008; transition: scale .2s cubic-bezier(.34, 1.56, .64, 1);
}
.yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border-left: 18px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.yt-thumb:hover .yt-play { scale: 1.1; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }

/* ================================================================ temas especiais
   Fundos animados (só CSS, só transform/background-position: leves) e toques
   próprios de cada tema. O modo leve desliga as animações. */

@keyframes fx-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes fx-drift-down { from { background-position: 0 -100vh, 0 0; } to { background-position: 0 100vh, 0 0; } }
@keyframes fx-grid { from { background-position: 0 0, 0 0; } to { background-position: 0 60px, 0 0; } }
@keyframes fx-petals { from { background-position: 0 -300px, 120px -150px, 60px -450px; } to { background-position: 300px 100vh, 480px calc(100vh + 150px), 220px calc(100vh - 100px); } }
@keyframes fx-embers { from { background-position: 0 100vh, 70px 100vh, 140px 100vh; } to { background-position: 30px -10vh, 40px -30vh, 160px -20vh; } }
@keyframes fx-pulse { 50% { opacity: .55; scale: 1.05; } }
@keyframes fx-caustics { 50% { background-position: 60% 40%, 30% 70%, 0 0; } }
@keyframes fx-sheen { from { background-position: -60vw 0; } to { background-position: 160vw 0; } }
@keyframes fx-neon { 0%, 100% { opacity: 1; } 92% { opacity: 1; } 94% { opacity: .6; } 96% { opacity: 1; } }

.theme-fx { position: fixed; inset: 0; z-index: -1; pointer-events: none; display: none; }
.theme-fx::before, .theme-fx::after { content: ""; position: absolute; inset: 0; }

/* Galáxia: estrelas em duas camadas piscando em tempos diferentes. */
[data-theme="galaxia"] .theme-fx { display: block; }
[data-theme="galaxia"] .theme-fx::before {
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 90px 120px, #c4b5fd, transparent),
    radial-gradient(1px 1px at 160px 60px, #fff, transparent), radial-gradient(1.5px 1.5px at 230px 190px, #bae6fd, transparent),
    radial-gradient(1px 1px at 50px 220px, #fff, transparent), radial-gradient(1px 1px at 280px 20px, #fff, transparent);
  background-size: 300px 260px; animation: fx-twinkle 5s ease-in-out infinite;
}
[data-theme="galaxia"] .theme-fx::after {
  background-image:
    radial-gradient(2px 2px at 70px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 330px 240px, #ddd6fe, transparent),
    radial-gradient(1px 1px at 210px 330px, #fff, transparent), radial-gradient(2px 2px at 400px 140px, #e0f2fe, transparent);
  background-size: 470px 410px; animation: fx-twinkle 7s ease-in-out -3s infinite;
}

/* Matrix: colunas de "código" caindo + fonte de terminal nos títulos. */
/* Cada camada é uma "família" de colunas com largura e altura diferentes: como
   cada uma desce a própria altura por ciclo, elas nunca andam sincronizadas. */
@keyframes fx-matrix {
  from { background-position: 0 0, 9px 0, 17px 0, 4px 0; }
  to { background-position: 0 70vh, 9px 110vh, 17px 90vh, 4px 130vh; }
}
[data-theme="matrix"] .theme-fx { display: block; opacity: .5; }
[data-theme="matrix"] .theme-fx::before {
  background-image:
    linear-gradient(180deg, transparent 55%, #22ff6633 85%, #22ff66cc 92%, transparent 93%),
    linear-gradient(180deg, transparent 60%, #22ff6626 88%, #22ff66aa 94%, transparent 95%),
    linear-gradient(180deg, transparent 50%, #22ff6622 84%, #22ff6699 90%, transparent 91%),
    linear-gradient(180deg, transparent 65%, #22ff6630 90%, #22ff66bb 96%, transparent 97%);
  background-size: 31px 70vh, 47px 110vh, 23px 90vh, 59px 130vh;
  animation: fx-matrix 7s linear infinite;
  /* "Letrinhas": corta as faixas em pedacinhos. */
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 10px), repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px);
  -webkit-mask-composite: source-in;
  mask: repeating-linear-gradient(180deg, #000 0 7px, transparent 7px 10px), repeating-linear-gradient(90deg, #000 0 9px, transparent 9px 12px);
  mask-composite: intersect;
}
[data-theme="matrix"] :is(h1, h2, h3, .room-title, .guild-name, .msg-author, .wordmark, .section-head) {
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace; letter-spacing: .02em;
}
[data-theme="matrix"] .guild-name { color: var(--accent); background: none; -webkit-background-clip: initial; background-clip: initial; text-shadow: 0 0 8px #22ff6688; }

/* Vaporwave: grade retrô em perspectiva + sol listrado. */
[data-theme="vaporwave"] .theme-fx { display: block; }
[data-theme="vaporwave"] .theme-fx::before {
  inset: 55% -50% -10%;
  background:
    linear-gradient(transparent 0 94%, #ff71ce77 94%),
    linear-gradient(90deg, transparent 0 94%, #01cdfe55 94%);
  background-size: 60px 60px;
  transform: perspective(320px) rotateX(62deg); transform-origin: top;
  animation: fx-grid 2.5s linear infinite;
  -webkit-mask: linear-gradient(180deg, transparent, #000 35%);
  mask: linear-gradient(180deg, transparent, #000 35%);
}
[data-theme="vaporwave"] .theme-fx::after {
  inset: auto; left: 50%; top: 38%; width: 260px; height: 260px; translate: -50% -50%; border-radius: 50%;
  background: linear-gradient(180deg, #ffd319, #ff71ce 70%);
  -webkit-mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 18px), linear-gradient(#000 0 55%, transparent 55%);
  -webkit-mask-composite: source-over;
  mask: linear-gradient(#000 0 55%, transparent 55%), repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 18px);
  mask-composite: add;
  opacity: .35; filter: blur(.5px);
}

/* Sakura: pétalas caindo na diagonal. */
[data-theme="sakura"] .theme-fx { display: block; }
[data-theme="sakura"] .theme-fx::before {
  background-image:
    radial-gradient(7px 4px at 50% 50%, #f9a8c9 60%, transparent 62%),
    radial-gradient(6px 3px at 50% 50%, #fbcfe0 60%, transparent 62%),
    radial-gradient(5px 3px at 50% 50%, #f472a6aa 60%, transparent 62%);
  background-size: 300px 300px, 360px 360px, 420px 420px;
  animation: fx-petals 22s linear infinite; opacity: .7;
}

/* Lava: brilho de brasa embaixo e fagulhas subindo. */
[data-theme="lava"] .theme-fx { display: block; }
[data-theme="lava"] .theme-fx::before {
  inset: auto 0 0; height: 45%;
  background: radial-gradient(80% 100% at 50% 100%, #ff572255, #ff8a0022 45%, transparent 75%);
  animation: fx-pulse 4s ease-in-out infinite; transform-origin: bottom;
}
[data-theme="lava"] .theme-fx::after {
  background-image:
    radial-gradient(2px 2px at 20px 20px, #ffb300, transparent), radial-gradient(1.5px 1.5px at 90px 60px, #ff5722, transparent),
    radial-gradient(2px 2px at 160px 30px, #ffd54f, transparent);
  background-size: 200px 220px, 240px 260px, 280px 300px;
  animation: fx-embers 9s linear infinite; opacity: .7;
}

/* Halloween: névoa roxa embaixo, lua no palco e morcegos voando por cima (sem atrapalhar o clique). */
[data-theme="halloween"] .theme-fx { display: block; z-index: 3; }
[data-theme="halloween"] .theme-fx::before {
  z-index: -1;
  background: radial-gradient(90% 45% at 50% 105%, #a855f733, #ff7a1810 55%, transparent 80%);
}
[data-theme="halloween"] .theme-fx::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='520' fill='%23ff9a3c'%3E%3Cpath transform='translate(70 60) scale(0.9)' d='M20 6l2-4 1 4c3-3 8-4 17-3-4 2-6 5-6 11-3-3-6-3-8 0-1-2-3-3-6-3s-5 1-6 3c-2-3-5-3-8 0 0-6-2-9-6-11 9-1 14 0 17 3l1-4z'/%3E%3Cpath transform='translate(430 150) scale(0.55)' d='M20 6l2-4 1 4c3-3 8-4 17-3-4 2-6 5-6 11-3-3-6-3-8 0-1-2-3-3-6-3s-5 1-6 3c-2-3-5-3-8 0 0-6-2-9-6-11 9-1 14 0 17 3l1-4z'/%3E%3Cpath transform='translate(250 320) scale(0.7)' d='M20 6l2-4 1 4c3-3 8-4 17-3-4 2-6 5-6 11-3-3-6-3-8 0-1-2-3-3-6-3s-5 1-6 3c-2-3-5-3-8 0 0-6-2-9-6-11 9-1 14 0 17 3l1-4z'/%3E%3Cpath transform='translate(620 410) scale(0.45)' d='M20 6l2-4 1 4c3-3 8-4 17-3-4 2-6 5-6 11-3-3-6-3-8 0-1-2-3-3-6-3s-5 1-6 3c-2-3-5-3-8 0 0-6-2-9-6-11 9-1 14 0 17 3l1-4z'/%3E%3C/svg%3E");
  animation: fx-bats 70s linear infinite; opacity: .32;
}
@keyframes fx-bats { to { background-position: 1520px -520px; } }
[data-theme="halloween"] #stage {
  background-image:
    radial-gradient(circle 34px at 88% 60px, #ffe2a8 0 96%, transparent),
    radial-gradient(circle 120px at 88% 60px, #ff9a3c40, transparent 75%);
  background-repeat: no-repeat; background-size: auto; background-position: 0 0; animation: none;
}
html.lite[data-theme="halloween"] .theme-fx { display: none; }

/* Oceano: luz de água se mexendo (cáusticas). */
[data-theme="oceano"] .theme-fx { display: block; }
[data-theme="oceano"] .theme-fx::before {
  background:
    radial-gradient(40% 30% at 30% 20%, #14b8a622, transparent 70%),
    radial-gradient(35% 25% at 70% 60%, #38bdf81c, transparent 70%),
    repeating-radial-gradient(circle at 50% -20%, transparent 0 40px, #e0f7fa06 40px 42px);
  background-size: 180% 180%, 180% 180%, auto;
  animation: fx-caustics 14s ease-in-out infinite;
}

/* Ouro: um reflexo dourado atravessando a tela de vez em quando. */
[data-theme="ouro"] .theme-fx { display: block; }
[data-theme="ouro"] .theme-fx::before {
  background: linear-gradient(105deg, transparent 40%, #f5d77a14 50%, transparent 60%) no-repeat;
  background-size: 60vw 100%;
  animation: fx-sheen 9s ease-in-out infinite;
}
[data-theme="ouro"] .guild-name { background: linear-gradient(90deg, #f5d77a, #d4af37, #fff3c4); -webkit-background-clip: text; background-clip: text; }

/* Neon Tóquio: ilhas com contorno neon e letreiro piscando de leve. */
[data-theme="neon-toquio"] :is(.sidebar, .main, .chat) {
  border-color: #ff3dbb55;
  box-shadow: 0 0 0 1px #ff3dbb33, 0 0 28px -8px #ff3dbbaa, inset 0 0 30px -18px #00e5ff, 0 24px 60px -28px #000c;
}
[data-theme="neon-toquio"] .guild-name, [data-theme="neon-toquio"] .room-title {
  color: #fff; background: none; -webkit-background-clip: initial; background-clip: initial;
  text-shadow: 0 0 6px #ff3dbb, 0 0 18px #ff3dbbaa; animation: fx-neon 6s linear infinite;
}
[data-theme="neon-toquio"] .ctl.active, [data-theme="neon-toquio"] .btn.primary { box-shadow: 0 0 18px -2px var(--accent), 0 0 30px -10px var(--accent-2); }

/* Alto contraste: sem aurora nem transparência, tudo nítido. */
[data-theme="alto-contraste"] .app::before, [data-theme="alto-contraste"] .app::after { display: none; }
[data-theme="alto-contraste"] :is(.sidebar, .main, .chat) { background: #000; border: 1px solid #ffffffaa; box-shadow: none; }
[data-theme="alto-contraste"] .guild-name { color: #fff; background: none; -webkit-background-clip: initial; background-clip: initial; }
[data-theme="alto-contraste"] :focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px; }
[data-theme="alto-contraste"] .channel.active, [data-theme="alto-contraste"] .tab.active { outline: 2px solid var(--accent); }

/* ================================================================ modo leve
   Para PC fraco: sem desfoque (o mais pesado), sem aurora e sem animações
   decorativas em loop. As animações que dão informação (girando "carregando",
   anel de quem fala) continuam, só que paradas/mais simples. */
html.lite *, html.lite *::before, html.lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite .app::before, html.lite .theme-fx, html.lite .app::after { display: none; }
html.lite .stage, html.lite .live-card, html.lite .live-card::before, html.lite .summon-card::before,
html.lite .tile.speaking, html.lite .tile .avatar::before, html.lite .tile .avatar::after,
html.lite .empty-art img, html.lite .empty-art::after, html.lite .update-art img, html.lite .update-art::after,
html.lite .gd-orbit, html.lite .gd-orbit img, html.lite .live-av::after, html.lite .rec-btn.recording svg.i,
html.lite .btn.primary:hover, html.lite .laser-dot i, html.lite .eq i, html.lite .ctl:not(.playing) .eq i { animation: none !important; }
html.lite :is(.sidebar, .main, .chat) { background: var(--bg-1); }
html.lite .main { background: var(--bg-2); }
html.lite .music-panel, html.lite .profile-card, html.lite .ctx-menu, html.lite .emoji-picker, html.lite .mention-box,
html.lite .controls, html.lite .share-panel, html.lite .summon-card { background: var(--bg-1); }

.mobile-only { display: none; }
.drawer-backdrop { display: none; }

/* Celular (e o app Android): a área principal ocupa a tela; servidores+canais
   viram uma gaveta à esquerda e chat/membros uma gaveta à direita. */
@media (max-width: 900px) {
  .mobile-only { display: grid; }
  .app, .app.chat-hidden { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 100%; height: 100dvh; }
  .main { grid-column: 1; grid-row: 1; }
  .topbar { padding: 0 8px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }

  .guild-rail, .sidebar, .chat {
    position: fixed; top: 0; bottom: 0; z-index: 30; transition: transform .22s ease;
    padding-top: env(safe-area-inset-top);
  }
  .guild-rail { left: 0; width: 72px; transform: translateX(-340px); }
  .sidebar { left: 72px; width: min(270px, calc(88vw - 72px)); transform: translateX(-340px); box-shadow: var(--shadow); }
  .app.drawer-left .guild-rail, .app.drawer-left .sidebar { transform: none; }
  .chat { right: 0; width: min(380px, 92vw); display: flex !important; transform: translateX(110%); border-left: 1px solid var(--border); box-shadow: var(--shadow); }
  .app.drawer-right .chat { transform: none; }
  .app.drawer-left ~ .drawer-backdrop, .app.drawer-right ~ .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: #0008; backdrop-filter: blur(4px); opacity: 0; animation: backdrop-in .22s ease forwards; }
  @keyframes backdrop-in { to { opacity: 1; } }
  .me-panel { margin-bottom: calc(8px + env(safe-area-inset-bottom)); }

  .stage { padding: 12px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile .avatar { --size: 60px; margin-bottom: 18px; }
  .tile .name { font-size: 12px; left: 6px; bottom: 6px; }
  .controls { gap: 6px; padding: 8px; margin-bottom: env(safe-area-inset-bottom); }
  .ctl { width: 46px; height: 46px; }
  .ctl.danger { width: 54px; }
  .ctl-select { height: 46px; }
  .ctl-sep { display: none; }
  .music-panel { top: 8px; right: 8px; left: 8px; width: auto; }
  .text-scroll { padding: 10px 10px 6px; }
  .text-composer { margin: 0 8px calc(10px + env(safe-area-inset-bottom)); }
  /* Sem mouse no celular: reagir/apagar ficam sempre visíveis, discretos no canto. */
  .msg-tools { display: flex; top: 2px; right: 2px; opacity: .55; box-shadow: none; border: 0; background: none; padding: 0; }
  .text-messages .msg { padding-right: 70px; }

  .guild-choice-grid { grid-template-columns: 1fr; }
  .themes { grid-template-columns: repeat(2, 1fr); }
  .profile-editor-grid, .roles-layout { grid-template-columns: 1fr; }
  .profile-card:not(.static) { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); max-height: 86vh; overflow-y: auto; }
  .dialog { width: 94vw; padding: 18px; }
  .update-chip { display: none; }
}

/* ---------- barra de título própria (app do Windows, sem a moldura do sistema) */
:root { --titlebar-h: 36px; }
.titlebar { display: none; }
html.has-titlebar body { height: calc(100% - var(--titlebar-h)); margin-top: var(--titlebar-h); }
html.has-titlebar .titlebar {
  position: fixed; inset: 0 0 auto; height: var(--titlebar-h); z-index: 9000; padding: 0 6px 0 12px;
  display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 12px;
  background: var(--bg-0); color: var(--text); user-select: none; -webkit-app-region: drag;
}
html.has-titlebar .toasts { top: calc(var(--titlebar-h) + 12px); }
html.has-titlebar dialog::backdrop { top: var(--titlebar-h); }
.tb-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-brand img { width: 16px; height: 16px; display: block; flex: none; }
.tb-brand span { font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.tb-where { grid-column: 2; display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.tb-where[hidden] { display: none; }
.tb-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-dot { display: none; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.tb-where.in-call { color: var(--text); }
.tb-where.in-call .tb-dot { display: block; }
.tb-where.offline .tb-dot { background: #f0b232; box-shadow: 0 0 0 3px #f0b23238; }
/* − □ ✕: traço arredondado e cantos suaves, combinando com o resto do app. */
.tb-ctl { grid-column: 3; justify-self: end; display: flex; gap: 2px; -webkit-app-region: no-drag; }
.tb-ctl button {
  width: 34px; height: 26px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--text-dim); transition: background .12s, color .12s, transform .12s;
}
.tb-ctl button:hover, .tb-ctl button.hover { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
.tb-ctl button:active { transform: scale(.92); }
.tb-ctl .tb-close:hover, .tb-ctl .tb-close.hover { background: #ed4245; color: #fff; }
.tb-ctl svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tb-restore { display: none; }
html.win-max .tb-max { display: none; }
html.win-max .tb-restore { display: block; }

/* ---------- tela de entrada: o K rachado (animação "Impacto") */
.login { --accent: #6d3bff; --accent-2: #8f6bff; }
.login-card {
  width: min(340px, 100%); padding: 0; gap: 12px; animation: none;
  background: none; border: 0; box-shadow: none; border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.login-card::before { display: none; }
/* Até decidir se anima ou entra direto, não mostra nada (evita piscar). */
.login-card:not(.ready) > * { visibility: hidden; }
.login-card h1, .login-card > p, .login-card .field, .login-card .btn { animation: none; }
.login-card h1.wordmark {
  display: flex; justify-content: center; margin: 2px 0 0; font-size: 28px; letter-spacing: .14em;
  background: none; color: var(--text); -webkit-text-fill-color: currentColor;
}
.login-card h1.wordmark span { display: block; }
.login-card > p { margin: 0 0 10px; }
.login-mark { position: relative; width: 118px; height: 118px; margin: 0 auto; }
.login-mark svg {
  position: relative; display: block; width: 100%; height: 100%; overflow: visible; fill: var(--text);
  filter: drop-shadow(0 12px 34px color-mix(in srgb, var(--accent) 70%, transparent));
}
/* Risco de luz no mesmo ângulo do corte do K. */
.login-crack {
  position: absolute; left: 50%; top: 50%; width: 200vw; height: 2px; margin-left: -100vw;
  background: linear-gradient(90deg, transparent, var(--accent-2) 30%, var(--text) 50%, var(--accent-2) 70%, transparent);
  transform: rotate(-17.350deg); opacity: .4; pointer-events: none;
}
.login-ring {
  position: absolute; inset: 14px; border-radius: 50%; border: 3px solid var(--accent-2); opacity: 0; pointer-events: none;
}
/* A batida acontece em .3s; o resto da tela entra a partir daí. */
.login-card.intro { --hit: .3s; animation: login-shake .34s linear var(--hit); }
.login-card.intro .login-half.top { animation: login-top .42s cubic-bezier(.6,0,1,.6) both; }
.login-card.intro .login-half.bottom { animation: login-bottom .42s cubic-bezier(.6,0,1,.6) both; }
.login-card.intro .login-ring { animation: login-ring .55s ease-out var(--hit) both; }
.login-card.intro .login-crack { animation: login-crack .6s cubic-bezier(.2,.8,.2,1) var(--hit) both; }
.login-card.intro h1.wordmark span { animation: text-enter .34s ease-out calc(var(--hit) + .06s + var(--i) * .028s) both; }
.login-card.intro > p, .login-card.intro .field, .login-card.intro .btn { animation: text-enter .36s ease-out calc(var(--hit) + .34s) both; }
@keyframes login-top { 0% { transform: translateY(-260px); } 72% { transform: translateY(4px); } 100% { transform: none; } }
@keyframes login-bottom { 0% { transform: translateY(260px); } 72% { transform: translateY(-4px); } 100% { transform: none; } }
@keyframes login-ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes login-crack { 0% { transform: rotate(-17.350deg) scaleX(0); opacity: 1; } 100% { transform: rotate(-17.350deg) scaleX(1); opacity: .4; } }
@keyframes login-shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 3px); } 45% { transform: translate(4px, -3px); } 70% { transform: translate(-2px, 1px); } }
html.lite .login-card.intro, html.lite .login-card.intro * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .login-card.intro, .login-card.intro * { animation: none !important; } }

/* ---------- controles das Configurações (no lugar dos do Windows)
   Padrão de seleção em tudo: círculo marcado ou visto + cor de destaque. */
#settings label.check {
  display: flex; flex-direction: row-reverse; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
}
#settings label.check:last-of-type { border-bottom: 0; }
#settings label.check input {
  appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; margin: 0; border-radius: 999px;
  background: var(--bg-4); position: relative; cursor: pointer; transition: background .18s;
}
#settings label.check input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px #0006; transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
#settings label.check input:checked { background: var(--accent); }
#settings label.check input:checked::after { transform: translateX(16px); }
#settings label.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#settings input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none; padding: 0; border: 0;
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), var(--bg-4) var(--fill, 50%));
}
#settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--accent);
  box-shadow: 0 2px 6px #0007; cursor: pointer;
}

.kselect { position: relative; margin-top: 6px; }
.kselect-btn {
  width: 100%; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px; cursor: pointer;
  background: var(--bg-0); border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); color: var(--text);
  font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; text-align: left;
}
.kselect-btn:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.kselect.open .kselect-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.kselect-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kselect-chev svg.i { width: 16px; height: 16px; color: var(--text-dim); transition: transform .18s; }
.kselect.open .kselect-chev svg.i { transform: rotate(180deg); }
.kselect-meter { display: flex; align-items: flex-end; gap: 2px; width: 28px; height: 14px; }
.kselect-meter[hidden] { display: none; }
.kselect-meter i { flex: 1; border-radius: 2px; background: var(--bg-4); }
.kselect-meter i:nth-child(1) { height: 30%; } .kselect-meter i:nth-child(2) { height: 47%; } .kselect-meter i:nth-child(3) { height: 64%; }
.kselect-meter i:nth-child(4) { height: 81%; } .kselect-meter i:nth-child(5) { height: 100%; }
.kselect-meter i.on { background: var(--green); }
.kselect-list {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; padding: 5px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); box-shadow: 0 16px 40px -8px #000c;
  max-height: 260px; overflow-y: auto;
}
.kselect.open .kselect-list { display: block; animation: kselect-pop .14s ease-out; }
@keyframes kselect-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.kselect-opt {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--text-dim); text-transform: none; letter-spacing: 0; outline: none;
}
.kselect-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kselect-opt:hover, .kselect-opt:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.kselect-radio { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 30%, transparent); display: grid; place-items: center; }
.kselect-opt em { display: none; font-style: normal; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.kselect-opt.sel { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); font-weight: 600; }
.kselect-opt.sel::before { content: ""; position: absolute; left: 3px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--accent); }
.kselect-opt.sel .kselect-radio { border-color: var(--accent); background: var(--accent); }
.kselect-opt.sel .kselect-radio::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.kselect-opt.sel em { display: block; }

.kseg-wrap { margin-top: 6px; display: grid; gap: 6px; }
.kseg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-0); border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.kseg-btn {
  flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--text-dim);
  font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
}
.kseg-btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.kseg-check { display: none; }
.kseg-check svg.i { width: 15px; height: 15px; }
.kseg-btn.on { background: var(--accent); color: #fff; box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.kseg-btn.on .kseg-check { display: inline-flex; }
.kseg-hint { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }

.out-row { display: flex; gap: 8px; align-items: flex-start; }
.out-row .kselect { flex: 1; min-width: 0; }
.out-row #out-test { margin-top: 6px; height: 44px; }

.sens-wrap { display: grid; gap: 8px; margin-top: 4px; }
.sens-wrap[hidden] { display: none; }
.sens-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.sens-head span:first-child { flex: 1; }
.sens-line { display: flex; align-items: center; gap: 10px; }
.sens-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--bg-4); transition: background .1s; }
.sens-dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.sens-meter {
  position: relative; flex: 1; height: 20px; border-radius: 6px; cursor: ew-resize; touch-action: none; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--bg-4) 0 6px, transparent 6px 8px);
}
.sens-meter div {
  height: 100%; width: 0; transition: width .06s linear;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 35%, transparent) 0 6px, transparent 6px 8px);
}
.sens-meter div.live { background: repeating-linear-gradient(90deg, var(--green) 0 6px, transparent 6px 8px); }
.sens-meter span { position: absolute; top: 1px; bottom: 1px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--accent); pointer-events: none; }
.sens-val { width: 38px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
#sens-hint { margin: 0; }

.saved-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto; margin-right: 8px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent);
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.saved-chip svg.i { width: 13px; height: 13px; }
.saved-chip.show { opacity: 1; }

/* Tema escolhido: selo com visto. */
.theme { position: relative; }
.theme.sel { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.theme.sel::after {
  content: "✓"; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 0 0 3px var(--bg-1);
}

/* ---------- visual Krakko ("Marcante"): risco diagonal, balões no chat, dock mais redonda */
/* Risco de luz no mesmo ângulo do corte do K, atrás das ilhas (só com o app aberto). */
body:has(#app:not([hidden]))::after {
  content: ""; position: fixed; left: -10%; right: -10%; top: 58%; height: 1px; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent);
  transform: rotate(-17.35deg);
}
html.lite body::after { display: none; }

/* Mensagens em balão, com a ponta arredondada do lado do autor. */
.msg:not(.system) .msg-text {
  display: inline-block; max-width: 100%; box-sizing: border-box; padding: 7px 11px; border-radius: 4px 14px 14px 14px;
  background: color-mix(in srgb, var(--text) 6%, transparent); border: 1px solid color-mix(in srgb, var(--text) 7%, transparent);
}
.msg.cont:not(.system) .msg-text { border-radius: 14px; }
.msg:not(.system) .msg-text:empty { display: none; padding: 0; border: 0; }
.msg.mention .msg-text { background: color-mix(in srgb, var(--highlight, #f5b942) 14%, transparent); border-color: color-mix(in srgb, var(--highlight, #f5b942) 35%, transparent); }

/* Dock de controles e botões mais redondos. */
.controls { border-radius: 22px; }
.ctl { border-radius: 14px; }
.ctl.danger { border-radius: 14px; }

/* Servidor ativo: cor cheia e cantos mais quadrados, como no desenho. */
.guild-btn.active { border-radius: 14px; }
