/*  Ses cubugu, ping, teknik bilgi, cihaz ve seviye gostergeleri  */

.device-row { display: flex; gap: 0.5rem; align-items: center; }

.device-row select { flex: 1; min-width: 0; }

.connection-status {
    padding: 0.35rem 1.1rem;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--border);
}

.connection-status.online     { color: var(--success); }

.connection-status.connecting { color: var(--warn); }

.connection-status.offline    { color: var(--danger); }

.voice-bar-controls .icon-btn { min-width: 34px; min-height: 34px; padding: 0.4rem; }

/* ---------- Ses baglantisi cubugu ---------- */

.voice-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.5rem 0.7rem; background: var(--bg-darker);
    border-top: 1px solid var(--border);
}

.voice-bar-info { min-width: 0; flex: 1; }

.voice-bar-status {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.78rem; font-weight: 600; color: var(--success);
}

.voice-dot {
    width: 8px; height: 8px; border-radius: var(--radius); background: var(--success); flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

/* Kopma / yeniden baglanma: ayni cubukta sari, nokta yanip soner */

.voice-bar-status.connecting { color: var(--warn); }

.voice-bar-status.offline    { color: var(--danger); }

.voice-bar-status:is(.connecting, .offline) .voice-dot {
    background: currentColor; box-shadow: none; animation: rec-pulse 1s ease-in-out infinite;
}

.voice-bar-status:is(.connecting, .offline) .voice-ping { display: none; }

.voice-bar-room {
    font-size: 0.72rem; color: var(--text-muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.voice-bar-controls { display: flex; gap: 0.1rem; flex-shrink: 0; }

.voice-bar + .user-panel { border-top-color: transparent; }

/* Kamerasi kapali seste olan: avatar kutusu */

.voice-tile {
    position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
    background: var(--bg-panel); display: flex; align-items: center; justify-content: center;
}

.voice-tile .avatar { transition: box-shadow var(--d-fast) var(--e-out); }

.voice-tile.clickable { cursor: pointer; }

.voice-tile.speak .avatar { box-shadow: 0 0 0 3px var(--bg-panel), 0 0 0 5px var(--success); }

#btn-mute.locked, #btn-deafen.locked {
    background: rgba(239,68,68,0.18); color: #ef4444; position: relative;
}

#btn-mute.locked::after, #btn-deafen.locked::after {
    /* Tabler lock; renk dugmeyle ayni olsun diye maske */
    content: ''; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0M8 11v-4a4 4 0 1 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0M8 11v-4a4 4 0 1 1 8 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Mikrofon hic acilamadi (izin yok / cihaz yok) - tiklayinca tekrar izin istenir */

#btn-mute.no-mic { position: relative; color: var(--warning, #f59e0b); background: rgba(245,158,11,0.14); }

#btn-mute.no-mic::after {
    content: '!'; position: absolute; right: 1px; top: 1px;
    width: 13px; height: 13px; border-radius: var(--radius); background: #f59e0b; color: #111;
    font-size: 0.6rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

.meter-container { display: flex; flex-direction: column; gap: 0.4rem; }

.meter-head { display: flex; justify-content: space-between; align-items: center; }

.meter-head label { font-size: 0.88rem; font-weight: 500; }

.gate-status { font-size: 0.72rem; color: var(--text-muted); }

.self-listen-row { margin-top: .5rem; align-items: center; }

.self-listen-row small { flex: 1; }

#btn-self-listen[aria-pressed="true"] { color: var(--primary-ink); border-color: var(--primary); }

.meter-bar { height: 10px; background: var(--bg-panel); border-radius: var(--radius); overflow: hidden; }

.meter-fill {
    height: 100%; width: 0%;
    background: var(--text-muted);
    transition: width 0.08s linear, background var(--d-fast) var(--e-out);
}

.meter-fill.gate-open { background: var(--success); }

#audio-sinks { position: absolute; width: 0; height: 0; overflow: hidden; }

.tech-info-grid {
    background: var(--bg-darker); border-radius: var(--radius);
    padding: 0.6rem 0.75rem; font-size: 0.8rem;
    display: flex; flex-direction: column; gap: 0.25rem;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =========================================================================
   SES CUBUGU: ping
   ========================================================================= */

.voice-ping {
    display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.45rem;
    font-size: 0.7rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums;
}

.voice-ping .i { width: 1.05em; height: 1.05em; }

.voice-ping.good { color: #23a55a; }

.voice-ping.ok   { color: #f0b232; }

.voice-ping.bad  { color: var(--danger); }

.voice-tile .avatar {
    width: clamp(44px, 44cqh, 150px) !important; height: clamp(44px, 44cqh, 150px) !important;
    font-size: clamp(16px, 17cqh, 56px) !important;
}
/* Kucuk kutu (telefonda 5+ kisi): 44px avatar alttaki ad etiketinin altinda kaliyordu. Avatar kuculur ve
   yukari kayar, etikete yer kalir. */
@container (max-height: 100px) {
    .voice-tile .avatar {
        width: 46cqh !important; height: 46cqh !important; font-size: 18cqh !important; margin-bottom: 34cqh;
    }
    /* Tam ekran / ana kutu altindaki serit: kutu genis, ad etiketi solda; avatar ortada kalir */
    .video-grid:has(> .stage-main) > .voice-tile .avatar {
        width: 40cqh !important; height: 40cqh !important; font-size: 16cqh !important; margin-bottom: 0;
    }
}
