* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Video Grid */
#video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px;
    padding: 8px;
    width: 100%;
    height: 100%;
    align-content: center;
    justify-content: center;
}

#video-grid.has-remote-only {
    grid-template-columns: 1fr;
}

/* Video element */
.video-wrapper {
    position: relative;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 12px;
    font-size: 13px;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 3px 8px;
    border-radius: 4px;
}

.video-muted {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
    background: rgba(0,0,0,0.5);
    padding: 3px 6px;
    border-radius: 4px;
}

/* Kiosk mode */
#video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Controls */
#controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

#controls button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls button:hover {
    background: rgba(255,255,255,0.3);
}

#controls button.active {
    background: rgba(255,255,255,0.15);
}

#controls button#btn-hangup {
    background: #e53e3e;
    width: 60px;
    height: 60px;
    font-size: 24px;
}

#controls button#btn-hangup:hover {
    background: #c53030;
}

/* Status */
.status-connecting {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
}

.status-connected {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.status-error {
    color: #fc8181;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error overlay */
.error-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    gap: 16px;
}

.error-overlay button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: #3182ce;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.error-overlay button:hover {
    background: #2b6cb0;
}

/* Responsive */
@media (max-width: 600px) {
    #video-grid {
        grid-template-columns: 1fr;
    }

    #controls {
        bottom: 10px;
        padding: 8px 14px;
    }

    #controls button {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    #controls button#btn-hangup {
        width: 54px;
        height: 54px;
    }
}
