/* ============================================
   PYRAMID · Call system styles
   Mini panel, stream preview, in-call tiles
   ============================================ */

/* Mini call panel (above user profile) */
.mini-call {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
  flex-shrink: 0;
  animation: slide-up 0.28s var(--spring-bounce);
}
.mini-call-connected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(90deg, hsl(142 60% 30% / 0.18), transparent 60%);
  border-bottom: 1px solid var(--border);
}
.mini-call-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mini-call-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--online);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.mini-call-title .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--online);
  animation: pulse-ring 1.4s infinite;
  box-shadow: 0 0 0 0 hsl(142 76% 50% / 0.6);
}
.mini-call-room {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  display: flex; align-items: center; gap: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-call-meta {
  font-size: 10px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.mini-call-actions { display: flex; gap: 2px; }
.mini-call-actions .icon-btn { width: 26px; height: 26px; }
.mini-call-actions .icon-btn.leave { color: var(--danger); }
.mini-call-actions .icon-btn.leave:hover { background: rgba(229,72,77,0.14); color: var(--danger); }

.mini-call-controls {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-2);
}
.mini-call-ctrl {
  flex: 1;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  color: var(--fg);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s var(--spring-bounce);
}
.mini-call-ctrl:hover { background: var(--bg-hover); transform: translateY(calc(-1px * var(--motion))); }
.mini-call-ctrl.active { background: var(--accent); color: var(--accent-fg); }
.mini-call-ctrl.danger.active { background: var(--danger); color: white; }

/* Stream mini preview (above mini-call) */
.stream-mini {
  position: relative;
  background: #000;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  transition: height 0.3s var(--spring-bounce);
}
.stream-mini.collapsed {
  height: 28px !important;
}
.stream-mini.collapsed .stream-mini-content { opacity: 0; }

.stream-mini-content {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, #1a1a2e 0 10px, #16213e 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.stream-mini-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.25), transparent 70%);
  animation: shimmer 4s infinite linear;
  background-size: 200% 100%;
}
.stream-mini-label {
  position: relative;
  z-index: 1;
  color: white;
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.7;
  padding: 3px 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
}

.stream-mini-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85), rgba(0,0,0,0.55) 70%, transparent);
  z-index: 2;
  color: white;
  font-size: 11px;
  font-weight: 500;
}
.stream-mini.collapsed .stream-mini-bar {
  background: var(--bg-3);
  color: var(--fg);
}
.stream-mini-bar .streamer {
  display: flex; align-items: center; gap: 6px;
  flex: 1;
  min-width: 0;
}
.stream-mini-bar .streamer .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ef4444;
  animation: pulse-ring 1.4s infinite;
}
.stream-mini-bar .name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stream-mini-bar .chevron-btn {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: inherit;
  opacity: 0.7;
  transition: transform 0.3s var(--spring-bounce), opacity 0.15s;
}
.stream-mini-bar .chevron-btn:hover { opacity: 1; }
.stream-mini.collapsed .stream-mini-bar .chevron-btn { transform: rotate(180deg); }

.stream-mini-btn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12);
  border-radius: 5px;
  color: white;
  transition: all 0.18s;
}
.stream-mini-btn:hover { background: rgba(255,255,255,0.22); }
.stream-mini.collapsed .stream-mini-btn { display: none; }

/* ==== Voice channel: stream-as-hero layout ==== */
.voice-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 16px;
  min-height: 0;
}

.stream-hero {
  flex: 1;
  min-height: 280px;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  background: #000;
  border: 1.5px solid var(--border);
  transition: all 0.3s var(--spring-soft);
}
.stream-hero.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  border-radius: 0;
  border: none;
}

.stream-hero-content {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, #1a1a2e 0 14px, #16213e 14px 28px);
}
.stream-hero-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(99,102,241,0.35), transparent 60%),
              radial-gradient(ellipse at 70% 70%, rgba(236,72,153,0.25), transparent 60%);
}
.stream-hero-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
}
.stream-hero-center .big-icon {
  width: 64px; height: 64px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
}
.stream-hero-center .big-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.stream-hero-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  color: white;
  z-index: 3;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.stream-hero:hover .stream-hero-topbar,
.stream-hero.fullscreen .stream-hero-topbar { opacity: 1; pointer-events: auto; }

.stream-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(239,68,68,0.9);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stream-live-pill .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: white;
  animation: pulse-ring 1.4s infinite;
}

.stream-hero-title {
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.stream-hero-viewers {
  font-size: 11px;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 4px;
}

.stream-hero-bottombar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.stream-hero:hover .stream-hero-bottombar,
.stream-hero.fullscreen .stream-hero-bottombar { opacity: 1; pointer-events: auto; }

.stream-hero-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  color: white;
  border-radius: var(--r-sm);
  transition: all 0.18s var(--spring-bounce);
}
.stream-hero-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(calc(1 + 0.08 * var(--motion)));
}

.stream-hero-btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
}
.stream-hero-btn.primary:hover { background: var(--accent); filter: brightness(1.08); }

.stream-hero-spacer { flex: 1; }

.stream-quality-menu {
  position: absolute;
  bottom: 62px;
  right: 16px;
  background: rgba(15,15,22,0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-base);
  padding: 4px;
  min-width: 200px;
  z-index: 5;
  animation: pop-in 0.18s var(--spring-bounce);
  transform-origin: bottom right;
}
.stream-quality-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.12s;
}
.stream-quality-item:hover { background: rgba(255,255,255,0.1); }
.stream-quality-item .check-col { width: 14px; display: flex; color: var(--accent); }
.stream-quality-item .label { flex: 1; }
.stream-quality-item .hint {
  font-size: 10px;
  font-family: var(--font-mono);
  opacity: 0.5;
}
.stream-quality-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 4px; }
.stream-quality-title {
  padding: 6px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* participants row below stream */
.voice-participants-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 170px;
  overflow: hidden;
}

.voice-tile.small {
  aspect-ratio: 16/10;
  min-height: 100px;
}
.voice-tile.small .voice-tile-avatar {
  width: 44px; height: 44px;
  font-size: 18px;
}
.voice-tile.small .voice-tile-name {
  font-size: 11px;
  padding: 2px 6px;
  bottom: 6px; left: 6px;
}

/* DM header call buttons */
.chat-header-actions .call-btn {
  position: relative;
}
.chat-header-actions .call-btn.video:hover { color: var(--accent); }
.chat-header-actions .call-btn.voice:hover { color: var(--online); }

/* Create/Join menu (expanded) */
.space-menu-wide { min-width: 240px; }
.space-menu-section {
  padding: 6px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

/* Align user-panel baseline with composer bottom */
.user-panel {
  padding: 8px 10px !important;
  min-height: 52px;
}
.composer-wrap {
  padding: 0 16px 12px !important;
}
