* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-form {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.connection-form input {
    padding: 12px 16px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    width: 320px;
}

.connection-form button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.connection-form button:hover {
    background: #45a049;
}

.connection-form button:disabled {
    background: #666;
    cursor: not-allowed;
}

.status {
    margin-top: 20px;
    padding: 10px;
    border-radius: 6px;
    min-height: 40px;
}

.status.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.status.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
}

#video-container.hidden {
    display: none;
}

#remote-video {
    width: 100%;
    height: 0;
    flex: 1 1 0;
    min-height: 0;
    object-fit: contain;
    background: #000;
    -webkit-user-select: none;
    user-select: none;
}

.hud { flex: 0 0 auto; width: 100%; padding: 10px 14px; background: #17202e;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; border-bottom: 1px solid #344157; }
.hud label { display: flex; align-items: center; gap: 6px; }
.hud input { accent-color: #63d6ad; width: 17px; height: 17px; }
.hud-button, .hud select { padding: 7px 9px; border: 1px solid #526078; border-radius: 5px; color: white; background: #27354a; cursor: pointer; }
.hud select { max-width: 280px; }
.hud-button:disabled, .hud select:disabled { opacity: .5; cursor: wait; }
#control-mode { color: #63d6ad; }
#video-stats { font-variant-numeric: tabular-nums; color: #b9cce3; }
#viewer-message { flex: 0 0 auto; padding: 7px 12px; width: 100%; background: #17202e; color: #c6d2e4; font-size: 12px; }
.overlay-content { max-width: 550px; max-height: 100%; overflow: auto; }
.connection-form input { width: 100%; }
.debug-console {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #333;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    z-index: 200;
}

.debug-console.hidden {
    display: none;
}

.log-info { color: #4fc3f7; }
.log-warn { color: #ffd54f; }
.log-error { color: #ef5350; }
.log-debug { color: #81c784; }

.hidden {
    display: none !important;
}
