:root {
  --bg0: #07060f;
  --glass1: rgba(14, 12, 30, 0.72);
  --glass2: rgba(20, 17, 40, 0.55);
  --glass3: rgba(255, 255, 255, 0.06);
  --glass4: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.08);
  --text: #ecebf7;
  --muted: #9a97b8;
  --accent: #8b5cf6;
  --accent2: #a78bfa;
  --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #22d3ee 100%);
  --green: #34d399;
  --red: #fb5172;
  --yellow: #fbbf24;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg0);
  color: var(--text);
  font: 15px/1.5 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--glass4); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
::selection { background: #8b5cf680; }

/* ================= ФОН ================= */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-img {
  position: absolute; inset: -6%;
  background: url(assets/bg.webp) center / cover no-repeat;
  animation: drift 40s ease-in-out infinite alternate;
  filter: saturate(1.15);
}
@keyframes drift {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.08) translate(-2%, 1%); }
  100% { transform: scale(1.04) translate(2%, -1.5%); }
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; mix-blend-mode: screen; }
.o1 { width: 42vw; height: 42vw; background: #7c3aed; left: -10vw; top: -12vw; animation: float1 22s ease-in-out infinite alternate; }
.o2 { width: 36vw; height: 36vw; background: #0891b2; right: -8vw; bottom: -14vw; animation: float2 26s ease-in-out infinite alternate; }
.o3 { width: 26vw; height: 26vw; background: #db2777; left: 45vw; top: 35vh; opacity: .18; animation: float3 30s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate(18vw, 14vh) scale(1.2); } }
@keyframes float2 { to { transform: translate(-16vw, -18vh) scale(1.15); } }
@keyframes float3 { to { transform: translate(-20vw, -15vh) scale(.8); } }
#stars { position: absolute; inset: 0; }
.bg-vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, #05040acc 100%); }

/* ================= КНОПКИ ================= */
.btn {
  position: relative; overflow: hidden;
  border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer;
  background: var(--glass4); display: inline-flex; align-items: center; gap: 7px;
  transition: transform .2s var(--spring), background .2s, box-shadow .25s, filter .2s;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .14); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: var(--grad); background-size: 200% 200%; color: #fff; font-weight: 650; box-shadow: 0 6px 24px -6px #8b5cf6aa; animation: gradmove 6s ease infinite; }
.btn.primary:hover { box-shadow: 0 10px 34px -6px #8b5cf6dd; }
@keyframes gradmove { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.btn.shine::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, #ffffff55, transparent); transform: skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--glass4); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.icon-btn {
  position: relative; overflow: hidden;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0;
  transition: background .2s, color .2s, transform .25s var(--spring);
}
.icon-btn:hover { background: var(--glass4); color: var(--text); transform: scale(1.08); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.off { color: var(--red); background: #fb517218; }
.icon-btn.off svg { animation: wiggle .4s var(--ease); }
.icon-btn.danger { color: var(--red); }
.icon-btn.danger:hover { background: var(--red); color: #fff; }
@keyframes wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.ripple {
  position: absolute; border-radius: 50%; background: #ffffff33; pointer-events: none;
  transform: scale(0); animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--accent);
  box-shadow: inset 0 -6px 12px #0003, inset 0 2px 6px #fff3;
  transition: box-shadow .15s, transform .2s var(--spring);
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }

/* ================= ВХОД ================= */
.login { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; transition: opacity .45s, transform .45s var(--ease), filter .45s; }
.login.leaving { opacity: 0; transform: scale(1.06); filter: blur(10px); }
.login-card {
  width: min(390px, 92vw); padding: 34px 32px; border-radius: 22px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
  background: rgba(16, 13, 34, .62);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid #ffffff18;
  box-shadow: 0 30px 80px -10px #000c, inset 0 1px 0 #ffffff14;
  animation: cardIn .8s var(--spring) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.94); } }
.login-card > * { animation: fadeUp .6s var(--ease) both; }
.login-card > :nth-child(2) { animation-delay: .1s; }
.login-card > :nth-child(3) { animation-delay: .15s; }
.login-card > :nth-child(4) { animation-delay: .2s; }
.login-card > :nth-child(5) { animation-delay: .25s; }
.login-card > :nth-child(6), .login-card > :nth-child(7) { animation-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.login-card h1 {
  margin: 4px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(90deg, #fff, #c4b5fd, #67e8f9, #fff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fadeUp .6s var(--ease) .1s both, gradmove 8s linear infinite;
}
.login-card p { margin: 0 0 6px; }
.login-card label { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .04em; display: flex; flex-direction: column; gap: 7px; }
.login-card input {
  background: #0007; border: 1px solid #ffffff14; border-radius: 11px; padding: 12px 14px; font-size: 15px;
  text-transform: none; letter-spacing: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px #8b5cf640; background: #000a; }
.login-card .btn { justify-content: center; padding: 13px; font-size: 16px; margin-top: 4px; }
.logo-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto; animation: bob 4s ease-in-out infinite !important; }
.logo { width: 96px; height: 96px; display: block; filter: drop-shadow(0 10px 30px #8b5cf6aa); position: relative; z-index: 1; }
.logo-ring { position: absolute; inset: -10px; border-radius: 32px; border: 2px solid #a78bfa66; animation: ring 2.6s ease-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.error { color: var(--red); min-height: 1.2em; font-size: 14px; }
.shake { animation: shake .45s var(--ease) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

/* ================= РАСКЛАДКА ================= */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 268px 1fr 248px; height: 100vh; height: 100dvh;
  gap: 10px; padding: 10px;
}
.app > * {
  border-radius: 18px; border: 1px solid var(--line); overflow: hidden;
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 20px 60px -20px #000c, inset 0 1px 0 #ffffff0d;
  opacity: 0;
}
.app.ready > * { animation: panelIn .7s var(--spring) both; }
.app.ready > .main { animation-delay: .08s; }
.app.ready > .members { animation-delay: .16s; }
@keyframes panelIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
body.members-hidden .app { grid-template-columns: 268px 1fr 0; }
body.members-hidden .members { display: none; }

.sidebar { background: var(--glass1); display: flex; flex-direction: column; min-height: 0; }
.server-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.server-logo { width: 32px; height: 32px; filter: drop-shadow(0 4px 10px #8b5cf688); transition: transform .4s var(--spring); }
.server-head:hover .server-logo { transform: rotate(-10deg) scale(1.12); }
.server-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.channels { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
.cat { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; letter-spacing: .08em; }
.chan, .vname {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; margin: 2px 0;
  color: var(--muted); cursor: pointer; user-select: none;
  transition: background .2s, color .2s, padding-left .25s var(--ease);
}
.chan::before {
  content: ''; position: absolute; left: 0; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0;
  background: var(--grad); transform: translateY(-50%); transition: height .3s var(--spring);
}
.chan .hash { font-size: 19px; line-height: 1; opacity: .6; transition: transform .3s var(--spring); }
.chan:hover, .vname:hover { background: var(--glass3); color: var(--text); padding-left: 15px; }
.chan:hover .hash { transform: rotate(12deg); }
.chan:hover::before { height: 40%; }
.chan.active { background: linear-gradient(90deg, #8b5cf633, #8b5cf60a); color: #fff; }
.chan.active::before { height: 70%; }
.chan.unread { color: #fff; font-weight: 650; }
.chan.unread::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-left: auto; box-shadow: 0 0 10px var(--cyan); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .6; } }
.vname svg { width: 18px; height: 18px; transition: transform .3s var(--spring); }
.vname:hover svg { transform: scale(1.15); }
.vname small { margin-left: auto; font-size: 11px; background: var(--glass4); padding: 0 7px; border-radius: 8px; }
.vchan.active > .vname { color: var(--green); background: #34d39914; }
.vchan.active > .vname svg { animation: speakerPulse 1.6s ease-in-out infinite; }
@keyframes speakerPulse { 50% { transform: scale(1.15); filter: drop-shadow(0 0 6px var(--green)); } }
.vmembers { padding-left: 24px; }
.vmember {
  display: flex; align-items: center; gap: 9px; padding: 5px 9px; border-radius: 9px; margin: 1px 0;
  color: var(--muted); font-size: 14px; cursor: pointer; transition: background .2s, color .2s, transform .2s;
}
.vmember.enter { animation: popIn .5s var(--spring) both; }
@keyframes popIn { from { opacity: 0; transform: translateX(-14px) scale(.9); } }
.vmember:hover { background: var(--glass3); color: var(--text); transform: translateX(3px); }
.vmember.me { cursor: default; }
.vmember .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmember .st svg { width: 15px; height: 15px; color: var(--red); }
.vmember.speaking { color: #fff; }
.vmember.speaking .avatar, .member.speaking .avatar { box-shadow: 0 0 0 2px #0b0a18, 0 0 0 4px var(--green), 0 0 16px 4px #34d39988; transform: scale(1.06); }
.vmember.speaking .avatar::after, .member.speaking .avatar::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--green);
  animation: speakRing 1s ease-out infinite;
}
@keyframes speakRing { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.live {
  background: linear-gradient(90deg, #fb5172, #f43f5e); color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 5px; letter-spacing: .04em; box-shadow: 0 0 12px #fb517288;
  animation: livePulse 1.8s ease-in-out infinite;
}
@keyframes livePulse { 50% { box-shadow: 0 0 2px #fb517200; opacity: .85; } }

.voice-panel { border-top: 1px solid var(--line); padding: 10px 12px; background: linear-gradient(180deg, #34d3990d, transparent); animation: slideUp .45s var(--spring) both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }
.vp-status { display: flex; align-items: center; gap: 8px; }
.vp-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.vp-text b { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.vp-text b.ok { color: var(--green); }
.vp-text b.wait { color: var(--yellow); }
.vp-text b.bad { color: var(--red); }
.vp-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; background: currentColor; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .4s; }
.eq i:nth-child(4) { animation-delay: .15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.vp-text b.wait .eq i { animation-duration: .5s; }
.vp-actions { display: flex; gap: 6px; margin-top: 9px; }
.vp-actions .btn { flex: 1; justify-content: center; }
.vp-actions .btn svg { width: 16px; height: 16px; }
.vp-actions .btn.live { background: linear-gradient(90deg, #fb5172, #e11d48); color: #fff; box-shadow: 0 0 20px #fb517266; animation: livePulse 1.8s ease-in-out infinite; }
.vp-actions select { background: var(--glass4); border: 0; border-radius: 10px; padding: 0 6px; font-size: 12px; cursor: pointer; }
.vp-actions select option { background: #15122b; }

.user-panel { display: flex; align-items: center; gap: 6px; padding: 10px; border-top: 1px solid var(--line); background: #0004; }
.user-panel .avatar { width: 36px; height: 36px; }
.user-panel .avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid #0e0c1e; }
.me-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.me-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name small { color: var(--muted); font-size: 12px; }
#btnSettings:hover svg { animation: spin 1s var(--ease); }
@keyframes spin { to { transform: rotate(180deg); } }

/* ================= ЦЕНТР ================= */
.main { background: var(--glass2); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: 54px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); }
.topbar .hash { font-size: 22px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
#chanTitle { font-size: 16px; }
.only-mobile { display: none; }

.stage { position: relative; height: 55vh; flex-shrink: 0; background: #0009; padding: 12px 12px 16px; animation: stageIn .5s var(--spring) both; }
@keyframes stageIn { from { opacity: 0; transform: translateY(-14px); } }
.stage-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; }
.stage-resize::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 54px; height: 4px; margin-left: -27px; border-radius: 2px; background: #ffffff30; transition: background .2s, width .2s; }
.stage-resize:hover::after { background: var(--accent2); }
.tiles { height: 100%; display: grid; gap: 12px; grid-template-columns: 1fr; }
.tiles[data-count="2"] { grid-template-columns: 1fr 1fr; }
.tiles[data-count="3"], .tiles[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.tiles.has-focus { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.tiles.has-focus .tile:not(.focused) { display: none; }
.tile {
  position: relative; background: #000; border-radius: 14px; overflow: hidden; min-height: 0; cursor: pointer;
  box-shadow: 0 0 0 1px #ffffff14, 0 14px 40px -10px #000;
  animation: tileIn .55s var(--spring) both; transition: box-shadow .3s, transform .3s var(--ease);
}
@keyframes tileIn { from { opacity: 0; transform: scale(.9); filter: blur(8px); } }
.tile.leaving { animation: tileOut .26s var(--ease) forwards; }
@keyframes tileOut { to { opacity: 0; transform: scale(.92); filter: blur(6px); } }
.tile:hover { box-shadow: 0 0 0 2px #a78bfa99, 0 18px 50px -10px #8b5cf655; }
.tile.focused { animation: none; }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile.local { box-shadow: 0 0 0 2px var(--accent), 0 14px 40px -10px #8b5cf666; }
.tile-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: linear-gradient(transparent, #000d); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease);
}
.tile:hover .tile-bar, .tile:fullscreen .tile-bar { opacity: 1; transform: none; }
.tile-name { font-weight: 650; font-size: 14px; text-shadow: 0 1px 3px #000; }
.tile-bar .icon-btn { color: #fff; }
.tile-bar .icon-btn:hover { background: #fff2; }
.tvol { display: flex; align-items: center; gap: 4px; color: #fff; }
.tvol input { width: 90px; accent-color: var(--accent); }
.click-play { position: absolute; inset: 0; display: grid; place-items: center; background: #000b; font-weight: 650; }
.tile:fullscreen { border-radius: 0; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; scroll-behavior: smooth; }
.msg { display: flex; gap: 14px; padding: 5px 20px; margin-top: 12px; position: relative; transition: background .2s; }
.msg.grouped { margin-top: 0; padding-left: 74px; padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: #ffffff07; }
.msg:hover .avatar { transform: scale(1.06) rotate(-4deg); }
.msg.new { animation: msgIn .45s var(--spring) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.msg.mentioned { background: linear-gradient(90deg, #fbbf2420, transparent 70%); box-shadow: inset 3px 0 var(--yellow); }
.msg .content { min-width: 0; }
.msg .meta { display: flex; align-items: baseline; gap: 8px; }
.msg .author { font-weight: 650; }
.msg .time { font-size: 12px; color: var(--muted); }
.msg .text { word-wrap: break-word; overflow-wrap: anywhere; }
.hover-time { position: absolute; left: 20px; width: 44px; text-align: right; font-size: 11px; color: var(--muted); top: 5px; opacity: 0; transition: opacity .2s; }
.msg.grouped:hover .hover-time { opacity: 1; }
.mention { background: #8b5cf640; color: #ddd6fe; padding: 0 4px; border-radius: 5px; font-weight: 650; }
img.embed { display: block; max-width: min(400px, 100%); max-height: 300px; border-radius: 12px; margin-top: 6px; transition: transform .3s var(--ease), box-shadow .3s; }
img.embed:hover { transform: scale(1.02); box-shadow: 0 12px 30px #0009; }
.empty { padding: 40px 22px; animation: fadeUp .6s var(--ease) both; }
.empty .big {
  width: 72px; height: 72px; border-radius: 22px; background: var(--grad); display: grid; place-items: center;
  font-size: 40px; font-weight: 800; color: #fff; box-shadow: 0 12px 30px -6px #8b5cf6aa; animation: bob 4s ease-in-out infinite;
}
.empty h3 { font-size: 26px; margin: 14px 0 4px; }

.typing { height: 22px; padding: 0 20px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.typing b { color: var(--text); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent2); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.composer {
  margin: 0 16px 16px; display: flex; align-items: flex-end; border-radius: 14px; padding: 4px 4px 4px 16px;
  background: #0006; border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s;
}
.composer:focus-within { border-color: #8b5cf6aa; box-shadow: 0 0 0 4px #8b5cf622, 0 10px 30px -10px #8b5cf666; }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; padding: 10px 0; max-height: 200px; outline: none; }
.composer .send {
  border: 0; width: 42px; height: 42px; border-radius: 11px; cursor: pointer; font-size: 17px; color: #fff;
  background: var(--grad); box-shadow: 0 4px 14px -4px #8b5cf6; transition: transform .3s var(--spring), box-shadow .3s;
}
.composer .send:hover { transform: rotate(-12deg) scale(1.08); box-shadow: 0 6px 20px -4px #8b5cf6; }
.composer .send:active { transform: translateX(4px) scale(.95); }

/* ================= УЧАСТНИКИ ================= */
.members { background: var(--glass1); overflow-y: auto; padding: 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 11px; transition: background .2s, transform .2s var(--ease); animation: fadeUp .4s var(--ease) both; }
.member:hover { background: var(--glass3); transform: translateX(-3px); }
.member .avatar { width: 34px; height: 34px; font-size: 14px; }
.member .online { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid #110f24; }
.mtext { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mtext b { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtext small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtext .live-t { color: var(--red); }

/* ================= МОДАЛКИ ================= */
.modal { position: fixed; inset: 0; background: #0009; backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(450px, 92vw); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px;
  background: rgba(20, 17, 42, .85); border: 1px solid #ffffff18; box-shadow: 0 30px 80px #000c;
  animation: modalIn .45s var(--spring) both;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.9) translateY(20px); } }
.modal-card h2 { margin: 0; }
.modal-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.modal-card label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; }
.modal-card select { background: #0007; border: 1px solid #ffffff18; border-radius: 10px; padding: 10px; color: var(--text); }
.modal-card select option { background: #15122b; }
.modal-card input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.meter { height: 8px; background: #0008; border-radius: 4px; overflow: hidden; }
.meter div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width .1s; box-shadow: 0 0 10px var(--green); }

.vol-pop {
  position: fixed; z-index: 40; width: 236px; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px;
  background: rgba(16, 13, 34, .92); backdrop-filter: blur(16px); border: 1px solid #ffffff18; box-shadow: 0 16px 40px #000b;
  animation: modalIn .35s var(--spring) both;
}
.vol-pop label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.vol-pop input { accent-color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 50px) scale(.9); opacity: 0; pointer-events: none;
  background: rgba(20, 17, 42, .92); backdrop-filter: blur(14px); border: 1px solid #a78bfa44;
  padding: 11px 18px; border-radius: 12px; z-index: 60; max-width: 90vw; box-shadow: 0 14px 40px -8px #8b5cf688;
  transition: opacity .3s, transform .45s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #ffffff1f; border-radius: 5px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #a78bfa66; }

/* ================= АДАПТИВ ================= */
@media (max-width: 1000px) {
  .app { grid-template-columns: 250px 1fr; }
  .members { display: none; }
  body.members-hidden .app { grid-template-columns: 250px 1fr; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .app > * { border-radius: 0; border: 0; }
  body.members-hidden .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .app.ready > .sidebar { animation: none; opacity: 1; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-100%); transition: transform .35s var(--ease); background: rgba(12, 10, 26, .95); }
  body.menu-open .sidebar { transform: none; }
  #btnMembers { display: none; }
  .stage { height: 35vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
