:root{
  --bg0:#1a1b1e;--bg1:#212226;--bg2:#2a2b30;--bg3:#34363c;--line:#3a3c42;
  --bg0-rgb:26,27,30;--bg1-rgb:33,34,38;--bg2-rgb:42,43,48;--bg3-rgb:52,54,60;
  --tx:#e3e3e6;--tx2:#a4a6ad;--tx3:#74767d;--acc:#5b7fd6;--acc2:#4a6cc0;
  --ok:#3fa66b;--warn:#d4a23a;--bad:#d2504c;--r:6px;
  --app-font:14px;--panel-alpha:0.78;--bg-blur:6px;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:var(--bg0);color:var(--tx);font:var(--app-font, 14px)/1.45 "Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;overflow:hidden;transition:font-size 0.12s ease}
button,input,textarea,select{font:inherit;color:inherit}
a{color:var(--acc);text-decoration:none}a:hover{text-decoration:underline}
.hidden{display:none!important}
.muted{color:var(--tx2)}.small{font-size:12px}
input,textarea,select{background:var(--bg0);border:1px solid var(--line);border-radius:var(--r);padding:8px 10px;width:100%;outline:none}
input:focus,textarea:focus{border-color:var(--acc)}
label{display:block;font-size:12px;font-weight:600;color:var(--tx2);margin:12px 0 4px}
.btn{background:var(--bg3);border:0;border-radius:var(--r);padding:8px 14px;cursor:pointer}
.btn:hover{filter:brightness(1.12)}.btn.primary{background:var(--acc);color:#fff}.btn.danger{background:var(--bad);color:#fff}
.btn.wide{width:100%;margin-top:16px}.btn.sm{padding:4px 10px;font-size:13px}
.ibtn{background:none;border:0;color:var(--tx2);cursor:pointer;padding:6px;border-radius:4px;font-size:15px;line-height:1}
.ibtn:hover{background:var(--bg3);color:var(--tx)}.ibtn.on{color:var(--bad)}
.err{color:var(--bad);font-size:13px;min-height:18px;margin-top:8px}
.hint.ok{color:var(--ok)}.hint.bad{color:var(--bad)}

/* auth */
.auth{height:100%;display:flex;align-items:center;justify-content:center;position:relative;z-index:1}
.auth-box{width:410px;background:var(--bg1);padding:24px 26px;border-radius:12px;border:1px solid var(--line);box-shadow:0 8px 32px rgba(0,0,0,0.45)}
.auth-box h1{font-size:20px;font-weight:700}.auth-box details{margin-top:12px}.auth-box details input{margin-top:6px}
.auth-tabs{display:flex;gap:5px;margin-bottom:16px;background:var(--bg0);padding:4px;border-radius:8px;border:1px solid var(--line)}
.auth-tab-btn{flex:1;padding:7px 8px;font-size:12px;font-weight:700;border-radius:6px;border:none;background:transparent;color:var(--tx2);cursor:pointer;transition:all 0.16s ease;text-align:center}
.auth-tab-btn:hover{color:#fff;background:var(--bg2)}
.auth-tab-btn.act{background:var(--acc);color:#fff;box-shadow:0 2px 8px rgba(91,127,214,0.35)}
.auth-tab-btn.guest-pill{color:#34d399}
.auth-tab-btn.guest-pill.act{background:linear-gradient(135deg, #10b981, #059669);color:#fff;box-shadow:0 2px 8px rgba(16,185,129,0.35)}
.auth.reg .login-only,.auth:not(.reg) .reg-only{display:none}

/* layout */
.app{display:flex;height:100%;position:relative;z-index:1}
.rail{width:64px;background:var(--bg0);display:flex;flex-direction:column;align-items:center;padding:10px 0;gap:8px;overflow-y:auto}
.rail .g{width:44px;height:44px;border-radius:12px;background:var(--bg2);display:flex;align-items:center;justify-content:center;cursor:pointer;font-weight:600;font-size:15px;position:relative;flex:none;background-size:cover;background-position:center}
.rail .g:hover,.rail .g.act{background-color:var(--acc);border-radius:10px}
.rail .g.act::before{content:"";position:absolute;left:-10px;width:4px;height:28px;background:var(--tx);border-radius:0 3px 3px 0}
.rail .sep{width:28px;height:1px;background:var(--line)}
.rail .g.add{color:var(--ok);font-size:22px;font-weight:400}.rail .g.add:hover{background:var(--ok);color:#fff}
.side{width:240px;background:var(--bg1);display:flex;flex-direction:column;flex:none}
.side-head{height:48px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--bg0);font-weight:600}
.side-body{flex:1;overflow-y:auto;padding:8px}
.cat{font-size:11px;font-weight:700;text-transform:uppercase;color:var(--tx3);margin:14px 6px 4px;display:flex;justify-content:space-between;align-items:center}
.cat .ibtn{padding:0 4px}
.item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:4px;color:var(--tx2);cursor:pointer;user-select:none}
.item:hover{background:var(--bg2);color:var(--tx)}.item.act{background:var(--bg3);color:var(--tx)}
.item .ic{width:18px;text-align:center;color:var(--tx3)}
.item .grow{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item .badge{background:var(--bad);color:#fff;font-size:11px;border-radius:8px;padding:0 6px}
.vusers{margin:0 0 4px 30px}.vuser{display:flex;align-items:center;gap:6px;padding:3px 4px;font-size:13px;color:var(--tx2)}
.vuser .av{width:22px;height:22px;font-size:10px}.vuser.speaking .av{box-shadow:0 0 0 2px var(--ok)}
.vuser .st{margin-left:auto;font-size:11px;color:var(--tx3)}
.me-bar{height:52px;background:var(--bg0);display:flex;align-items:center;gap:8px;padding:0 8px}
.me-bar .nm{flex:1;overflow:hidden;line-height:1.2}.me-bar .nm b{display:block;font-size:13px}.me-bar .nm span{font-size:11px;color:var(--tx3)}
.voice-bar{background:var(--bg0);border-bottom:1px solid var(--bg2);padding:8px 10px}
.voice-bar .vs{color:var(--ok);font-weight:600;font-size:13px}.voice-bar .vn{font-size:12px;color:var(--tx2)}
.voice-bar .row{display:flex;gap:4px;margin-top:6px}.voice-bar .row .btn{flex:1;padding:6px 0;font-size:13px}
.voice-bar .row .btn.on{background:var(--acc);color:#fff}

.av{width:32px;height:32px;border-radius:50%;background:var(--bg3);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:13px;flex:none;position:relative;background-size:cover;background-position:center;color:#fff}
.av .dot{position:absolute;right:-2px;bottom:-2px;width:12px;height:12px;border-radius:50%;border:3px solid var(--bg1)}
.dot.online{background:var(--ok)}.dot.idle{background:var(--warn)}.dot.dnd{background:var(--bad)}.dot.offline,.dot.invisible{background:var(--tx3)}

.main{flex:1;display:flex;flex-direction:column;min-width:0;background:var(--bg2)}
.main-head{height:48px;display:flex;align-items:center;gap:10px;padding:0 16px;border-bottom:1px solid var(--bg0);flex:none}
.main-head .t{font-weight:600}.main-head .topic{color:var(--tx3);font-size:13px;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-left:1px solid var(--line);padding-left:10px}
.main-head input{width:180px;padding:4px 8px;font-size:13px}
.main-row{flex:1;display:flex;min-height:0}
.content{flex:1;display:flex;flex-direction:column;min-width:0}
.members{width:230px;background:var(--bg1);overflow-y:auto;padding:8px;flex:none}

/* messages */
.msgs{flex:1;overflow-y:auto;padding:16px 0 8px}
.msg{display:flex;gap:12px;padding:2px 16px;position:relative}
.msg:hover{background:rgba(128,128,128,.07)}.msg.first{margin-top:14px}
.msg .av{width:38px;height:38px;cursor:pointer}.msg .gap{width:38px;flex:none}
.msg .body{flex:1;min-width:0}
.msg .meta b{cursor:pointer;font-weight:600;margin-right:6px;font-size:var(--app-font, 14px)}.msg .meta b:hover{text-decoration:underline}
.msg .meta span{font-size:calc(var(--app-font, 14px) - 3px);color:var(--tx3)}
.msg .txt{white-space:pre-wrap;word-wrap:break-word;font-size:var(--app-font, 14px);line-height:1.45}.msg .txt .ed{font-size:10px;color:var(--tx3)}
.msg .txt code{background:var(--bg0);padding:1px 4px;border-radius:3px;font-family:Consolas,monospace;font-size:calc(var(--app-font, 14px) - 1px)}
.msg .txt pre{background:var(--bg0);padding:8px;border-radius:4px;font-family:Consolas,monospace;font-size:calc(var(--app-font, 14px) - 1px);margin:4px 0;white-space:pre-wrap}
.msg .reply{font-size:calc(var(--app-font, 14px) - 2px);color:var(--tx3);margin-bottom:2px;cursor:pointer}.msg .reply b{color:var(--tx2)}
.msg .tools{position:absolute;right:16px;top:-14px;background:var(--bg1);border:1px solid var(--line);border-radius:4px;display:none}
.msg:hover .tools{display:flex}
.msg.pinned{border-left:2px solid var(--warn)}
.att img,.att video{max-width:400px;max-height:300px;border-radius:4px;margin-top:4px;display:block;cursor:pointer}
.att .file{display:inline-flex;gap:8px;align-items:center;background:var(--bg1);border:1px solid var(--line);padding:8px 12px;border-radius:4px;margin-top:4px}
.rx{display:flex;gap:4px;flex-wrap:wrap;margin-top:4px}
.rx button{background:var(--bg1);border:1px solid var(--line);border-radius:6px;padding:0 6px;cursor:pointer;font-size:13px}
.rx button.mine{border-color:var(--acc);background:rgba(91,127,214,.22)}
.composer{padding:0 16px 16px;flex:none}
.composer .replying{background:var(--bg1);padding:6px 10px;font-size:12px;border-radius:6px 6px 0 0;color:var(--tx2);display:flex;justify-content:space-between}
.composer .box{display:flex;align-items:flex-end;background:var(--bg3);border-radius:8px;padding:4px 6px}
.composer textarea{background:none;border:0;resize:none;max-height:200px;min-height:38px;padding:9px 6px;font-size:var(--app-font, 14px)}
.composer .pend{display:flex;gap:6px;flex-wrap:wrap;padding:6px}
.composer .pend span{background:var(--bg1);padding:2px 8px;border-radius:4px;font-size:12px}
.typing{height:18px;font-size:12px;color:var(--tx2);padding:2px 18px}
.empty{margin:auto;text-align:center;color:var(--tx3);padding:40px}
.empty h2{color:var(--tx);font-weight:600;margin-bottom:6px}

/* voice stage */
.stage{flex:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:10px;padding:16px;overflow:auto;align-content:center;background:var(--bg0)}
.tile{background:var(--bg1);border-radius:8px;aspect-ratio:16/9;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;border:2px solid transparent}
.tile.speaking{border-color:var(--ok)}
.tile video{width:100%;height:100%;object-fit:contain;background:#000}
.tile .av{width:72px;height:72px;font-size:26px}
.tile .lbl{position:absolute;left:8px;bottom:8px;background:rgba(0,0,0,.6);padding:2px 8px;border-radius:4px;font-size:12px}
.tile.big{grid-column:1/-1}

/* friends */
.tabs{display:flex;gap:6px;align-items:center}.tabs .btn{background:none;color:var(--tx2)}.tabs .btn.act{background:var(--bg3);color:var(--tx)}
.flist{padding:12px 20px;overflow:auto}
.frow{display:flex;align-items:center;gap:10px;padding:10px 8px;border-top:1px solid var(--line)}
.frow .grow{flex:1}

/* modal / ctx / toast */
.modal{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:150;animation:fadeInBackdrop .16s ease}
.modal-box{background:var(--bg1);border-radius:8px;padding:22px;width:440px;max-height:85vh;overflow:auto;border:1px solid var(--line);animation:settingsSlideIn .2s cubic-bezier(.16,1,.3,1)}
.modal-box h2{font-size:18px;font-weight:600;margin-bottom:4px}
.modal-box .acts{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.modal-box.wide{width:720px}
.ctx{position:fixed;background:var(--bg0);border:1px solid var(--line);border-radius:6px;padding:4px;z-index:180;min-width:170px;box-shadow:0 6px 20px rgba(0,0,0,.35)}
.ctx div{padding:6px 10px;border-radius:4px;cursor:pointer;font-size:13px}.ctx div:hover{background:var(--acc);color:#fff}.ctx div.bad{color:var(--bad)}.ctx div.bad:hover{color:#fff;background:var(--bad)}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--bg3);color:var(--tx);border:1px solid var(--line);padding:9px 18px;border-radius:6px;z-index:220;box-shadow:0 6px 18px rgba(0,0,0,.45);font-weight:500}
.profile .banner{height:80px;background:var(--acc);background-size:cover;background-position:center;margin:-22px -22px 0;border-radius:8px 8px 0 0}
.profile .av{width:80px;height:80px;font-size:30px;margin-top:-40px;border:5px solid var(--bg1)}
.profile .av .dot{width:20px;height:20px;right:-2px;bottom:-2px;border-width:4px;border-color:var(--bg1)}
.tile video.mirrored{transform:scaleX(-1)}
.emoji-pick{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.emoji-pick button{background:none;border:0;font-size:22px;cursor:pointer;border-radius:4px}.emoji-pick button:hover{background:var(--bg3)}
::-webkit-scrollbar{width:8px}::-webkit-scrollbar-thumb{background:var(--bg3);border-radius:4px}::-webkit-scrollbar-track{background:transparent}

/* ================= THEMES & CUSTOM BACKGROUNDS ================= */
body.theme-midnight {
  --bg0:#0b0c0e;--bg1:#121316;--bg2:#18191c;--bg3:#222428;--line:#2b2d32;
  --bg0-rgb:11,12,14;--bg1-rgb:18,19,22;--bg2-rgb:24,25,28;--bg3-rgb:34,36,40;
  --tx:#f2f3f5;--tx2:#949ba4;--tx3:#6d737e;--acc:#5865f2;--acc2:#4752c4;
}
body.theme-light {
  --bg0:#e3e5e8;--bg1:#f2f3f5;--bg2:#ffffff;--bg3:#e0e2e5;--line:#d0d2d6;
  --bg0-rgb:227,229,232;--bg1-rgb:242,243,245;--bg2-rgb:255,255,255;--bg3-rgb:224,226,229;
  --tx:#060607;--tx2:#4e5058;--tx3:#747780;--acc:#5865f2;--acc2:#4752c4;
}

.app-bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  opacity: 0; contain: strict; transform: translateZ(0); backface-visibility: hidden;
}
body.has-custom-bg .app-bg-layer { opacity: 1; }
.bg-image-el, .bg-anim-el, .bg-particles, .bg-dim-el {
  position: absolute; inset: -4%; width: 108%; height: 108%;
  transform: translate3d(0, 0, 0); backface-visibility: hidden;
}
.bg-image-el {
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.bg-image-el.ken-burns {
  will-change: transform;
  animation: bgKenBurns 24s ease-in-out infinite alternate;
}
@keyframes bgKenBurns {
  0% { transform: scale3d(1, 1, 1) translate3d(0, 0, 0); }
  100% { transform: scale3d(1.06, 1.06, 1) translate3d(-1.5%, 1%, 0); }
}
.app-bg-layer.paused .bg-image-el,
.app-bg-layer.paused .bg-anim-el,
.app-bg-layer.paused .bg-anim-el::before,
.app-bg-layer.paused .bg-anim-el::after,
.app-bg-layer.paused .bg-particles {
  animation: none !important;
}

/* Lightweight GPU-Compositor Presets (Zero filter:blur or background-position repaints) */
.bg-preset-aurora {
  background:
    radial-gradient(ellipse 80% 60% at 20% 25%, rgba(16, 185, 129, 0.42), transparent 65%),
    radial-gradient(ellipse 75% 65% at 80% 30%, rgba(88, 101, 242, 0.48), transparent 65%),
    radial-gradient(ellipse 85% 70% at 50% 80%, rgba(168, 85, 247, 0.38), transparent 65%),
    #090d16;
}
.bg-preset-aurora::before {
  content: ""; position: absolute; inset: -10%;
  background: radial-gradient(circle at 60% 40%, rgba(56, 189, 248, 0.32), rgba(236, 72, 153, 0.22) 45%, transparent 70%);
  will-change: transform;
  animation: auroraFloat 14s ease-in-out infinite alternate;
}
@keyframes auroraFloat {
  0% { transform: translate3d(-4%, -3%, 0) scale(1); }
  100% { transform: translate3d(4%, 3%, 0) scale(1.06); }
}

/* Preset 2: Cyber Neon */
.bg-preset-cyber {
  background:
    radial-gradient(circle at 50% 20%, rgba(236, 72, 153, 0.38), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.32), transparent 55%),
    linear-gradient(135deg, #090414 0%, #150726 55%, #051622 100%);
}
.bg-preset-cyber::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(236, 72, 153, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.16) 1px, transparent 1px);
  background-size: 44px 44px;
  will-change: transform;
  animation: auroraFloat 12s ease-in-out infinite alternate;
}

/* Preset 3: Cosmos */
.bg-preset-cosmos {
  background:
    radial-gradient(circle at 65% 32%, rgba(139, 92, 246, 0.35), transparent 50%),
    radial-gradient(circle at 25% 70%, rgba(59, 130, 246, 0.28), transparent 50%),
    radial-gradient(ellipse at 50% 40%, #1a1033 0%, #080912 70%, #040508 100%);
}
.bg-preset-cosmos::before {
  content: ""; position: absolute; inset: -6%;
  background-image:
    radial-gradient(2px 2px at 40px 60px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 140px 120px, #a5b4fc, transparent),
    radial-gradient(2px 2px at 260px 50px, #f472b6, transparent),
    radial-gradient(1.5px 1.5px at 90px 210px, #fff, transparent),
    radial-gradient(2px 2px at 310px 180px, #38bdf8, transparent);
  background-size: 350px 260px;
  will-change: transform;
  animation: auroraFloat 18s ease-in-out infinite alternate;
}

/* Preset 4: Sunset */
.bg-preset-sunset {
  background:
    radial-gradient(circle at 75% 25%, rgba(255, 94, 98, 0.45), transparent 55%),
    radial-gradient(circle at 25% 75%, rgba(255, 8, 68, 0.38), transparent 55%),
    linear-gradient(135deg, #2b1055 0%, #5c164e 50%, #190a28 100%);
}
.bg-preset-sunset::before {
  content: ""; position: absolute; inset: -8%;
  background: radial-gradient(circle at 45% 45%, rgba(255, 153, 102, 0.28), transparent 60%);
  will-change: transform;
  animation: auroraFloat 13s ease-in-out infinite alternate;
}

/* Preset 5: Ocean */
.bg-preset-ocean {
  background:
    radial-gradient(circle at 30% 25%, rgba(11, 163, 96, 0.36), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(0, 140, 255, 0.36), transparent 55%),
    linear-gradient(135deg, #031525 0%, #062c49 55%, #041824 100%);
}
.bg-preset-ocean::before {
  content: ""; position: absolute; inset: -8%;
  background: radial-gradient(circle at 55% 40%, rgba(56, 189, 248, 0.26), transparent 60%);
  will-change: transform;
  animation: auroraFloat 14s ease-in-out infinite alternate;
}

/* Floating Light Particles Overlay (Compositor transform only) */
.bg-particles {
  opacity: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 15% 25%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 45% 65%, rgba(255,255,255,0.4), transparent),
    radial-gradient(2.5px 2.5px at 75% 35%, rgba(147,197,253,0.6), transparent),
    radial-gradient(2px 2px at 85% 80%, rgba(244,114,182,0.5), transparent),
    radial-gradient(2px 2px at 30% 85%, rgba(167,243,208,0.5), transparent);
  background-size: 320px 320px;
}
.bg-particles.active {
  opacity: 0.8; will-change: transform;
  animation: particlesFloat 16s ease-in-out infinite alternate;
}
@keyframes particlesFloat {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-24px, -28px, 0); }
}

/* Fast Alpha Surfaces when custom background is active (No expensive per-panel backdrop-filter) */
body.has-custom-bg .rail,
body.has-custom-bg .me-bar,
body.has-custom-bg .voice-bar,
body.has-custom-bg .stage {
  background: rgba(var(--bg0-rgb), var(--panel-alpha, 0.78));
}
body.has-custom-bg .side,
body.has-custom-bg .members,
body.has-custom-bg .auth-box,
body.has-custom-bg .settings-sidebar {
  background: rgba(var(--bg1-rgb), var(--panel-alpha, 0.82));
}
body.has-custom-bg .main,
body.has-custom-bg .settings-main {
  background: rgba(var(--bg2-rgb), calc(var(--panel-alpha, 0.78) - 0.04));
}
body.has-custom-bg .s-card {
  background: rgba(var(--bg2-rgb), 0.86);
}

/* ================= DETAILED SETTINGS OVERLAY ================= */
.settings-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: stretch; justify-content: stretch;
  overflow: hidden;
}
.settings-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.76);
  animation: fadeInBackdrop 0.2s ease forwards;
}
@keyframes fadeInBackdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOutBackdrop { from { opacity: 1; } to { opacity: 0; } }

.settings-container {
  position: relative; width: 100%; height: 100%; display: flex; z-index: 1;
  animation: settingsSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes settingsSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes settingsSlideOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.96) translateY(10px); }
}
.settings-overlay.closing .settings-modal-backdrop { animation: fadeOutBackdrop 0.18s ease forwards; }
.settings-overlay.closing .settings-container { animation: settingsSlideOut 0.18s ease forwards; }

/* Left Sidebar */
.settings-sidebar {
  width: 250px; background: var(--bg0); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 14px 20px 24px; flex-shrink: 0; overflow-y: auto;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-cat {
  font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--tx3);
  letter-spacing: 0.6px; padding: 12px 10px 4px; margin-top: 6px;
}
.settings-tab-btn {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px;
  font-size: 14px; font-weight: 500; color: var(--tx2); cursor: pointer; position: relative;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1); user-select: none;
}
.settings-tab-btn:hover {
  background: var(--bg2); color: var(--tx); transform: translateX(3px);
}
.settings-tab-btn.act {
  background: var(--bg3); color: var(--tx); font-weight: 600;
}
.settings-tab-btn.act::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--acc);
}
.settings-tab-btn .s-icon {
  width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; transition: transform 0.2s ease;
}
.settings-tab-btn:hover .s-icon { transform: scale(1.1); }
.settings-tab-btn.act .s-icon { opacity: 1; color: var(--acc); }
.settings-tab-btn.danger-tab { color: var(--bad); }
.settings-tab-btn.danger-tab:hover { background: rgba(210, 80, 76, 0.15); color: #ff6864; }
.settings-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.settings-sidebar-foot {
  padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px;
}
.settings-sidebar-foot .foot-title { font-size: 12px; font-weight: 700; color: var(--tx2); }

/* Right Main Area */
.settings-main {
  flex: 1; background: var(--bg1); display: flex; flex-direction: column;
  position: relative; overflow-y: auto; padding: 40px 96px 100px 48px;
}
.settings-close-wrap {
  position: fixed; right: 36px; top: 32px; display: flex; flex-direction: column;
  align-items: center; gap: 4px; z-index: 50;
}
.settings-esc-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--tx3);
  background: var(--bg1); color: var(--tx2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.settings-esc-btn svg { width: 18px; height: 18px; }
.settings-esc-btn:hover {
  transform: rotate(90deg) scale(1.12); border-color: var(--tx); color: var(--tx);
  background: var(--bg3);
}
.settings-esc-btn:active { transform: scale(0.95); }
.settings-esc-label {
  font-size: 11px; font-weight: 700; color: var(--tx3); letter-spacing: 0.5px;
}

/* Tab Content Box */
.settings-content-wrap {
  max-width: 740px; width: 100%;
}
.s-pane {
  animation: sTabFade 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes sTabFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.s-pane h2 {
  font-size: 20px; font-weight: 700; margin-bottom: 22px; color: var(--tx);
}
.s-section { margin-bottom: 28px; }
.s-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--tx2);
  letter-spacing: 0.5px; margin-bottom: 8px;
}
.s-card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; margin-bottom: 16px;
}

/* Profile Card Banner & Live Preview */
.profile-split {
  display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap;
}
.acc-avatar-wrap {
  width: 84px; height: 84px; border-radius: 50%; border: 6px solid #111214;
  background: #1e1f22; position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  cursor: pointer; flex-shrink: 0;
}
.acc-avatar-wrap .av { width: 100%; height: 100%; font-size: 28px; }
.acc-avatar-wrap .av .dot { width: 20px; height: 20px; right: -2px; bottom: -2px; border: 4px solid #111214; }
.profile-preview-card {
  width: 300px; background: #111214; border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.profile-preview-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55); }
.preview-banner {
  height: 96px; width: 100%; background: #5865f2; position: relative;
  transition: background 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-size: cover; background-position: center;
}
.preview-avatar-wrap {
  width: 80px; height: 80px; border-radius: 50%; border: 6px solid #111214;
  margin-top: -42px; margin-left: 14px; position: relative; background: #2b2d31;
}
#liveAv { width: 100%; height: 100%; }
.preview-avatar-wrap .av { width: 100%; height: 100%; font-size: 26px; }
.preview-avatar-wrap .av .dot { width: 20px; height: 20px; right: -2px; bottom: -2px; border: 4px solid #111214; }
.preview-body { padding: 12px 16px 16px; }
.preview-display { font-size: 18px; font-weight: 700; color: #fff; line-height: 1.2; word-break: break-word; }
.preview-tag { font-size: 13px; color: #949ba4; margin-top: 2px; }
.preview-badges { display: flex; gap: 6px; margin: 10px 0; }
.preview-badge {
  background: #1e1f22; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 4px;
  padding: 2px 7px; font-size: 11px; font-weight: 600; color: #fff; display: inline-flex;
  align-items: center; gap: 4px;
}
.preview-badge.nitro {
  background: linear-gradient(135deg, rgba(244, 123, 203, 0.2), rgba(88, 101, 242, 0.2));
  border-color: rgba(244, 123, 203, 0.4);
}
.preview-divider { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 12px 0; }
.preview-bio-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #b5bac1; margin-bottom: 4px; }
.preview-bio { font-size: 13px; color: #dbdee1; white-space: pre-wrap; word-break: break-word; line-height: 1.35; max-height: 120px; overflow-y: auto; }
.preview-meta { margin-top: 12px; font-size: 11px; color: #949ba4; }

/* Swatch Colors for Banner */
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.color-swatch:hover { transform: scale(1.18); }
.color-swatch.selected { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 10px rgba(255,255,255,0.4); }

/* Discord Toggle Switch */
.d-toggle-row {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.d-toggle-row:last-child { border-bottom: none; }
.d-toggle-info { display: flex; flex-direction: column; gap: 2px; }
.d-toggle-title { font-size: 14px; font-weight: 600; color: var(--tx); }
.d-toggle-desc { font-size: 12px; color: var(--tx2); }
.d-switch {
  position: relative; width: 44px; height: 24px; border-radius: 12px;
  background: #4e5058; cursor: pointer; transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; user-select: none;
}
.d-switch.on { background: #23a55a; }
.d-switch .d-switch-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.d-switch.on .d-switch-knob { transform: translateX(20px); }

/* Sliders */
.d-slider-wrap { display: flex; align-items: center; gap: 14px; margin: 8px 0; }
.d-slider {
  flex: 1; -webkit-appearance: none; height: 6px; border-radius: 3px;
  background: var(--bg3); outline: none; cursor: pointer;
}
.d-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}
.d-slider::-webkit-slider-thumb:hover { transform: scale(1.2); background: var(--acc); }
.d-slider-val { font-size: 13px; font-weight: 600; color: var(--tx2); min-width: 44px; text-align: right; }

/* Mic Test Visualizer */
.mic-test-box {
  background: var(--bg0); border-radius: 8px; padding: 16px; margin: 12px 0 20px;
  border: 1px solid var(--line);
}
.eq-bars {
  display: flex; align-items: flex-end; gap: 4px; height: 44px; margin: 14px 0;
  background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 8px 12px;
}
.eq-bar {
  flex: 1; background: var(--bg3); border-radius: 2px; height: 6px;
  transition: height 0.06s ease, background 0.15s ease;
}
.eq-bar.active {
  background: linear-gradient(to top, #23a55a, #57f287);
  box-shadow: 0 0 8px rgba(35, 165, 90, 0.4);
}

/* Radio Selection Cards (Voice Mode) */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0 16px; }
.radio-card {
  background: var(--bg0); border: 2px solid transparent; border-radius: 8px; padding: 14px;
  cursor: pointer; display: flex; align-items: flex-start; gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.radio-card:hover { background: var(--bg2); border-color: rgba(255, 255, 255, 0.1); }
.radio-card.selected { border-color: var(--acc); background: rgba(88, 101, 242, 0.08); }
.radio-circle {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--tx3);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
  transition: all 0.2s;
}
.radio-card.selected .radio-circle { border-color: var(--acc); }
.radio-card.selected .radio-circle::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acc);
}
.radio-title { font-size: 14px; font-weight: 600; color: var(--tx); }
.radio-desc { font-size: 12px; color: var(--tx2); margin-top: 2px; }

/* Camera Preview */
.cam-preview-box {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: 8px; overflow: hidden; margin: 12px 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.cam-preview-box video { width: 100%; height: 100%; object-fit: cover; }
.cam-preview-box video.mirrored { transform: scaleX(-1); }

/* Theme Selection Cards */
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 20px; }
.theme-card {
  border-radius: 8px; padding: 12px; cursor: pointer; border: 2px solid transparent;
  display: flex; flex-direction: column; gap: 8px; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg0);
}
.theme-card:hover { transform: translateY(-3px); }
.theme-card.act { border-color: var(--acc); box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3); }
.theme-preview-box {
  height: 60px; border-radius: 6px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
}
.theme-preview-box .th-line { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.2); width: 60%; }
.theme-preview-box .th-msg { height: 16px; border-radius: 4px; background: rgba(255,255,255,0.1); width: 85%; }
.theme-card.dark .theme-preview-box { background: #212226; }
.theme-card.midnight .theme-preview-box { background: #0b0c0e; }
.theme-card.light .theme-preview-box { background: #f2f3f5; }
.theme-card.light .theme-preview-box .th-line { background: rgba(0,0,0,0.2); }
.theme-card.light .theme-preview-box .th-msg { background: rgba(0,0,0,0.1); }
.theme-label { font-size: 13px; font-weight: 600; text-align: center; color: var(--tx); }

/* Floating Unsaved Changes Bottom Notice Bar */
.unsaved-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: min(680px, calc(100vw - 48px));
  background: #111214; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px;
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  z-index: 120; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: unsavedSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.unsaved-bar.shake {
  border-color: var(--bad);
  animation: unsavedShake 0.38s ease;
}
@keyframes unsavedSlideUp {
  from { transform: translate(-50%, 60px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes unsavedShake {
  0%, 100% { transform: translate(-50%, 0); }
  20%, 60% { transform: translate(calc(-50% - 8px), 0); }
  40%, 80% { transform: translate(calc(-50% + 8px), 0); }
}
.unsaved-text { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: #fff; }
.unsaved-actions { display: flex; align-items: center; gap: 10px; }
.unsaved-actions .ghost-btn {
  background: transparent; color: #fff; padding: 7px 14px; border-radius: 4px;
}
.unsaved-actions .ghost-btn:hover { text-decoration: underline; }
.unsaved-actions .success-btn {
  background: #23a55a; color: #fff; padding: 7px 18px; border-radius: 4px; font-weight: 600;
  transition: background 0.15s, transform 0.15s;
}
.unsaved-actions .success-btn:hover { background: #1f9450; transform: scale(1.02); }

/* ================= BACKGROUND CUSTOMIZATION & SFX VOLUME ================= */
.bg-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px 0 18px;
}
.bg-card {
  position: relative; border-radius: 10px; padding: 8px; cursor: pointer;
  border: 2px solid var(--line); background: var(--bg0);
  display: flex; flex-direction: column; gap: 8px;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden;
}
.bg-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}
.bg-card.act {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25), 0 8px 24px rgba(88, 101, 242, 0.35);
}
.bg-card-thumb {
  position: relative; height: 74px; border-radius: 6px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1); background: #18191c;
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.bg-card-thumb .bg-mini-anim,
.bg-card-thumb .bg-mini-anim::before,
.bg-card-thumb .bg-mini-anim::after {
  position: absolute; inset: 0; animation: none !important;
}
.bg-card-badge {
  position: absolute; top: 6px; right: 6px; background: rgba(15, 16, 20, 0.85);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; z-index: 2; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 4px;
}
.bg-card.act .bg-card-badge { background: var(--acc); }
.bg-card-title {
  font-size: 13px; font-weight: 600; color: var(--tx); text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}

.bg-upload-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--bg0); border: 1px dashed var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; transition: border-color 0.2s ease, background 0.2s ease;
}
.bg-upload-box:hover { border-color: var(--acc); background: rgba(88, 101, 242, 0.05); }
.bg-upload-preview {
  width: 76px; height: 48px; border-radius: 6px; background: var(--bg2);
  border: 1px solid var(--line); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 20px; color: var(--tx3); overflow: hidden;
}

/* Font Size Preset Pills */
.font-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px;
}
.font-pill {
  background: var(--bg0); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--tx2);
  cursor: pointer; transition: all 0.16s ease;
}
.font-pill:hover { background: var(--bg3); color: var(--tx); }
.font-pill.act { background: var(--acc); border-color: var(--acc); color: #fff; }

/* Notification Sound Volume Row Controls */
.sfx-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.sfx-row:last-child { border-bottom: none; }
.sfx-ctrl {
  display: flex; align-items: center; gap: 10px; min-width: 270px;
}
.sfx-mute-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg0); color: var(--tx2); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  transition: all 0.15s ease; flex-shrink: 0;
}
.sfx-mute-btn:hover { background: var(--bg3); color: var(--tx); }
.sfx-mute-btn.muted { color: var(--bad); border-color: rgba(210, 80, 76, 0.4); background: rgba(210, 80, 76, 0.1); }
.sfx-ctrl .d-slider { min-width: 120px; }
.sfx-ctrl .d-slider-val { min-width: 48px; font-variant-numeric: tabular-nums; }

/* ================= VECTOR SVG ICONS & DETAILED PROFILE MODAL ================= */
.svg-ic {
  width: 16px; height: 16px; display: inline-block; vertical-align: middle;
  flex-shrink: 0; fill: currentColor;
}
.ibtn .svg-ic { width: 17px; height: 17px; display: block; }
.item .ic { display: flex; align-items: center; justify-content: center; width: 18px; }
.vuser .st { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--tx3); }
.vuser .st .svg-ic { width: 13px; height: 13px; }

.modal-box:has(.p-modal) {
  padding: 0; width: 540px; max-width: calc(100vw - 32px);
  background: #111214; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}
.p-modal {
  display: flex; flex-direction: column; color: #f2f3f5;
}
.p-banner {
  height: 150px; width: 100%; position: relative;
  background-color: #5865f2; background-size: cover; background-position: center;
}
.p-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.22) 0%, transparent 45%, rgba(17,18,20,0.75) 100%);
  pointer-events: none;
}
.p-banner-actions {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: flex; gap: 8px;
}
.p-top-pill {
  background: rgba(17, 18, 20, 0.72); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f2f3f5; border-radius: 20px; padding: 5px 11px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.p-top-pill:hover { background: rgba(30, 31, 34, 0.95); transform: translateY(-1px); }

.p-avatar-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 22px; margin-top: -50px; position: relative; z-index: 3;
}
.p-avatar-ring {
  width: 96px; height: 96px; border-radius: 50%; border: 6px solid #111214;
  background: #1e1f22; position: relative; flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.p-avatar-ring .av { width: 100%; height: 100%; font-size: 34px; }
.p-avatar-ring .av .dot {
  width: 24px; height: 24px; right: -2px; bottom: -2px;
  border: 5px solid #111214;
}

.p-badge-tray {
  display: inline-flex; align-items: center; gap: 6px;
  background: #1e1f22; border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 9px; border-radius: 10px; margin-bottom: 6px;
}
.p-badge-icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04); cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s ease;
}
.p-badge-icon:hover { transform: scale(1.18) translateY(-2px); background: rgba(255, 255, 255, 0.12); }
.p-badge-icon svg { width: 16px; height: 16px; }

.p-main-body {
  padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 14px;
}
.p-identity-card {
  background: #1e1f22; border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px; padding: 14px 16px;
}
.p-name-line {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.p-display-name {
  font-size: 21px; font-weight: 700; color: #fff; line-height: 1.2;
  display: flex; align-items: center; gap: 8px;
}
.p-status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); color: #dbdee1;
}
.p-status-chip .s-dot { width: 8px; height: 8px; border-radius: 50%; }
.p-status-chip .s-dot.online { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.p-status-chip .s-dot.idle { background: var(--warn); }
.p-status-chip .s-dot.dnd { background: var(--bad); }
.p-status-chip .s-dot.offline, .p-status-chip .s-dot.invisible { background: var(--tx3); }

.p-sub-line {
  display: flex; align-items: center; gap: 8px; margin-top: 4px; color: #949ba4; font-size: 13px;
}
.p-tag-copy {
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px; padding: 1px 7px; font-size: 11px; color: #b5bac1;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.p-tag-copy:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.p-tabs {
  display: flex; gap: 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 12px; padding-top: 4px;
}
.p-tab {
  padding: 8px 2px; font-size: 13px; font-weight: 600; color: #949ba4;
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.16s ease;
}
.p-tab:hover { color: #dbdee1; }
.p-tab.act { color: #fff; border-bottom-color: #5865f2; }

.p-tab-pane {
  display: flex; flex-direction: column; gap: 12px; margin-top: 12px;
  max-height: 270px; overflow-y: auto; padding-right: 2px;
}
.p-sec-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: #b5bac1; margin-bottom: 5px; display: flex; align-items: center; gap: 5px;
}
.p-bio-box {
  font-size: 13.5px; color: #dbdee1; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.p-connect-box {
  margin-top: 8px; background: #111214; border: 1px solid rgba(88, 101, 242, 0.35);
  border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.p-connect-cmd {
  font-family: Consolas, monospace; font-size: 12.5px; color: #57f287; font-weight: 600;
  display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.p-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.p-info-cell {
  background: #111214; border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; gap: 10px;
}
.p-info-ic {
  width: 32px; height: 32px; border-radius: 8px; background: rgba(88, 101, 242, 0.14);
  color: #5865f2; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.p-roles-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.p-role-pill {
  background: #111214; border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: #e3e5e8;
  display: inline-flex; align-items: center; gap: 6px;
}
.p-role-dot { width: 9px; height: 9px; border-radius: 50%; }
.p-note-inp {
  background: #111214; border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px; padding: 7px 10px; font-size: 12.5px; color: #dbdee1;
  width: 100%; resize: none;
}
.p-note-inp:focus { border-color: #5865f2; }
.p-mutual-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #111214; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.04); transition: background 0.15s ease;
}
.p-mutual-row:hover { background: #26282d; }
.p-footer-acts {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 6px;
}

/* ==================== DISCORD SERVER (GUILD) SETTINGS ==================== */
.gs-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px;
}
.gs-stat-card {
  background: var(--bg1); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 12px;
}
.gs-stat-ic {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(88, 101, 242, 0.14);
  color: var(--acc); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gs-stat-val { font-size: 18px; font-weight: 700; color: var(--tx); line-height: 1.1; }
.gs-stat-lbl { font-size: 11.5px; color: var(--tx2); margin-top: 2px; }

.gs-roles-layout {
  display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: start;
}
.gs-role-sidebar {
  background: var(--bg1); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.gs-role-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--tx2);
  transition: background 0.14s ease, color 0.14s ease;
}
.gs-role-item:hover { background: var(--bg3); color: var(--tx); }
.gs-role-item.act { background: rgba(88, 101, 242, 0.18); color: #fff; border: 1px solid rgba(88, 101, 242, 0.4); }
.gs-role-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

.gs-role-editor {
  background: var(--bg1); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px;
}

.gs-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; background: var(--bg1); border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: 8px; transition: border-color 0.15s ease, background 0.15s ease;
}
.gs-list-row:hover { border-color: rgba(88, 101, 242, 0.4); background: var(--bg2); }

.gs-badge-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600;
  background: var(--bg0); border: 1px solid var(--line); color: var(--tx2);
}
.gs-role-check-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--bg0); border: 1px solid var(--line); color: var(--tx2);
  user-select: none; transition: all 0.14s ease;
}
.gs-role-check-pill.on {
  background: rgba(88, 101, 242, 0.18); border-color: var(--acc); color: #fff;
}

.side-guild-banner {
  height: 84px; background-size: cover; background-position: center;
  position: relative; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.side-guild-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.1) 60%, rgba(0,0,0,0.55) 100%);
}
.vc-limit-badge {
  font-size: 11px; font-weight: 600; color: var(--tx3); background: var(--bg0);
  padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line);
}

/* ==================== DISCORD HOME / FRIENDS / DM HUB ==================== */
.dm-search-wrap {
  width: 100%; position: relative; display: flex; align-items: center;
}
.dm-search-inp {
  width: 100%; background: var(--bg0) !important; border: 1px solid var(--line) !important;
  border-radius: 6px !important; padding: 6px 10px !important; font-size: 12.5px !important;
  color: var(--tx) !important; transition: border-color 0.15s ease;
}
.dm-search-inp:focus { border-color: var(--acc) !important; }

.dm-row-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  border-radius: 6px; color: var(--tx2); cursor: pointer; user-select: none;
  transition: background 0.12s ease, color 0.12s ease; position: relative;
}
.dm-row-item:hover { background: var(--bg2); color: var(--tx); }
.dm-row-item.act { background: var(--bg3); color: #fff; }
.dm-row-meta { flex: 1; min-width: 0; line-height: 1.25; }
.dm-row-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row-sub { font-size: 11.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-close-btn {
  opacity: 0; background: none; border: none; color: var(--tx3);
  cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 4px;
}
.dm-row-item:hover .dm-close-btn { opacity: 1; }
.dm-close-btn:hover { color: var(--tx); background: var(--bg0); }

.head-divider {
  width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex-shrink: 0;
}
.f-tabs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.f-tab-pill {
  background: transparent; border: none; border-radius: 6px; padding: 5px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--tx2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.14s ease;
}
.f-tab-pill:hover { background: var(--bg3); color: var(--tx); }
.f-tab-pill.act { background: rgba(255,255,255,0.1); color: #fff; }
.f-tab-pill.add-btn {
  background: #248046; color: #fff;
}
.f-tab-pill.add-btn:hover { background: #1a6334; }
.f-tab-pill.add-btn.act {
  background: rgba(36, 128, 70, 0.2); color: #2dc770; border: 1px solid rgba(45, 199, 112, 0.35);
}
.f-tab-count {
  background: var(--bg0); color: var(--tx2); font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.f-tab-count.alert { background: var(--bad); color: #fff; }

.friends-layout {
  flex: 1; display: grid; grid-template-columns: 1fr 330px; min-height: 0; overflow: hidden;
}
@media (max-width: 1080px) {
  .friends-layout { grid-template-columns: 1fr; }
  .active-now-pane { display: none; }
}
.friends-main {
  padding: 20px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}
.active-now-pane {
  border-left: 1px solid var(--line); background: rgba(var(--bg1-rgb), 0.55);
  padding: 20px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px;
}
.active-now-title {
  font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.active-card {
  background: rgba(var(--bg0-rgb), 0.72); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.active-card:hover { border-color: rgba(88, 101, 242, 0.45); transform: translateY(-1px); }

/* Add Friend Bar (Discord Style) */
.add-friend-hero {
  background: rgba(var(--bg1-rgb), 0.85); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 22px; max-width: 780px;
}
.add-friend-bar {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  background: var(--bg0); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 6px 8px 6px 14px; cursor: text;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.16s ease;
}
.add-friend-bar:focus-within {
  border-color: var(--acc); box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25); transform: translateY(-1px);
}
.add-friend-at {
  font-size: 17px; font-weight: 700; color: var(--acc); user-select: none;
}
.add-friend-bar input,
#fAdd {
  border: none !important; outline: none !important; box-shadow: none !important;
  background: transparent !important; padding: 8px 4px !important;
  font-size: 14.5px !important; color: var(--tx) !important;
  flex: 1; min-width: 140px; width: auto !important; cursor: text;
}
.add-friend-bar .btn {
  flex-shrink: 0; white-space: nowrap; padding: 9px 18px; font-weight: 600; border-radius: 7px;
}

.my-id-card {
  max-width: 780px; background: rgba(var(--bg1-rgb), 0.78); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; flex-wrap: wrap;
  animation: cardSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.my-id-card:hover {
  border-color: rgba(88, 101, 242, 0.45); transform: translateY(-1px);
}

/* Friend List Rows & Directory Cards */
.f-search-box {
  position: relative; max-width: 780px;
}
.f-search-box input {
  background: var(--bg0); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font-size: 13.5px;
}
.f-card-list {
  display: flex; flex-direction: column; gap: 6px; max-width: 780px;
}
.f-card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: 10px; background: rgba(var(--bg1-rgb), 0.72);
  border: 1px solid var(--line);
  animation: cardSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.f-card-row:hover {
  background: rgba(var(--bg2-rgb), 0.92); border-color: rgba(88, 101, 242, 0.45);
  transform: translateX(4px);
}
.f-card-user {
  display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; cursor: pointer;
}
.f-card-user .av { width: 40px; height: 40px; font-size: 15px; transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.f-card-row:hover .f-card-user .av { transform: scale(1.06); }
.f-card-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.f-act-circle {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg0);
  border: 1px solid var(--line); color: var(--tx2); display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.f-act-circle:hover { background: var(--bg3); color: #fff; border-color: var(--acc); transform: translateY(-2px) scale(1.06); }
.f-act-circle:active { transform: scale(0.92); }
.f-act-circle.ok:hover { background: var(--ok); color: #fff; border-color: var(--ok); }
.f-act-circle.bad:hover { background: var(--bad); color: #fff; border-color: var(--bad); }

.f-empty-box {
  max-width: 780px; background: rgba(var(--bg1-rgb), 0.65); border: 1px dashed var(--line);
  border-radius: 12px; padding: 36px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: cardSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.f-empty-ic {
  width: 56px; height: 56px; border-radius: 16px; background: rgba(88, 101, 242, 0.15);
  color: var(--acc); display: flex; align-items: center; justify-content: center;
  animation: pulseFloat 3s ease-in-out infinite alternate;
}

/* ==================== GLOBAL MICRO-ANIMATION ENGINE ==================== */
@keyframes cardSlideUp {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes msgPopIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes toolsPop {
  from { opacity: 0; transform: translate3d(0, 4px, 0) scale(0.92); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes pulseFloat {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.05); }
}
@keyframes speakingPulse {
  0% { box-shadow: 0 0 0 0 rgba(63, 166, 107, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(63, 166, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 166, 107, 0); }
}
@keyframes toastPop {
  from { opacity: 0; transform: translate3d(-50%, 14px, 0) scale(0.94); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0) scale(1); }
}

/* Rail Icons Elastic Morph & Glow */
.rail .g {
  transition: border-radius 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.2s ease,
              transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
}
.rail .g:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.32);
}
.rail .g:active { transform: scale(0.93); }
.rail .g.discover { color: var(--acc); }
.rail .g.discover:hover, .rail .g.discover.act { background: var(--acc); color: #fff; }
.rail .g.pubhub { color: #38bdf8; }
.rail .g.pubhub:hover { background: #0284c7; color: #fff; }

/* Sidebar Items & DM Rows Smooth Slide */
.item {
  transition: background 0.16s ease, color 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.item:hover { transform: translateX(3px); }
.item:active { transform: translateX(1px) scale(0.98); }
.dm-row-item {
  transition: background 0.16s ease, color 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.dm-row-item:hover { transform: translateX(3px); }

/* Buttons & Interactive Controls */
.btn, .ibtn, .f-tab-pill {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              background-color 0.16s ease,
              box-shadow 0.16s ease,
              filter 0.16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1.5px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.95); }
.ibtn:hover { transform: scale(1.1); }
.ibtn:active { transform: scale(0.9); }
.f-tab-pill:hover { transform: translateY(-1px); }
.f-tab-pill:active { transform: scale(0.95); }

/* Messages & Floating Toolbar */
.msg {
  animation: msgPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: background-color 0.14s ease;
}
.msg:hover .tools {
  animation: toolsPop 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rx button {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease, border-color 0.15s ease;
}
.rx button:hover { transform: translateY(-2px) scale(1.06); }
.rx button:active { transform: scale(0.92); }

/* Speaking Pulse & Context / Toast Animations */
.tile.speaking, .vuser.speaking .av {
  animation: speakingPulse 1.5s infinite;
}
.ctx {
  animation: toolsPop 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast {
  animation: toastPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.add-friend-hero, .gs-stat-card, .active-card {
  animation: cardSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== CODE BLOCK COPY HEADER ==================== */
.code-block-wrap {
  margin: 6px 0; border-radius: 7px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg0);
}
.code-block-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 10px; background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--tx2); font-weight: 600;
}
.code-copy-btn {
  background: var(--bg2); border: 1px solid var(--line); color: var(--tx);
  border-radius: 5px; padding: 2px 8px; font-size: 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; transition: all 0.14s ease;
}
.code-copy-btn:hover { background: var(--acc); color: #fff; border-color: var(--acc); }
.code-block-wrap pre {
  margin: 0 !important; border-radius: 0 !important; border: none !important;
}

/* ==================== INTERACTIVE POLL CARDS ==================== */
.poll-card {
  max-width: 480px; margin-top: 8px; background: rgba(var(--bg1-rgb), 0.9);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  animation: cardSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.poll-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.poll-ic {
  width: 36px; height: 36px; border-radius: 9px; background: rgba(88, 101, 242, 0.18);
  color: var(--acc); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.poll-question {
  font-weight: 700; color: #fff; font-size: 14.5px; line-height: 1.3;
}
.poll-options {
  display: flex; flex-direction: column; gap: 7px;
}
.poll-opt {
  position: relative; border-radius: 8px; background: var(--bg0);
  border: 1.5px solid var(--line); padding: 9px 12px; cursor: pointer;
  overflow: hidden; transition: border-color 0.16s ease, transform 0.14s ease;
}
.poll-opt:hover {
  border-color: var(--acc); transform: translateX(3px);
}
.poll-opt.voted {
  border-color: var(--acc); background: rgba(88, 101, 242, 0.08);
}
.poll-opt-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.35), rgba(139, 92, 246, 0.28));
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none;
}
.poll-opt-content {
  position: relative; z-index: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; font-size: 13.5px;
}
.poll-opt-text { font-weight: 600; color: #fff; }
.poll-opt-meta { font-size: 12px; font-weight: 700; color: var(--tx2); white-space: nowrap; }

/* ==================== PUBLIC SERVER DISCOVERY (KEŞFET) ==================== */
.discover-wrap {
  flex: 1; overflow-y: auto; padding: 24px 28px; display: flex; flex-direction: column; gap: 22px;
}
.discover-hero {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.28) 0%, rgba(139, 92, 246, 0.22) 50%, rgba(16, 185, 129, 0.18) 100%),
              rgba(var(--bg1-rgb), 0.88);
  border: 1px solid rgba(88, 101, 242, 0.35); border-radius: 16px;
  padding: 28px 30px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 10px; animation: cardSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.discover-hero-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: 20px; background: rgba(88, 101, 242, 0.22); color: #a5b4fc;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
}
.discover-hero h1 { font-size: 24px; font-weight: 800; color: #fff; }
.discover-hero p { color: var(--tx2); max-width: 580px; font-size: 13.5px; }
.discover-search-bar {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px;
  background: var(--bg0); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 6px 8px 6px 14px; margin-top: 6px;
}
.discover-search-bar:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.25); }
.discover-search-bar input {
  border: none !important; background: transparent !important; flex: 1; width: auto !important; padding: 6px 4px !important;
}
.discover-cats {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px;
}
.discover-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.discover-card {
  background: rgba(var(--bg1-rgb), 0.85); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
  animation: cardSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.discover-card:hover {
  transform: translateY(-4px); border-color: var(--acc);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}
.discover-card-banner {
  height: 88px; position: relative; background-size: cover; background-position: center;
}
.discover-cat-pill {
  position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, 0.65);
  color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px;
}
.discover-card-body {
  padding: 0 16px 16px; display: flex; flex-direction: column; flex: 1;
}
.discover-card-icon {
  width: 54px; height: 54px; border-radius: 16px; border: 4px solid var(--bg1);
  margin-top: -27px; margin-bottom: 8px; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 18px; color: #fff;
  background-size: cover; background-position: center;
}
.discover-card-title {
  font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px;
}
.discover-card-desc {
  font-size: 12.5px; color: var(--tx2); margin: 6px 0 14px; flex: 1; line-height: 1.4;
}
.discover-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.discover-card-stats {
  font-size: 12px; color: var(--tx3); display: flex; align-items: center; gap: 6px; font-weight: 600;
}

/* ==================== DISCORD SPOILERS, QUOTES & AUTO-UPDATE ==================== */
.spoiler-text {
  background: #2b2d31; color: transparent; border-radius: 4px; padding: 1px 6px;
  cursor: pointer; user-select: none; transition: background 0.16s ease, color 0.16s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.spoiler-text:hover { background: #35373c; }
.spoiler-text.revealed {
  background: rgba(255, 255, 255, 0.12); color: var(--tx); user-select: text;
  border-color: transparent;
}
.chat-quote {
  border-left: 4px solid var(--acc); margin: 4px 0; padding: 4px 10px;
  background: rgba(88, 101, 242, 0.08); border-radius: 0 6px 6px 0;
  color: var(--tx2); font-style: italic; line-height: 1.4;
}

.app-update-banner {
  position: fixed; top: 0; left: 0; right: 0; height: 38px;
  background: linear-gradient(90deg, #5865f2 0%, #8b5cf6 50%, #10b981 100%);
  color: #fff; z-index: 9999; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; font-size: 13px; font-weight: 700; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  animation: bannerSlideDown 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bannerSlideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
.app-update-actions { display: flex; align-items: center; gap: 8px; }
.btn-update-now {
  background: #fff; color: #1e1b4b; font-weight: 800; font-size: 12px;
  padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-update-now:hover { transform: scale(1.05); background: #f3f4f6; }
.btn-update-dismiss {
  background: transparent; color: rgba(255, 255, 255, 0.8); border: none;
  font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
}
.btn-update-dismiss:hover { color: #fff; background: rgba(255, 255, 255, 0.2); }

.server-boost-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
  border-radius: 10px; background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

.stage {
  flex: 1; display: flex !important; flex-direction: column;
  padding: 0 !important; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 0%, rgba(88, 101, 242, 0.12), transparent 65%), var(--bg0);
}
.stage-top-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: rgba(var(--bg1-rgb), 0.85);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 4;
}
.stage-top-left, .stage-top-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.stage-mic-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 8px; background: var(--bg0); border: 1px solid var(--line);
  color: var(--tx); font-size: 12px; font-weight: 600; cursor: pointer;
}
.stage-mic-pill:hover { border-color: var(--acc); color: #fff; }
.stage-mic-meter {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg0); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 8px;
}
.stage-mic-meter-bar {
  width: 68px; height: 7px; border-radius: 4px; background: var(--bg3); overflow: hidden;
}
#stageMicMeterFill {
  height: 100%; background: linear-gradient(90deg, #3fa66b, #34d399);
  border-radius: 4px; transition: width 0.08s linear;
}
.rtc-signal-bars {
  display: inline-flex; align-items: flex-end; gap: 2px; height: 12px;
}
.rtc-signal-bars i {
  width: 3px; background: var(--ok); border-radius: 1.5px; display: block;
}
.rtc-signal-bars i:nth-child(1) { height: 5px; }
.rtc-signal-bars i:nth-child(2) { height: 8px; }
.rtc-signal-bars i:nth-child(3) { height: 12px; }

.stage-grid {
  flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px; padding: 18px 22px 88px; overflow-y: auto; align-content: center;
}
.stage-grid.has-spotlight {
  align-content: stretch;
}
.tile {
  background: var(--bg1); border-radius: 14px; aspect-ratio: 16/9;
  position: relative; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32); background-size: cover; background-position: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease, box-shadow 0.2s ease;
}
.tile:hover { border-color: rgba(88, 101, 242, 0.55); }
.tile.speaking {
  border-color: #23a55a !important;
  box-shadow: 0 0 0 3px rgba(35, 165, 90, 0.4), 0 12px 28px rgba(0, 0, 0, 0.4) !important;
}
.tile.big {
  grid-column: 1 / -1; max-height: 64vh;
}
.tile-avatar-wrap .av {
  width: 84px; height: 84px; font-size: 30px;
  border: 4px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tile.speaking .tile-avatar-wrap .av {
  transform: scale(1.08);
  border-color: #23a55a;
}
.tile .lbl {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(15, 16, 20, 0.78); backdrop-filter: blur(6px);
  padding: 5px 11px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.speaking-wave {
  display: none; align-items: flex-end; gap: 2px; height: 12px;
}
.tile.speaking .speaking-wave { display: inline-flex; }
.speaking-wave i {
  width: 2.5px; background: #23a55a; border-radius: 2px;
  animation: waveBounce 0.55s ease-in-out infinite alternate;
}
.speaking-wave i:nth-child(1) { height: 5px; animation-delay: 0s; }
.speaking-wave i:nth-child(2) { height: 11px; animation-delay: 0.15s; }
.speaking-wave i:nth-child(3) { height: 7px; animation-delay: 0.3s; }
@keyframes waveBounce {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.15); }
}

.tile-top-badges {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: flex; align-items: center; gap: 6px;
}
.live-pill-4k {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 6px;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.45);
}
.tile-icon-btn {
  background: rgba(15, 16, 20, 0.75); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tile-icon-btn:hover { background: var(--acc); transform: scale(1.08); }

.ctrl-4k-tag {
  position: absolute; top: -4px; right: -6px;
  background: linear-gradient(135deg, #f472b6, #8b5cf6);
  color: #fff; font-size: 9px; font-weight: 800;
  padding: 1px 4px; border-radius: 5px; line-height: 1.2;
}
.scr-res-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px;
}
.scr-res-card {
  background: var(--bg0); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: all 0.16s ease;
}
.scr-res-card:hover { border-color: var(--acc); }
.scr-res-card.act {
  border-color: var(--acc); background: rgba(88, 101, 242, 0.14);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

.stage-controls-bar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: rgba(var(--bg1-rgb), 0.92); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); z-index: 5;
}
.stage-ctrl-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--bg3); color: var(--tx); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.16s ease;
}
.stage-ctrl-btn:hover { transform: translateY(-2px) scale(1.08); background: var(--acc); color: #fff; }
.stage-ctrl-btn.active { background: var(--ok); color: #fff; }
.stage-ctrl-btn.accent { background: rgba(88, 101, 242, 0.25); color: #a5b4fc; border: 1px solid rgba(88, 101, 242, 0.45); }
.stage-ctrl-btn.danger { background: var(--bad); color: #fff; }

.soundboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 10px;
}
.soundboard-pad {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--bg0); border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.soundboard-pad:hover {
  border-color: var(--acc); background: var(--bg2); transform: translateY(-2px) scale(1.02);
}
.soundboard-pad.playing {
  border-color: var(--ok); box-shadow: 0 0 0 3px rgba(63, 166, 107, 0.3); transform: scale(0.95);
}
.sb-pad-ic {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(88, 101, 242, 0.18);
  color: var(--acc); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}






