* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

#container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

#videoGrid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-rows: 1fr;
    gap: 2px;
    background: #000;
}

#videoGrid.active {
    display: grid;
}

.videoWrapper {
    position: relative;
    overflow: hidden;
    background: #111;
}

.videoWrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#callButton {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #4CAF50;
    border: 3px solid #fff;
    cursor: pointer;
    margin-bottom: 40px;
    transition: all 0.3s ease;
    z-index: 10;
    position: relative;
}

#callButton:active {
    transform: scale(0.95);
}

#callButton.active {
    background: #f44336;
}

#status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0.7;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
}

#qrcode {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

#qrcode canvas {
    display: block;
    max-width: 200px;
    height: auto;
}

#fullscreenButton {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    z-index: 20;
}

#fullscreenButton:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

#fullscreenButton:active {
    transform: scale(0.95);
}

#fullscreenButton.hidden {
    display: none;
}

/* Settings button */
.settingsButton {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settingsButton:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: rotate(90deg);
}

@media (max-width: 600px) {
    #videoGrid {
        grid-template-columns: 1fr;
    }
    
    #status {
        font-size: 12px;
        max-width: 90%;
        top: 15px;
    }
    
    #qrcode {
        top: 100px;
    }
    
    #qrcode canvas {
        max-width: 150px;
    }
}
