:root{
  --bg-server:#1e1f22;
  --bg-channel:#2b2d31;
  --bg-main:#313338;
  --bg-members:#2b2d31;
  --bg-input:#383a40;
  --bg-hover:#35373c;
  --bg-active:#404249;
  --bg-user:#232428;
  --border:#26272b;
  --text:#f2f3f5;
  --text-2:#dbdee1;
  --muted:#b5bac1;
  --muted-2:#949ba4;
  --muted-3:#80848e;
  --brand:#5865f2;
  --green:#23a559;
  --red:#f23f42;
  --yellow:#f0b232;
  --shadow:0 1px 0 rgba(0,0,0,.2),0 1.5px 0 rgba(0,0,0,.05),0 2px 0 rgba(0,0,0,.05);
}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--bg-main);color:var(--text);overflow:hidden;font-size:14px}
button,input{font:inherit}button{color:inherit}.hidden{display:none!important}
button{border:0}.toast{position:fixed;z-index:1000;left:50%;top:18px;transform:translate(-50%,-12px);padding:11px 16px;border-radius:4px;background:#111214;color:var(--text);box-shadow:0 8px 28px #0008;opacity:0;pointer-events:none;transition:.18s;font-size:13px}.toast.show{opacity:1;transform:translate(-50%,0)}.toast.error{background:#5b2023;color:#fff}

/* Login */
.landing{min-height:100vh;overflow:auto;background:radial-gradient(circle at 70% 30%,rgba(88,101,242,.2),transparent 28%),linear-gradient(135deg,#191a1f,#262832 60%,#1d1f26);padding:0 clamp(24px,5vw,72px);display:grid;grid-template-rows:76px 1fr}
.landing-header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(255,255,255,.08)}
.brand{display:flex;gap:10px;align-items:center;font-weight:800;font-size:17px}.brand-mark{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:var(--brand);color:#fff}.brand small{font-weight:500;color:#9ea3ad}.privacy-pill{font-size:12px;color:#c3c6cc;background:#0003;padding:7px 10px;border-radius:12px;border:1px solid #ffffff12}
.hero{width:min(1080px,100%);margin:auto;display:grid;grid-template-columns:1fr 420px;gap:76px;align-items:center;padding:56px 0}.eyebrow,.mini-label{color:#aeb4ff;font-size:12px;font-weight:800;letter-spacing:.14em}.hero h1{font-size:clamp(48px,6vw,78px);line-height:.98;letter-spacing:-.05em;margin:15px 0 22px}.hero h1 em{font-style:normal;color:#aeb4ff}.hero-copy>p{color:#c3c7cf;font-size:17px;line-height:1.7;max-width:580px}.feature-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}.feature-row span{background:#0003;border:1px solid #ffffff10;border-radius:8px;padding:9px 12px;color:#d6d8de;font-size:12px}
.login-card{background:#313338;border-radius:8px;padding:32px;box-shadow:0 12px 42px #0008}.login-card h2{font-size:24px;margin:8px 0 6px;text-align:center}.login-card>p{text-align:center;color:var(--muted);margin:0 0 24px}.login-card .mini-label{display:block;text-align:center}.login-card label{display:block;margin:14px 0 0;color:#b5bac1;font-size:12px;font-weight:700;text-transform:uppercase}.login-card input{display:block;width:100%;height:42px;margin-top:7px;background:#1e1f22;color:#f2f3f5;border:0;border-radius:3px;padding:0 12px;outline:0}.login-card input:focus{box-shadow:0 0 0 1px #00a8fc}.primary{width:100%;height:44px;margin-top:22px;background:var(--brand);border-radius:3px;color:white;font-weight:700;cursor:pointer}.primary:hover{filter:brightness(.95)}.login-card>small{display:block;margin-top:12px;color:#80848e;font-size:11px;text-align:center}

/* Shell */
.app{height:100dvh;display:grid;grid-template-columns:72px 240px minmax(0,1fr) 240px;background:var(--bg-main)}
.server-rail{background:var(--bg-server);display:flex;flex-direction:column;align-items:center;padding:12px 0 10px;gap:8px;overflow:hidden}.server-home,.server-icon{width:48px;height:48px;border-radius:50%;background:#313338;color:var(--text-2);display:grid;place-items:center;cursor:pointer;font-size:19px;transition:.15s;position:relative}.server-home{background:var(--brand);color:#fff;font-weight:800}.server-icon:hover,.server-icon.active{border-radius:16px;background:var(--brand);color:#fff}.server-icon.active:before{content:"";position:absolute;left:-12px;width:4px;height:38px;border-radius:0 4px 4px 0;background:white}.server-divider{width:32px;height:2px;background:#35363c;border-radius:2px;margin:0 0 2px}.rail-spacer{flex:1}.server-icon.logout:hover{background:var(--red)}

.channels-panel{min-width:0;background:var(--bg-channel);display:grid;grid-template-rows:48px 1fr auto auto;overflow:hidden}.server-header{height:48px;padding:0 16px;display:flex;align-items:center;justify-content:space-between;box-shadow:var(--shadow);cursor:default}.server-header strong{font-size:15px}.server-chevron{font-size:18px;color:var(--muted)}.channel-scroll{overflow-y:auto;padding:14px 8px 8px}.channel-section{margin-bottom:18px}.channel-section h3{margin:0 6px 5px;color:#949ba4;font-size:11px;font-weight:800;letter-spacing:.02em;display:flex;align-items:center;gap:2px}.channel-section h3 span{font-size:10px}.channel{width:100%;height:34px;border-radius:4px;background:transparent;color:#949ba4;display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;padding:0 8px;text-align:left;cursor:pointer;font-weight:500;font-size:15px;gap:2px}.channel:hover{color:#dbdee1;background:#35373c}.channel.active,.voice-channel.connected{color:#fff;background:#404249}.channel-icon{font-size:18px;color:#80848e;text-align:center}.text-channel .channel-icon{font-size:21px;font-weight:500}.channel span:nth-child(2){overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.voice-count{font-size:10px;min-width:18px;height:18px;line-height:18px;text-align:center;background:#1e1f22;border-radius:10px;color:#949ba4}.voice-members{padding:2px 2px 3px 30px}.voice-member{min-height:30px;display:flex;align-items:center;gap:7px;color:#b5bac1;border-radius:4px;padding:3px 5px;font-size:12px}.voice-member:hover{background:#35373c;color:#fff}.voice-member-dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 2px var(--bg-channel)}.voice-member>span:nth-child(2){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.voice-member-states{display:flex;gap:3px}.voice-state-icon{font-size:10px}.voice-state-icon.off{opacity:.55;filter:grayscale(1)}

.voice-dock{border-top:1px solid #1f2023;background:#232428;padding:9px 8px 8px}.voice-connected-row{display:flex;align-items:center;justify-content:space-between}.voice-connected-copy{min-width:0;display:flex;flex-direction:column}.voice-connected-copy strong{color:#23a559;font-size:12px}.voice-connected-copy small{color:#b5bac1;font-size:11px;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.signal-bars{font-size:11px;letter-spacing:-2px;margin-right:5px}.dock-icon{width:30px;height:30px;border-radius:4px;background:transparent;color:#b5bac1;cursor:pointer}.dock-icon:hover{background:#35373c;color:#fff}.danger-hover:hover{color:#f23f42}.voice-status-line{display:flex;gap:5px;margin-top:7px;flex-wrap:wrap}.voice-status-chip{font-size:10px;color:#c7c9ce;background:#2b2d31;border-radius:3px;padding:4px 6px}.voice-status-chip.off{color:#f0a1a3}.voice-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:8px}.dock-control{height:30px;border-radius:4px;background:#2b2d31;color:#b5bac1;cursor:pointer}.dock-control:hover{background:#35373c;color:#fff}.dock-control.active{color:#fff}.dock-control.off{color:#f23f42;background:#35292b}

.self-card{height:52px;background:#232428;display:flex;align-items:center;justify-content:space-between;padding:0 8px}.self-profile{display:flex;align-items:center;min-width:0;gap:8px}.avatar-wrap{position:relative;flex:0 0 auto}.avatar{width:32px;height:32px;border-radius:50%;background:#5865f2;color:white;display:grid;place-items:center;font-size:11px;font-weight:800}.status-dot{width:10px;height:10px;border:3px solid #232428;border-radius:50%;background:#23a559;position:absolute;right:-1px;bottom:-1px}.self-copy{display:flex;flex-direction:column;min-width:0}.self-copy strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:105px}.self-copy span{font-size:10px;color:#b5bac1}.self-mini-actions{display:flex;gap:2px}.self-mini-actions span{width:26px;height:26px;border-radius:4px;display:grid;place-items:center;color:#b5bac1;font-size:12px}.self-mini-actions span:hover{background:#35373c}

.main-panel{min-width:0;min-height:0;height:100dvh;position:relative;background:var(--bg-main);display:grid;grid-template-rows:48px auto minmax(0,1fr)}.chat-head{height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid #26272b;box-shadow:var(--shadow);z-index:2}.channel-title{display:flex;align-items:center;min-width:0;gap:8px}.channel-title-icon{font-size:24px;color:#80848e;font-weight:600}.channel-title strong{font-size:15px}.head-divider{width:1px;height:24px;background:#3f4147;margin:0 2px}.channel-title small{color:#949ba4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.head-right{display:flex;align-items:center;gap:12px;color:#b5bac1}.online-count{font-size:11px;color:#949ba4}.head-icon{cursor:default}.head-button{background:transparent;color:#b5bac1;font-size:17px;cursor:pointer;padding:4px}.head-button:hover{color:#fff}

.call-stage{min-height:220px;max-height:68vh;border-bottom:1px solid #26272b;background:#1e1f22;display:grid;grid-template-rows:40px minmax(0,1fr);overflow:hidden}.call-stage-head{display:flex;align-items:center;justify-content:space-between;padding:0 12px;border-bottom:1px solid #2b2d31;gap:10px}.call-stage-head>div{display:flex;align-items:center;gap:7px}.call-stage-head strong{font-size:12px}.call-stage-head small{font-size:9px;color:#949ba4}.live-dot{width:8px;height:8px;border-radius:50%;background:#f23f42;box-shadow:0 0 0 3px #f23f4220}.call-stage-actions{margin-left:auto}.call-stage-head button{background:#2b2d31;color:#b5bac1;border-radius:4px;padding:5px 8px;font-size:10px;cursor:pointer;white-space:nowrap}.call-stage-head button:hover{background:#35373c;color:#fff}.video-grid{min-width:0;min-height:0;overflow:auto;padding:12px;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:10px;align-content:center;justify-content:center}.video-grid.single-video{grid-template-columns:minmax(0,1fr);align-content:stretch}.video-grid.two-videos{grid-template-columns:repeat(2,minmax(0,1fr))}.video-grid.has-screen{align-content:stretch}.video-tile{position:relative;background:#111214;border-radius:8px;overflow:hidden;min-width:0;min-height:160px;aspect-ratio:16/9}.video-grid.single-video .video-tile{width:min(100%,1400px);height:100%;max-height:100%;margin:auto;aspect-ratio:auto}.video-grid.has-screen .video-tile.screen{grid-column:1/-1;width:100%;min-height:260px;aspect-ratio:16/9}.video-tile video{width:100%;height:100%;object-fit:cover;display:block;background:#000}.video-tile.screen video,.video-grid.single-video .video-tile video{object-fit:contain}.video-label{position:absolute;left:8px;bottom:8px;background:#111214d9;color:#fff;border-radius:4px;padding:4px 7px;font-size:10px;z-index:2}.empty-video{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:#949ba4;min-height:150px}.empty-video-icon{width:54px;height:54px;border-radius:50%;background:#2b2d31;display:grid;place-items:center;font-size:22px}.empty-video strong{color:#dbdee1}.empty-video span{font-size:11px}.audio-bin{display:none}
.call-stage:fullscreen{width:100vw;height:100vh;min-height:100vh;max-height:none;border:0;background:#000;grid-template-rows:48px minmax(0,1fr)}.call-stage:fullscreen .call-stage-head{background:#111214;border-bottom-color:#202225;padding:0 16px}.call-stage:fullscreen .video-grid{height:100%;overflow:hidden;padding:16px;align-content:stretch}.call-stage:fullscreen .video-grid.single-video .video-tile{width:100%;height:100%;max-width:none}.call-stage:fullscreen .video-tile{min-height:0;max-height:100%}.call-stage:fullscreen .video-tile video{object-fit:contain}.call-stage:fullscreen .empty-video{height:100%}

.messages{min-height:0;height:100%;overflow-y:auto;padding:0 0 92px}.welcome-message{padding:54px 16px 24px}.hash-bubble{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;background:#41434a;color:#fff;font-size:42px;font-weight:700}.welcome-message h2{font-size:30px;letter-spacing:-.03em;margin:14px 0 5px}.welcome-message p{margin:0;color:#b5bac1;font-size:13px}.message{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px;padding:3px 16px 3px 16px;min-height:48px;align-items:flex-start}.message:hover{background:#2e3035}.message .avatar{width:40px;height:40px;margin-top:2px}.message-head{display:flex;align-items:baseline;gap:7px;min-height:20px}.message-head strong{font-size:14px;color:#f2f3f5}.message-head time{font-size:10px;color:#949ba4}.message p{margin:0;color:#dbdee1;line-height:1.45;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.message-box{position:absolute;left:16px;right:16px;bottom:24px;z-index:5;margin:0;height:44px;border-radius:8px;background:#383a40;display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;padding-right:10px;box-shadow:0 -10px 28px rgba(0,0,0,.18)}.plus-btn{background:transparent;color:#b5bac1;font-size:24px;cursor:pointer}.message-box input{border:0;outline:0;background:transparent;color:#dbdee1;font-size:14px;min-width:0}.message-box input::placeholder{color:#6d6f78}.message-tools{display:flex;align-items:center;gap:10px;color:#b5bac1;font-size:14px}.message-tools span:nth-child(2){font-size:9px;font-weight:800;background:#b5bac1;color:#383a40;padding:2px 3px;border-radius:2px}

.members-panel{background:var(--bg-members);overflow-y:auto;padding:0 8px 20px}.members-head{height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 8px;border-bottom:1px solid #26272b;margin-bottom:12px}.members-head strong{font-size:13px}.members-head span{font-size:10px;color:#949ba4}.members-panel h3{font-size:11px;color:#949ba4;margin:14px 8px 5px}.member{display:grid;grid-template-columns:32px minmax(0,1fr);gap:9px;align-items:center;padding:6px 8px;border-radius:4px;color:#b5bac1}.member:hover{background:#35373c;color:#dbdee1}.member-avatar-wrap{position:relative}.member .avatar{width:32px;height:32px;font-size:10px}.member .status-dot{border-color:#2b2d31}.member-info{min-width:0;display:flex;flex-direction:column}.member-info strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.member-info span{font-size:10px;color:#80848e;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

::-webkit-scrollbar{width:10px}::-webkit-scrollbar-thumb{background:#1a1b1e;border:2px solid transparent;background-clip:padding-box;border-radius:8px}::-webkit-scrollbar-track{background:transparent}

@media(max-width:1080px){.app{grid-template-columns:72px 230px minmax(0,1fr)}.members-panel{position:fixed;right:0;top:0;bottom:0;width:240px;z-index:20;transform:translateX(100%);transition:.18s;box-shadow:-10px 0 30px #0005}.members-panel.open{transform:translateX(0)}}
@media(max-width:760px){body{overflow:auto}.landing{padding:0 18px}.brand small,.privacy-pill{display:none}.hero{grid-template-columns:1fr;gap:28px;padding:35px 0}.hero-copy{text-align:center}.feature-row{justify-content:center}.login-card{padding:24px}.app{grid-template-columns:1fr;height:100dvh}.server-rail,.channels-panel{display:none}.channel-title small,.head-divider,.online-count{display:none}.message-tools{display:none}.messages{padding-bottom:72px}.message-box{left:9px;right:9px;bottom:10px;grid-template-columns:42px 1fr;margin:0}.call-stage{max-height:55vh}.call-stage:fullscreen{max-height:none}}


/* Indicador de quem está falando */
.voice-member.speaking{
  color:#fff;
  background:rgba(35,165,89,.12);
}
.voice-member.speaking .voice-member-dot{
  background:#23a559;
  box-shadow:0 0 0 2px var(--bg-channel),0 0 0 4px rgba(35,165,89,.28);
  animation:speakingPulse 1s ease-in-out infinite;
}
.member.speaking{
  background:rgba(35,165,89,.10);
  color:#fff;
}
.member.speaking .avatar,
.self-card.speaking .avatar{
  box-shadow:0 0 0 3px #23a559;
}
.video-tile.speaking{
  box-shadow:0 0 0 3px #23a559;
}
.video-tile.speaking .video-label{
  background:#167a43e8;
}
@keyframes speakingPulse{
  0%,100%{transform:scale(1);opacity:.9}
  50%{transform:scale(1.3);opacity:1}
}


/* Etapa 2: volume individual por pessoa */
.voice-member.volume-user{cursor:pointer}
.voice-member.volume-user:hover{background:#3a3c42}
.volume-popover{position:fixed;z-index:1400;width:240px;padding:12px;border:1px solid #2f3136;border-radius:8px;background:#111214;color:#f2f3f5;box-shadow:0 12px 34px rgba(0,0,0,.48)}
.volume-popover-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.volume-popover-head strong{font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.volume-popover-head button{width:26px;height:26px;border-radius:4px;background:transparent;color:#b5bac1;cursor:pointer;font-size:18px;line-height:1}
.volume-popover-head button:hover{background:#2b2d31;color:#fff}
.volume-popover-row{display:flex;align-items:center;justify-content:space-between;color:#b5bac1;font-size:11px;margin-bottom:7px}
.volume-popover-row b{color:#dbdee1;font-size:11px}
.volume-range{width:100%;accent-color:var(--brand);cursor:pointer}
.volume-mute-btn{width:100%;height:34px;margin-top:10px;border-radius:4px;background:#2b2d31;color:#dbdee1;cursor:pointer;font-size:11px}
.volume-mute-btn:hover{background:#35373c;color:#fff}
.volume-mute-btn.muted{background:#3b292b;color:#f0a1a3}
.volume-popover small{display:block;margin-top:9px;color:#80848e;font-size:10px;line-height:1.35}


/* Etapa 4: live em destaque, estilo Discord */
.call-stage.screen-active{
  min-height:min(72vh,720px);
  max-height:78vh;
}
.video-tile{
  cursor:pointer;
  transition:box-shadow .16s ease,transform .16s ease,opacity .16s ease;
}
.video-tile:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}
.video-tile-fullscreen{
  position:absolute;
  top:8px;
  right:8px;
  z-index:4;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:5px;
  background:rgba(17,18,20,.82);
  color:#fff;
  cursor:pointer;
  opacity:0;
  transform:translateY(-2px);
  transition:.15s;
  font-size:15px;
}
.video-tile:hover .video-tile-fullscreen,
.video-tile:focus-within .video-tile-fullscreen,
.video-tile.focused .video-tile-fullscreen{
  opacity:1;
  transform:translateY(0);
}
.video-tile-fullscreen:hover{background:#2b2d31}
.video-grid.has-focus{
  grid-template-columns:repeat(auto-fit,minmax(120px,180px));
  grid-template-rows:minmax(280px,1fr) auto;
  align-content:stretch;
  justify-content:center;
}
.video-grid.has-focus .video-tile.focused{
  grid-column:1/-1;
  grid-row:1;
  width:100%;
  height:100%;
  min-height:280px;
  max-height:none;
  margin:0;
  aspect-ratio:auto;
  box-shadow:0 0 0 2px #3f4147;
}
.video-grid.has-focus .video-tile.focused video{
  object-fit:contain;
}
.video-grid.has-focus .video-tile:not(.focused){
  width:min(180px,100%);
  height:92px;
  min-height:92px;
  aspect-ratio:16/9;
  justify-self:center;
}
.video-grid.has-focus .video-tile:not(.focused) .video-label{
  max-width:calc(100% - 12px);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9px;
  padding:3px 5px;
}
.video-grid.has-screen .video-tile.screen.focused{
  min-height:320px;
}
.video-tile:fullscreen{
  width:100vw;
  height:100vh;
  max-width:none;
  max-height:none;
  border-radius:0;
  background:#000;
  aspect-ratio:auto;
}
.video-tile:fullscreen video{
  width:100%;
  height:100%;
  object-fit:contain;
}
.video-tile:fullscreen .video-label{font-size:12px}
.video-tile:fullscreen .video-tile-fullscreen{opacity:1}
.call-stage:fullscreen .video-grid.has-focus{
  grid-template-rows:minmax(0,1fr) auto;
}
.call-stage:fullscreen .video-grid.has-focus .video-tile.focused{
  min-height:0;
}
.call-stage:fullscreen .video-grid.has-focus .video-tile:not(.focused){
  height:100px;
  min-height:100px;
}
@media(max-width:760px){
  .call-stage.screen-active{min-height:58vh;max-height:68vh}
  .video-grid.has-focus{grid-template-columns:repeat(auto-fit,minmax(92px,1fr));grid-template-rows:minmax(210px,1fr) auto;padding:8px;gap:7px}
  .video-grid.has-focus .video-tile.focused{min-height:210px}
  .video-grid.has-focus .video-tile:not(.focused){width:100%;height:70px;min-height:70px}
}
