body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    overflow-x: hidden;
}
h1 {
    text-align: center;
    color: #333;
    padding: 20px;
    margin: 0;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.stream-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    padding: 15px;
    transition: all 0.3s ease;
}
.stream-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}
.stream-container.expanded {
    position: fixed;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    z-index: 100;
    background: black;
}
.stream-title {
    padding: 12px;
    background: #2c3e50;
    color: white;
    text-align: center;
    font-weight: bold;
}
.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 соотношение */
    background: #000;
}
.expanded .video-wrapper {
    padding-bottom: 0;
    height: calc(100% - 45px);
}
video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.status {
    padding: 8px;
    text-align: center;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
}
.backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 50;
}
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    z-index: 101;
    display: none;
}
@media (max-width: 768px) {
    .stream-container.expanded {
        top: 5%;
        left: 5%;
        width: 90%;
        height: 90%;
    }
}
.video-error {
    border: 3px solid red !important;
    position: relative;
}
.video-error::after {
    content: "ПОТОК ОСТАНОВИЛСЯ";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    background: rgba(255,0,0,0.7);
    padding: 10px;
}