.remote-video-container {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    height: 100%;
    padding: 0.5rem;
}

.remote-video {
    position: relative;
    aspect-ratio: 8/5;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: var(--mud-palette-surface);
}

.remote-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.participant-initials {
    position: absolute;
    inset: 0;
    font-size: 3rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.participant-name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    z-index: 2;
}

.participant-muted {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border-radius: 4px;
    font-size: 1.25rem;
    z-index: 2;
}

/* 1 item - full screen */
.remote-video-container:has(.remote-video:nth-child(1):last-child) {
    grid-template-columns: 1fr;
}

/* 2 items - side by side on desktop, stacked on mobile */
.remote-video-container:has(.remote-video:nth-child(2):last-child) {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .remote-video-container:has(.remote-video:nth-child(2):last-child) {
        grid-template-columns: 1fr 1fr;
    }
}

/* 3 items - 2 top, 1 bottom centered on desktop */
.remote-video-container:has(.remote-video:nth-child(3):last-child) {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .remote-video-container:has(.remote-video:nth-child(3):last-child) {
        grid-template-columns: 1fr 1fr;
    }

        .remote-video-container:has(.remote-video:nth-child(3):last-child) .remote-video:nth-child(3) {
            grid-column: 1 / -1;
            max-width: 50%;
            margin: 0 auto;
        }
}

/* 4 items - 2x2 grid */
.remote-video-container:has(.remote-video:nth-child(4):last-child) {
    grid-template-columns: 1fr 1fr;
}

/* 5+ items - 3 columns on desktop, 2 on tablet, 1 on mobile */
.remote-video-container:has(.remote-video:nth-child(n+5)) {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .remote-video-container:has(.remote-video:nth-child(n+5)) {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .remote-video-container:has(.remote-video:nth-child(n+5)) {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
