/* Stellar group calls pass 39. */

.group-call-overlay {
    z-index: 9050;
}

.group-call-overlay.is-hidden {
    display: none !important;
}

.group-call-card {
    width: min(430px, calc(100vw - 28px));
}

.group-call-count {
    position: relative;
    z-index: 3;
    margin: 0;
    color: rgba(226, 232, 240, 0.70);
    font-size: 12px;
    font-weight: 800;
}

.group-call-stage {
    position: relative;
    z-index: 2;
    width: 100%;
}

.group-call-stage[hidden],
.group-call-video-stage[hidden],
.group-call-voice-stage[hidden] {
    display: none !important;
}

.group-call-voice-stage {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.group-call-voice-participant {
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.58);
    display: grid;
    justify-items: center;
    gap: 6px;
}

.group-call-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    overflow: hidden;
    color: #e0f2fe;
    background: rgba(127, 195, 255, 0.18);
    border: 1px solid rgba(127, 195, 255, 0.26);
    font-size: 13px;
    font-weight: 950;
}

.group-call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-call-voice-participant h3,
.group-call-voice-participant p {
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-call-voice-participant h3 {
    color: #f8fafc;
    font-size: 13px;
}

.group-call-voice-participant p {
    color: rgba(226, 232, 240, 0.60);
    font-size: 11px;
}

/* Active group video full-screen shell. */
.group-call-overlay.is-video.is-active,
body.is-stellar-group-video-call-active #groupCallOverlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: hidden !important;
    background: #020617 !important;
    z-index: 9050 !important;
}

.group-call-overlay.is-video.is-active .group-call-card,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-card {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    overflow: hidden !important;
    background: #020617 !important;
    box-shadow: none !important;
    text-align: left !important;
}

.group-call-overlay.is-video.is-active .group-call-card::before,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-card::before,
.group-call-overlay.is-video.is-active .group-call-icon,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-icon {
    display: none !important;
}

.group-call-overlay.is-video.is-active .group-call-stage,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    display: block !important;
    overflow: hidden !important;
}

.group-call-overlay.is-video.is-active .group-call-video-stage,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-video-stage {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    display: grid !important;
    gap: 2px !important;
    background: #020617 !important;
    overflow: hidden !important;
}

.group-video-tile {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 15%, rgba(127, 195, 255, 0.20), transparent 35%),
        #020617;
}

.group-video-tile video,
.group-video-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.group-video-tile video {
    object-fit: cover;
    background: #020617;
}

.group-video-tile.is-local video {
    transform: scaleX(-1);
}

.group-video-placeholder {
    display: grid;
    place-items: center;
    color: #e0f2fe;
    background: rgba(15, 23, 42, 0.88);
}

.group-video-placeholder span {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(127, 195, 255, 0.18);
    border: 1px solid rgba(127, 195, 255, 0.30);
    font-weight: 950;
    font-size: 22px;
}

.group-video-tile p {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    margin: 0;
    max-width: calc(100% - 20px);
    padding: 5px 9px;
    border-radius: 999px;
    color: #f8fafc;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(12px);
    font-size: 12px;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 2 participants: normal call feel, remote full-screen + local floating. */
.group-call-video-stage[data-group-video-count="1"],
.group-call-video-stage[data-group-video-count="2"] {
    display: block !important;
}

.group-call-video-stage[data-group-video-count="1"] .group-video-tile,
.group-call-video-stage[data-group-video-count="2"] .group-video-tile.is-remote:first-of-type {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
}

.group-call-video-stage[data-group-video-count="1"] .group-video-tile.is-local,
.group-call-video-stage[data-group-video-count="2"] .group-video-tile.is-local {
    position: fixed !important;
    z-index: 6 !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    top: max(166px, calc(env(safe-area-inset-top) + 118px + 5vh)) !important;
    width: min(25.6vw, 109px) !important;
    height: auto !important;
    aspect-ratio: 9 / 13 !important;
    max-width: 109px !important;
    max-height: 157px !important;
    border: 2px solid rgba(248, 250, 252, 0.78) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48) !important;
}

/* 3 participants: two remotes split top/bottom, local floating. */
.group-call-video-stage[data-group-video-count="3"] {
    display: grid !important;
    grid-template-rows: 1fr 1fr !important;
    grid-template-columns: 1fr !important;
}

.group-call-video-stage[data-group-video-count="3"] .group-video-tile.is-remote {
    position: relative !important;
}

.group-call-video-stage[data-group-video-count="3"] .group-video-tile.is-local {
    position: fixed !important;
    z-index: 6 !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    top: max(166px, calc(env(safe-area-inset-top) + 118px + 5vh)) !important;
    width: min(25.6vw, 109px) !important;
    height: auto !important;
    aspect-ratio: 9 / 13 !important;
    max-width: 109px !important;
    max-height: 157px !important;
    border: 2px solid rgba(248, 250, 252, 0.78) !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48) !important;
}

/* 4/5/6 participants: grid includes local tile. */
.group-call-video-stage[data-group-video-count="4"] {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

.group-call-video-stage[data-group-video-count="5"],
.group-call-video-stage[data-group-video-count="6"] {
    grid-template-columns: 1fr 1fr !important;
    grid-auto-rows: 1fr !important;
}

.group-call-video-stage[data-group-video-count="4"] .group-video-tile,
.group-call-video-stage[data-group-video-count="5"] .group-video-tile,
.group-call-video-stage[data-group-video-count="6"] .group-video-tile {
    position: relative !important;
}

/* Overlay labels/controls for group video. */
.group-call-overlay.is-video.is-active [data-group-call-state],
body.is-stellar-group-video-call-active #groupCallOverlay [data-group-call-state] {
    position: fixed !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    z-index: 8 !important;
    margin: 0 !important;
    padding: 7px 11px !important;
    border-radius: 999px !important;
    color: rgba(226, 232, 240, 0.90) !important;
    background: rgba(15, 23, 42, 0.56) !important;
    backdrop-filter: blur(14px) !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}

.group-call-overlay.is-video.is-active [data-group-call-title],
body.is-stellar-group-video-call-active #groupCallOverlay [data-group-call-title] {
    position: fixed !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    top: max(57px, calc(env(safe-area-inset-top) + 48px)) !important;
    z-index: 8 !important;
    margin: 0 !important;
    max-width: calc(100vw - 190px) !important;
    color: #ffffff !important;
    font-size: clamp(22px, 6vw, 32px) !important;
    line-height: 1.05 !important;
    font-weight: 950 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.86) !important;
}

.group-call-overlay.is-video.is-active [data-group-call-subtitle],
body.is-stellar-group-video-call-active #groupCallOverlay [data-group-call-subtitle] {
    position: fixed !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    top: max(91px, calc(env(safe-area-inset-top) + 82px)) !important;
    z-index: 8 !important;
    margin: 0 !important;
    color: rgba(226, 232, 240, 0.78) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.76) !important;
}

.group-call-overlay.is-video.is-active .group-call-count,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-count {
    position: fixed !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    top: max(116px, calc(env(safe-area-inset-top) + 107px)) !important;
    z-index: 8 !important;
    margin: 0 !important;
    color: rgba(226, 232, 240, 0.72) !important;
}

.group-call-overlay.is-video.is-active .group-call-actions,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-actions {
    position: fixed !important;
    left: max(18px, env(safe-area-inset-left)) !important;
    right: max(18px, env(safe-area-inset-right)) !important;
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 18px)) !important;
    z-index: 9 !important;
    width: auto !important;
    min-height: 76px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    background: rgba(2, 6, 23, 0.52) !important;
    border: 1px solid rgba(248, 250, 252, 0.12) !important;
    box-shadow: 0 18px 58px rgba(0, 0, 0, 0.44) !important;
    backdrop-filter: blur(18px) !important;
}

.group-call-overlay.is-video.is-active .group-call-actions .call-action-button,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-actions .call-action-button {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
}

.group-call-overlay.is-video.is-active .group-call-actions .call-action-button i,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-actions .call-action-button i {
    font-size: 20px !important;
}

.group-call-overlay.is-video.is-active .group-call-actions .call-action-button span,
body.is-stellar-group-video-call-active #groupCallOverlay .group-call-actions .call-action-button span {
    display: none !important;
}

@media (orientation: landscape) {
    .group-call-video-stage[data-group-video-count="5"],
    .group-call-video-stage[data-group-video-count="6"] {
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-rows: 1fr !important;
    }
}
