:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --text: #fff;
  --muted: rgba(255,255,255,0.5);
  --accent: #73d2de;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --cam-active: #3b82f6;
  --sans: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  height: 100dvh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.viewer-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---- 视频区 ---- */
.video-wrap {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

#remote-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.02em;
}

/* ---- 观众摄像头小窗 ---- */
.viewer-cams {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}

.viewer-cam {
  width: 120px;
  height: 90px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.3);
  background: #111;
  object-fit: cover;
}

/* ---- 顶部状态 ---- */
.top-bar {
  position: absolute;
  top: env(safe-area-inset-top, 12px);
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  padding-top: 8px;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.badge.green { color: var(--ok); }
.badge.warn  { color: var(--warn); }
.badge.red   { color: var(--danger); }

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- 音频提示 ---- */
.audio-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 28px;
  border-radius: 16px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  font-size: 15px;
  color: var(--text);
  text-align: center;
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite;
  z-index: 10;
}

@keyframes pulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

/* ---- 提示 ---- */
.toast {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* ---- 底部操作栏 ---- */
.action-bar {
  flex-shrink: 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 12px) + 12px);
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.08);
}

.action-btns {
  display: flex;
  gap: 10px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  width: 20px; height: 20px;
}

/* Talk button states */
.talk-btn.idle {
  background: var(--accent);
  color: #000;
}

.talk-btn.talking {
  background: var(--danger);
}

/* Camera button states */
.cam-btn.active {
  background: var(--cam-active);
}
