/* ============================================
   LIVE PAGE — LANDING (session list + host modal)
   ============================================ */
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.live-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}
.live-header .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.live-header .btn-primary svg {
  width: 18px;
  height: 18px;
}

.live-sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.live-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.live-session-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.08);
}

.live-session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.live-session-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.live-session-card-onair {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--error);
  border-radius: 999px;
  padding: 3px 9px;
}

.live-session-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-session-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.live-session-card-host {
  font-weight: 500;
}
.live-session-card-participants {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.live-session-card-participants svg {
  width: 14px;
  height: 14px;
}

.live-session-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.live-session-card-actions button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.live-session-card-actions svg {
  width: 16px;
  height: 16px;
}

.live-loading,
.live-empty,
.live-error {
  text-align: center;
  padding: 48px 24px;
  font-size: 14px;
  color: var(--text-muted);
  margin: auto;
}
.live-error {
  color: var(--error);
}

/* Host modal */
#live-host-modal .modal-content {
  max-width: 440px;
}
#live-host-modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text-primary);
}
#live-host-modal .form-group {
  margin-bottom: 16px;
}
#live-host-modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
#live-host-modal .live-host-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .live-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .live-header h2 {
    font-size: 18px;
  }
  .live-header .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .live-sessions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .live-session-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .live-session-card {
    padding: 14px;
  }
  .live-session-card-header h3 {
    font-size: 15px;
  }
  .live-session-card-desc {
    font-size: 12px;
  }
  .live-session-card-actions {
    flex-direction: column;
  }
}

/* ============================================
   LIVE SESSION — STUDIO CONTAINER
   ============================================ */
/* The studio is a long page: video at the top, then everything the host adds
   to the gliim below it. So the window scrolls rather than being pinned. */
body.live-studio-active {
  background: #0a0a0a;
  padding-bottom: 0 !important;
}

body.live-studio-active .bottom-bar {
  display: none !important;
}

body.live-studio-active .sidebar {
  display: none;
}

body.live-studio-active .main-content {
  margin-left: 0 !important;
  width: 100% !important;
}

body.live-studio-active .view-container {
  padding: 0;
  max-width: 100%;
}

body.live-studio-active .topbar {
  display: none;
}

.live-studio-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top, 0px);
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
}

.live-video-area {
  flex: 0 0 auto;
  height: clamp(320px, 56vh, 620px);
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 12px;
  min-height: 0;
  position: relative;
}

/* Stage — the large focused video */
.live-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.live-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.live-stage video.speaking {
  box-shadow: inset 0 0 0 3px #22c55e;
  border-radius: 16px;
}
.live-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  pointer-events: none;
}
.live-stage-info {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Participant rail — vertical (right) on wide, horizontal (bottom) on mobile */
.live-participant-rail {
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
}
.live-participant-rail::-webkit-scrollbar {
  width: 6px;
}
.live-participant-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.live-participant-tile {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.live-participant-tile:hover {
  transform: translateY(-1px);
}
.live-participant-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.live-participant-tile.focused {
  border-color: var(--brand-primary);
}
.live-participant-tile.speaking {
  border-color: #22c55e;
}
.live-participant-tile.focused.speaking {
  border-color: #22c55e;
}
.live-participant-tile.host {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}
.live-participant-tile.host.focused {
  border-color: #fbbf24;
}

.live-participant-info {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  color: white;
  pointer-events: none;
}
.live-participant-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-host-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fbbf24;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.live-host-badge svg {
  flex-shrink: 0;
}

/* Session header bar (inside video area) */
.live-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.8);
  gap: 12px;
  flex-wrap: wrap;
}
.live-session-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: white;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-session-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.live-session-meta span {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   CONTROLS BAR
   ============================================ */
.live-studio-top {
  position: sticky;
  top: var(--safe-top, 0px);
  z-index: 12;
  background: #0a0a0a;
}

.live-controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.92);
  flex-wrap: wrap;
}

.live-ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.live-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.live-ctrl-btn svg {
  width: 20px;
  height: 20px;
}
.live-ctrl-btn.danger {
  background: #dc2626;
  border-color: #dc2626;
}
.live-ctrl-btn.danger:hover {
  background: #b91c1c;
}
.live-ctrl-btn.active {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}
.live-ctrl-btn.recording {
  background: #dc2626;
  border-color: #dc2626;
  animation: live-recording-pulse 1.5s ease-in-out infinite;
}
.live-ctrl-btn.copied {
  background: rgba(34, 197, 94, 0.3);
  border-color: #22c55e;
}

/* ============================================
   CHAT PANEL
   ============================================ */
.live-chat-panel {
  position: fixed;
  right: 0;
  top: var(--safe-top, 0px);
  bottom: 0;
  width: 320px;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 15;
}

.live-chat-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.live-chat-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: white;
}
.live-chat-header button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.live-chat-header button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Chat close — centred in the header so it cannot be missed */
.live-chat-header button.live-chat-close {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
}
.live-chat-header button.live-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.live-chat-header button.live-chat-close svg {
  width: 16px;
  height: 16px;
}

.live-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-chat-message {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  max-width: 85%;
}
.live-chat-message.own {
  align-self: flex-end;
  background: rgba(139, 92, 246, 0.2);
}

.live-chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.live-chat-message-header strong {
  color: white;
  font-weight: 600;
}
.live-chat-message-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
}

.live-chat-message-content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.45;
  word-wrap: break-word;
}

.live-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.live-chat-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 9px 12px;
  color: white;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
  min-width: 0;
}
.live-chat-input input:focus {
  border-color: var(--brand-primary);
}
.live-chat-input input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.live-chat-input button {
  background: var(--brand-primary);
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.live-chat-input button:hover {
  opacity: 0.9;
}

.live-chat-attach-btn {
  background: none !important;
  border: none !important;
  padding: 4px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s ease;
  border-radius: 6px !important;
}
.live-chat-attach-btn:hover {
  color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.live-chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}
.live-chat-attachment-preview img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}
.live-chat-attachment-preview svg {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.5);
}
.live-chat-attachment-preview span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-attach-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  line-height: 1;
  flex-shrink: 0;
}
.live-attach-remove:hover {
  color: white;
}

.live-chat-attachment {
  margin-top: 6px;
}
.live-chat-attachment img {
  max-width: 200px;
  max-height: 160px;
  border-radius: 8px;
  cursor: pointer;
  display: block;
}
.live-chat-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--brand-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s ease;
  max-width: 220px;
}
.live-chat-file-link:hover {
  background: rgba(255, 255, 255, 0.14);
}
.live-chat-file-link svg {
  flex-shrink: 0;
}

/* '...' button on participant tiles */
.live-tile-menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 5;
  padding: 0;
}

.live-participant-tile:hover .live-tile-menu-btn {
  opacity: 1;
}

.live-tile-menu-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.live-tile-menu-btn svg {
  width: 14px;
  height: 14px;
}

/* Tile menu popup */
.live-tile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.live-tile-menu {
  position: fixed;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  min-width: 160px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: live-tile-menu-in 0.15s ease-out;
}

@keyframes live-tile-menu-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.live-tile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.live-tile-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.live-tile-menu-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.live-tile-menu-item.danger {
  color: #ef4444;
}

.live-tile-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.live-tile-menu-item + .live-tile-menu-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .live-studio-container {
    border-radius: 0;
  }

  /* Stack: stage on top, horizontal rail at the bottom */
  .live-video-area {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }
  .live-stage {
    border-radius: 12px;
  }
  .live-participant-rail {
    flex: 0 0 auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }
  .live-participant-rail::-webkit-scrollbar {
    width: auto;
    height: 5px;
  }
  .live-participant-tile {
    width: 108px;
    aspect-ratio: 3 / 4;
    scroll-snap-align: start;
  }

  .live-controls-bar {
    padding: 10px 12px;
    gap: 8px;
  }
  .live-ctrl-btn {
    width: 42px;
    height: 42px;
  }
  .live-ctrl-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Chat opens as a bottom sheet over the studio, not a side drawer */
  .live-chat-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(76vh, 620px);
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px 18px 0 0;
    background: rgba(10, 10, 10, 0.96);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 60;
  }

  .live-chat-header {
    padding: 10px 12px;
  }
  .live-chat-header h4 {
    font-size: 14px;
  }

  .live-session-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
  }
  .live-session-header h3 {
    font-size: 14px;
  }
  .live-session-meta {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .live-session-meta span {
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .live-video-area {
    gap: 6px;
    padding: 6px;
  }
  .live-participant-tile {
    width: 92px;
  }

  .live-controls-bar {
    gap: 6px;
    padding: 8px 10px;
  }
  .live-ctrl-btn {
    width: 38px;
    height: 38px;
  }
  .live-ctrl-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Share chat picker modal */
.share-chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.share-chat-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.share-chat-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.share-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.share-chat-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   MINIMIZED FLOATING TILE
   ============================================ */
.live-minimized-tile {
  position: fixed;
  z-index: 1100;
  width: 200px;
  background: #111;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.live-minimized-tile:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(139, 92, 246, 0.4);
}

.live-minimized-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}

.live-minimized-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-mini-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px;
  pointer-events: none;
}

.live-mini-live {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  animation: live-recording-pulse 1.5s ease-in-out infinite;
}

.live-minimized-info {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.85);
}

.live-minimized-title {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.live-minimized-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.live-minimized-close:hover {
  color: #ef4444;
  background: rgba(255, 255, 255, 0.1);
}

.live-minimized-close svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  .live-minimized-tile {
    width: 160px;
  }
  .live-minimized-video {
    aspect-ratio: 16 / 12;
  }
}

/* ============================================
   JOIN TOAST NOTIFICATION
   ============================================ */
.live-join-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.live-join-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.live-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: live-recording-pulse 1.2s ease-in-out infinite;
}

/* Support button in controls bar — same gold as the reader engagement support icon */
.live-ctrl-btn#live-support-btn {
  color: var(--gold, #fbbf24);
}
.live-ctrl-btn#live-support-btn:hover {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
}
.live-ctrl-btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}

/* Reaction button — its icon mirrors the current stage of the ladder */
.live-ctrl-btn#live-react-btn.is-bolt {
  color: var(--gold, #fbbf24);
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
}

/* Floating confirmation bolt over the video stage */
.live-support-fly {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--gold, #fbbf24);
  background: rgba(10, 10, 10, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 20;
  animation: live-support-rise 1.5s ease-out forwards;
}
.live-support-fly svg {
  width: 16px;
  height: 16px;
}
@keyframes live-support-rise {
  0% { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.9); }
  18% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-42px) scale(1.04); }
}

/* ============================================
   FLOATING REACTIONS + MOBILE CHAT MODAL
   ============================================ */
/* Every viewer gets the tapper's profile and the emoji of their stage. */
.live-react-fly {
  position: absolute;
  bottom: 74px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 21;
  animation: live-react-rise 2.4s ease-out forwards;
}
.live-react-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.live-react-ico {
  display: flex;
  align-items: center;
}
.live-react-ico svg {
  width: 18px;
  height: 18px;
}
.live-react-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.live-react-gp {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold, #fbbf24);
}
.emoji-like .live-react-ico { color: #60a5fa; }
.emoji-heart .live-react-ico { color: #f472b6; }
.emoji-bolt .live-react-ico { color: var(--gold, #fbbf24); }

@keyframes live-react-rise {
  0% { opacity: 0; transform: translateY(16px) scale(0.9); }
  12% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-56px) scale(1.02); }
}

/* Backdrop for the mobile chat sheet */
.live-chat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 55;
}
body.live-chat-modal-open {
  overflow: hidden;
}
