/* ================================================================== voz */
.stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; background: var(--bg-void); position: relative; }

.stage-grid {
  flex: 1 1 auto; min-height: 0;
  display: grid; gap: 12px; padding: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-content: center; justify-content: center;
  overflow-y: auto;
}
.stage-grid[data-focus="true"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
}
.stage-grid[data-count="1"] { grid-template-columns: minmax(0, min(880px, 100%)); }
.stage-grid[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.tile {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--bg-raised), var(--bg-sidebar));
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 10;
  min-height: 130px;
  transition: border-color var(--med), box-shadow var(--med), transform var(--med);
  /* A grade muda em tempo real; animar cada reconstrução faz as telas piscarem. */
  animation: none;
}
.tile.speaking { border-color: color-mix(in srgb, var(--green) 65%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 45%, transparent), 0 0 30px -10px var(--green); }
.tile.video { background: #05060a; }
.tile.video video { width: 100%; height: 100%; object-fit: contain; }
.tile.focused { aspect-ratio: auto; height: 100%; }
.tile[data-kind="screen"] { cursor: zoom-in; }

.tile .who {
  position: absolute; left: 10px; bottom: 10px; right: 10px;
  display: flex; align-items: center; gap: 7px;
  pointer-events: none;
}
.tile .who .plate {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 4px 10px 4px 5px; border-radius: var(--r-pill);
  background: rgba(6, 8, 14, .72); backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 600; color: #fff;
  border: 1px solid rgba(255,255,255,.09);
}
.tile .who .plate .avatar { --size: 20px; }
.tile .who .plate .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .who .plate svg { width: 14px; height: 14px; flex: none; }
.tile .who .plate .muted { color: var(--red); }
.tile .who .plate .live { color: var(--red); }

.tile .idle-face { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tile .idle-face .avatar { --size: 84px; transition: box-shadow var(--med), transform var(--med); }
.tile.speaking .idle-face .avatar { box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 75%, transparent); transform: scale(1.03); }
.tile .idle-face .nm { font-weight: 600; font-size: 14.5px; color: var(--text-soft); }

.tile .corner {
  position: absolute; top: 10px; right: 10px; display: flex; gap: 6px;
  opacity: 0; transition: opacity var(--fast);
}
.tile:hover .corner { opacity: 1; }
.tile .corner .icon-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: rgba(6, 8, 14, .72); backdrop-filter: blur(8px); color: #fff;
  border: 1px solid rgba(255,255,255,.09);
}
.tile .corner .icon-btn:hover { background: rgba(6,8,14,.92); }

.tile .badge-live {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  box-shadow: 0 4px 14px -4px var(--red);
}
.tile .badge-live i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-ring 1.8s infinite; }

.tile .stat {
  position: absolute; bottom: 10px; right: 10px;
  font-size: 11px; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: rgba(6,8,14,.7); color: var(--text-muted); border: 1px solid rgba(255,255,255,.07);
  opacity: 0; transition: opacity var(--fast);
}
.tile:hover .stat { opacity: 1; }

.tile .vol { position: absolute; inset: auto 12px 46px 12px; opacity: 0; transition: opacity var(--fast); }
.tile:hover .vol { opacity: 1; }

/* faixa de miniaturas no modo foco */
.filmstrip { display: flex; gap: 10px; padding: 0 2px 2px; overflow-x: auto; }
.filmstrip .tile { flex: 0 0 168px; aspect-ratio: 16/10; min-height: 0; animation: none; }
.filmstrip .tile .who .plate { font-size: 11.5px; padding: 3px 8px 3px 4px; }
.filmstrip .tile .idle-face .avatar { --size: 44px; }
.filmstrip .tile .idle-face .nm { font-size: 12px; }
.filmstrip .tile .corner, .filmstrip .tile .stat, .filmstrip .tile .vol { display: none; }

/* --------------------------------------------------------------- controles */
.stage-bar {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px 16px;
  background: linear-gradient(to top, var(--bg-void) 55%, transparent);
}
.stage-bar .group {
  display: flex; align-items: center; gap: 6px;
  padding: 6px; border-radius: var(--r-pill);
  background: var(--bg-raised); border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.ctl {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-hover); color: var(--text-soft);
  transition: background var(--fast), color var(--fast), transform var(--fast);
  position: relative;
}
.ctl:hover { background: var(--bg-active); color: var(--text); }
.ctl:active { transform: scale(.94); }
.ctl svg { width: 21px; height: 21px; }
.ctl.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px var(--accent); }
.ctl.off { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.ctl.leave { background: var(--red); color: #fff; box-shadow: 0 6px 18px -8px var(--red); }
.ctl.leave:hover { background: color-mix(in srgb, var(--red) 88%, white); }
.ctl .split {
  position: absolute; right: -1px; bottom: -1px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--text-muted);
}
.ctl .split svg { width: 10px; height: 10px; }

.mic-meter {
  position: absolute; inset: auto 6px 4px 6px; height: 3px;
  border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden;
}
.mic-meter i { display: block; height: 100%; width: 0%; background: var(--green); transition: width 70ms linear; }

/* -------------------------------------------------------- aviso de áudio */
.audio-hint {
  position: absolute; left: 50%; top: 14px; translate: -50% 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100% - 32px));
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--bg-raised); border: 1px solid color-mix(in srgb, var(--yellow) 40%, transparent);
  box-shadow: var(--shadow-lg); font-size: 13px; color: var(--text-soft);
  animation: slide-up .24s var(--ease);
}
.audio-hint svg { width: 18px; height: 18px; color: var(--yellow); flex: none; }
.audio-hint .btn { flex: none; }

/* --------------------------------------------------------------- overlay */
.viewer {
  position: fixed; inset: 0; z-index: 380;
  background: #04050a; display: flex; flex-direction: column;
  animation: fade-in .18s var(--ease);
}
.viewer video { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: contain; background: #04050a; }
.viewer-bar {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--bg-void); border-top: 1px solid var(--line);
}
.viewer-bar .title { font-weight: 700; }
.viewer-bar .spacer { flex: 1 1 auto; }
