/* ══════════════════════════════════════════════════════════════════
   ZWORLD — PROFZ STAGE INTELLIGENT
   Interface média indépendante : vocal, caméra et stream
   ══════════════════════════════════════════════════════════════════ */

#profz-stage[hidden] {
  display: none !important;
}

#profz-stage {
  --stage-green: #3ddc84;
  --stage-purple: #a855f7;
  --stage-danger: #ff4d67;
  --stage-bg: #050807;
  --stage-panel: rgba(13, 20, 17, 0.94);
  --stage-line: rgba(61, 220, 132, 0.18);

  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 15% 10%, rgba(168, 85, 247, 0.18), transparent 34%),
    radial-gradient(circle at 85% 90%, rgba(61, 220, 132, 0.14), transparent 38%),
    var(--stage-bg);
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

#profz-stage-header {
  min-height: 58px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  background: rgba(5, 8, 7, 0.86);
  border-bottom: 1px solid var(--stage-line);
  backdrop-filter: blur(16px);
}

#profz-stage-header > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#profz-stage-title {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profz-stage-status {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

#profz-stage-chat-toggle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  color: #fff;
  background: rgba(168, 85, 247, 0.14);
  cursor: pointer;
}

#profz-stage-layout {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#profz-stage-main {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.34);
}

#profz-stage-chat {
  width: min(360px, 38vw);
  min-width: 280px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--stage-panel);
  border-left: 1px solid rgba(168, 85, 247, 0.25);
  backdrop-filter: blur(18px);
}

#profz-stage-chat[hidden] {
  display: none !important;
}

#profz-stage-chat-messages {
  flex: 1;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

#profz-stage-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--stage-line);
}

#profz-stage-chat-input {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--stage-line);
  border-radius: 12px;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

#profz-stage-chat-input:focus {
  border-color: var(--stage-purple);
}

#profz-stage-chat-form button {
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #07110c;
  font-weight: 700;
  background: var(--stage-green);
  cursor: pointer;
}

#profz-stage-participants {
  min-height: 96px;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  background: rgba(5, 8, 7, 0.88);
  border-top: 1px solid var(--stage-line);
}

#profz-stage-controls {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
  padding: 8px 12px;
  flex-shrink: 0;
  background: rgba(5, 8, 7, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

#profz-stage-controls button {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  font-size: 19px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

#profz-stage-controls button[aria-pressed="true"] {
  background: rgba(255, 77, 103, 0.9);
  border-color: rgba(255, 77, 103, 0.7);
}

#profz-stage-leave {
  background: var(--stage-danger) !important;
}

@media (max-width: 720px) {
  #profz-stage-chat {
    position: absolute;
    inset: auto 0 0;
    z-index: 5;
    width: 100%;
    min-width: 0;
    height: min(58vh, 520px);
    border-top: 1px solid rgba(168, 85, 247, 0.35);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.55);
  }

  #profz-stage-participants {
    min-height: 82px;
    padding: 7px 8px;
  }

  #profz-stage-controls {
    min-height: 66px;
    gap: 8px;
    padding: 7px 8px;
  }

  #profz-stage-controls button {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PROFZ STAGE — scène active et participants
   ══════════════════════════════════════════════════════════════════ */

.profz-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.profz-stage-empty span {
  font-size: clamp(42px, 8vw, 72px);
}

.profz-stage-empty strong {
  color: #fff;
  font-size: clamp(20px, 4vw, 34px);
}

.profz-stage-empty small {
  font-size: 13px;
}

.profz-participant {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  outline: none;
  background:
    radial-gradient(circle at 50% 35%, rgba(168, 85, 247, 0.2), transparent 48%),
    #090d0b;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}

.profz-participant:focus-visible {
  border-color: var(--stage-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.profz-participant.is-featured {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  cursor: default;
}

.profz-participant.is-speaking {
  border-color: var(--stage-green);
  box-shadow:
    0 0 0 2px rgba(61, 220, 132, 0.22),
    0 0 28px rgba(61, 220, 132, 0.18);
}

.profz-participant.is-pinned {
  border-color: var(--stage-purple);
  box-shadow:
    0 0 0 2px rgba(168, 85, 247, 0.25),
    0 0 24px rgba(168, 85, 247, 0.18);
}

.profz-participant video,
.profz-participant-fallback {
  width: 100%;
  height: 100%;
}

.profz-participant video {
  display: block;
  object-fit: cover;
  background: #000;
}

#profz-stage[data-facing-mode="user"]
.profz-participant.is-local video {
  transform: scaleX(-1);
}

#profz-stage[data-facing-mode="environment"]
.profz-participant.is-local video {
  transform: none;
}

.profz-participant-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(61, 220, 132, 0.16), transparent 38%),
    linear-gradient(145deg, rgba(168, 85, 247, 0.14), rgba(5, 8, 7, 0.95));
}

.profz-participant-fallback[hidden] {
  display: none;
}

.profz-participant-initial {
  width: clamp(70px, 18vw, 150px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(61, 220, 132, 0.32);
  border-radius: 50%;
  color: #fff;
  font-size: clamp(34px, 9vw, 72px);
  font-weight: 700;
  background: rgba(61, 220, 132, 0.1);
  box-shadow: 0 0 40px rgba(61, 220, 132, 0.12);
}

.profz-participant-information {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
}

.profz-participant-nick {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profz-participant-indicators {
  flex-shrink: 0;
  font-size: 12px;
}

#profz-stage-participants .profz-participant {
  width: 130px;
  min-width: 130px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 12px;
}

#profz-stage-participants .profz-participant:hover {
  transform: translateY(-2px);
}

#profz-stage-participants .profz-participant-initial {
  width: 42px;
  font-size: 20px;
}

#profz-stage-participants .profz-participant-information {
  right: 5px;
  bottom: 5px;
  left: 5px;
  padding: 4px 6px;
  border-radius: 7px;
}

#profz-stage-participants .profz-participant-nick {
  font-size: 10px;
}

#profz-stage-participants .profz-participant-indicators {
  font-size: 10px;
}

#profz-stage[data-mode="stream"] .profz-participant.is-featured {
  inset: 8px;
  border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 720px) {
  .profz-participant.is-featured {
    inset: 5px;
    border-radius: 14px;
  }

  .profz-participant-information {
    right: 7px;
    bottom: 7px;
    left: 7px;
  }

  #profz-stage-participants .profz-participant {
    width: 104px;
    min-width: 104px;
    height: 68px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PROFZ CAMÉRA — salle d’attente
   ══════════════════════════════════════════════════════════════════ */

#profz-camera-lobby[hidden] {
  display: none !important;
}

#profz-camera-lobby {
  --camera-green: #3ddc84;
  --camera-purple: #a855f7;
  --camera-danger: #ff4d67;
  --camera-panel: rgba(10, 15, 13, 0.96);

  position: fixed;
  inset: 0;
  z-index: 340;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow-y: auto;
  color: #fff;
}

#profz-camera-lobby-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      circle at 16% 14%,
      rgba(168, 85, 247, 0.24),
      transparent 38%
    ),
    radial-gradient(
      circle at 85% 86%,
      rgba(61, 220, 132, 0.18),
      transparent 40%
    ),
    rgba(2, 5, 4, 0.88);
  backdrop-filter: blur(18px);
}

#profz-camera-lobby-card {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  grid-template-areas:
    "header header"
    "preview modes"
    "preview controls"
    "preview actions";
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(61, 220, 132, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(
      145deg,
      rgba(168, 85, 247, 0.08),
      transparent 36%
    ),
    var(--camera-panel);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  animation: profz-camera-lobby-in 0.24s ease-out;
}

@keyframes profz-camera-lobby-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#profz-camera-lobby-header {
  grid-area: header;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

#profz-camera-lobby-header > div {
  min-width: 0;
}

.profz-camera-lobby-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--camera-green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

#profz-camera-lobby-title {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.05;
}

#profz-camera-lobby-header p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

#profz-camera-lobby-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

#profz-camera-lobby-close:hover {
  color: #fff;
  border-color: rgba(255, 77, 103, 0.45);
  background: rgba(255, 77, 103, 0.12);
}

#profz-camera-lobby-close svg,
#profz-camera-lobby-controls svg,
#profz-camera-join-mode svg,
#profz-camera-lobby-enter svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#profz-camera-preview-frame {
  position: relative;
  grid-area: preview;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(
      circle at 50% 36%,
      rgba(168, 85, 247, 0.2),
      transparent 44%
    ),
    #040706;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

#profz-camera-preview {
  width: 100%;
  height: 100%;
  min-height: 360px;
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
  background: #000;
}

#profz-camera-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(61, 220, 132, 0.14),
      transparent 34%
    );
}

#profz-camera-preview-placeholder[hidden] {
  display: none;
}

.profz-camera-preview-orbit {
  width: 92px;
  height: 92px;
  margin-bottom: 8px;
  border: 1px solid rgba(61, 220, 132, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(168, 85, 247, 0.22),
      rgba(61, 220, 132, 0.08) 48%,
      transparent 50%
    );
  box-shadow:
    0 0 0 12px rgba(168, 85, 247, 0.045),
    0 0 44px rgba(61, 220, 132, 0.14);
  animation: profz-camera-orbit 3.2s ease-in-out infinite;
}

@keyframes profz-camera-orbit {
  50% {
    transform: scale(1.06);
    box-shadow:
      0 0 0 17px rgba(168, 85, 247, 0.035),
      0 0 58px rgba(61, 220, 132, 0.2);
  }
}

#profz-camera-preview-placeholder strong {
  color: #fff;
  font-size: 17px;
}

#profz-camera-preview-placeholder span {
  max-width: 330px;
  font-size: 12px;
  line-height: 1.5;
}

#profz-camera-preview-status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 10px;
  border: 1px solid rgba(61, 220, 132, 0.24);
  border-radius: 999px;
  color: #d9ffe9;
  font-size: 10px;
  font-weight: 700;
  background: rgba(4, 10, 7, 0.72);
  backdrop-filter: blur(12px);
}

#profz-camera-join-mode {
  grid-area: modes;
  display: grid;
  gap: 10px;
  align-self: end;
}

#profz-camera-join-mode button {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 17px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition:
    transform 0.18s,
    border-color 0.18s,
    background 0.18s;
}

#profz-camera-join-mode button:hover {
  transform: translateY(-1px);
  border-color: rgba(168, 85, 247, 0.32);
}

#profz-camera-join-mode button[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(61, 220, 132, 0.52);
  background:
    linear-gradient(
      135deg,
      rgba(61, 220, 132, 0.16),
      rgba(168, 85, 247, 0.09)
    );
  box-shadow: 0 0 0 1px rgba(61, 220, 132, 0.08) inset;
}

#profz-camera-join-mode svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

#profz-camera-join-mode span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#profz-camera-join-mode strong {
  color: inherit;
  font-size: 13px;
}

#profz-camera-join-mode small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

#profz-camera-lobby-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  align-self: center;
}

#profz-camera-lobby-controls button {
  min-width: 0;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

#profz-camera-lobby-controls button:hover {
  border-color: rgba(61, 220, 132, 0.34);
  background: rgba(61, 220, 132, 0.09);
}

#profz-camera-lobby-controls button[aria-pressed="true"] {
  color: #ffdce2;
  border-color: rgba(255, 77, 103, 0.5);
  background: rgba(255, 77, 103, 0.14);
}

#profz-camera-lobby-controls span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profz-camera-lobby-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 10px;
  align-self: start;
}

#profz-camera-lobby-actions button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 750;
  cursor: pointer;
}

#profz-camera-lobby-cancel {
  border: 1px solid rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.05);
}

#profz-camera-lobby-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  color: #06110b;
  background:
    linear-gradient(
      135deg,
      var(--camera-green),
      #75f0aa
    );
  box-shadow: 0 12px 28px rgba(61, 220, 132, 0.2);
}

#profz-camera-lobby-enter:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 34px rgba(61, 220, 132, 0.28);
}

#profz-camera-lobby button:focus-visible {
  outline: 3px solid rgba(168, 85, 247, 0.34);
  outline-offset: 2px;
}

@media (max-width: 780px) {
  #profz-camera-lobby {
    align-items: start;
    padding:
      calc(12px + env(safe-area-inset-top, 0px))
      10px
      calc(12px + env(safe-area-inset-bottom, 0px));
  }

  #profz-camera-lobby-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "preview"
      "modes"
      "controls"
      "actions";
    gap: 13px;
    padding: 16px;
    border-radius: 22px;
  }

  #profz-camera-preview-frame,
  #profz-camera-preview {
    min-height: 230px;
  }

  #profz-camera-join-mode {
    grid-template-columns: 1fr 1fr;
  }

  #profz-camera-join-mode button {
    min-height: 92px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  #profz-camera-join-mode span {
    align-items: center;
  }
}

@media (max-width: 430px) {
  #profz-camera-lobby-title {
    font-size: 25px;
  }

  #profz-camera-lobby-header p {
    max-width: 250px;
  }

  #profz-camera-preview-frame,
  #profz-camera-preview {
    min-height: 205px;
  }

  #profz-camera-lobby-actions {
    grid-template-columns: 1fr;
  }

  #profz-camera-lobby-enter {
    grid-row: 1;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PROFZ STAGE — vrai chat IRC dans la vidéo
   ══════════════════════════════════════════════════════════════════ */

.profz-stage-chat-context {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -14px -14px 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(8, 12, 10, 0.92);
  backdrop-filter: blur(14px);
}

.profz-stage-chat-empty {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 12px;
  text-align: center;
}

.profz-stage-chat-line {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.profz-stage-chat-line.is-mine {
  border-color: rgba(61, 220, 132, 0.2);
  background: rgba(61, 220, 132, 0.08);
}

.profz-stage-chat-line.is-system {
  border-color: rgba(168, 85, 247, 0.14);
  background: rgba(168, 85, 247, 0.07);
}

.profz-stage-chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.profz-stage-chat-meta strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profz-stage-chat-meta span {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.profz-stage-chat-text,
.profz-stage-chat-system {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profz-stage-chat-system {
  color: rgba(255, 255, 255, 0.58);
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════
   ZMEDIA — carte rejoindre dans le chat
   ══════════════════════════════════════════════════════════════════ */

.zmedia-join-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid rgba(61, 220, 132, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(168, 85, 247, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(61, 220, 132, 0.08), rgba(8, 12, 10, 0.9));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.zmedia-join-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(61, 220, 132, 0.28);
  border-radius: 14px;
  background: rgba(61, 220, 132, 0.1);
  box-shadow: 0 0 24px rgba(61, 220, 132, 0.1);
}

.zmedia-join-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.zmedia-join-body strong {
  color: #fff;
  font-size: 13px;
}

.zmedia-join-body span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  line-height: 1.35;
}

.zmedia-join-action {
  padding: 8px 12px;
  border-radius: 999px;
  color: #06110b !important;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  background: var(--stage-green, #3ddc84);
}

@media (max-width: 520px) {
  .zmedia-join-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .zmedia-join-action {
    grid-column: 1 / -1;
    text-align: center;
  }
}


/* ══════════════════════════════════════════════════════════════════
   ZMEDIA TÉLÉPHONE — invitation vocale privée
   ══════════════════════════════════════════════════════════════════ */

#zmedia-phone-invite {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 420;
  width: min(520px, calc(100vw - 22px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(61, 220, 132, 0.3);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(168, 85, 247, 0.24), transparent 45%),
    linear-gradient(135deg, rgba(8, 13, 10, 0.98), rgba(2, 7, 5, 0.96));
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -16px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#zmedia-phone-invite.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.zmedia-phone-invite-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(61, 220, 132, 0.34);
  border-radius: 17px;
  background: rgba(61, 220, 132, 0.11);
  box-shadow: 0 0 30px rgba(61, 220, 132, 0.15);
  animation: zmedia-phone-ring 1.7s ease-in-out infinite;
}

@keyframes zmedia-phone-ring {
  0%,
  100% {
    transform: rotate(0);
  }

  12% {
    transform: rotate(-8deg);
  }

  24% {
    transform: rotate(7deg);
  }

  36% {
    transform: rotate(-4deg);
  }

  48% {
    transform: rotate(3deg);
  }
}

.zmedia-phone-invite-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.zmedia-phone-invite-body span {
  color: #3ddc84;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.zmedia-phone-invite-body strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zmedia-phone-invite-body small {
  color: rgba(255, 255, 255, 0.54);
  font-size: 11px;
}

.zmedia-phone-invite-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zmedia-phone-invite-actions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
}

.zmedia-phone-invite-actions [data-phone-accept] {
  border: 0;
  color: #06110b;
  background: #3ddc84;
  box-shadow: 0 10px 24px rgba(61, 220, 132, 0.22);
}

.zmedia-phone-invite-actions [data-phone-refuse] {
  border: 1px solid rgba(255, 77, 103, 0.36);
  color: #ffd9de;
  background: rgba(255, 77, 103, 0.12);
}

@media (max-width: 560px) {
  #zmedia-phone-invite {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .zmedia-phone-invite-actions {
    grid-column: 1 / -1;
  }

  .zmedia-phone-invite-actions button {
    flex: 1;
  }
}


.is-stream-self-preview {
  position: relative;
  overflow: hidden;
}

.is-stream-self-preview video {
  display: none !important;
}

.is-stream-self-preview::after {
  content: "▶ Tu partages ton écran\A Les autres voient ton stream";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  white-space: pre-line;
  font-weight: 800;
  font-size: clamp(1rem, 2vw, 1.5rem);
  letter-spacing: .02em;
  color: var(--z-text, #f8fafc);
  background:
    radial-gradient(circle at center, rgba(168, 85, 247, .18), transparent 55%),
    rgba(5, 8, 12, .88);
  pointer-events: none;
}

/* ZLINK — LA LIAISON VIVANTE */

#profz-stage[data-audio-only="true"] {
  background:
    radial-gradient(
      circle at 18% 15%,
      rgba(118, 62, 180, 0.24),
      transparent 38%
    ),
    radial-gradient(
      circle at 82% 78%,
      rgba(80, 210, 118, 0.16),
      transparent 36%
    ),
    #08070d;
}

#profz-stage[data-audio-only="true"] #profz-stage-main {
  display: grid;
  place-items: center;
  min-height: clamp(360px, 58vh, 620px);
  padding: clamp(18px, 4vw, 52px);
  overflow: hidden;
}

#profz-stage[data-audio-only="true"] #profz-stage-participants {
  display: none !important;
}

#profz-stage[data-audio-only="true"] #profz-stage-controls {
  justify-content: center;
  gap: 16px;
}

#profz-stage[data-audio-only="true"] #profz-stage-controls button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

#profz-stage[data-audio-only="true"] #profz-stage-leave {
  background: linear-gradient(145deg, #7d224c, #a42d52);
  border-color: rgba(255, 255, 255, 0.16);
  transform: rotate(135deg);
}

.zlink-call {
  width: min(820px, 100%);
  display: grid;
  gap: clamp(26px, 5vw, 52px);
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(177, 130, 255, 0.22);
  border-radius: 32px;
  background:
    linear-gradient(
      145deg,
      rgba(26, 20, 39, 0.92),
      rgba(9, 13, 14, 0.96)
    );
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  isolation: isolate;
}

.zlink-call::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 23px;
  border: 1px solid rgba(76, 216, 120, 0.08);
  pointer-events: none;
}

.zlink-brand {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.zlink-brand span {
  color: #c4a0ff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.42em;
  margin-left: 0.42em;
}

.zlink-brand small {
  color: rgba(230, 226, 239, 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.zlink-network {
  display: grid;
  grid-template-columns:
    minmax(105px, 1fr)
    minmax(120px, 2fr)
    minmax(105px, 1fr);
  align-items: center;
  gap: clamp(12px, 3vw, 30px);
}

.zlink-person {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
}

.zlink-person strong {
  width: 100%;
  color: #f4efff;
  font-size: clamp(0.88rem, 2.3vw, 1.08rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zlink-person small {
  color: rgba(222, 218, 232, 0.48);
  font-size: 0.72rem;
}

.zlink-core {
  width: clamp(82px, 13vw, 126px);
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
}

.zlink-avatar {
  width: 72%;
  height: 72%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f7f2ff;
  font-size: clamp(1.55rem, 5vw, 2.55rem);
  font-weight: 900;
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(255, 255, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(145deg, #7341aa, #322143);
  box-shadow:
    0 0 0 7px rgba(120, 69, 171, 0.12),
    0 14px 36px rgba(0, 0, 0, 0.34);
  z-index: 2;
}

.zlink-person-remote .zlink-avatar {
  background:
    radial-gradient(
      circle at 32% 24%,
      rgba(255, 255, 255, 0.18),
      transparent 34%
    ),
    linear-gradient(145deg, #23884e, #17442d);
  box-shadow:
    0 0 0 7px rgba(65, 205, 111, 0.11),
    0 14px 36px rgba(0, 0, 0, 0.34);
}

.zlink-ring {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(176, 116, 255, 0.36);
  border-radius: 50%;
  opacity: 0.55;
}

.zlink-person-remote .zlink-ring {
  border-color: rgba(68, 222, 115, 0.4);
}

.zlink-bridge {
  min-width: 0;
  height: 82px;
  display: grid;
  place-items: center;
  position: relative;
}

.zlink-wave {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zlink-wave::before,
.zlink-wave::after {
  content: "";
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      #854fc4,
      #4bd677
    );
  box-shadow:
    0 0 18px rgba(104, 214, 126, 0.38);
  background-size: 220% 100%;
}

.zlink-wave span {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #67df88;
  box-shadow: 0 0 12px rgba(102, 224, 136, 0.75);
}

.zlink-symbol {
  position: absolute;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 14px;
  color: #e8d7ff;
  font-size: 1.28rem;
  font-style: italic;
  background:
    linear-gradient(
      145deg,
      rgba(125, 72, 178, 0.96),
      rgba(40, 126, 70, 0.96)
    );
  box-shadow:
    0 0 0 7px rgba(9, 8, 14, 0.88),
    0 0 28px rgba(117, 205, 129, 0.26);
  transform: rotate(-8deg);
  z-index: 3;
}

.zlink-call-information {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.zlink-call-state {
  color: #d9cbeb;
  font-size: 0.88rem;
  letter-spacing: 0.035em;
}

.zlink-call-duration {
  color: #67df88;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.zlink-call.is-connecting .zlink-symbol,
.zlink-call.is-ringing .zlink-symbol,
.zlink-call.is-reconnecting .zlink-symbol {
  animation: zlink-search 1.5s ease-in-out infinite;
}

.zlink-call.is-connected .zlink-wave::before,
.zlink-call.is-connected .zlink-wave::after {
  animation: zlink-flow 2.1s linear infinite;
}

.zlink-call.is-connected .zlink-ring {
  animation: zlink-pulse 2.2s ease-out infinite;
}

.zlink-call.is-connected .zlink-person-remote .zlink-ring {
  animation-delay: 0.45s;
}

.zlink-call.is-local-muted .zlink-person-local {
  opacity: 0.52;
}

.zlink-call.is-local-muted .zlink-person-local .zlink-avatar {
  filter: grayscale(0.72);
}

@keyframes zlink-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

@keyframes zlink-pulse {
  0% {
    transform: scale(0.82);
    opacity: 0.74;
  }

  75%,
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

@keyframes zlink-search {
  0%,
  100% {
    transform: rotate(-8deg) scale(0.94);
    filter: brightness(0.86);
  }

  50% {
    transform: rotate(-8deg) scale(1.08);
    filter: brightness(1.25);
  }
}

@media (max-width: 640px) {
  #profz-stage[data-audio-only="true"] #profz-stage-main {
    min-height: 430px;
    padding: 14px;
  }

  .zlink-call {
    gap: 30px;
    padding: 30px 15px;
    border-radius: 25px;
  }

  .zlink-network {
    grid-template-columns:
      minmax(74px, 1fr)
      minmax(82px, 1.15fr)
      minmax(74px, 1fr);
    gap: 5px;
  }

  .zlink-bridge {
    height: 68px;
  }

  .zlink-wave {
    gap: 4px;
  }

  .zlink-symbol {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 1.05rem;
  }

  .zlink-person small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zlink-call *,
  .zlink-call *::before,
  .zlink-call *::after {
    animation: none !important;
  }
}

/* ZLINK — DÉTECTION VOCALE RÉELLE */

.zlink-person-local .zlink-core {
  transform: scale(var(--zlink-local-scale, 1));
  transition: transform 70ms linear;
}

.zlink-person-remote .zlink-core {
  transform: scale(var(--zlink-remote-scale, 1));
  transition: transform 70ms linear;
}

.zlink-person-local .zlink-ring {
  box-shadow:
    0 0 var(--zlink-local-glow, 0px)
    rgba(181, 111, 255, 0.85);
}

.zlink-person-remote .zlink-ring {
  box-shadow:
    0 0 var(--zlink-remote-glow, 0px)
    rgba(74, 231, 124, 0.85);
}

.zlink-call.is-local-speaking
.zlink-person-local .zlink-avatar {
  filter: brightness(1.22);
  box-shadow:
    0 0 0 7px rgba(143, 78, 211, 0.2),
    0 0 34px rgba(180, 101, 255, 0.48);
}

.zlink-call.is-remote-speaking
.zlink-person-remote .zlink-avatar {
  filter: brightness(1.22);
  box-shadow:
    0 0 0 7px rgba(70, 218, 116, 0.18),
    0 0 34px rgba(70, 231, 123, 0.48);
}

.zlink-call.is-connected.is-local-speaking
.zlink-wave::before,
.zlink-call.is-connected.is-local-speaking
.zlink-wave::after {
  animation-duration: 0.58s;
  animation-direction: normal;
  filter: brightness(1.4);
}

.zlink-call.is-connected.is-remote-speaking
.zlink-wave::before,
.zlink-call.is-connected.is-remote-speaking
.zlink-wave::after {
  animation-duration: 0.58s;
  animation-direction: reverse;
  filter: brightness(1.4);
}

.zlink-call.is-connected.is-duet
.zlink-wave::before {
  animation-direction: normal;
}

.zlink-call.is-connected.is-duet
.zlink-wave::after {
  animation-direction: reverse;
}

.zlink-call.is-local-speaking .zlink-symbol,
.zlink-call.is-remote-speaking .zlink-symbol {
  box-shadow:
    0 0 0 7px rgba(9, 8, 14, 0.88),
    0 0 36px rgba(114, 221, 135, 0.52);
}

.zlink-call.is-duet .zlink-symbol {
  animation: zlink-duet 0.55s ease-in-out infinite alternate;
}

@keyframes zlink-duet {
  from {
    transform: rotate(-8deg) scale(0.96);
  }

  to {
    transform: rotate(-8deg) scale(1.1);
  }
}

/* ZPORTAL — UNE FENÊTRE DANS TON MONDE */

#profz-stage[data-mode="stream"] {
  background:
    radial-gradient(
      circle at 14% 12%,
      rgba(138, 73, 205, 0.26),
      transparent 38%
    ),
    radial-gradient(
      circle at 88% 84%,
      rgba(55, 213, 111, 0.17),
      transparent 40%
    ),
    linear-gradient(145deg, #08060e, #050a08);
}

#profz-stage[data-mode="stream"] #profz-stage-main {
  display: grid;
  place-items: center;
  min-height: clamp(400px, 66vh, 760px);
  padding: clamp(12px, 2.4vw, 30px);
  overflow: auto;
}

#profz-stage[data-mode="stream"]
#profz-stage-participants {
  display: none !important;
}

#profz-stage[data-mode="stream"]
#profz-stage-controls {
  justify-content: center;
  gap: 18px;
}

#profz-stage[data-mode="stream"]
#profz-stage-controls button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

#profz-stage[data-mode="stream"]
#profz-stage-leave {
  background:
    linear-gradient(145deg, #7b2349, #a32d54);
  border-color: rgba(255, 255, 255, 0.15);
}

.zportal-shell {
  --zportal-purple: #a66aef;
  --zportal-green: #4ddd81;
  --zportal-energy: 0;

  width: min(1180px, 100%);
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2.3vw, 24px);
  border: 1px solid rgba(172, 112, 242, 0.2);
  border-radius: 30px;
  color: #f8f4ff;
  background:
    linear-gradient(
      145deg,
      rgba(29, 19, 43, 0.94),
      rgba(7, 14, 11, 0.97)
    );
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: zportal-shell-in 0.42s ease-out;
}

.zportal-heading,
.zportal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.zportal-brand {
  display: grid;
  gap: 3px;
}

.zportal-brand span {
  color: #caa4ff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.38em;
}

.zportal-brand small,
.zportal-state small,
.zportal-audience > small {
  color: rgba(232, 226, 240, 0.52);
  font-size: 0.72rem;
}

.zportal-live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(241, 237, 247, 0.66);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.zportal-live i,
.zportal-joined-indicator i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zportal-green);
  box-shadow:
    0 0 14px rgba(77, 221, 129, 0.82);
}

.zportal-shell.is-opening .zportal-live i {
  animation: zportal-live-search 1s ease-in-out infinite;
}

.zportal-frame {
  position: relative;
  overflow: hidden;
  padding: 8px;
  border-radius: 24px;
  background:
    linear-gradient(
      110deg,
      rgba(169, 101, 239, 0.88),
      rgba(66, 225, 123, 0.82),
      rgba(169, 101, 239, 0.88)
    );
  background-size: 240% 100%;
  box-shadow:
    0 0 38px rgba(143, 83, 210, 0.22),
    0 0 54px rgba(65, 220, 119, 0.1);
  animation: zportal-border-flow 5s linear infinite;
}

.zportal-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 21px;
  background: #050707;
  pointer-events: none;
}

.zportal-edge {
  position: absolute;
  right: 12%;
  left: 12%;
  z-index: 4;
  height: 2px;
  border-radius: 999px;
  opacity: calc(0.18 + var(--zportal-energy));
  background:
    linear-gradient(
      90deg,
      transparent,
      var(--zportal-purple),
      var(--zportal-green),
      transparent
    );
  box-shadow:
    0 0 24px rgba(79, 223, 128, 0.62);
  pointer-events: none;
}

.zportal-edge-top {
  top: 5px;
}

.zportal-edge-bottom {
  bottom: 5px;
}

.zportal-lock {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 6;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  color: #ecddff;
  font-size: 1rem;
  font-style: italic;
  background:
    linear-gradient(145deg, #7443a7, #276b42);
  box-shadow:
    0 0 0 5px rgba(4, 7, 6, 0.76),
    0 0 28px rgba(94, 215, 125, 0.28);
  transform: rotate(-7deg);
}

.zportal-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 17px;
  background:
    radial-gradient(
      circle at center,
      rgba(140, 75, 205, 0.16),
      transparent 48%
    ),
    #020403;
}

.zportal-viewport > .profz-participant {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: 100%;
  display: flex;
  border: 0;
  border-radius: 17px;
  background: #000;
  cursor: default;
}

.zportal-viewport
.profz-participant-information {
  display: none;
}

.zportal-viewport
.profz-participant video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

.zportal-viewport
.profz-participant-fallback {
  min-height: 100%;
}

.zportal-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  background:
    radial-gradient(
      circle,
      rgba(163, 94, 226, 0.18),
      transparent 42%
    );
}

.zportal-placeholder[hidden] {
  display: none;
}

.zportal-placeholder span {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(85, 224, 132, 0.4);
  border-radius: 24px;
  color: #e7d4ff;
  font-size: 2rem;
  font-weight: 900;
  font-style: italic;
  background:
    linear-gradient(
      145deg,
      rgba(128, 72, 177, 0.7),
      rgba(35, 98, 59, 0.7)
    );
  animation: zportal-search 1.35s ease-in-out infinite;
}

.zportal-placeholder strong {
  font-size: clamp(1rem, 2.4vw, 1.35rem);
}

.zportal-placeholder small {
  color: rgba(235, 230, 240, 0.5);
}

.zportal-equalizer {
  position: absolute;
  right: 50%;
  bottom: 18px;
  z-index: 7;
  height: 32px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  opacity: 0.32;
  background: rgba(4, 8, 6, 0.68);
  backdrop-filter: blur(10px);
  transform: translateX(50%);
  transition: opacity 0.25s;
  pointer-events: none;
}

.zportal-shell.has-shared-audio
.zportal-equalizer {
  opacity: 0.82;
}

.zportal-shell.has-audio-energy
.zportal-equalizer {
  opacity: 1;
  box-shadow:
    0 0 24px rgba(72, 223, 126, 0.22);
}

.zportal-equalizer span {
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background:
    linear-gradient(
      to top,
      var(--zportal-purple),
      var(--zportal-green)
    );
  transform: scaleY(0.14);
  transform-origin: bottom;
  transition: transform 55ms linear;
}

.zportal-footer {
  min-width: 0;
}

.zportal-broadcaster {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.zportal-host-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid rgba(182, 119, 245, 0.38);
  border-radius: 14px;
  color: #f6edff;
  font-weight: 900;
  background:
    linear-gradient(145deg, #70409e, #245c3a);
}

.zportal-broadcaster > div,
.zportal-state {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.zportal-broadcaster small {
  color: rgba(232, 226, 240, 0.46);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.zportal-host-nick {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zportal-state {
  justify-items: center;
  text-align: center;
}

.zportal-state strong {
  color: #e8dcf6;
  font-size: 0.84rem;
}

.zportal-audience {
  min-width: 150px;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.zportal-orbits {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.zportal-viewer-core {
  display: grid;
  justify-items: center;
  gap: 3px;
  animation: zportal-viewer-arrive 0.32s ease-out;
}

.zportal-viewer-core b {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 221, 129, 0.34);
  border-radius: 50%;
  color: #f3fff7;
  font-size: 0.75rem;
  background:
    linear-gradient(145deg, #2f7549, #352243);
  box-shadow:
    0 0 15px rgba(77, 221, 129, 0.12);
}

.zportal-viewer-core small {
  max-width: 58px;
  overflow: hidden;
  color: rgba(237, 232, 243, 0.62);
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zportal-joined-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #dcefe1;
  font-size: 0.72rem;
}

.zportal-shell.is-active
.zportal-lock {
  animation:
    zportal-lock-pulse 2.8s ease-in-out infinite;
}

.zportal-shell.has-audio-energy
.zportal-frame {
  box-shadow:
    0 0 44px rgba(143, 83, 210, 0.3),
    0 0 calc(28px + 42px * var(--zportal-energy))
      rgba(65, 220, 119, 0.25);
}

.zportal-shell
.is-stream-self-preview::after {
  border-radius: 17px;
  background:
    radial-gradient(
      circle at center,
      rgba(154, 87, 224, 0.2),
      transparent 52%
    ),
    rgba(3, 7, 5, 0.93);
}

@keyframes zportal-shell-in {
  from {
    opacity: 0;
    transform: scaleY(0.08) scaleX(0.72);
    filter: brightness(1.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes zportal-border-flow {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 240% 50%;
  }
}

@keyframes zportal-search {
  0%,
  100% {
    transform: scale(0.92) rotate(-7deg);
    opacity: 0.58;
  }

  50% {
    transform: scale(1.07) rotate(-7deg);
    opacity: 1;
  }
}

@keyframes zportal-live-search {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes zportal-lock-pulse {
  0%,
  100% {
    filter: brightness(0.88);
  }

  50% {
    filter: brightness(1.25);
  }
}

@keyframes zportal-viewer-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.75);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  #profz-stage[data-mode="stream"]
  #profz-stage-main {
    min-height: 420px;
    padding: 8px;
  }

  .zportal-shell {
    gap: 12px;
    padding: 11px;
    border-radius: 22px;
  }

  .zportal-heading {
    padding: 2px 4px;
  }

  .zportal-brand small {
    display: none;
  }

  .zportal-frame {
    padding: 5px;
    border-radius: 18px;
  }

  .zportal-frame::before,
  .zportal-viewport {
    border-radius: 14px;
  }

  .zportal-lock {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.8rem;
  }

  .zportal-equalizer {
    bottom: 10px;
    height: 26px;
    padding: 5px 8px;
  }

  .zportal-footer {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      auto;
    gap: 10px;
  }

  .zportal-state {
    display: none;
  }

  .zportal-audience {
    min-width: 0;
  }

  .zportal-viewer-core small {
    display: none;
  }

  .zportal-host-nick {
    max-width: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zportal-shell,
  .zportal-shell *,
  .zportal-shell *::before,
  .zportal-shell *::after {
    animation: none !important;
  }
}

/* ZMEDIA INTRO — identité officielle mauve et verte */
#zmedia-intro[hidden] {
  display: none !important;
}

#zmedia-intro {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  color: #f7f4ff;
  background:
    radial-gradient(
      circle at 28% 38%,
      rgba(168, 85, 247, 0.22),
      transparent 38%
    ),
    radial-gradient(
      circle at 72% 62%,
      rgba(61, 220, 132, 0.18),
      transparent 42%
    ),
    linear-gradient(
      145deg,
      #030405 0%,
      #08050d 48%,
      #030807 100%
    );
  isolation: isolate;
  animation: zmediaIntroReveal 360ms ease-out both;
}

#zmedia-intro::before,
#zmedia-intro::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.5;
}

#zmedia-intro::before {
  width: min(54vw, 520px);
  height: min(54vw, 520px);
  top: -22%;
  left: -12%;
  background: rgba(168, 85, 247, 0.28);
}

#zmedia-intro::after {
  width: min(48vw, 460px);
  height: min(48vw, 460px);
  right: -10%;
  bottom: -24%;
  background: rgba(61, 220, 132, 0.24);
}

.zmedia-intro-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: zmediaIntroShell 520ms cubic-bezier(.2,.75,.25,1) both;
}

.zmedia-intro-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 0.88;
  letter-spacing: -0.06em;
  filter:
    drop-shadow(0 0 14px rgba(168, 85, 247, 0.38))
    drop-shadow(0 0 18px rgba(61, 220, 132, 0.24));
}

.zmedia-intro-z {
  font-size: clamp(72px, 15vw, 142px);
  font-weight: 1000;
  font-style: italic;
  color: #b84dff;
  text-shadow:
    0 0 12px rgba(184, 77, 255, 0.7),
    0 0 36px rgba(168, 85, 247, 0.4);
  transform: skewX(-8deg);
}

.zmedia-intro-media {
  margin-top: 15px;
  font-size: clamp(35px, 7vw, 68px);
  font-weight: 950;
  font-style: italic;
  color: #39ff9a;
  text-shadow:
    0 0 10px rgba(57, 255, 154, 0.7),
    0 0 30px rgba(61, 220, 132, 0.35);
}

#zmedia-intro-mode {
  margin-top: 30px;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
}

#zmedia-intro-host {
  margin-top: 9px;
  font-size: clamp(14px, 2.4vw, 18px);
  color: rgba(255, 255, 255, 0.76);
}

#zmedia-intro-status {
  margin-top: 20px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
}

.zmedia-intro-dots {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.zmedia-intro-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b84dff;
  box-shadow: 0 0 12px currentColor;
  animation: zmediaIntroDot 900ms ease-in-out infinite;
}

.zmedia-intro-dots span:nth-child(2) {
  animation-delay: 130ms;
}

.zmedia-intro-dots span:nth-child(3) {
  color: #39ff9a;
  background: #39ff9a;
  animation-delay: 260ms;
}

#zmedia-intro.is-leaving {
  animation: zmediaIntroLeave 300ms ease-in forwards;
}

@keyframes zmediaIntroReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes zmediaIntroShell {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes zmediaIntroDot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.72);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes zmediaIntroLeave {
  to {
    opacity: 0;
    transform: scale(1.015);
  }
}

@media (max-width: 640px) {
  #zmedia-intro {
    padding: 18px;
  }

  .zmedia-intro-brand {
    letter-spacing: -0.08em;
  }

  #zmedia-intro-mode {
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #zmedia-intro,
  .zmedia-intro-shell,
  .zmedia-intro-dots span {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* ZMEDIA INTRO — profondeur mauve et verte vers le spectateur */
#zmedia-intro {
  background-size:
    118% 118%,
    118% 118%,
    100% 100%;
  animation:
    zmediaIntroReveal 360ms ease-out both,
    zmediaIntroBackgroundApproach 2200ms ease-out both;
}

#zmedia-intro::before {
  will-change: transform, opacity;
  animation:
    zmediaIntroDepthPurple 2200ms
    cubic-bezier(.16, .75, .24, 1) both;
}

#zmedia-intro::after {
  will-change: transform, opacity;
  animation:
    zmediaIntroDepthGreen 2200ms
    cubic-bezier(.16, .75, .24, 1) both;
}

.zmedia-intro-brand {
  will-change: transform;
  animation:
    zmediaIntroBrandApproach 2200ms
    cubic-bezier(.16, .75, .24, 1) both;
}

@keyframes zmediaIntroBackgroundApproach {
  from {
    background-size:
      86% 86%,
      88% 88%,
      100% 100%;
  }

  to {
    background-size:
      142% 142%,
      148% 148%,
      100% 100%;
  }
}

@keyframes zmediaIntroDepthPurple {
  from {
    opacity: 0.12;
    transform:
      translate3d(-12%, -10%, 0)
      scale(0.58);
  }

  55% {
    opacity: 0.56;
  }

  to {
    opacity: 0.22;
    transform:
      translate3d(8%, 8%, 0)
      scale(1.65);
  }
}

@keyframes zmediaIntroDepthGreen {
  from {
    opacity: 0.1;
    transform:
      translate3d(14%, 12%, 0)
      scale(0.56);
  }

  55% {
    opacity: 0.5;
  }

  to {
    opacity: 0.2;
    transform:
      translate3d(-7%, -8%, 0)
      scale(1.58);
  }
}

@keyframes zmediaIntroBrandApproach {
  from {
    opacity: 0;
    transform: scale(0.82) translateZ(0);
  }

  48% {
    opacity: 1;
  }

  to {
    opacity: 1;
    transform: scale(1.035) translateZ(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #zmedia-intro,
  #zmedia-intro::before,
  #zmedia-intro::after,
  .zmedia-intro-brand {
    animation-duration: 1ms !important;
  }
}


/* MOBILE CAMERA PRINCIPALE SANS CADRE */
@media (max-width: 720px) {
  #profz-stage[data-mode="camera"]
  .profz-participant.is-featured {
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #profz-stage[data-mode="camera"]
  .profz-participant.is-featured
  .profz-participant-information {
    display: none;
  }

  #profz-stage[data-mode="camera"]
  .profz-participant.is-featured.is-host::after {
    content: "👑";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(8px);
  }
}


/* MOBILE CAMERA SANS ENTETE */
@media (max-width: 720px) {
  #profz-stage[data-mode="camera"]
  #profz-stage-header {
    display: none !important;
  }
}


/* MOBILE STAGE CAMERA REEL */
@media (max-width: 720px) {
  /*
   * La caméra réelle n'utilise pas forcément data-mode="camera".
   * Elle se distingue du vocal et du stream par audio-only=false
   * et par l'absence du mode stream.
   */
  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-header {
    display: none !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  .profz-participant.is-featured {
    inset: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  .profz-participant.is-featured
  .profz-participant-information {
    display: none !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  .profz-participant.is-featured.is-host::after {
    content: "👑";
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 17px;
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.32);
  }
}


/* INTRO CAMERA SANS BOUTON FLIP */
#profz-camera-lobby-flip {
  display: none !important;
}


/* LOBBY CAMERA COMPACT SANS DOUBLON */

/* Les deux gros boutons choisissent déjà vidéo ou vocal. */
#profz-camera-lobby-camera {
  display: none !important;
}

/*
 * Le micro reste disponible comme réglage indépendant,
 * mais prend une seule ligne compacte.
 */
#profz-camera-lobby-controls {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

#profz-camera-lobby-mic {
  width: 100% !important;
  min-height: 58px !important;
  padding: 10px 16px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  border-radius: 16px !important;
}

#profz-camera-lobby-mic svg {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 auto !important;
}

/* État coupé : visible sans agrandir le contrôle. */
#profz-camera-lobby-mic[aria-pressed="true"] {
  border-color: rgba(255, 77, 103, 0.55) !important;
  background:
    linear-gradient(
      135deg,
      rgba(255, 77, 103, 0.16),
      rgba(20, 23, 21, 0.94)
    ) !important;
}


/* CHAT STAGE — COMPOSITEUR PHOTO COMPACT */

#profz-stage-chat-form {
  display: grid !important;
  grid-template-columns:
    44px
    minmax(0, 1fr)
    44px !important;
  align-items: center !important;
  gap: 8px !important;
  padding:
    10px
    10px
    max(10px, env(safe-area-inset-bottom))
    !important;
  border-top:
    1px solid rgba(255, 255, 255, 0.09)
    !important;
  background:
    linear-gradient(
      180deg,
      rgba(10, 14, 12, 0.92),
      rgba(5, 8, 7, 0.98)
    ) !important;
  backdrop-filter: blur(18px);
}

#profz-stage-chat-input {
  width: 100% !important;
  height: 44px !important;
  min-width: 0 !important;
  padding: 0 16px !important;
  border:
    1px solid rgba(255, 255, 255, 0.13)
    !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-size: 14px !important;
  background:
    rgba(255, 255, 255, 0.075)
    !important;
  box-shadow:
    inset 0 1px 0
    rgba(255, 255, 255, 0.04);
}

#profz-stage-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

#profz-stage-chat-input:focus {
  border-color:
    rgba(168, 85, 247, 0.72)
    !important;
  box-shadow:
    0 0 0 3px
    rgba(168, 85, 247, 0.13)
    !important;
}

#profz-stage-chat-attach,
#profz-stage-chat-send {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  font-size: 18px !important;
  cursor: pointer;
}

#profz-stage-chat-attach {
  border:
    1px solid rgba(168, 85, 247, 0.3)
    !important;
  color: #fff !important;
  background:
    rgba(168, 85, 247, 0.14)
    !important;
}

#profz-stage-chat-send {
  border:
    1px solid rgba(61, 220, 132, 0.34)
    !important;
  color: #06110b !important;
  background:
    var(--stage-green, #3ddc84)
    !important;
  box-shadow:
    0 6px 18px
    rgba(61, 220, 132, 0.2);
}

#profz-stage-chat-attach:active,
#profz-stage-chat-send:active {
  transform: scale(0.94);
}

@media (max-width: 720px) {
  #profz-stage-chat {
    height: min(64dvh, 560px) !important;
    max-height:
      calc(
        100dvh
        - 76px
        - env(safe-area-inset-top)
      );
    overflow: hidden;
    background:
      linear-gradient(
        180deg,
        rgba(14, 18, 16, 0.94),
        rgba(5, 8, 7, 0.99)
      ) !important;
  }

  #profz-stage-chat::before {
    content: "";
    width: 42px;
    height: 4px;
    margin: 8px auto 2px;
    flex: 0 0 auto;
    border-radius: 999px;
    background:
      rgba(255, 255, 255, 0.22);
  }

  #profz-stage-chat-messages {
    padding:
      10px
      12px
      12px !important;
  }
}

/* WEB CAMERA SANS ENTETE NI CADRE */

#profz-stage[data-audio-only="false"]:not([data-mode="stream"])
#profz-stage-header,
#profz-stage[data-mode="camera"]
#profz-stage-header {
  display: none !important;
}

#profz-stage[data-audio-only="false"]:not([data-mode="stream"])
.profz-participant.is-featured,
#profz-stage[data-mode="camera"]
.profz-participant.is-featured {
  inset: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#profz-stage[data-audio-only="false"]:not([data-mode="stream"])
.profz-participant.is-featured
.profz-participant-information,
#profz-stage[data-mode="camera"]
.profz-participant.is-featured
.profz-participant-information {
  display: none !important;
}

#profz-stage[data-audio-only="false"]:not([data-mode="stream"])
.profz-participant.is-featured.is-host::after,
#profz-stage[data-mode="camera"]
.profz-participant.is-featured.is-host::after {
  content: "👑";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  display: flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.32);
}

/* MOBILE CAMERA CHAT FLOTTANT TRANSPARENT */
@media (max-width: 720px) {
  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-chat {
    height: clamp(180px, 40dvh, 340px) !important;
    max-height: clamp(180px, 40dvh, 340px) !important;
    border: 0 !important;
    border-radius: 0 !important;
    background:
      linear-gradient(
        180deg,
        rgba(5, 8, 7, 0.04) 0%,
        rgba(5, 8, 7, 0.38) 28%,
        rgba(5, 8, 7, 0.82) 72%,
        rgba(5, 8, 7, 0.94) 100%
      ) !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-chat:focus-within {
    height: clamp(150px, 32dvh, 260px) !important;
    max-height: clamp(150px, 32dvh, 260px) !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-chat::before {
    display: none !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-chat-messages {
    padding: 12px 10px 6px !important;
    background: transparent !important;
  }

  #profz-stage[data-audio-only="false"]:not([data-mode="stream"])
  #profz-stage-chat-form {
    background: rgba(5, 8, 7, 0.72) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}
