/* Mon Live — interface mobile moderne (Android Chrome prioritaire) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(120% 90% at 50% 0%, #16213e 0%, #0b1020 60%) fixed;
  color: #eaf0ff; overflow: hidden;
}
.hidden { display: none !important; }
.screen { height: 100dvh; display: flex; flex-direction: column; }

/* flux caméra interne : invisible à l'écran mais jamais throttled */
.raw-video {
  position: fixed; right: 0; bottom: 0; width: 2px; height: 2px;
  opacity: 0.01; pointer-events: none; z-index: -1;
}

/* ---------- Accueil ---------- */
#screen-home { align-items: center; justify-content: center; padding: 20px; }
.home-card {
  width: 100%; max-width: 420px; padding: 28px 22px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px; backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.logo { font-size: 44px; }
h1 { margin: 0; font-size: 30px; letter-spacing: 0.5px; }
.subtitle { margin: 0 0 8px; color: #9fb0d8; font-size: 14px; }
.btn {
  border: none; border-radius: 14px; padding: 15px 18px; font-size: 16px; font-weight: 600;
  color: #fff; cursor: pointer; transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, #6c5ce7, #4834d4); box-shadow: 0 6px 20px rgba(108,92,231,.35); }
.btn.secondary { background: rgba(255,255,255,0.12); }
.divider { display: flex; align-items: center; gap: 10px; color: #7787ad; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,0.12); }
.join-row { display: flex; gap: 10px; }
.join-row input {
  flex: 1; min-width: 0; background: rgba(0,0,0,0.35); color: #fff; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.16); border-radius: 14px; padding: 14px; font-size: 18px;
  letter-spacing: 4px; text-align: center; outline: none;
}
.join-row input:focus { border-color: #6c5ce7; }
.join-row .btn { padding: 14px 16px; }
.status { min-height: 18px; font-size: 13px; color: #ffd37a; }
.privacy-note { font-size: 12px; color: #8fa0c7; line-height: 1.5; }

/* ---------- Live ---------- */
.video-stage { position: relative; flex: 1; background: #000; overflow: hidden; }
#local-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#remote-video {
  position: absolute; top: 12px; right: 12px; width: 31%; max-width: 170px; aspect-ratio: 3/4;
  object-fit: cover; border-radius: 14px; border: 2px solid rgba(255,255,255,0.25);
  background: #111; z-index: 3;
}
.pip-placeholder {
  position: absolute; top: 12px; right: 12px; width: 31%; max-width: 170px; aspect-ratio: 3/4;
  border-radius: 14px; border: 2px dashed rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; color: #9fb0d8; padding: 8px; background: rgba(0,0,0,0.35); z-index: 2;
}
.code-chip {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; letter-spacing: 1px;
}
.face-msg {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 3;
  background: rgba(0,0,0,0.6); color: #ffd37a; padding: 7px 14px; border-radius: 999px;
  font-size: 12px; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
.cam-off-overlay {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: #000; color: #8fa0c7; font-size: 15px;
}
.banner {
  padding: 10px 16px; font-size: 13px; text-align: center;
  background: #b3261e; color: #fff; flex-shrink: 0;
}
.banner.warn { background: #8a6d1c; }

/* ---------- Contrôles ---------- */
.controls {
  flex-shrink: 0; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10,14,28,0.92); border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 10px;
}
.chips-row {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
}
.chips-row::-webkit-scrollbar { display: none; }
.chips-label { font-size: 11px; color: #9fb0d8; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }
.chip {
  flex-shrink: 0; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.07);
  color: #eaf0ff; border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer;
}
.chip.active { background: linear-gradient(135deg, #6c5ce7, #4834d4); border-color: transparent; font-weight: 600; }
.chip.ghost { border-style: dashed; color: #9fb0d8; }
.ctl-row { display: flex; gap: 8px; }
.ctl {
  flex: 1; border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.08);
  color: #eaf0ff; border-radius: 14px; padding: 12px 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ctl:active { transform: scale(0.96); }
.ctl.ai[aria-pressed="true"] {
  background: linear-gradient(135deg, #00b894, #00875f); border-color: transparent;
  box-shadow: 0 0 14px rgba(0,184,148,0.45);
}
.ctl.off { opacity: 0.45; }
.ctl.danger { background: rgba(179,38,30,0.25); border-color: rgba(179,38,30,0.6); }
.fx-status { text-align: center; font-size: 11px; color: #7787ad; min-height: 14px; }