@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Figtree:wght@400;700;800&family=Pacifico&family=Playfair+Display:wght@700;800&family=Poppins:wght@600;700&family=Space+Mono:wght@700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-0:#1a1b1e; --bg-1:#2b2d31; --bg-2:#313338; --bg-3:#383a40;
  --bg-hover:#35373c; --fg:#f2f3f5; --fg-dim:#949ba4;
  --blue:#5865f2; --blue-hover:#4752c4; --green:#23a55a;
  --red:#da373c; --yellow:#f0b232; --pink:#eb459e;
  --radius:8px; --radius-sm:4px;
  --ease-out:cubic-bezier(.16,1,.3,1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
}
html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; background: var(--bg-2); color: var(--fg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: #7289ff; }
button { font-family: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, textarea { font-family: inherit; }
svg { display: block; flex-shrink: 0; }

@keyframes fadeIn     { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeInUp   { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: translateY(0) } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-16px) } to { opacity: 1; transform: translateY(0) } }
@keyframes popIn      { 0% { opacity: 0; transform: scale(.85) } 60% { transform: scale(1.03) } 100% { opacity: 1; transform: scale(1) } }
@keyframes springIn   { 0% { opacity: 0; transform: scale(.92) translateY(10px) } 100% { opacity: 1; transform: scale(1) translateY(0) } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-20px) } to { opacity: 1; transform: translateX(0) } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px) } to { opacity: 1; transform: translateX(0) } }
@keyframes msgIn      { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: translateY(0) } }
@keyframes pulseRing  { 0% { box-shadow: 0 0 0 0 rgba(35,165,90,.55) } 70% { box-shadow: 0 0 0 8px rgba(35,165,90,0) } 100% { box-shadow: 0 0 0 0 rgba(35,165,90,0) } }
@keyframes typingDot  { 0%,60%,100% { transform: translateY(0); opacity: .35 } 30% { transform: translateY(-4px); opacity: 1 } }
@keyframes float      { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-10px) } }
@keyframes shake      { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }
@keyframes vPop       { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes loadPulse  { 0%,100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.15); opacity: 1 } }

/* ============ AUTH ============ */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #0b0e14; overflow: hidden; }
.auth-side { position: relative; overflow: hidden; background: radial-gradient(circle at 30% 40%, #1c2d5a 0%, #0a0d18 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; }
.auth-side::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 70% 80%, rgba(88,101,242,.18), transparent 45%), radial-gradient(circle at 20% 20%, rgba(235,69,158,.12), transparent 40%); animation: float 12s ease-in-out infinite; }
.auth-side .stars { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 40% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent), radial-gradient(1px 1px at 80% 50%, #fff, transparent), radial-gradient(1px 1px at 15% 85%, #fff, transparent), radial-gradient(1.5px 1.5px at 90% 80%, #fff, transparent); opacity: .5; }
.auth-side .illus { width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(88,101,242,.35), rgba(88,101,242,.05) 70%); display: flex; align-items: center; justify-content: center; position: relative; animation: float 5s ease-in-out infinite; box-shadow: 0 0 120px rgba(88,101,242,.35) inset; }
.auth-side .illus img { width: 180px; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); }
.auth-side .quote { position: relative; z-index: 2; margin-top: 60px; max-width: 420px; text-align: left; }
.auth-side .quote .mark { font-size: 48px; font-weight: 900; color: #fff; line-height: 0; margin-bottom: 12px; }
.auth-side .quote h3 { font-size: 26px; font-weight: 800; line-height: 1.25; color: #fff; }
.auth-side .quote p { color: #8b93a7; font-size: 13px; margin-top: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: linear-gradient(180deg, #15171c 0%, #0f1114 100%); overflow-y: auto; }
.auth-card { width: 100%; max-width: 480px; animation: fadeInUp .5s var(--ease-out); }
.auth-card .eyebrow { font-size: 12px; font-weight: 800; color: var(--blue); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.auth-card h1 { font-size: 40px; font-weight: 900; line-height: 1.1; margin-bottom: 12px; letter-spacing: -.02em; }
.auth-card .lead { color: var(--fg-dim); font-size: 15px; margin-bottom: 28px; }
.auth-card label.lb { display: block; font-size: 12px; font-weight: 700; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.auth-field { margin-bottom: 16px; }
.auth-field .field { display: flex; align-items: center; gap: 8px; background: #1e2026; border: 1px solid #1e2026; border-radius: 6px; padding: 0 14px; transition: border-color .15s, box-shadow .15s; }
.auth-field .field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,101,242,.18); }
.auth-field input { flex: 1; background: transparent; border: none; outline: none; color: var(--fg); padding: 14px 0; font-size: 15px; width: 100%; }
.auth-field input::placeholder { color: #6b6f76; }
.auth-field .show-btn { font-size: 12px; font-weight: 700; color: var(--fg-dim); padding: 6px; }
.auth-field .show-btn:hover { color: var(--fg); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-card .err { background: rgba(218,55,60,.1); border: 1px solid rgba(218,55,60,.4); color: #ff8a8a; font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.auth-card .err:empty { display: none; }
.auth-card .err:not(:empty) { animation: shake .3s ease; }
.auth-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--fg-dim); margin: 8px 0 20px; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--blue); margin-top: 2px; cursor: pointer; }
.auth-check a { font-weight: 600; }
.btn-primary { width: 100%; padding: 14px; border-radius: 6px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, transform .12s, box-shadow .2s; }
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 8px 24px rgba(88,101,242,.35); }
.btn-primary:active { transform: scale(.98); }
.divider-or { display: flex; align-items: center; gap: 12px; color: var(--fg-dim); font-size: 12px; margin: 20px 0; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: #1e2026; }
.btn-google { width: 100%; padding: 12px; border-radius: 6px; background: #1e2026; border: 1px solid #26282e; color: var(--fg); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, transform .12s; }
.btn-google:hover { background: #26282e; transform: translateY(-1px); }
.auth-foot { text-align: center; margin-top: 20px; color: var(--fg-dim); font-size: 13px; }
.auth-foot a { font-weight: 700; }
.auth-captcha { background: #1e2026; border-radius: 6px; padding: 12px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.auth-captcha .code { flex: 1; background: linear-gradient(180deg, #f5f5f5, #e5e5e5); border-radius: 6px; padding: 10px 16px; font-size: 24px; font-weight: 900; color: #2b2d31; letter-spacing: .3em; font-style: italic; text-align: center; font-family: 'Courier New', monospace; user-select: none; }
.auth-captcha input { width: 100px; background: transparent; border: 1px solid #2b2d31; border-radius: 4px; color: var(--fg); padding: 10px; font-size: 14px; text-align: center; outline: none; }
.auth-captcha input:focus { border-color: var(--blue); }
.auth-captcha button { font-size: 12px; font-weight: 700; color: var(--blue); padding: 8px 12px; border-radius: 4px; }
.auth-captcha button:hover { background: rgba(88,101,242,.12); }
@media (max-width: 900px) { .auth-split { grid-template-columns: 1fr } .auth-side { display: none } }

/* ============ APP LAYOUT ============ */
.app { display: grid; grid-template-columns: 72px 240px 1fr; height: 100vh; animation: fadeIn .3s ease; }
.rail { background: var(--bg-0); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; }
.rail::-webkit-scrollbar { display: none; }
.rail-item { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-1); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; cursor: pointer; color: var(--fg); position: relative; overflow: hidden; transition: border-radius .25s var(--ease-spring), background .2s, transform .2s var(--ease-spring), box-shadow .2s; }
.rail-item img { width: 100%; height: 100%; object-fit: cover; }
.rail-item:hover { border-radius: 16px; background: var(--blue); transform: translateY(-2px) scale(1.05); box-shadow: 0 8px 20px rgba(88,101,242,.4); }
.rail-item.active { border-radius: 16px; background: var(--blue); box-shadow: 0 4px 16px rgba(88,101,242,.35); }
.rail-item.active::before { content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); width: 4px; height: 40px; background: #fff; border-radius: 0 4px 4px 0; }
.rail-item.home { background: #fff; color: var(--blue); }
.rail-item.home.active { background: var(--blue); color: #fff; }
.rail-item.home img { width: 32px; height: 32px; object-fit: contain; }
.rail-item.add { background: var(--green); color: #fff; }
.rail-item.add:hover { background: #1e8e4d; box-shadow: 0 8px 20px rgba(35,165,90,.4); }
.rail-sep { width: 32px; height: 2px; background: var(--bg-1); border-radius: 1px; }

.sidebar { background: var(--bg-1); display: flex; flex-direction: column; animation: slideInLeft .25s var(--ease-out); }
.sidebar-search { padding: 10px; }
.sidebar-search input { width: 100%; background: var(--bg-0); border: none; padding: 8px 10px; border-radius: 4px; color: var(--fg); font-size: 13px; }
.sidebar-nav { padding: 8px; }
.sidebar-nav .item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 4px; cursor: pointer; color: var(--fg-dim); font-weight: 500; font-size: 15px; transition: background .15s, color .15s, transform .12s; }
.sidebar-nav .item:hover { background: var(--bg-hover); color: var(--fg); transform: translateX(2px); }
.sidebar-nav .item.active { background: var(--bg-hover); color: var(--fg); }
.sidebar-nav .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 8px; font-weight: 700; }
.sidebar-nav .soon { margin-left: auto; background: var(--bg-0); color: var(--fg-dim); font-size: 10px; padding: 2px 6px; border-radius: 8px; font-weight: 700; }
.sidebar-section-title { padding: 16px 10px 4px; font-size: 11px; color: var(--fg-dim); text-transform: uppercase; font-weight: 700; display: flex; justify-content: space-between; align-items: center; letter-spacing: .02em; }
.sidebar-section-title button { color: var(--fg-dim); padding: 2px; border-radius: 4px; display: flex; }
.sidebar-section-title button:hover { color: var(--fg); background: var(--bg-hover); }
.sidebar-dm-empty { padding: 8px 10px; color: var(--fg-dim); font-size: 13px; line-height: 1.45; }

.user-panel { margin-top: auto; background: #232428; padding: 8px; display: flex; align-items: center; gap: 8px; }
.user-avatar-wrap { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; transition: transform .2s var(--ease-spring), box-shadow .2s; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar-wrap:hover .user-avatar { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(88,101,242,.4); }
.user-avatar-frame { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 150%; height: 150%; object-fit: contain; pointer-events: none; z-index: 3; filter: drop-shadow(0 3px 8px rgba(0,0,0,.6)); }
.user-info { flex: 1; min-width: 0; cursor: pointer; padding: 4px 6px; border-radius: 4px; transition: background .15s; }
.user-info:hover { background: rgba(255,255,255,.05); }
.user-info .name { font-size: 13px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .tag { font-size: 11px; color: var(--fg-dim); }
.user-actions { display: flex; gap: 2px; }
.icon-btn { width: 32px; height: 32px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); cursor: pointer; transition: background .15s, color .15s, transform .15s var(--ease-spring); }
.icon-btn:hover { background: var(--bg-hover); color: var(--fg); transform: scale(1.08); }
.icon-btn:active { transform: scale(.92); }

.status-dot { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--fg-dim); border: 3px solid #232428; transition: background .3s; z-index: 5; }
.status-dot.online { background: var(--green); animation: pulseRing 2.5s ease-out infinite; }
.status-dot.idle { background: var(--yellow); }
.status-dot.dnd { background: var(--red); }
.status-dot.offline { background: #80848e; }

.server-header { padding: 12px 16px; font-weight: 700; font-size: 15px; border-bottom: 1px solid #1e1f22; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; transition: background .15s; position: relative; overflow: hidden; }
.server-header:hover { background: rgba(0,0,0,.15); }
.server-header > * { position: relative; z-index: 2; }
.server-header .actions { display: flex; gap: 2px; }
.server-header .actions .icon-btn { width: 24px; height: 24px; }
.channels-scroll { flex: 1; overflow-y: auto; padding: 8px; }

.category-header { display: flex; align-items: center; gap: 6px; padding: 16px 4px 4px; font-size: 11px; color: var(--fg-dim); text-transform: uppercase; font-weight: 700; letter-spacing: .02em; cursor: pointer; user-select: none; }
.category-header:hover { color: var(--fg); }
.category-header .chev { display: flex; transition: transform .2s var(--ease-out); }
.category-header.collapsed .chev { transform: rotate(-90deg); }
.category-header .cat-name { flex: 1; }
.category-header .cat-actions { opacity: 0; display: flex; gap: 2px; }
.category-header:hover .cat-actions { opacity: 1; }
.category-header .cat-actions button { color: var(--fg-dim); padding: 2px; border-radius: 3px; }
.category-header .cat-actions button:hover { color: var(--fg); background: var(--bg-hover); }

.channel-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 4px; color: var(--fg-dim); cursor: pointer; font-size: 15px; position: relative; transition: background .15s, color .15s, transform .12s; }
.channel-item:hover { background: var(--bg-hover); color: var(--fg); transform: translateX(2px); }
.channel-item.active { background: var(--bg-hover); color: var(--fg); }
.channel-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--blue); border-radius: 0 2px 2px 0; }
.channel-item .hash { color: #80848e; flex-shrink: 0; }
.channel-item .ch-actions { position: absolute; right: 6px; display: none; gap: 2px; }
.channel-item:hover .ch-actions { display: flex; }
.channel-item .ch-actions button { color: var(--fg-dim); padding: 2px; border-radius: 3px; }
.channel-item .ch-actions button:hover { color: var(--fg); background: rgba(0,0,0,.3); }

.main { display: flex; flex-direction: column; background: var(--bg-2); height: 100vh; min-width: 0; animation: fadeIn .25s ease; }
.main-header { height: 48px; padding: 0 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #26272b; flex-shrink: 0; z-index: 2; position: relative; overflow: hidden; }
.main-header .banner-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(6px) brightness(.7); transform: scale(1.15); z-index: 0; }
.main-header .banner-overlay { position: absolute; inset: 0; background: rgba(20,22,26,.65); z-index: 1; }
.main-header > *:not(.banner-bg):not(.banner-overlay) { position: relative; z-index: 2; }
.main-header .title { font-weight: 700; font-size: 15px; }
.main-header .right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.main-body { flex: 1; display: flex; min-height: 0; }
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.friends-page { flex: 1; display: flex; min-height: 0; }
.friends-content { flex: 1; padding: 20px; overflow-y: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.tab { padding: 6px 12px; border-radius: 4px; font-size: 14px; cursor: pointer; color: var(--fg-dim); font-weight: 500; transition: background .15s, color .15s; }
.tab:hover { color: var(--fg); background: rgba(255,255,255,.04); }
.tab.active { background: var(--bg-hover); color: var(--fg); }
.tab.add { background: var(--blue); color: #fff; margin-left: auto; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tab.add:hover { background: var(--blue-hover); box-shadow: 0 4px 14px rgba(88,101,242,.4); transform: translateY(-1px); }
.search-friends { width: 100%; background: var(--bg-0); border: none; padding: 10px 12px; border-radius: 4px; color: var(--fg); margin-bottom: 16px; }
.friends-section-title { font-size: 12px; text-transform: uppercase; color: var(--fg-dim); margin: 20px 0 8px; font-weight: 700; letter-spacing: .02em; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-top: 1px solid #26272b; cursor: pointer; transition: background .15s, transform .15s; }
.friend-row:hover { background: var(--bg-hover); border-radius: 4px; transform: translateX(3px); }
.friend-row .name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 4px; }
.friend-row .tag { color: var(--fg-dim); font-size: 13px; }
.friend-actions { margin-left: auto; display: flex; gap: 8px; }
.friend-actions button { background: #2b2d31; color: #fff; padding: 8px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.friend-actions button:hover { background: #3a3d43; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--fg-dim); text-align: center; padding: 40px; gap: 12px; }
.empty-state h3 { color: var(--fg); }
.empty-state .big-icon { color: #4e5058; opacity: .5; margin-bottom: 8px; }
.now-active { width: 320px; background: var(--bg-1); border-left: 1px solid #26272b; padding: 16px; overflow-y: auto; }
.now-active h4 { font-size: 15px; margin-bottom: 16px; }
.now-active .empty { color: var(--fg-dim); font-size: 13px; text-align: center; margin-top: 40px; line-height: 1.5; }

.messages { flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.msg { display: flex; gap: 12px; padding: 4px 8px; border-radius: 6px; position: relative; animation: msgIn .25s var(--ease-out) both; transition: background .15s; }
.msg:hover { background: rgba(0,0,0,.08); }
.msg .avatar-wrap { width: 40px; height: 40px; flex-shrink: 0; }
.msg .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; font-size: 18px; color: #fff; }
.msg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-header .author { font-weight: 600; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.msg-header .author:hover { text-decoration: underline; }
.msg-header .role-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; color: #fff; }
.msg-header .time { color: var(--fg-dim); font-size: 11px; }
.msg .content { color: #dbdee1; font-size: 15px; line-height: 1.4; word-wrap: break-word; white-space: pre-wrap; }
.msg .content .mention { background: rgba(88,101,242,.3); color: #dee0fc; padding: 0 2px; border-radius: 3px; font-weight: 500; }
.msg .content .mention.me { background: rgba(88,101,242,.6); color: #fff; }

.msg .attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg .attachments img { max-width: 280px; max-height: 220px; border-radius: 8px; cursor: pointer; object-fit: cover; }
.msg .attachments img:hover { transform: scale(1.02); }
.msg-attach-preview { display: flex; gap: 6px; padding: 8px 12px; background: #2b2d31; border-radius: 8px 8px 0 0; flex-wrap: wrap; align-items: center; }
.msg-attach-preview .thumb { position: relative; width: 60px; height: 60px; border-radius: 6px; overflow: hidden; }
.msg-attach-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.msg-attach-preview .thumb button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.7); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; display: flex; align-items: center; justify-content: center; }

.msg-reply-preview { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-dim); margin-bottom: 4px; padding-left: 4px; }
.msg-reply-preview .bar { width: 32px; height: 12px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; margin-top: 4px; }
.msg-reply-preview .user { font-weight: 600; cursor: pointer; color: var(--fg-dim); }
.msg-reply-preview .preview { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; }

.msg-hover-actions { position: absolute; top: -12px; right: 12px; display: none; gap: 2px; background: var(--bg-1); border: 1px solid #1e1f22; border-radius: 6px; padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.msg:hover .msg-hover-actions { display: flex; }
.msg-hover-actions button { width: 30px; height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); }
.msg-hover-actions button:hover { background: var(--bg-hover); color: var(--fg); }

.reactions-row { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.reaction-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; background: #2b2d31; border: 1px solid transparent; font-size: 13px; cursor: pointer; }
.reaction-pill:hover { border-color: #4e5058; }
.reaction-pill.mine { background: rgba(88,101,242,.25); border-color: var(--blue); }
.reaction-pill .count { color: var(--fg-dim); font-size: 12px; }

.emoji-picker { position: absolute; bottom: 100%; margin-bottom: 4px; right: 0; background: var(--bg-1); border-radius: 8px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; z-index: 30; }
.emoji-picker button { width: 34px; height: 34px; font-size: 20px; border-radius: 4px; }
.emoji-picker button:hover { background: var(--bg-hover); transform: scale(1.25); }

.typing-indicator { padding: 4px 16px; color: var(--fg-dim); font-size: 13px; height: 22px; display: flex; align-items: center; gap: 4px; }
.typing-dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.typing-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--fg-dim); animation: typingDot 1.2s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: .15s } .typing-dots span:nth-child(3) { animation-delay: .3s }

.input-area { padding: 0 16px 24px; }
.reply-bar { display: flex; align-items: center; gap: 10px; background: #2b2d31; padding: 8px 12px; border-radius: 8px 8px 0 0; font-size: 13px; color: var(--fg-dim); }
.reply-bar .user { font-weight: 700; color: var(--fg); }
.reply-bar .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar button { color: var(--fg-dim); font-size: 16px; }
.reply-bar button:hover { color: var(--fg); transform: rotate(90deg); }
.input-wrap { background: var(--bg-3); border-radius: 8px; display: flex; align-items: center; padding: 0 16px; position: relative; }
.input-wrap:focus-within { box-shadow: 0 0 0 2px rgba(88,101,242,.35); }
.input-wrap.has-reply { border-radius: 0 0 8px 8px; }
.input-wrap input { flex: 1; background: transparent; border: none; padding: 12px 0; color: var(--fg); font-size: 15px; outline: none; }
.input-wrap input::placeholder { color: var(--fg-dim); }
.input-wrap .attach-btn, .input-wrap .send-btn { padding: 6px; color: var(--fg-dim); }
.input-wrap .attach-btn:hover, .input-wrap .send-btn:hover { color: var(--fg); transform: scale(1.15); }
.no-perm { color: var(--fg-dim); text-align: center; padding: 8px; font-size: 13px; font-style: italic; }

.channel-welcome { padding: 32px 0 16px; }
.channel-welcome .hash-big { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-3); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }

.members-panel { width: 240px; background: var(--bg-1); border-left: 1px solid #1e1f22; padding: 16px 8px; overflow-y: auto; }
.members-group { margin-bottom: 16px; }
.members-group h5 { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; padding: 4px 8px; letter-spacing: .02em; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.member-row:hover { background: var(--bg-hover); }
.member-row .name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 4px; }

.pinned-list { position: absolute; top: 48px; right: 16px; width: 380px; max-height: 70vh; background: var(--bg-1); border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.6); overflow-y: auto; z-index: 50; }
.pinned-list .pin-head { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid #1e1f22; display: flex; justify-content: space-between; align-items: center; }
.pinned-list .pin-head button { color: var(--fg-dim); padding: 4px; border-radius: 4px; }
.pinned-list .pin-head button:hover { color: var(--fg); background: var(--bg-hover); }
.pinned-list .pin-item { padding: 12px 16px; border-bottom: 1px solid #1e1f22; font-size: 13px; }
.pinned-list .pin-item .u { color: var(--blue); font-weight: 600; }
.pinned-list .pin-item .t { color: var(--fg-dim); font-size: 11px; margin-left: 6px; }
.pinned-list .pin-item .c { color: #dbdee1; margin-top: 4px; word-break: break-word; }

.tag-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 700; color: #fff; letter-spacing: .02em; vertical-align: middle; margin-left: 4px; }
.tag-pill.mini { transform: scale(.9); }

.context-menu { position: fixed; background: #18191c; border-radius: 6px; padding: 6px; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,.6); z-index: 999; }
.context-menu .cm-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 14px; color: #dcddde; border-radius: 4px; cursor: pointer; }
.context-menu .cm-item:hover { background: var(--blue); color: #fff; }
.context-menu .cm-item.danger { color: #f38ba8; }
.context-menu .cm-item.danger:hover { background: var(--red); color: #fff; }
.context-menu .cm-sep { height: 1px; background: #2f3136; margin: 4px 2px; }
.context-menu .cm-title { font-size: 11px; text-transform: uppercase; color: #949ba4; font-weight: 700; padding: 8px 10px 4px; letter-spacing: .04em; }

.msg-action-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: 14px; margin-top: 10px; }
.msg-action-btn:hover { background: var(--blue-hover); transform: translateY(-2px); }
.msg-action-btn.joined { background: var(--green); cursor: default; }
.msg-action-btn.joined:hover { transform: none; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; backdrop-filter: blur(2px); }
.modal { background: var(--bg-1); border-radius: 12px; max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; position: relative; animation: springIn .35s var(--ease-spring); box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 560px; }
.modal.xwide { max-width: 720px; }
.modal h2 { font-size: 22px; margin-bottom: 8px; text-align: center; font-weight: 800; }
.modal .sub { color: var(--fg-dim); font-size: 14px; margin-bottom: 24px; text-align: center; line-height: 1.5; }
.modal .close-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; color: var(--fg-dim); border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 5; }
.modal .close-x:hover { color: var(--fg); background: var(--bg-hover); transform: rotate(90deg); }
.template-list { display: flex; flex-direction: column; gap: 8px; }
.template { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 8px; background: #26272b; cursor: pointer; text-align: left; color: var(--fg); }
.template:hover { background: #2f3136; transform: translateX(4px); }
.template .ico { width: 44px; height: 44px; background: var(--bg-0); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); }
.template .info { flex: 1; }
.template .info .t { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.template .info .d { color: var(--fg-dim); font-size: 13px; }
.template .arrow { color: var(--fg-dim); }

.server-customize { text-align: center; }
.server-customize h2 { font-size: 24px; margin-bottom: 8px; font-weight: 800; }
.server-customize .sub { color: var(--fg-dim); font-size: 14px; margin-bottom: 28px; line-height: 1.5; }
.server-icon-upload { position: relative; width: 96px; height: 96px; margin: 0 auto 24px; cursor: pointer; display: block; }
.server-icon-upload .circle { width: 96px; height: 96px; border-radius: 50%; border: 2px dashed #5c5f66; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--fg-dim); overflow: hidden; }
.server-icon-upload .circle:hover { border-color: var(--blue); background: rgba(88,101,242,.08); }
.server-icon-upload .circle span { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.server-icon-upload .circle img { width: 100%; height: 100%; object-fit: cover; }
.server-icon-upload .plus { position: absolute; top: -4px; right: -4px; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid var(--bg-1); }
.server-icon-upload:hover .plus { transform: scale(1.15) rotate(90deg); }
.server-customize .field-label { text-align: left; display: block; font-size: 12px; font-weight: 700; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.server-customize .field-label .req { color: var(--red); }
.server-customize input[type=text] { width: 100%; padding: 12px 14px; background: #1e2026; border: 1px solid #1e2026; border-radius: 6px; color: var(--fg); font-size: 15px; outline: none; }
.server-customize input[type=text]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,101,242,.18); }
.server-customize .terms { text-align: left; color: var(--fg-dim); font-size: 12px; margin-top: 12px; line-height: 1.5; }
.server-customize .actions { display: flex; gap: 12px; margin-top: 28px; }
.server-customize .actions button { flex: 1; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 15px; }
.server-customize .actions .back { background: transparent; color: var(--fg); }
.server-customize .actions .back:hover { background: var(--bg-hover); }
.server-customize .actions .create { background: var(--blue); color: #fff; }
.server-customize .actions .create:hover { background: var(--blue-hover); }
.server-customize .actions .create:disabled { opacity: .5; cursor: not-allowed; }

.modal input[type=text], .modal input:not([type]), .modal textarea { width: 100%; padding: 12px; background: #1e2026; border: 1px solid #1e2026; border-radius: 6px; color: var(--fg); margin-bottom: 12px; font-family: inherit; font-size: 14px; }
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,101,242,.18); }
.modal button.primary { width: 100%; padding: 12px; background: var(--blue); color: #fff; border-radius: 6px; font-weight: 700; font-size: 15px; }
.modal button.primary:hover { background: var(--blue-hover); }
.modal .label { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; margin-bottom: 6px; display: block; letter-spacing: .04em; }
.modal .btn-secondary { padding: 10px 22px; border-radius: 6px; background: transparent; color: var(--fg); font-weight: 600; font-size: 14px; }
.modal .btn-secondary:hover { background: var(--bg-hover); text-decoration: underline; }

.tag-input-row { display: flex; gap: 8px; align-items: center; }
.tag-input-row input { flex: 1; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; font-size: 20px; }
.tag-icons-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 8px; }
.tag-icon-btn { aspect-ratio: 1; border-radius: 8px; background: #1e2026; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; border: 2px solid transparent; }
.tag-icon-btn:hover { transform: scale(1.05); background: #26282e; }
.tag-icon-btn.selected { border-color: var(--blue); background: rgba(88,101,242,.15); }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #4e5058; transition: .2s; border-radius: 24px; }
.switch .slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; transition: .2s; border-radius: 50%; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(16px); }

.ch-type-option { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: 6px; cursor: pointer; }
.ch-type-option:hover { background: var(--bg-hover); }
.ch-type-option input[type=radio] { margin-top: 4px; accent-color: var(--blue); width: 18px; height: 18px; cursor: pointer; }
.ch-type-option .ct-label { font-weight: 700; font-size: 15px; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.ch-type-option .ct-desc { font-size: 13px; color: var(--fg-dim); margin-top: 3px; line-height: 1.4; }

.ch-name-wrap { display: flex; align-items: center; gap: 8px; background: #1e2026; border: 1px solid #1e2026; border-radius: 6px; padding: 0 14px; }
.ch-name-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,101,242,.18); }
.ch-name-wrap .prefix { color: var(--fg-dim); font-size: 18px; font-weight: 600; }
.ch-name-wrap input { flex: 1; background: transparent; border: none; outline: none; color: var(--fg); padding: 12px 0; font-size: 15px; font-family: inherit; margin: 0 !important; box-shadow: none !important; }
.ch-name-wrap .emoji-pick { color: var(--fg-dim); padding: 4px; border-radius: 4px; }
.ch-name-wrap .emoji-pick:hover { color: var(--fg); background: var(--bg-hover); }

.shop-page { flex: 1; padding: 24px; overflow-y: auto; }
.shop-banner { border-radius: 12px; padding: 40px; text-align: center; margin-bottom: 24px; background: linear-gradient(135deg, #1a1b3a 0%, #2a1a3a 100%); border: 1px solid #3a3a5a; }
.shop-banner h2 { font-size: 26px; margin-bottom: 8px; font-weight: 800; }
.shop-banner p { color: var(--fg-dim); }
.shop-section-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.shop-card { background: var(--bg-1); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; }
.shop-card:hover { transform: translateY(-6px); background: #35373c; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.shop-card img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 12px; }
.shop-card:hover img { transform: scale(1.1) rotate(3deg); }
.shop-card .name { font-weight: 600; font-size: 15px; }
.shop-card .price { color: var(--fg-dim); font-size: 13px; margin-top: 4px; }
.shop-card.owned { border: 2px solid var(--green); }
.shop-card.owned::after { content: 'Adquirido'; display: block; color: var(--green); font-size: 11px; font-weight: 700; margin-top: 4px; }

.prime-page { flex: 1; overflow-y: auto; background: linear-gradient(180deg, #1a0e2e 0%, #0c0d18 40%, var(--bg-2) 100%); }
.prime-topnav { padding: 16px 40px; display: flex; gap: 32px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; font-weight: 600; color: #c9cbd1; justify-content: center; }
.prime-topnav span { padding: 6px 0; cursor: pointer; position: relative; }
.prime-topnav span.active { color: #fff; }
.prime-topnav span.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -17px; height: 2px; background: #fff; }
.prime-inner { max-width: 1100px; margin: 0 auto; padding: 40px; }
.prime-block { margin-bottom: 60px; }
.prime-block h2 { font-size: 30px; font-weight: 900; margin-bottom: 8px; text-align: center; }
.prime-block .lead { color: #9aa0ad; text-align: center; margin-bottom: 32px; font-size: 15px; }
.news-hero { background: linear-gradient(120deg, #1a0e3a 0%, #2a0e3a 100%); border-radius: 14px; padding: 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; margin-bottom: 20px; position: relative; overflow: hidden; }
.news-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 50%, rgba(139,69,255,.35), transparent 55%); pointer-events: none; }
.news-hero .tag-new { display: inline-block; background: #fff; color: #8b45ff; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 900; letter-spacing: .1em; margin-bottom: 14px; }
.news-hero h3 { font-size: 28px; font-weight: 900; line-height: 1.15; margin-bottom: 10px; }
.news-hero p { color: #c9cbd1; font-size: 14px; line-height: 1.5; }
.news-visual { position: relative; height: 220px; }
.news-visual .glass-card { position: absolute; background: rgba(120,80,220,.35); border: 1px solid rgba(180,140,255,.4); backdrop-filter: blur(12px); border-radius: 12px; padding: 20px; width: 70%; }
.news-visual .glass-card:nth-child(1) { top: 10px; left: 0; transform: rotate(-4deg); }
.news-visual .glass-card:nth-child(2) { top: 50px; right: 0; transform: rotate(4deg); width: 75%; }
.news-visual .glass-card .bar { height: 8px; background: rgba(255,255,255,.4); border-radius: 4px; margin-bottom: 8px; }
.news-visual .glass-card .bar.short { width: 60%; }
.news-visual .glass-card .bar.tiny { width: 35%; }
.feature-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.feature-card { background: #0e0f14; border: 1px solid #1a1c22; border-radius: 12px; padding: 28px; }
.feature-card h4 { font-size: 16px; margin-bottom: 10px; }
.feature-card p { color: #9aa0ad; font-size: 13px; line-height: 1.5; }
.feature-card .preview-mini { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }
.feature-card .preview-mini .name-box { padding: 10px 14px; border-radius: 6px; font-weight: 700; background: linear-gradient(90deg, #6b2fd6, #b13dd6); color: #fff; }
.feature-card .preview-mini .name-box.blue { background: linear-gradient(90deg, #2d8bd6, #2dd6c4); }
.feature-card .preview-mini .name-box.outline { background: transparent; border: 1.5px solid #d6d62d; color: #fff; }
.compare-table { width: 100%; border-collapse: collapse; background: #0e0f14; border-radius: 12px; overflow: hidden; }
.compare-table th { padding: 14px 20px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #9aa0ad; font-weight: 800; background: #0a0b0f; }
.compare-table th:nth-child(2), .compare-table th:nth-child(3) { text-align: center; }
.compare-table td { padding: 14px 20px; border-top: 1px solid #1a1c22; font-size: 14px; color: #e4e6ea; }
.compare-table td:nth-child(2), .compare-table td:nth-child(3) { text-align: center; color: #9aa0ad; }
.compare-table td.prime-col { color: #fff; font-weight: 700; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.plan { background: #0e0f14; border: 1px solid #1a1c22; border-radius: 12px; padding: 28px; text-align: center; position: relative; }
.plan:hover { transform: translateY(-4px); }
.plan.featured { border-color: #8b45ff; box-shadow: 0 0 40px rgba(139,69,255,.35); }
.plan .p-name { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9aa0ad; font-weight: 800; margin-bottom: 12px; }
.plan .p-price { font-size: 32px; font-weight: 900; }
.plan .p-price small { font-size: 14px; color: #9aa0ad; font-weight: 500; }
.plan .p-off { position: absolute; top: -10px; right: 16px; background: linear-gradient(90deg,#d64ac9,#8b45ff); color: #fff; padding: 4px 10px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.plan-btn { margin-top: 40px; text-align: center; }
.plan-btn button { padding: 14px 32px; background: #fff; color: #111; border-radius: 8px; font-weight: 800; box-shadow: 0 0 40px rgba(139,69,255,.5); display: inline-flex; align-items: center; gap: 8px; }
.plan-btn button:hover { transform: translateY(-2px) scale(1.03); }

.popout { position: absolute; bottom: 76px; left: 76px; width: 320px; background: #232428; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.6); z-index: 60; overflow: visible; }
.popout .banner { height: 60px; background: linear-gradient(135deg, #5865f2, #eb459e); background-size: cover; background-position: center; border-radius: 8px 8px 0 0; }
.popout .body { padding: 12px 16px 16px; }
.popout .avatar-row { margin-top: -40px; display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; padding-left: 6px; }
.popout .avatar-big { width: 72px; height: 72px; border-radius: 50%; border: 6px solid #232428; background: #313338; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; position: relative; overflow: hidden; }
.popout .avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.popout .name { font-size: 18px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.popout .tag { color: var(--fg-dim); font-size: 13px; }
.popout .section-label { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; margin: 12px 0 6px; letter-spacing: .04em; }
.popout .divider { height: 1px; background: #2f3136; margin: 12px 0; }
.popout .action { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; color: var(--fg); font-size: 14px; border-radius: 4px; }
.popout .action:hover { background: #2b2d31; transform: translateX(3px); }
.popout .action.red { color: #f38ba8; }
.popout .action.red:hover { background: rgba(218,55,60,.15); }
.popout .avatar-big-wrap { position: relative; width: 72px; height: 72px; }
.popout .avatar-big-wrap .avatar-big { border: 0; }
.popout .custom-status { background: rgba(255,255,255,.05); padding: 6px 10px; border-radius: 8px; margin-top: 8px; }

.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #fff; }
.role-row { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 6px; background: #1e2026; margin-bottom: 6px; }
.role-row:hover { background: #26272b; transform: translateX(3px); }
.role-row .dot { width: 14px; height: 14px; border-radius: 50%; }
.role-row .name { flex: 1; font-size: 14px; font-weight: 600; }
.role-row button { color: var(--fg-dim); padding: 6px; border-radius: 4px; }
.role-row button:hover { background: var(--bg-hover); color: var(--fg); }
.member-perms { display: flex; flex-direction: column; gap: 4px; }
.member-perms label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 8px 10px; border-radius: 4px; }
.member-perms label:hover { background: var(--bg-hover); }
.member-perms input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
/* ============ EDIT PROFILE PAGE ============ */
.edit-profile-page { position: fixed; inset: 0; background: var(--bg-2); z-index: 200; display: grid; grid-template-columns: 260px 1fr; }
.edit-profile-page .side { background: var(--bg-1); overflow-y: auto; padding: 24px 12px; display: flex; flex-direction: column; gap: 2px; }
.edit-profile-page .side .close-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--fg-dim); margin-bottom: 8px; }
.edit-profile-page .side .close-btn:hover { color: var(--fg); background: var(--bg-hover); transform: rotate(90deg); }
.edit-profile-page .side .grp { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; padding: 16px 12px 6px; letter-spacing: .04em; }
.edit-profile-page .side .nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 4px; color: var(--fg-dim); font-size: 14px; font-weight: 500; cursor: pointer; }
.edit-profile-page .side .nav-item:hover { background: var(--bg-hover); color: var(--fg); transform: translateX(3px); }
.edit-profile-page .side .nav-item.active { background: var(--bg-hover); color: var(--fg); }
.edit-profile-page .side .nav-item.danger { color: #f38ba8; }
.edit-profile-page .side .nav-item.danger:hover { background: rgba(218,55,60,.12); }
.edit-profile-page .content { overflow-y: auto; padding: 40px 48px; }
.edit-profile-page .content-inner { max-width: 700px; margin: 0 auto; }
.edit-profile-page h1 { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

.edit-profile-page .card-preview {
  background: #1e1f22;
  border-radius: 12px;
  margin-bottom: 40px;
  position: relative;
  overflow: visible;
  padding-top: 20px;
}
.edit-profile-page .card-preview .banner {
  height: 120px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--blue);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  margin-top: -20px;
}
.edit-profile-page .card-preview .banner .edit-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(0,0,0,.4); cursor: pointer; color: #fff; gap: 8px; font-size: 13px; font-weight: 600; }
.edit-profile-page .card-preview .banner:hover .edit-overlay { opacity: 1; }
.edit-profile-page .card-preview .av-big {
  position: absolute;
  left: 24px;
  top: 80px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 6px solid #1e1f22;
  background: #313338;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform .25s var(--ease-spring);
  overflow: visible;
  z-index: 5;
}
.edit-profile-page .card-preview .av-big:hover { transform: scale(1.03); }
.edit-profile-page .card-preview .av-big .edit-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; background: rgba(0,0,0,.5); transition: opacity .2s; font-size: 12px; font-weight: 700; letter-spacing: .04em; border-radius: 50%; }
.edit-profile-page .card-preview .av-big:hover .edit-badge { opacity: 1; }
.edit-profile-page .card-preview .info { padding: 124px 24px 28px; border-radius: 0 0 12px 12px; }
.edit-profile-page .card-preview .info h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.edit-profile-page .card-preview .info .meta { color: var(--fg-dim); font-size: 13px; }
.edit-profile-page .card-preview .info .section-label { font-size: 11px; text-transform: uppercase; color: var(--fg-dim); font-weight: 700; margin: 16px 0 4px; letter-spacing: .04em; }
.edit-profile-page .card-preview .info .bio-text { font-size: 14px; color: #dbdee1; line-height: 1.5; }
.edit-profile-page .card-preview .info .created-at { color: var(--fg-dim); font-size: 13px; }

.edit-profile-page .form-group { margin-bottom: 24px; }
.edit-profile-page .form-group label { display: block; font-size: 11px; font-weight: 700; color: var(--fg-dim); text-transform: uppercase; margin-bottom: 8px; letter-spacing: .04em; }
.edit-profile-page .form-group input, .edit-profile-page .form-group textarea { width: 100%; padding: 12px 14px; background: #1e1f22; border: 1px solid #1e1f22; border-radius: 6px; color: var(--fg); font-family: inherit; font-size: 14px; outline: none; }
.edit-profile-page .form-group textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.edit-profile-page .form-group input:focus, .edit-profile-page .form-group textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88,101,242,.18); }
.edit-profile-page .form-group .hint { color: var(--fg-dim); font-size: 12px; margin-top: 6px; }
.edit-profile-page .btn-save { padding: 12px 24px; background: var(--blue); color: #fff; border-radius: 6px; font-weight: 700; font-size: 14px; }
.edit-profile-page .btn-save:hover { background: var(--blue-hover); box-shadow: 0 8px 20px rgba(88,101,242,.4); }
.edit-profile-page .btn-file { display: inline-flex; align-items: center; gap: 8px; background: #1e1f22; color: var(--fg); padding: 10px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.edit-profile-page .btn-file:hover { background: #26282e; transform: translateY(-1px); }
.edit-profile-page .btn-file input { display: none; }
.edit-profile-page .danger-zone { border-top: 1px solid #1e1f22; padding-top: 24px; margin-top: 32px; }
.edit-profile-page .danger-zone h3 { color: #f38ba8; font-size: 15px; margin-bottom: 8px; }
.edit-profile-page .danger-zone p { color: var(--fg-dim); font-size: 13px; margin-bottom: 16px; }
.edit-profile-page .danger-zone button { padding: 10px 18px; background: var(--red); color: #fff; border-radius: 6px; font-weight: 700; font-size: 13px; }
.edit-profile-page .danger-zone button:hover { background: #c92f33; }
.edit-profile-page .frames-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.edit-profile-page .frame-option { background: #1e1f22; border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; border: 2px solid transparent; }
.edit-profile-page .frame-option:hover { transform: translateY(-3px); background: #26282e; }
.edit-profile-page .frame-option.selected { border-color: var(--blue); }
.edit-profile-page .frame-option img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 8px; }
.edit-profile-page .frame-option .name { font-size: 12px; font-weight: 600; }
.edit-profile-page .frame-option .placeholder { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 2px dashed #4e5058; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); margin-bottom: 8px; }

/* ============ LANDING ============ */
.land { min-height: 100vh; background: radial-gradient(circle at 20% 0%, #1c2d5a, #050810 60%); color: #fff; overflow-y: auto; overflow-x: hidden; }
.land-nav { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 24px; position: relative; z-index: 2; }
.land-nav .brandwrap { display: flex; align-items: center; gap: 10px; }
.land-nav .brandwrap img { width: 32px; }
.land-nav .brandwrap span { font-weight: 800; font-size: 18px; }
.land-nav .links { display: flex; gap: 24px; margin-left: 32px; }
.land-nav .links a { color: #ddd; font-size: 14px; font-weight: 600; }
.land-nav .links a:hover { color: #fff; }
.land-nav .actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.land-nav .actions a { font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 4px; display: inline-flex; align-items: center; gap: 8px; }
.land-nav .actions a.entrar { color: #fff; }
.land-nav .actions a.entrar:hover { background: rgba(255,255,255,.08); }
.land-nav .actions a.criar { background: #5865f2; color: #fff; }
.land-nav .actions a.criar:hover { background: #4752c4; transform: translateY(-1px); }
.land-nav .actions a.openapp { background: #23a55a; color: #fff; }
.land-nav .actions a.openapp:hover { background: #1e8e4d; transform: translateY(-1px); }
.hero { max-width: 1200px; margin: 0 auto; padding: 80px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 2; }
.hero h1 { font-size: 56px; font-weight: 900; line-height: 1.05; letter-spacing: -.02em; }
.hero h1 .accent { color: #8ab4ff; }
.hero p { color: #c9d1e0; font-size: 18px; margin-top: 20px; max-width: 480px; }
.hero .btns { margin-top: 32px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero .btns a { padding: 14px 24px; border-radius: 6px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.hero .btns .primary { background: #5865f2; color: #fff; }
.hero .btns .primary:hover { background: #4752c4; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(88,101,242,.5); }
.hero .btns .ghost { background: rgba(255,255,255,.08); color: #fff; }
.hero .btns .ghost:hover { background: rgba(255,255,255,.15); transform: translateY(-3px); }
.hero .mock { background: #1a1b2e; border-radius: 12px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); font-size: 13px; }
.hero .mock .row { display: flex; gap: 8px; margin-bottom: 8px; }
.hero .mock .row .dot { width: 10px; height: 10px; border-radius: 50%; }
.hero .mock .row .dot:nth-child(1) { background: #ff5f57; } .hero .mock .row .dot:nth-child(2) { background: #febc2e; } .hero .mock .row .dot:nth-child(3) { background: #28c840; }
.hero .mock .msg { display: flex; gap: 10px; margin-top: 12px; }
.hero .mock .av { width: 32px; height: 32px; border-radius: 50%; background: #5865f2; flex-shrink: 0; }
.hero .mock .av.pink { background: #eb459e; } .hero .mock .av.green { background: #23a55a; } .hero .mock .av.purple { background: #9b59b6; }
.hero .mock .txt { color: #ddd; }
.stats { max-width: 1200px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid rgba(255,255,255,.05); position: relative; z-index: 2; }
.stats .s .num { font-size: 40px; font-weight: 900; }
.stats .s .lbl { color: #8b93a7; font-size: 14px; }
.features { max-width: 1200px; margin: 0 auto; padding: 80px 24px; position: relative; z-index: 2; }
.features h2 { font-size: 40px; font-weight: 900; margin-bottom: 12px; letter-spacing: -.02em; }
.features .sub { color: #8b93a7; font-size: 16px; margin-bottom: 40px; max-width: 600px; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fcard { background: #151824; border-radius: 12px; padding: 24px; border: 1px solid #222838; }
.fcard:hover { transform: translateY(-6px); border-color: #5865f2; box-shadow: 0 20px 40px rgba(88,101,242,.15); }
.fcard .fico { width: 40px; height: 40px; border-radius: 10px; background: rgba(88,101,242,.15); color: #8ab4ff; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.fcard h3 { font-size: 17px; margin-bottom: 8px; font-weight: 700; }
.fcard p { color: #8b93a7; font-size: 14px; line-height: 1.5; }
.prime-banner { max-width: 1200px; margin: 0 auto; padding: 40px 24px; position: relative; z-index: 2; }
.prime-card { background: linear-gradient(135deg, #4a1a6b, #1a1b2e); border-radius: 16px; padding: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.prime-card .tag { display: inline-block; background: #eb459e; color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 800; margin-bottom: 12px; }
.prime-card h3 { font-size: 32px; font-weight: 900; line-height: 1.1; }
.prime-card .checks { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prime-card .checks div { font-size: 14px; color: #ddd; }
.prime-card .checks div::before { content: '✓ '; color: #eb459e; font-weight: 900; }
.prime-card button { background: #ff6bb5; color: #fff; padding: 14px 28px; border-radius: 8px; font-weight: 800; font-size: 15px; }
.prime-card button:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 30px rgba(235,69,158,.5); }
.cta-final { max-width: 1200px; margin: 40px auto 80px; padding: 60px 24px; text-align: center; background: linear-gradient(135deg, #2a1a4a, #1a1b2e); border-radius: 16px; }
.cta-final h2 { font-size: 40px; font-weight: 900; margin-bottom: 12px; }
.cta-final p { color: #8b93a7; margin-bottom: 24px; }
.cta-final a { background: #5865f2; color: #fff; padding: 14px 32px; border-radius: 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.cta-final a:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 30px rgba(88,101,242,.5); }
.footer { border-top: 1px solid rgba(255,255,255,.05); padding: 40px 24px; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; color: #8b93a7; font-size: 14px; }
.footer h4 { color: #fff; font-size: 13px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.footer a { color: #8b93a7; display: block; margin-bottom: 8px; }
.footer a:hover { color: #fff; transform: translateX(3px); }
.footer .brand-col { display: flex; flex-direction: column; gap: 8px; }
.footer .brand-col img { width: 40px; }
.footer .brand-col .name { color: #fff; font-weight: 800; font-size: 18px; }

/* ============ BADGE VERIFICADO ============ */
.verified-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 3px; animation: vPop .3s var(--ease-spring); }
.verified-badge svg { display: block; filter: drop-shadow(0 0 4px rgba(59,130,246,.6)); }
.verified-badge .vbadge-official { font-size: 9px; font-weight: 900; letter-spacing: .06em; background: #3b82f6; color: #fff; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; line-height: 1.4; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #0f1012; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 900px) {
  .hero, .fgrid, .prime-card, .footer, .plans, .feature-split, .edit-profile-page { grid-template-columns: 1fr }
  .hero h1 { font-size: 40px }
}

.srv-danger-zone { margin-top: 32px; padding-top: 20px; border-top: 1px solid #2b2d31; }
.srv-danger-zone h4 { color: #f38ba8; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.srv-danger-zone p { color: var(--fg-dim); font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.btn-danger { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--red); color: #fff; border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; transition: background .15s, transform .15s; }
.btn-danger:hover { background: #c92f33; transform: translateY(-1px); }
.btn-danger svg { width: 16px; height: 16px; }

.server-header .srv-name { display: inline-flex; align-items: center; gap: 4px; text-shadow: 0 1px 6px rgba(0,0,0,.8); }
.server-header .srv-name .verified-badge svg { width: 16px; height: 16px; }
.rail-verified { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; border-radius: 50%; background: #3b82f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12 10 17 19 7'/%3E%3C/svg%3E") center/10px no-repeat; border: 2px solid var(--bg-0); box-sizing: content-box; }

.prime-logo { height: 26px; width: auto; object-fit: contain; display: block; }
.prime-logo.sm { height: 20px; display: inline-block; vertical-align: middle; margin-right: 6px; }

.embed { max-width: 520px; margin-top: 6px; background: #2b2d31; border-left: 4px solid #8b5cf6; border-radius: 4px; padding: 12px 16px 14px; }
.embed-title { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.embed-desc { font-size: 14px; color: #dbdee1; line-height: 1.45; margin-bottom: 10px; white-space: pre-wrap; }
.embed-field { margin-bottom: 10px; }
.embed-field-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.embed-field-value { font-size: 14px; color: #dbdee1; line-height: 1.4; }
.embed-footer { font-size: 12px; color: var(--fg-dim); margin-top: 8px; padding-top: 8px; border-top: 1px solid #3a3c41; }

/* ===== Tela de carregamento ===== */
#loading-screen { position: fixed; inset: 0; z-index: 99999; background: radial-gradient(circle at 50% 40%, #1c2d5a 0%, #0a0d18 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity .5s ease; }
#loading-screen.hide { opacity: 0; pointer-events: none; }
#loading-screen img { max-width: min(140px, 40vw); max-height: 140px; object-fit: contain; animation: loadPulse 1.4s ease-in-out infinite; }
#loading-screen .ld-text { color: #c9cbd1; font-size: 14px; font-weight: 600; letter-spacing: .04em; }

/* ===== Barra de servidores ===== */
.rail-item.home, .rail-item.home:hover, .rail-item.home.active { background: var(--blue); color: #fff; }
.rail-item.home:hover { background: var(--blue-hover); }
.rail-item.home.active { background: var(--blue); box-shadow: 0 4px 16px rgba(88,101,242,.35); }
.rail-item.has-img, .rail-item.has-img:hover, .rail-item.has-img.active { background: var(--bg-1); }
.rail-item.has-img:hover { box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.rail-item.has-img.active { box-shadow: 0 4px 16px rgba(0,0,0,.35); }

/* ===== Tema azul ===== */
.app.theme-blue { --bg-0:#080f20; --bg-1:#0e1b3a; --bg-2:#0c1832; --bg-3:#17285a; --bg-hover:#1b3066; --fg-dim:#9fb1da; --blue:#4f8cff; --blue-hover:#3b78ee; }
.app.theme-blue .rail { background: #070d1c; }
.app.theme-blue .sidebar { background: linear-gradient(180deg, #102146 0%, #0b1632 100%); border-right: 1px solid #1a2c5c; }
.app.theme-blue .main { background: radial-gradient(circle at 80% 0%, #15275a 0%, transparent 55%), linear-gradient(165deg, #0d1b3c 0%, #0a1430 100%); }
.app.theme-blue .main-header { background: #1a2f63; border-bottom: 1px solid #2a4585; }
.app.theme-blue .server-header { border-bottom-color: #1a2c5c; }
.app.theme-blue .user-panel { background: #12224d; border-top: 1px solid #1f3570; }
.app.theme-blue .members-panel { background: #0e1b3a; border-left: 1px solid #1a2c5c; }
.app.theme-blue .channel-item:hover, .app.theme-blue .channel-item.active { background: rgba(79,140,255,.18); }
.app.theme-blue .channel-item.active::before { background: #6aa0ff; width: 3px; }
.app.theme-blue .channel-item .hash { color: #8296c8; }
.app.theme-blue .input-wrap { background: #17285a; }
.app.theme-blue .input-wrap:focus-within { box-shadow: 0 0 0 2px rgba(79,140,255,.45); }
.app.theme-blue .msg:hover { background: rgba(79,140,255,.06); }
.app.theme-blue .msg-hover-actions { background: #0e1b3a; border-color: #1f3570; }
.app.theme-blue .embed { background: #12224d; }
.app.theme-blue .embed-footer { border-top-color: #243b78; }
.app.theme-blue .rail-sep { background: #1a2c5c; }
.app.theme-blue .rail-item.has-img, .app.theme-blue .rail-item.has-img:hover, .app.theme-blue .rail-item.has-img.active { background: #12224d; }
.rail, .sidebar, .main, .main-header, .user-panel, .members-panel { transition: background .35s ease, border-color .35s ease; }

/* ===== Painel do usuário fixo ===== */
.user-panel { position: fixed; left: 0; bottom: 0; width: 312px; height: 60px; margin: 0; padding: 8px 12px; z-index: 30; border-top: 1px solid rgba(255,255,255,.06); border-right: 1px solid rgba(255,255,255,.06); }
.sidebar { padding-bottom: 60px; }
.rail { padding-bottom: 72px; }
.popout { left: 12px; bottom: 70px; }

/* ===== CALL DE VOZ ===== */
.icon-btn.off { color: var(--red) !important; }
.sidebar.has-voice { padding-bottom: 112px !important; }
.voice-bar { position: fixed; left: 72px; bottom: 60px; width: 240px; background: #1e2a24; border-top: 1px solid rgba(255,255,255,.06); padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; z-index: 29; }
.voice-bar .vb-title { color: var(--green); font-size: 13px; font-weight: 700; }
.voice-bar .vb-sub { color: var(--fg-dim); font-size: 12px; }
.voice-bar button { color: var(--fg-dim); padding: 6px; border-radius: 4px; display: flex; }
.voice-bar button:hover { color: var(--fg); background: rgba(255,255,255,.08); }
.voice-member { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 28px; color: var(--fg-dim); font-size: 14px; }
.voice-member .vm-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-member .vm-ic { color: var(--red); display: flex; }
.voice-member .vm-av { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; transition: box-shadow .12s; }
.voice-member .vm-av img { width: 100%; height: 100%; object-fit: cover; }
.voice-member.speaking .vm-av { box-shadow: 0 0 0 2px var(--green); }
.voice-member.speaking { color: var(--fg); }

/* ============ MARKDOWN NO CHAT ============ */
.md-pre { background: #1e1f22; padding: 10px 12px; border-radius: 6px; font-family: 'Consolas', monospace; font-size: 13px; margin: 6px 0; overflow-x: auto; border: 1px solid #1e1f22; }
.md-code { background: #1e1f22; padding: 2px 5px; border-radius: 4px; font-family: 'Consolas', monospace; font-size: 13px; }
.md-spoiler { background: #1e1f22; color: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; transition: background .2s, color .2s; }
.md-spoiler.revealed { background: rgba(88,101,242,.2); color: var(--fg); }
.msg .content a { color: #00a8fc; }
.msg .content a:hover { text-decoration: underline; }
.time.edited { font-style: italic; opacity: .75; font-size: 10px; }

.link-preview { display: flex; gap: 10px; align-items: flex-start; max-width: 480px; margin-top: 6px; padding: 10px 12px; background: #2b2d31; border-left: 3px solid #5865f2; border-radius: 4px; }
.link-preview .lp-favicon { width: 24px; height: 24px; flex-shrink: 0; background: #1e1f22; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.link-preview .lp-favicon img { width: 16px; height: 16px; }
.link-preview .lp-host { font-size: 12px; font-weight: 700; color: #fff; }
.link-preview .lp-url { font-size: 12px; color: #00a8fc; word-break: break-all; }

.search-row { padding: 10px; border-bottom: 1px solid #1e1f22; cursor: pointer; display: flex; gap: 10px; border-radius: 4px; }
.search-row:hover { background: var(--bg-hover); }
.search-head { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.search-time { color: var(--fg-dim); font-weight: 400; font-size: 11px; margin-left: 6px; }
.search-body { font-size: 13px; color: #dbdee1; line-height: 1.35; }

/* ============ NOTIFICAÇÕES ============ */
.rail-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 800;
  border-radius: 9px; border: 2px solid var(--bg-0);
  display: flex; align-items: center; justify-content: center;
  box-sizing: content-box;
  z-index: 6;
}
.ch-badge {
  margin-left: auto;
  min-width: 18px; height: 16px; padding: 0 6px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.channel-item.has-mention { color: #fff; }
.channel-item.has-mention .hash { color: #fff; }
.channel-item.has-mention .ch-badge { background: var(--yellow); color: #1a1b1e; }
.mention-tag {
  margin-left: 10px; padding: 2px 8px;
  background: rgba(240,178,50,.2); color: var(--yellow);
  font-size: 11px; font-weight: 800; border-radius: 8px;
}

/* ============ SOCIAL ============ */
.custom-status { font-size: 12px; color: var(--fg-dim); margin-top: 2px; display: inline-flex; gap: 4px; align-items: center; }
.member-row .custom-status, .friend-row .custom-status { display: block; }

/* contador de pedidos pendentes */
.tab .badge { margin-left: 6px; background: var(--red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 8px; font-weight: 700; }
/* badges do rail (ficam fora do círculo, sem serem cortados) */
.rail-slot { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.rail-slot > .rail-badge { top: -4px; right: -6px; }
.rail-item.dm-unread { background: var(--bg-1); }

/* botão grande de convite no topo dos canais */
.invite-cta { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 10px 4px; padding: 9px 12px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; transition: filter .15s, transform .15s; }
.invite-cta:hover { filter: brightness(1.12); transform: translateY(-1px); }
.invite-cta svg { width: 16px; height: 16px; }

/* ===== correção de layout: o chat nunca pode ficar maior que a janela ===== */
html, body { overflow: hidden; }
.app { height: 100vh; height: 100dvh; overflow: hidden; }
.main { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.main-body, .chat-area, .messages,
.friends-content, .shop-page, .prime-page { min-height: 0; }
.sidebar { min-height: 0; overflow-y: auto; }
.sidebar::-webkit-scrollbar { width: 0; }

/* molduras: aparecem em volta da foto do próprio usuário */
.edit-profile-page .frame-option .frame-prev { display: flex; justify-content: center; align-items: center; padding: 22px 0 18px; }
.edit-profile-page .frame-option .frame-prev img { aspect-ratio: auto; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #23a55a; color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 8px; z-index: 9999; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: fadeIn .2s ease; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* ===== emojis personalizados ===== */
.custom-emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; margin: 0 1px; }
.msg .content.emoji-only .custom-emoji { width: 44px; height: 44px; vertical-align: -10px; }
.reaction-pill .custom-emoji { width: 18px; height: 18px; vertical-align: middle; margin: 0; }
.input-wrap .emoji-btn { padding: 6px; color: var(--fg-dim); display: flex; }
.input-wrap .emoji-btn:hover { color: var(--fg); transform: scale(1.15); }
.emoji-panel { position: absolute; bottom: 100%; right: 0; margin-bottom: 8px; width: 330px; max-height: 340px; display: flex; flex-direction: column; background: var(--bg-1); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.55); z-index: 40; overflow: hidden; }
.emoji-search { margin: 8px; width: auto !important; flex: none !important; padding: 8px 10px !important; background: var(--bg-0) !important; border-radius: 6px; font-size: 13px !important; }
.emoji-body { overflow-y: auto; padding: 0 8px 8px; }
.emoji-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--fg-dim); padding: 8px 4px 4px; letter-spacing: .02em; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-grid button { width: 36px; height: 36px; font-size: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.emoji-grid button img { width: 26px; height: 26px; object-fit: contain; }
.emoji-grid button:hover { background: var(--bg-hover); transform: scale(1.18); }
.emoji-empty { color: var(--fg-dim); font-size: 13px; padding: 16px 4px; text-align: center; }
.emo-add { display: flex; gap: 10px; align-items: center; }
.emo-add input[type=text], .emo-add #emo-name { flex: 1; }
.emo-pick { width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px; background: #1e1f22; border: 2px dashed #4e5058; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; color: var(--fg-dim); }
.emo-pick:hover { border-color: var(--blue); }
.emo-pick img { width: 100%; height: 100%; object-fit: contain; }
.emo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.emo-row { display: flex; align-items: center; gap: 10px; background: #1e1f22; border-radius: 8px; padding: 8px 10px; }
.emo-row img { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.emo-row input { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; color: var(--fg); font-size: 14px; }
.emo-row input:focus { border-color: var(--blue); background: var(--bg-0); outline: none; }
.emo-row .emo-name { flex: 1; font-size: 14px; }
.emo-del { color: #f38ba8; display: flex; padding: 6px; border-radius: 6px; }
.emo-del:hover { background: rgba(243,139,168,.15); }

/* ===== moldura: foto um pouco menor por dentro e mais espaço até o nome ===== */
:root { --frame-inner: .84; }            /* 1 = foto do tamanho todo; menor = foto mais pra dentro da moldura */
.user-avatar-wrap.has-frame { margin-right: 12px; }
.user-avatar-wrap.has-frame > .user-avatar { transform: scale(var(--frame-inner)); }
.user-avatar-wrap.has-frame:hover > .user-avatar { transform: scale(calc(var(--frame-inner) * 1.06)); }

/* ===== sem animação de entrada repetida (a tela é redesenhada várias vezes ao carregar) ===== */
.sidebar, .main, .msg, .verified-badge { animation: none !important; }

.messages { scroll-behavior: auto !important; }   /* sem rolagem animada ao abrir a conversa */
.server-header.no-settings { cursor: default; }
.server-header.no-settings:hover { background: transparent; }

/* ===== card do servidor (clique na tag) ===== */
.srvcard-backdrop, .ns-backdrop { z-index: 400; }
.modal.srvcard { max-width: 400px; padding: 0; overflow: hidden; }
.srvcard .close-x { background: rgba(0,0,0,.45); color: #fff; }
.srvcard-banner { height: 110px; background: linear-gradient(135deg,#5865f2,#eb459e) center/cover; }
.srvcard-head { display: flex; align-items: flex-end; gap: 12px; padding: 0 20px; margin-top: -34px; }
.srvcard-icon { width: 72px; height: 72px; border-radius: 18px; background: #1e1f22; border: 5px solid var(--bg-1); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; overflow: hidden; flex-shrink: 0; }
.srvcard-icon img { width: 100%; height: 100%; object-fit: cover; }
.srvcard-title { padding-bottom: 4px; min-width: 0; }
.srvcard-name { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.srvcard-count { font-size: 13px; color: var(--fg-dim); margin-top: 2px; }
.srvcard-body { padding: 16px 20px 20px; }
.srvcard-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1.5px solid; border-radius: 6px; font-weight: 800; font-size: 13px; margin-bottom: 14px; }
.srvcard-desc { font-size: 15px; color: #dbdee1; line-height: 1.45; margin-bottom: 14px; word-break: break-word; white-space: pre-wrap; }
.srvcard-date { font-size: 13px; color: var(--fg-dim); margin-bottom: 16px; }
.srvcard-btn { width: 100%; padding: 12px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: 15px; }
.srvcard-btn:hover { background: var(--blue-hover); }
.srvcard-btn:disabled { opacity: .6; cursor: default; }

/* ===== estilos de nome ===== */
.ns-solid { color: var(--ns1) !important; }
.ns-gradient, .ns-prism { background: linear-gradient(90deg, var(--ns1), var(--ns2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent !important; }
.ns-prism { background: linear-gradient(90deg, var(--ns1), var(--ns2), var(--ns1)); background-size: 200% 100%; animation: nsPrism 3s linear infinite; }
.ns-neon { color: var(--ns1) !important; text-shadow: 0 0 4px var(--ns2), 0 0 10px var(--ns2), 0 0 20px var(--ns2); }
.ns-toon { color: var(--ns1) !important; text-shadow: 1px 1px 0 var(--ns2), 2px 2px 0 var(--ns2), 3px 3px 0 var(--ns2); }
@keyframes nsPrism { to { background-position: 200% 0 } }

/* ===== editor do estilo do nome ===== */
.modal.ns-modal { max-width: 820px; padding: 24px; }
.ns-sub { color: var(--fg-dim); font-size: 14px; margin-bottom: 18px; }
.ns-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; }
.ns-label { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--fg-dim); letter-spacing: .04em; margin: 14px 0 8px; }
.ns-fonts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ns-font { background: #1e2026; border: 1px solid transparent; border-radius: 8px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--fg); }
.ns-font span { font-size: 22px; line-height: 1.2; }
.ns-font small { font-size: 11px; color: var(--fg-dim); }
.ns-font:hover { background: #26282e; }
.ns-font.sel, .ns-eff.sel { border-color: var(--blue); }
.ns-effects { display: flex; gap: 8px; flex-wrap: wrap; }
.ns-eff { background: #1e2026; border: 1px solid transparent; border-radius: 20px; padding: 9px 16px; font-weight: 600; font-size: 14px; color: var(--fg); }
.ns-eff:hover { background: #26282e; }
.ns-colors { display: flex; gap: 10px; }
.ns-color { position: relative; padding: 9px 16px; border-radius: 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9); cursor: pointer; border: 1px solid rgba(255,255,255,.25); }
.ns-color input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ns-italic { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--fg-dim); cursor: pointer; }
.ns-reset { display: inline-block; margin-top: 10px; font-size: 13px; cursor: pointer; }
.ns-prime { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: linear-gradient(90deg, #6a4be0, #eb459e); display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.ns-preview { background: #1e1f22; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.ns-pv-banner { height: 78px; background-size: cover; background-position: center; }
.ns-pv-row { display: flex; align-items: flex-end; gap: 14px; padding: 0 16px 16px; margin-top: -32px; }
.ns-pv-row .user-avatar { border: 4px solid #1e1f22; }
.ns-pv-name { font-size: 20px; font-weight: 800; }
.ns-pv-user { font-size: 13px; color: var(--fg-dim); }
.ns-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid #26272b; }
.ns-foot .primary:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 760px) { .ns-grid { grid-template-columns: 1fr; } }