/* ============================================================
   RoomChat — başlık yanı "Kameramı Aç" + canlı kamera şeridi
   ============================================================ */

.topCamBtn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(79,140,255,.18), rgba(123,92,255,.14));
  border: 1px solid rgba(79,140,255,.46);
  color: #9dc0ff;
  font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
.topCamBtn::after {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 42%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation: topSheen 3.8s ease-in-out infinite;
}
@keyframes topSheen { 0% { left: -60%; } 55% { left: 125%; } 100% { left: 125%; } }
.topCamBtn:hover {
  border-color: rgba(79,140,255,.85);
  box-shadow: 0 0 0 4px rgba(79,140,255,.13);
}
.topCamBtn:active { transform: scale(.98); }
.topCamBtn.on {
  background: rgba(47,208,122,.14);
  border-color: rgba(47,208,122,.5);
  color: #7ee8b0;
}
.topCam-ico { font-size: 15px; }

/* ---- kamerası açık olanlar ---- */
.liveCamStrip {
  display: flex; align-items: center; gap: 7px;
  margin-left: 4px;
  overflow-x: auto;
  max-width: 46vw;
  scrollbar-width: none;
  flex: 0 1 auto;
}
.liveCamStrip::-webkit-scrollbar { display: none; }
.liveCamStrip:empty { display: none; }

.liveCamChip {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 6px;
  border-radius: 20px;
  background: rgba(255,59,92,.1);
  border: 1px solid rgba(255,59,92,.4);
  flex: 0 0 auto;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.liveCamChip:hover {
  background: rgba(255,59,92,.2);
  border-color: rgba(255,59,92,.7);
  transform: translateY(-1px);
}
.liveCamChip.mine {
  background: rgba(47,208,122,.12);
  border-color: rgba(47,208,122,.5);
}
.liveCamChip.mine:hover { background: rgba(47,208,122,.22); }

.liveCamDot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  animation: pulse 1.5s infinite;
  flex: 0 0 auto;
}
.liveCamChip.mine .liveCamDot { background: var(--ok); }

.liveCamThumb {
  position: relative;
  width: 34px; height: 22px;
  border-radius: 6px;
  overflow: hidden;
  background: #05070c;
  border: 1px solid rgba(255,255,255,.16);
  flex: 0 0 auto;
}
.liveCamThumb video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.liveCamThumb video.on { display: block; }
.liveCamThumbPh {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 800; color: #fff;
}

/* yalnızca görüntü — ses kapalı işareti */
.liveCamNoAudio {
  font-size: 9.5px;
  opacity: .55;
  flex: 0 0 auto;
  margin-left: -2px;
}

.liveCamName {
  font-size: 12px; font-weight: 600;
  color: #ffa6b5;
  white-space: nowrap;
  max-width: 96px;
  overflow: hidden; text-overflow: ellipsis;
}
.liveCamChip.mine .liveCamName { color: #7ee8b0; }

/* ============================================================
   Kamera penceresi (tıklayınca açılır)
   ============================================================ */
.camViewOverlay {
  position: absolute; inset: 0;
  background: rgba(5,7,12,.72);
  backdrop-filter: blur(4px);
  z-index: 95;
  animation: fadeIn .16s ease;
}
.camView {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: min(720px, calc(100% - 32px));
  background: linear-gradient(180deg, var(--bg-2), #0f1420);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 96;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.camView.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ---- küçük pencere: kendi yayının (sağ altta) ---- */
.camView.mini {
  top: auto; left: auto;
  right: 14px; bottom: 14px;
  width: 158px;
  transform: none;
  opacity: 0;
  border-radius: 11px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(47,208,122,.3);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.camView.mini.dragging { cursor: grabbing; opacity: .94; }
.camView.mini .camViewHead { cursor: grab; }
.camView.mini.open {
  opacity: 1;
  transform: none;
}
.camView.mini .camViewHead { padding: 8px 10px; }
.camView.mini .camViewHead .avatar-xs { width: 26px; height: 26px; font-size: 10.5px; }
.camView.mini .camViewName { font-size: 12.5px; }
.camView.mini .camViewSub { font-size: 10px; }
.camView.mini .camViewStage { aspect-ratio: 4 / 3; max-height: 190px; }
.camView.mini .camViewPhAvatar { width: 54px; height: 54px; font-size: 20px; }
.camView.mini .camViewFoot { padding: 7px 10px; }
.camView.mini .camViewInfo { font-size: 10px; }
.camView.mini .camViewActions { display: none !important; }

/* küçük pencere karartmayı hafifletsin */
.camViewOverlay.mini { background: rgba(5,7,12,.25); }

.camViewHead {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.camViewHead .avatar-xs { width: 36px; height: 36px; font-size: 13px; }
.camViewHead .avatar-xs::after { border-color: var(--bg-2); }
.camViewMeta { flex: 1 1 auto; min-width: 0; }
.camViewName { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.camViewSub { font-size: 11.5px; color: var(--txt-mute); display: flex; align-items: center; gap: 6px; }
.camViewSub .live-dot { width: 6px; height: 6px; }

.camViewStage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 420px;
  background: #05070c;
}
.camViewStage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.camViewStage video.on { display: block; }
.camViewPh {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 13px;
  color: var(--txt-mute); font-size: 13px;
  background: radial-gradient(500px 260px at 50% 0%, rgba(79,140,255,.08), transparent 70%), #080b12;
}
.camViewPhAvatar {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 33px; font-weight: 800; color: #fff;
  box-shadow: 0 0 0 8px rgba(79,140,255,.12);
}
.camViewPh p { margin: 0; }

.camViewFoot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,.2);
}
.camViewInfo { font-size: 11.5px; color: var(--txt-mute); }
.camViewActions { display: flex; gap: 8px; }
.camViewBtn {
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 12.5px; font-weight: 700;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--txt-dim);
  transition: background .15s, color .15s;
}
.camViewBtn:hover { background: var(--bg-4); color: var(--txt); }
.camViewBtn.danger {
  background: rgba(255,59,92,.14);
  border-color: rgba(255,59,92,.42);
  color: #ff8095;
}
.camViewBtn.danger:hover { background: rgba(255,59,92,.26); color: #fff; }

@media (max-width: 900px) {
  .topCam-txt { display: none; }
  .topCamBtn { padding: 8px 11px; }
  .liveCamStrip { max-width: 34vw; }
  .liveCamName { max-width: 62px; }
}

/* orta boy mobil / küçük tablet */
@media (max-width: 620px) {
  .camView {
    width: calc(100% - 20px);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
  }
  .camView.open { transform: translate(-50%, -50%) scale(1); }
  .camView.mini { width: 200px; right: 10px; bottom: 10px; }
  .camViewStage { aspect-ratio: 4 / 3; max-height: 300px; }
  .liveCamStrip { max-width: 40vw; }
  .liveCamName { max-width: 54px; }
}

/* telefon */
@media (max-width: 480px) {
  .topCamBtn { padding: 7px 9px; border-radius: 9px; }
  .topCam-ico { font-size: 14px; }

  /* kamerayı açanlar başlıkta tek satır kalsın */
  .liveCamStrip { max-width: 30vw; gap: 5px; }
  .liveCamChip { padding: 4px 8px 4px 5px; gap: 5px; }
  .liveCamThumb { width: 28px; height: 19px; }
  .liveCamName { max-width: 44px; font-size: 11px; }
  .liveCamNoAudio { display: none; }

  /* kamera penceresi tam ekran */
  .camView {
    width: 100%; height: 100%;
    border-radius: 0;
    top: 0; left: 0;
    transform: none;
  }
  .camView.open { transform: none; }
  .camViewStage { aspect-ratio: auto; flex: 1 1 auto; max-height: none; min-height: 0; }
  .camView { display: flex; flex-direction: column; }
  .camViewHead { padding: 10px 12px; }
  .camViewHead .avatar-xs { width: 30px; height: 30px; font-size: 11.5px; }
  .camViewName { font-size: 14px; }
  .camViewFoot { flex-wrap: wrap; padding: 10px 12px; }
  .camViewActions { width: 100%; }
  .camViewBtn { flex: 1 1 auto; text-align: center; }

  /* küçük pencere köşede kalsın */
  .camView.mini {
    width: 170px; height: auto;
    right: 8px; bottom: 8px;
    border-radius: var(--r-sm);
  }
  .camView.mini .camViewStage { aspect-ratio: 4 / 3; max-height: 118px; flex: 0 0 auto; }
  .camView.mini .camViewFoot { display: none; }
  .camView.mini .camViewHead { padding: 6px 8px; }
  .camView.mini .camViewName { font-size: 11.5px; }
}

/* yatay telefon: kamera penceresi ekranı kaplamasın */
@media (max-height: 520px) {
  .camView.mini { width: 150px; right: 8px; bottom: 8px; }
  .camView.mini .camViewStage { max-height: 100px; }
}


/* ============================================================
   TAŞINABİLİR KAMERA PENCERESİ — sürükleme davranışı
   ============================================================ */
.camView.mini .camViewStage { cursor: inherit; }
.camView.mini .camViewFoot,
.camView.mini .camViewInfo { pointer-events: none; }

/* pencere taşınırken sayfa kaymasın */
body.camDragging { user-select: none; }


/* ============================================================
   KAMERAMI AÇ — KÜÇÜK EKRAN (KESİN ÖLÇÜLER)
   Kendi yayınım açıldığında sağ altta küçük bir pencere.
   Bu blok en son gelir, çakışan ölçüleri ezer.
   ============================================================ */
.camView.mini {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: 12px !important;
  bottom: 12px !important;
  width: 140px !important;
  max-width: 140px !important;
  height: auto !important;
  max-height: none !important;
  transform: none !important;
  opacity: 0;
  border-radius: 10px !important;
  border: 1px solid rgba(47,208,122,.45) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.65), 0 0 0 1px rgba(47,208,122,.25) !important;
  overflow: hidden !important;
  cursor: grab !important;
  touch-action: none !important;
  user-select: none !important;
  z-index: 8800 !important;
  backdrop-filter: none !important;
}
.camView.mini.open {
  opacity: 1 !important;
  transform: none !important;
}

/* başlık ince */
.camView.mini .camViewHead {
  padding: 4px 6px !important;
  min-height: 0 !important;
  gap: 5px !important;
}
.camView.mini .camViewHead .avatar-xs {
  width: 16px !important; height: 16px !important;
  font-size: 7.5px !important;
}
.camView.mini .camViewName {
  font-size: 9.5px !important;
  font-weight: 600 !important;
}
.camView.mini .camViewSub { display: none !important; }
.camView.mini .camViewHead .icon-btn.tiny {
  width: 22px !important; height: 22px !important;
  min-width: 22px !important; min-height: 22px !important;
  font-size: 15px !important;
}

/* görüntü alanı küçük */
.camView.mini .camViewStage {
  aspect-ratio: 4 / 3 !important;
  max-height: 105px !important;
  height: auto !important;
  background: #05080d !important;
}
.camView.mini .camViewPhAvatar {
  width: 32px !important; height: 32px !important;
  font-size: 12px !important;
}
.camView.mini .camViewPh p { font-size: 8.5px !important; }

/* alt bilgi ve işlemler gizli */
.camView.mini .camViewFoot { display: none !important; }
.camView.mini .camViewActions { display: none !important; }

/* karartma yok — küçük pencere sayfayı karartmasın */
.camViewOverlay.mini {
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* sürükleme geri bildirimi */
.camView.mini.dragging {
  cursor: grabbing !important;
  opacity: .95 !important;
}

/* mobil: biraz daha küçük */
@media (max-width: 760px) {
  .camView.mini {
    width: 124px !important;
    max-width: 124px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .camView.mini .camViewStage { max-height: 93px !important; }
  .camView.mini .camViewHead .icon-btn.tiny {
    width: 26px !important; height: 26px !important;
    font-size: 17px !important;
  }
}
