/* P16-r1-r19 — clean Mobilsesli call layer: lifecycle, timer and self-view framing */
#privateCallLayer{position:fixed;inset:0;z-index:14000;pointer-events:none;font-family:inherit}
#privateCallLayer[hidden]{display:none!important}
#privateCallLayer .private-call{position:absolute;inset:0;pointer-events:auto;box-sizing:border-box}
#privateCallLayer button{font:inherit}
#privateCallLayer .ref-avatar{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
#privateCallLayer .call-ref-avatar-stage{position:relative;width:184px;height:184px;display:flex;align-items:center;justify-content:center;margin-inline:auto}
#privateCallLayer .call-ref-avatar{position:relative;width:104px;height:104px;border-radius:50%;overflow:hidden;box-shadow:0 20px 45px rgba(0,0,0,.35);outline:2px solid rgba(255,255,255,.1);z-index:3}
#privateCallLayer .call-ref-pulse{position:absolute;border-radius:50%;background:rgba(255,255,255,.055);animation:tc-call-ping 2.2s cubic-bezier(0,0,.2,1) infinite}
#privateCallLayer .call-ref-pulse.one{width:168px;height:168px}
#privateCallLayer .call-ref-pulse.two{width:136px;height:136px;animation-delay:.7s;background:rgba(255,255,255,.075)}
#privateCallLayer .call-ref-dashed{position:absolute;width:176px;height:176px;border-radius:50%;border:1px dashed rgba(255,255,255,.17);animation:tc-call-spin 14s linear infinite}
@keyframes tc-call-ping{75%,100%{transform:scale(1.16);opacity:0}}
@keyframes tc-call-spin{to{transform:rotate(360deg)}}

/* incoming reference card */
#privateCallLayer .call-ref-incoming{display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(12,15,21,.52);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}
#privateCallLayer .call-ref-incoming-card{width:min(300px,calc(100vw - 32px));border-radius:24px;background:#2b2f36;color:#fff;padding:28px 24px 24px;box-shadow:0 28px 90px rgba(0,0,0,.42);border:1px solid rgba(255,255,255,.06);text-align:center}
#privateCallLayer .call-ref-incoming .call-ref-avatar-stage{width:164px;height:164px;margin-bottom:4px}
#privateCallLayer .call-ref-incoming .call-ref-pulse.one{width:144px;height:144px;animation-duration:1.8s}
#privateCallLayer .call-ref-incoming .call-ref-pulse.two{width:120px;height:120px;animation-duration:1.8s;animation-delay:.6s}
#privateCallLayer .call-ref-incoming .call-ref-dashed{width:152px;height:152px}
#privateCallLayer .call-ref-type-pill{position:relative;z-index:5;margin:-20px auto 12px;width:max-content;display:flex;align-items:center;gap:4px;background:#fff;color:#3b82f6;padding:4px 10px;border-radius:999px;box-shadow:0 5px 18px rgba(0,0,0,.22);font-size:11px;font-weight:700}
#privateCallLayer .call-ref-type-pill .material-symbols-outlined{font-size:14px}
#privateCallLayer .call-ref-incoming h3{font-size:20px;line-height:1.2;margin:0;font-weight:750;color:#fff}
#privateCallLayer .call-ref-incoming p{font-size:14px;color:rgba(255,255,255,.52);margin:5px 0 24px}
#privateCallLayer .call-ref-incoming .private-call-controls{display:flex;justify-content:center;gap:40px}

/* shared controls */
#privateCallLayer .call-ref-control-wrap{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:58px;color:rgba(255,255,255,.62);font-size:10px}
#privateCallLayer .call-ref-control{width:48px;height:48px;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.1);color:#fff;cursor:pointer;transition:transform .15s,background .15s,opacity .15s;box-shadow:none}
#privateCallLayer .call-ref-control:hover{transform:scale(1.06);background:rgba(255,255,255,.2)}
#privateCallLayer .call-ref-control:disabled{opacity:.45;cursor:default;transform:none}
#privateCallLayer .call-ref-control .material-symbols-outlined{font-size:22px}
#privateCallLayer .call-ref-control.end{width:56px;height:56px;background:#ef4444;box-shadow:0 10px 24px rgba(239,68,68,.28)}
#privateCallLayer .call-ref-control.end:hover{background:#dc2626}
#privateCallLayer .call-ref-control.accept{width:56px;height:56px;background:#22c55e;box-shadow:0 10px 24px rgba(34,197,94,.28);animation:tc-call-accept 1.6s ease-in-out infinite}
@keyframes tc-call-accept{50%{transform:scale(1.07)}}
#privateCallLayer .call-ref-control.off{background:#fff;color:#222}
#privateCallLayer .call-ref-control.speaker-on{background:#fff;color:#222}

/* voice screen */
#privateCallLayer .call-ref-voice{background:#2b2f36;color:#fff;display:flex;flex-direction:column}
#privateCallLayer .call-ref-voice-top{height:42px;flex:0 0 42px;display:flex;align-items:center;gap:8px;padding:0 16px;color:rgba(255,255,255,.7);font-size:12px}
#privateCallLayer .call-ref-state-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#22c55e;animation:tc-call-dot 1.4s ease-in-out infinite}
@keyframes tc-call-dot{50%{opacity:.45}}
#privateCallLayer .call-ref-voice-main{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px}
#privateCallLayer .call-ref-voice .private-call-person{text-align:center}
#privateCallLayer .call-ref-voice h3{margin:8px 0 0;font-size:20px;line-height:1.2;color:#fff;font-weight:750}
#privateCallLayer .call-ref-voice .private-call-person p{margin:3px 0 0;color:rgba(255,255,255,.5);font-size:14px}
#privateCallLayer .call-ref-voice>.private-call-controls{flex:0 0 auto;padding:8px 20px 18px;display:flex;align-items:flex-end;justify-content:center;gap:24px;flex-wrap:wrap}
#privateCallLayer .call-ref-end-separate{margin-left:12px}

/* upgrade request */
#privateCallLayer .call-ref-upgrade:empty{display:none}
#privateCallLayer .call-ref-video-request{margin:0 16px 8px;padding:12px;border-radius:12px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.15);display:flex;align-items:center;gap:10px;color:#fff}
#privateCallLayer .call-ref-video-request>.material-symbols-outlined{font-size:22px}
#privateCallLayer .call-ref-video-request>span:nth-child(2){display:flex;flex:1;min-width:0;flex-direction:column;text-align:left}
#privateCallLayer .call-ref-video-request b{font-size:12px;font-weight:650}
#privateCallLayer .call-ref-video-request small{font-size:11px;color:rgba(255,255,255,.5);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#privateCallLayer .call-ref-video-request button{border:0;border-radius:8px;padding:7px 12px;background:rgba(255,255,255,.1);color:#fff;font-size:12px;cursor:pointer}
#privateCallLayer .call-ref-video-request button.accept{background:#22c55e}

/* video screen */
#privateCallLayer .call-ref-video{background:#111827;color:#fff;overflow:hidden}
#privateCallLayer .private-call-media-host,#privateCallLayer .private-call-media{position:absolute;inset:0;overflow:hidden;pointer-events:none}
#privateCallLayer .call-remote-video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:2}
#privateCallLayer .call-remote-audio{display:none}
#privateCallLayer .call-local-preview{position:absolute;top:16px;right:16px;left:auto;width:192px;height:108px;aspect-ratio:16/9;background:#000;border-radius:12px;border:2px solid rgba(255,255,255,.20);box-shadow:0 18px 42px rgba(0,0,0,.42);cursor:move;z-index:8;touch-action:none;user-select:none;overflow:hidden;pointer-events:auto}
#privateCallLayer .call-local-video{width:100%;height:100%;object-fit:cover;object-position:center center;background:#000;display:block;transform:scaleX(-1);pointer-events:none}
#privateCallLayer .call-local-video[data-facing="environment"]{transform:none;object-position:center center}
#privateCallLayer .call-local-flip{position:absolute;right:7px;bottom:7px;width:34px;height:34px;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(17,24,39,.74);color:#fff;box-shadow:0 4px 14px rgba(0,0,0,.32);backdrop-filter:blur(7px);cursor:pointer;pointer-events:auto}
#privateCallLayer .call-local-flip .material-symbols-outlined{font-size:20px}
#privateCallLayer .call-ref-video-fallback{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:linear-gradient(135deg,#1f2937,#111827)}
#privateCallLayer .call-ref-video-fallback[hidden]{display:none}
#privateCallLayer .call-ref-video-fallback h3{font-size:24px;margin:8px 0 2px;color:#fff}
#privateCallLayer .call-ref-video-fallback p{font-size:14px;color:rgba(255,255,255,.5);margin:0}
#privateCallLayer .call-ref-video-top{position:absolute;z-index:10;left:0;right:0;top:0;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;background:linear-gradient(to bottom,rgba(0,0,0,.62),transparent)}
#privateCallLayer .call-ref-video-top>span{display:flex;align-items:center;gap:8px;color:rgba(255,255,255,.82);font-size:12px}
#privateCallLayer .call-ref-video-top button{width:36px;height:36px;border-radius:50%;border:0;background:rgba(255,255,255,.12);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
#privateCallLayer .call-ref-video>.call-ref-upgrade{position:absolute;z-index:11;left:0;right:0;bottom:104px}
#privateCallLayer .call-ref-video>.private-call-controls{position:absolute;z-index:10;left:0;right:0;bottom:0;padding:30px 18px 20px;background:linear-gradient(to top,rgba(0,0,0,.82),transparent);display:flex;align-items:flex-end;justify-content:center;gap:28px}

@media(max-width:767px){
 #privateCallLayer{z-index:14000}
 #privateCallLayer .call-ref-incoming{padding:14px}
 #privateCallLayer .call-ref-incoming-card{width:min(300px,calc(100vw - 28px));padding:24px 18px 20px}
 #privateCallLayer .call-ref-voice>.private-call-controls{gap:14px;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 #privateCallLayer .call-ref-control-wrap{min-width:52px}
 #privateCallLayer .call-ref-end-separate{margin-left:0}
 #privateCallLayer .call-local-preview{width:128px;height:72px;aspect-ratio:16/9;top:16px;right:16px;border-radius:12px}
 #privateCallLayer .call-local-flip{width:32px;height:32px;right:6px;bottom:6px}
 #privateCallLayer .call-ref-video>.private-call-controls{gap:14px;padding-inline:10px;padding-bottom:max(18px,env(safe-area-inset-bottom))}
 #privateCallLayer .call-ref-video-request{margin-inline:10px;gap:7px;padding:10px}
 #privateCallLayer .call-ref-video-request button{padding:6px 9px}
}


/* Mobilsesli desktop call screen lives inside the 380x520 private-chat popup.
   Our standalone call layer mirrors that reference footprint and centers it. */
@media(min-width:768px){
 #privateCallLayer[data-layout="voice"],
 #privateCallLayer[data-layout="video"]{
  inset:auto;
  left:50%;
  top:50%;
  width:380px;
  height:520px;
  transform:translate(-50%,-50%);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,.34);
 }
 #privateCallLayer[data-layout="incoming"]{
  inset:0;
  left:0;
  top:0;
  width:auto;
  height:auto;
  transform:none;
  border-radius:0;
  overflow:visible;
  box-shadow:none;
 }
}
@media(max-width:767px){
 #privateCallLayer[data-layout="voice"],
 #privateCallLayer[data-layout="video"],
 #privateCallLayer[data-layout="incoming"]{
  inset:0;
  left:0;
  top:0;
  width:auto;
  height:auto;
  transform:none;
  border-radius:0;
  overflow:hidden;
  box-shadow:none;
 }
}

/* P16-r1-r21 — final self-view polish.
   The holder already matches the decoded camera aspect ratio (r20). A tiny
   two-pixel overscan removes fractional-pixel black seams without changing
   the camera field of view in a noticeable way. On mobile the fullscreen
   button is hidden because it sits over the compact self-view card. */
#privateCallLayer .call-local-preview{background:#111827}
#privateCallLayer .call-local-video{
 position:absolute;
 left:-2px;
 top:-2px;
 width:calc(100% + 4px);
 height:calc(100% + 4px);
 max-width:none;
 max-height:none;
}
@media(max-width:767px){
 #privateCallLayer .call-ref-video-top button[data-call-action="fullscreen"]{display:none!important}
}
