/* The controls anchor the audience row: the first circles start 12px below the 44px control row. */
.live-room-overlay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 16px;
}
.live-stage .live-room-overlay > .live-overlay-left,
.live-stage .live-room-overlay > .live-overlay-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}
.live-stage .live-room-overlay > .live-overlay-right { align-items: flex-end; }
.live-stage:has(.live-camera-quick) .live-room-overlay > .live-overlay-left { gap: 0; }
.live-overlay-controls { display: flex; align-items: center; gap: 8px; height: 44px; width: 100%; min-width: 0; }
.live-overlay-right > .live-overlay-controls { justify-content: flex-end; }
.live-overlay-controls > strong { min-width: 0; flex: 1; }
.live-stage:has(.live-camera-quick) .live-room-overlay .live-overlay-controls > strong { max-width: none; }
.live-overlay-controls > button { flex-shrink: 0; }
.live-stage:has(.live-camera-quick) .live-room-overlay .live-viewer-total { display: inline-flex; }
.live-viewer-total { display: inline-flex; align-items: center; gap: 3px; }
.live-viewer-eye { width: 14px; height: 14px; flex-shrink: 0; }

.live-leaders { width: fit-content; max-width: 100%; min-width: 0; margin-top: 12px; display: flex; align-items: center; pointer-events: auto; }
.live-overlay-right .live-leaders { margin-right: 44px; max-width: calc(100% - 44px); }
.live-leader-avatars { display: flex; align-items: center; gap: 0; min-width: 0; min-height: 24px; margin: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x; padding: 0; isolation: isolate; }
.live-leader-avatars::-webkit-scrollbar { display: none; }
.live-leader-avatars:focus-visible { outline: 2px solid #c5ddff; outline-offset: 3px; border-radius: 8px; }
.live-leader-avatar { position: relative; display: grid; place-items: center; box-sizing: border-box; flex: 0 0 24px; width: 24px; height: 24px; overflow: hidden; border-radius: 50%; border: .5px solid #c5ddffb3; background: linear-gradient(145deg, #ffffff24, #152333bd); color: #fff; font-size: 0; }
.live-leader-avatar + .live-leader-avatar { margin-left: -2px; }
.live-leader-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.live-leader-avatar[data-leader-kind="gifter"], .live-leader-avatar[data-leader-kind="both"] { border-color: #f3d49acf; }

/* This sits above the chat/share row, leaving the input its existing width. */
.live-end-floating { position: absolute; z-index: 7; right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px) + var(--live-keyboard-lift, 0px)); min-height: 40px; padding: 9px 15px; border: 1px solid #ffffff38; border-radius: 999px; background: #a92040d9; color: #fff; font: inherit; font-size: 12px; font-weight: 700; box-shadow: 0 3px 15px #0003; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: auto; }
.live-stage.has-exit-control:has(.live-chat-shell) .live-stage-bottom { bottom: calc(132px + var(--live-keyboard-lift, 0px)); }
.live-stage:has(.live-chat-shell.is-chat-focused) .live-end-floating { bottom: calc(105px + env(safe-area-inset-bottom, 0px) + var(--live-keyboard-lift, 0px)); }
.live-stage.has-exit-control:has(.live-chat-shell.is-chat-focused) .live-stage-bottom { bottom: calc(157px + var(--live-keyboard-lift, 0px)); }
.live-stage:has([data-live-leaders]) .live-battle-overlay { top: calc(108px + env(safe-area-inset-top, 0px)); }
.live-end-floating:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 760px) {
  .live-room-overlay { padding-inline: 10px; gap: 8px; }
  .live-overlay-controls { gap: 4px; }
  .live-overlay-controls .live-viewer-total { font-size: 10px; white-space: nowrap; }
  .live-viewer-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .live-leaders { max-width: 100%; }
  .live-end-floating { right: max(10px, env(safe-area-inset-right, 0px)); }
}
@media (prefers-reduced-transparency: reduce) {
  .live-end-floating { background: #a92040; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .live-leader-avatar { background: #223047; }
}
@media (forced-colors: active) {
  .live-leader-avatar, .live-end-floating { background: Canvas; color: CanvasText; border-color: CanvasText; box-shadow: none; }
}
