.whitoo-screen-share-stage {
    position: fixed;
    inset: 72px 28px 28px 280px;
    /* 2026-08-27: mesaj kutusu (.editor-wrap) z-index 2147482001 ile
       geliyordu ve paylasilan ekrani ortuyordu. Onun uzerine cikiyoruz;
       kanal menusu (2147483000) hala ustte kaliyor. */
    z-index: 2147482100;
    pointer-events: none;
    overflow: hidden;
}

.whitoo-screen-share-stage.is-dragged {
    inset: auto;
    width: min(1320px, calc(100vw - 16px));
    height: min(820px, calc(100vh - 16px));
}

.whitoo-screen-share-stage.is-hidden {
    display: none;
}

.whitoo-screen-share-card {
    /* 2026-08-27: kart artik sahneyi TAM doldurur. Once 1320x820 ile sinirliydi
       ve saga yapisiyordu, bu yuzden "tam ekran" tam ekran olmuyordu. */
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: rgba(12, 18, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    pointer-events: auto;
    backdrop-filter: blur(18px);
}

.whitoo-screen-share-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 43, 82, 0.20), rgba(255, 255, 255, 0.06));
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    cursor: default;
    user-select: none;
    touch-action: auto;
}

.whitoo-screen-share-stage.is-dragging .whitoo-screen-share-head {
    cursor: default;
}

.screen-kicker {
    display: block;
    color: #ff4d6d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.screen-title {
    display: block;
    color: #ffffff;
    font-size: 16px;
}

.screen-subtitle {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    font-weight: 700;
}

.screen-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.screen-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.screen-actions .screen-size-preset {
    width: 34px;
    min-width: 34px;
    font-size: 17px;
}

.screen-actions .screen-quality-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    padding: 0 10px;
    font-weight: 900;
    font-size: 12px;
}

.screen-actions .screen-quality-toggle.is-active {
    border-color: rgba(52, 211, 153, 0.48);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(34, 197, 94, 0.14));
    color: #bbf7d0;
}

.whitoo-screen-share-stage.is-smooth-mode .whitoo-screen-share-card {
    border-color: rgba(52, 211, 153, 0.22);
}

.whitoo-screen-share-body {
    display: grid;
    /* tek yayinda surut yok; ikinci yayin gelince acilir */
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 14px;
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 43, 82, 0.14), transparent 32%),
        linear-gradient(135deg, rgba(7, 10, 19, 0.72), rgba(11, 16, 28, 0.96));
}

.screen-main,
.screen-rail {
    min-height: 0;
    min-width: 0;
}

.screen-main {
    display: grid;
    min-height: 0;
}

.screen-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 77, 109, 0.58) transparent;
}

.screen-tile {
    position: relative;
    min-height: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #050914;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.screen-tile:hover,
.screen-tile:focus-visible {
    border-color: rgba(255, 77, 109, 0.62);
    box-shadow: 0 16px 38px rgba(255, 43, 82, 0.13);
}

.screen-tile.is-active {
    cursor: default;
    border-color: rgba(255, 77, 109, 0.72);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

.screen-main .screen-tile {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.screen-rail .screen-tile {
    flex: 0 0 148px;
    min-height: 148px;
    border-radius: 12px;
}

.screen-rail .screen-tile.is-active {
    display: none;
}

.screen-tile video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #050914;
    image-rendering: auto;
    transform: translateZ(0);
}

.screen-local-preview {
    width: 100%;
    height: 100%;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    text-align: center;
    color: #ffffff;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 77, 109, 0.24), transparent 34%),
        linear-gradient(135deg, rgba(12, 18, 30, 0.96), rgba(6, 10, 19, 0.98));
}

.screen-local-preview-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #ff2b52, #22c7d8);
    box-shadow: 0 18px 48px rgba(255, 43, 82, 0.28);
    font-size: 29px;
}

.screen-local-preview strong {
    font-size: 18px;
    line-height: 1.2;
}

.screen-local-preview span {
    max-width: 360px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 13px;
    font-weight: 700;
}

.screen-label {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: #ffffff;
    background: rgba(5, 9, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-weight: 700;
}

.screen-main .screen-label {
    left: 18px;
    bottom: 18px;
    padding: 10px 13px;
    font-size: 14px;
}

.screen-rail .screen-label {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    justify-content: center;
    border-radius: 12px;
    font-size: 12px;
}

.screen-rail .screen-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-screen-share.is-sharing,
.call-toggle-screen.is-sharing {
    color: #ffffff !important;
    background: linear-gradient(135deg, #ff2b52, #ff6b86) !important;
    border-color: transparent !important;
}

.whitoo-screen-share-stage.is-minimized {
    inset: auto 24px 24px auto;
    width: 330px;
    height: 220px;
}

.whitoo-screen-share-stage.is-minimized.is-dragged {
    inset: auto;
    width: 330px;
    height: 220px;
}

.whitoo-screen-share-stage.is-minimized .whitoo-screen-share-card {
    width: 100%;
    height: 100%;
}

.whitoo-screen-share-stage.is-minimized .screen-label {
    display: none;
}

.whitoo-screen-share-stage.is-minimized .whitoo-screen-share-body {
    grid-template-columns: 1fr;
    padding: 8px;
}

.whitoo-screen-share-stage.is-minimized .screen-main .screen-tile {
    min-height: 0;
}

.whitoo-screen-share-stage.is-minimized .screen-rail,
.whitoo-screen-share-stage.is-minimized .screen-subtitle {
    display: none;
}

@media (max-width: 991px) {
    .whitoo-screen-share-stage {
        inset: 72px 10px 82px 10px;
    }

    .whitoo-screen-share-card {
        border-radius: 14px;
    }

    .whitoo-screen-share-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        padding: 10px;
    }

    .screen-main .screen-tile {
        min-height: 260px;
    }

    .screen-rail {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: 2px;
    }

    .screen-rail .screen-tile {
        flex: 0 0 min(220px, 52vw);
        min-height: 112px;
    }
}

@media (max-width: 767px) {
    .whitoo-screen-share-stage {
        inset: 8px;
    }

    .whitoo-screen-share-card {
        width: 100%;
        height: 100%;
        border-radius: 16px;
    }

    .whitoo-screen-share-head {
        min-height: 54px;
        padding: 9px 10px;
    }

    .screen-actions button {
        min-width: 34px;
        height: 34px;
    }

    .screen-actions .screen-quality-toggle {
        min-width: 74px;
    }

    .whitoo-screen-share-body {
        padding: 8px;
    }

    .screen-main .screen-tile {
        min-height: 0;
    }
}


/* === 2026-08-27 kendi ekranini izleme ===
   Yayinladigin ekran artik canli olarak sahnede gorunuyor. Tum ekrani
   paylasirken sonsuz ayna etkisi olusabildigi icin basliktaki goz dugmesiyle
   kapatilabiliyor; tercih hatirlaniyor. */
.screen-tile.is-local video { display: block; }
.screen-tile.is-local .screen-local-preview { display: none; }
.whitoo-screen-share-stage.hide-self-preview .screen-tile.is-local video { display: none; }
.whitoo-screen-share-stage.hide-self-preview .screen-tile.is-local .screen-local-preview { display: flex; }

.screen-actions .screen-self-toggle.is-off {
    color: #ff8fa1;
    border-color: rgba(242, 56, 98, 0.42);
    background: rgba(242, 56, 98, 0.12);
}
.screen-tile.is-local .screen-label i { color: #4ade80; }


/* === 2026-08-27 sahne duzeni ===
   Cok yayin, boyut dugmeleri ve en-boy orani. */

/* 4 - surut yalniz birden fazla yayin varken */
.whitoo-screen-share-stage .screen-rail { display: none; }
.whitoo-screen-share-stage.has-multiple-screens .whitoo-screen-share-body {
    grid-template-columns: minmax(0, 1fr) 240px;
}
.whitoo-screen-share-stage.has-multiple-screens .screen-rail {
    display: flex;
}

/* dar boyutta surut yana degil ALTA gecsin */
.whitoo-screen-share-stage.screen-size-small.has-multiple-screens .whitoo-screen-share-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 66px;
}
/* kucultulmus halde yalniz etkin yayin gorunur; digerleri buyutunce secilir */
.whitoo-screen-share-stage.is-minimized .screen-rail { display: none; }
.whitoo-screen-share-stage.is-minimized.has-multiple-screens .whitoo-screen-share-body {
    /* kucultulmus halde surut gizli oldugu icin ikinci satiri da kaldiriyoruz;
       yoksa screen-size-small kurali 66px'lik bos serit birakiyordu */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}
.whitoo-screen-share-stage.is-minimized .whitoo-screen-share-head { min-height: 44px; }
.whitoo-screen-share-stage.is-minimized .whitoo-screen-share-body { padding: 8px; }
.whitoo-screen-share-stage.screen-size-small .screen-rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 2px;
}
.whitoo-screen-share-stage.screen-size-small .screen-rail .screen-tile {
    flex: 0 0 108px;
    min-height: 0;
    height: 100%;
}

/* 5 - goruntu gerilmesin: ana karoda tamami gorunur, surutte kirpilir */
.screen-main .screen-tile video { object-fit: contain; background: #050914; }
.screen-rail .screen-tile video { object-fit: cover; }

/* kucultulmus halde baslik sadelesir */
.whitoo-screen-share-stage.is-minimized .screen-kicker,
.whitoo-screen-share-stage.is-minimized .screen-subtitle,
.whitoo-screen-share-stage.is-minimized .screen-size-preset,
.whitoo-screen-share-stage.is-minimized .screen-quality-toggle { display: none; }
.whitoo-screen-share-stage.is-minimized .whitoo-screen-share-head { padding: 8px 10px; }
.whitoo-screen-share-stage.is-minimized .screen-title { font-size: 13px; }

/* etkin boyut dugmesi belli olsun */
.screen-actions .screen-size-preset.is-active {
    border-color: rgba(255, 77, 109, 0.62);
    background: rgba(255, 43, 82, 0.16);
    color: #ffd7de;
}

/* kac yayin var - baslikta rozet */
.screen-count-badge {
    display: none;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 43, 82, 0.18);
    color: #ffb3c0;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}
.whitoo-screen-share-stage.has-multiple-screens .screen-count-badge { display: inline-block; }
