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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

#streamContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}

#statusOverlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#statusTitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

#streamStatus {
    font-size: 0.95rem;
    color: #aaa;
    margin: 0;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h4.error {
    color: #ff4444;
}

.error-message {
    color: #ffaaaa;
    margin: 1rem 0;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: #ff9900;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #cc7700;
}

#streamVideo {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#streamAudio {
    display: none;
}

#controls {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 20;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

#controls button {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

#controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#controls button:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

#controls button.danger {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.3);
}

#controls button.danger:not(:disabled):hover {
    background: rgba(255, 68, 68, 0.3);
}

#controls button svg {
    width: 16px;
    height: 16px;
}

#logo {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 20;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff9900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Fullscreen video styling */
#streamContainer:fullscreen video,
#streamContainer:-webkit-full-screen video,
#streamContainer:-moz-full-screen video,
#streamContainer:-ms-fullscreen video {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

/* Hide cursor in fullscreen */
#streamContainer:fullscreen {
    cursor: none;
}

/* Show controls on hover in fullscreen */
#streamContainer:fullscreen #controls {
    opacity: 0;
    transition: opacity 0.3s;
}

#streamContainer:fullscreen:hover #controls {
    opacity: 1;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #statusOverlay {
        min-width: 90%;
    }

    #controls {
        flex-wrap: wrap;
    }

    #controls button {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    #controls button svg {
        width: 14px;
        height: 14px;
    }

    #logo {
        font-size: 1rem;
        top: 1rem;
        left: 1rem;
    }
}
